You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ritchie <ga...@baml.com> on 2011/01/19 16:03:06 UTC

java script error in imported ant file

I have a build file -A.xml which imports another build file -B.xml and runs
the targets in the imported file. File B has multiuple targets and one of
the targets has a java script. In the java script i have a line of code
which says " Bproject.setProperty("newtoken", result);" , Bproject is the
name of the project in B.xml. When i run the A.xml the script fails in the
java script.
"C:\*****\A.xml:92: javax.script
.ScriptException: sun.org.mozilla.javascript.internal.EcmaError:
ReferenceError:
 "Bproject" is not defined. (<Unknown source>#9) in <Unknown source> at line
number 9".

Is there a way to solve this?

-- 
View this message in context: http://ant.1045680.n5.nabble.com/java-script-error-in-imported-ant-file-tp3347980p3347980.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: java script error in imported ant file

Posted by Michael Ludwig <mi...@gmx.de>.
ritchie schrieb am 19.01.2011 um 07:03 (-0800):
> 
> I have a build file -A.xml which imports another build file -B.xml and
> runs the targets in the imported file. File B has multiuple targets
> and one of the targets has a java script. In the java script i have a
> line of code which says " Bproject.setProperty("newtoken", result);" ,
> Bproject is the name of the project in B.xml.

There is no need to hardcode the name. You can refer to the currently
running project by simply saying "project". :-)

  project.log("toll!");
  project.setProperty("newtoken", "Gurke");

-- 
Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org