I get an error at the <script> task when I run this target (it all works
as expected up until it gets to there):
<target name="genNewBuildnum" depends="checkForOld"
if="haveOldBuildnum">
<rename src="buildnum.properties" dest="oldBuildnum.properties"/>
<replace token="buildnum" value="oldBuildnum"
file="oldBuildnum.properties"/>
<antcall target="buildnum"/>
<property file="buildnum.properties"/>
<property file="oldBuildnum.properties"/>
<script language="javascript"> <![CDATA[
var newnum = parseInt(nightly.getProperty('buildnum'));
var oldnum = parseInt(nightly.getProperty('oldBuildnum'));
if ( newnum == oldnum ) nightly.setProperty('nochgs', true);
]]>
</script>
<antcall target="notifyNochgs"/>
</target>
I ran the <script> task that Nico included in a mail a little while back
that does an increment on a number, and that runs fine -- and I thought
I'd basically done the same sort of thing in this one, but for some reason
it doesn't like what this one does. Any pointers as to where I've gone
wrong muchly appreciated. Thanks, Diane.
Here's the output:
Buildfile: nightly.xml
checkForOld:
genNewBuildnum:
[replace] Replacing buildnum --> oldBuildnum
setBuildnum:
Generating build number...
checkBuildnum:
buildnum:
Build number is 16580
BUILD FAILED
nightly.xml:377: TypeError: undefined is not a function.
TypeError: undefined is not a function.
at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:496)
at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:467)
at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1203)
at org.mozilla.javascript.gen.c1.call(<ANT>:1)
at org.mozilla.javascript.gen.c1.exec(<ANT>)
at org.mozilla.javascript.Context.evaluateReader(Context.java:741)
at org.mozilla.javascript.Context.evaluateString(Context.java:705)
at
com.ibm.bsf.engines.javascript.JavaScriptEngine.eval(JavaScriptEngine.java:82)
at com.ibm.bsf.util.BSFEngineImpl.exec(BSFEngineImpl.java:112)
at com.ibm.bsf.BSFManager.exec(BSFManager.java:482)
at
org.apache.tools.ant.taskdefs.optional.Script.execute(Script.java:110)
at org.apache.tools.ant.Target.execute(Target.java:142)
at org.apache.tools.ant.Project.runTarget(Project.java:807)
at org.apache.tools.ant.Project.executeTarget(Project.java:532)
at org.apache.tools.ant.Project.executeTargets(Project.java:506)
at org.apache.tools.ant.Main.runBuild(Main.java:400)
at org.apache.tools.ant.Main.main(Main.java:130)
Total time: 5 seconds
TypeError: undefined is not a function.
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/