Interesting. I wonder if passing in a property value from the command
line makes the property ready only. At least that is what appears to be
happening.

 

So, what do you want to happen here? 

If you want it to use the passed in value rather than the value in the
script file? Use:

 

<property name="TestProperty" value="foo" overwrite="false" />



 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken
Parrish
Sent: Monday, March 03, 2008 11:07 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Command line properties - Can you explain this
message?

 

I am setting a property from the command line.  It seems to work, but I
get a message indicating that I cannot overwrite the property, yet the
property does in fact get set.  Can anyone help explain this?
______________

Nant Script:

<?xml version="1.0"?>

<project name="TestBuild" default="default" basedir=".">

    <property name="TestProperty" value="foo" readonly="false" />

    <target name="*">

        <echo message="TestProperty = ${TestProperty}" />

    </target>
</project>
______________

Command Line:

nant -D:TestProperty=bar
______________

Output:

NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net

Buildfile:
file:///C:/Gomez/svn/Source/GPNCore/trunk/Applications/test/test.build
<file:///C:\Gomez\svn\Source\GPNCore\trunk\Applications\test\test.build>

Target framework: Microsoft .NET Framework 2.0
Target(s) specified: default 

 [property] Read-only property "TestProperty" cannot be overwritten.

default:

     [echo] TestProperty = bar

BUILD SUCCEEDED - 0 non-fatal error(s), 1 warning(s)

Total time: 0 seconds.
______________

Thanks,

Ken Parrish
Gomez, Inc.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to