Assume a sample build file
<project name="Proptest" default="testProperty">
<property name="ENV" value="DEV" overwrite="true" readonly="false"
/>
<target name="testProperty">
<echo message="${ENV}" />
</target>
</project>
When this is run the output is
C:\Temp\nantest>C:\nant\bin\NAnt.exe
NAnt 0.85 (Build 0.85.1684.0; net-1.0.win32; nightly; 8/11/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Temp/nantest/test.build
Target(s) specified: testProperty
testProperty:
[echo] DEV
BUILD SUCCEEDED
Total time: 0.1 seconds.
However when I try to set ENV on the command line I lose - output follows
C:\Temp\nantest>C:\nant\bin\NAnt.exe -D:ENV=JOE
NAnt 0.85 (Build 0.85.1684.0; net-1.0.win32; nightly; 8/11/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Temp/nantest/test.build
Target(s) specified: testProperty
BUILD FAILED
C:\Temp\nantest\test.build(2,3):
Read-only property "ENV" cannot be overwritten.
Total time: 0 seconds.
Do I really need to go through the absurd little dance of setting up two
properties, one to accept command line input and one to set a default value
if the command line property has not been set? Or is my build bad? As you
can see I am using a fairly recent nightly build...
Kevin Dickover
________________________________________________________________________________________________
This electronic mail (including any attachments) may contain information that is
privileged, confidential, and/or otherwise protected from disclosure to anyone other
than its intended recipient(s). Any dissemination or use of this electronic email or
its contents (including any attachments) by persons other than the intended
recipient(s) is strictly prohibited. If you have received this message in error,
please notify us immediately by reply email so that we may correct our internal
records. Please then delete the original message (including any attachments) in its
entirety. Thank you.