Pay tribute to ant (Ant) (3)

xiaoxiao2021-03-06  15

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:

< / Project> You can see that the primary component file is simply commissioned and ensures that the components files of the sub-project in the correct order.

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 Use Given File for log

-l ''

-logger The class which is to perform logging

-Listener Add an instance of class as a project listener

-buildfile Use Given Buildfile

-FILE ''

-f ''

-D = Use value for Given Property

-PropertyFile loading all properties from file with -d

Properties Taking Precedence

-InputHandler The Class Which Will Handle INPUT Requests

-find search for buildfile touths the root of the filesystem and us

转载请注明原文地址:https://www.9cbs.com/read-46454.html

New Post(0)