Environment Variables Needed by Ant
I need to define an environement variable within IDEA for the ANT build. This environment variable gives the location of a file that contains all of the property tags.
If I run from a batch file the command would be
SET MAXSYS_BUILD_PROPS = c:\Maxsys\build.properties
ant =f ...
Is there a way I can define MAXSYS_BUILD_PROPS for IDEA, specifically the ant build, without adding an environment variable to the system. I tried adding it via the Properties tab on the Build File Properties dialog but to no avail.
Any ideas?
Thanks,
Steve
请先登录再写评论。
Steve Ochry wrote:
The Properties tab defines Ant properties: "-Dfoobar=blah". You could
try using that instead of an environment variable in your Ant script.
Theoretically, it's more portable. From the commandline, you would
invoke your ant script like so: ant -Dfoobar=blah -f ...
Ciao,
Gordon
--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919
you can access environment variables in ant properties by prefixing env. (or whatever variable u use in ant build) to property name.
for example
env.MAXSYS_BUILD_PROPS
In this case, you should have following in your build.xml
]]>
check the ant manual for more detail
http://ant.apache.org/manual/CoreTasks/property.html