Pay tribute to ants (3)
Listing 5:
Manifest-Version: 1.0created-by: Dorianmain-Class: Dorian.HelloworldFrameclass-path: panel.jar manifest-version: 1.0created-by: DorianMain-Class: Dorian.HelloWorldMainClass-path: frame.jar
How is your helloworldmain.jar run? However, a little problem is a little problem: That is helloworldmain depends on HelloWorldFrame, and HelloWorldFrame relies on HelloWorldPanel. When I tried to HelloWorldMain prior to HelloWorldFrame and HelloWorldPanel, an error will occur.
Therefore, we need a method to component files in the correct order. At this time, you can use the main side of the ANT.
Then, establish a component file build.xml in the HelloWorld home directory (Listing 6).
Listing 6:
XML Version = "1.0"?>
Now just run Ant in the command line in the HelloWorld directory, you can make the entire project.
summary
Although it is just a simple implementation, it demonstrates how to create an application in an executable file. Also demonstrated how to package several classes shared by multiple applications in the same JAR file.
Of course, you may ask this role is not very obvious, but when you have hundreds (perhaps more than a dozen) subproject, these subprojects have built thousands of components. You will feel how happy it is using Ant components.
Reference
Resource
l In this article original code: http://www.y365.com/sxhv998/java/source/ant.rar
l ant Download address: http://jakart.Apache.org/ant/index.html
books
l "agile development"
Web site
l http://jakarta.apache.org Apache Software organization.
Appendix: ANT command line parameters
Ant [options] [target [target2 [target3] ...]]]]]]]
Options:
-Help Print this Message
-ProjectHelp Print Project Help Information
-version print the version information and exit
-Diagnostics print information this might beh helpful to diagnose or report problev.
-quiet, -q be extra quiet-verbose, -v be extra verbose
-debug print debugging information
-emacs produpe logging information without adornments
-logfile
-l
-logger
-Listener
-buildfile
-FILE
-f
-D
-PropertyFile
Properties Taking Precedence
-InputHandler
-find