wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Problem understanding ant syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Problem understanding ant syntax" Watch "Problem understanding ant syntax" New topic
Author

Problem understanding ant syntax

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
Could somebody please explain this syntax to human language, so I can understand what these syntaxes do







I also need to see the native ant syntax and man made variables. Thank you very much.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

In all three command, anything that starts with a -D sets a system property, which is a value that can be used within the Ant build script. Doing this is a good way to write a single generalized build script that can handle multiple build task, or build multiple things. It also enables a build on one PC to be easily adapted to another PC where files might be in different locations (that appears to be the case here since the properties are being set to file locations.) For example, this property:

-Dbuild.mods=C:\AmFam_Custom\build\build_mods.xml

sets the build.mods property to the value "C:\AmFam_Custom\build\build_mods.xml". Thus the build will expect to find that file in that location.

The items without a -D are build targets. For example, in the first command PrepareBuildFiles is a target. There will be a <target> directive in the build.xml file that has this name. That is where the build starts.


JBoss In Action
Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
-Dbuild.mods=C:\AmFam_Custom\build\build_mods.xml

and what does build.mods do? what's that? some sort of parameter? is it custom or native?
thank you.
Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
This is the ant syntax typed in the console


And this is the snippet .


so the ant syntax in the console will call CreateBuildFiles? yes? thank you
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Hendra Kurniawan wrote:and what does build.mods do? what's that? some sort of parameter? is it custom or native?

I have no idea. This is specific that build.xml, it is not something inherent in Ant. You will have to ask the person who created the build.xml what this means.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Hendra Kurniawan wrote:so the ant syntax in the console will call CreateBuildFiles? yes?

Yes.

And that in turn will call the CreateBuildFiles in the build/PrepareBuildFiles.xml script.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem understanding ant syntax