IntelliJ Java IDE
The moose likes Ant, Maven and Other Build Tools and the fly likes how to get build file name Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "how to get build file name" Watch "how to get build file name" New topic
Author

how to get build file name

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23621

Is there a way to get the name of the build from within Ant? In the below example, I would be trying to get the string "MyBuild" into a property.



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11945
${ant.project.name} is what you're looking for.
And if you find yourself needing to know the path of the build script itself, ${ant.file} to rescue


Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
Daniel Mayer
Ranch Hand

Joined: Sep 09, 2004
Posts: 103
Originally posted by Lasse Koskela:
${ant.project.name} is what you're looking for.
And if you find yourself needing to know the path of the build script itself, ${ant.file} to rescue


BTW, these properties and some more are documented in the manual: http://ant.apache.org/manual/using.html#built-in-props
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23621

Thanks!
 
 
subject: how to get build file name
 
Threads others viewed
Unchanged files get compiled. Why?
creating directory
ANT: Getting resource files moved to classes folder for JAR
JBOSS DeploymentException : Not able to find module file : .war in a .ear file
Build failed- ejb3.deployer not found
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com