Hi all,
I have various settings in my ccnet.config file and wish to pass them to my build file in order to keep these constants in one place.
How do I do that?!
Thanks,
Anders, Denmark
Hi all,
I have various settings in my ccnet.config file and wish to pass them to my build file in order to keep these constants in one place.
How do I do that?!
Thanks,
Anders, Denmark
Assuming your build file is a NAnt file, you would do it like this:
<nant>
<buildFile>xx.build</buildFile>
<buildArgs>-D:foo="$(foo)" -D:bar="$(bar)"</buildArgs>
...
</nant>
You can access the variable in the build script via ${foo}
resp. ${bar}
then.
Hi Chairman Tsetung,
Glad to see you alive and kicking ;-)
I probably should have been a bit more specific; below is an exerpt from my ccnet.config - I'm referring to the parameter value by a preprocessor block. I would expect, at the very least, that the variable side of the buildArg would appear in the log or something?! (I get error when referring to ${ccnetProject} in the build script).
<cb:define name="nant-build-block" >
<nant>
<executable>
<cb:pathToNant/>
</executable>
<buildArgs>-D:ccnetProject="$(ccnetProject)"</buildArgs>
<buildFile>
<cb:projectDirectory/>\$(buildFile)
</buildFile>
<targetList>
<target>
<cb:target/>
</target>
</targetList>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
</nant>
</cb:define>
There seems to be something wrong with your setup, because I'm using
<buildArgs>-D:publishroot="$(publish-directory)"</buildArgs>
and NAnt sees this as expected. Does the value of the variable contain spaces? I had problems with this before.