Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem understanding ant syntax

 
Hendra Kurniawan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hendra Kurniawan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-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
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic