does anyone knows how to set additional environment variables for an ant script from within intellij-idea/rubymine? The part of the ant script which uses the environment variable looks as below:
<property environment="env"/>
<fail unless="env.IDEA_HOME" message="IDEA_HOME must be set."/>
What I've tried so far:
You can set variables as additional command line parameters. Here is a screenshot.
And then my output:
echoproperties
#Ant properties
#Sun Mar 04 04:48:30 EST 2012
\==-buildfile
ant.core.lib=E\:\\IntelliJ IDEA 114.145\\lib\\ant\\lib\\ant.jar
ant.file=E\:\\IdeaProjects\\psiviewer\\build.xml
ant.file.psiviewer=E\:\\IdeaProjects\\psiviewer\\build.xml
ant.file.type=file
ant.file.type.psiviewer=file
ant.home=E\:\\IntelliJ IDEA 114.145\\lib\\ant
ant.java.version=1.6
ant.library.dir=E\:\\IntelliJ IDEA 114.145\\lib\\ant\\lib
ant.project.default-target=all
ant.project.name=psiviewer
ant.version=Apache Ant(TM) version 1.8.2 compiled on December 20 2010
awt.toolkit=sun.awt.windows.WToolkit
basedir=E\:\\IdeaProjects\\psiviewer
dir.idea=e\:/idea11
file.encoding=windows-1252
file.encoding.pkg=sun.io
You see dir.idea
is set to what we passed to ant.
Problem: Run ant build within IntelliJ, let ant build property to use IntelliJ Path Variables value
Solution:
In your Ant Build window (views -> Tool Windows -> Ant Build), right click on your ant script (assuming you have one added), click properties. create a property for ant script qc_deploy_dir. property for ant script with arbitrary value
Open ant.xml in your project .idea/ant.xml, change the line defining qc_deploy_dir to use IntelliJ Path Variable $QC1_SHELL_DEPLOY
Go back to your properties window for ant script, now qc_deploy_dir is picking up QC1_SHELL_DEPLOY value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With