That
explains a lot. I always thought, "that message is lying" because,
indeed, the property in the file DID get overwritten with my command
line entry. Now that I realize the error is talking about the property
statement in the file, I won't call NAnt a lier anymore. The only
reason I put in the property in the file is for a default. The message
doesn't bug me, so I'm ok with this.
-----
Original Message ----
From: Ken Parrish
<[EMAIL PROTECTED]>
To: "Roebuck, Alex"
<[EMAIL PROTECTED]>
Cc:
nant-users@lists.sourceforge.net
Sent: Monday, March 3, 2008 10:04:58 AM
Subject: Re: [NAnt-users] Command line properties - Can you
explainthismessage?
Alex,
Yes, now I see what is going on. Modified the script as follows to set
a 'default' value in the event it is not specified on the command line
as such:
<?xml version="1.0"?>
<project name="TestBuild" default="default" basedir=".">
<if test="${not property::exists('TestProperty')}" >
<property name="TestProperty" value="foo" />
</if>
<target name="*">
<echo message="TestProperty = ${TestProperty}" />
</target>
</project>
This elicits the behavior that I want without the error message.
Thanks,
Ken Parrish
Roebuck, Alex wrote:
This also fooled me for a
long time.
The message saying "cannot
overwrite read-only property" refers to the line in the NAnt build file
trying to assign to a property that has been assigned on the
command-line, not vice versa.
That won’t
work because a property set on the command line is read-only by design.
(Overwrite
by default is already set to true anyhow.)
BOb
Hi Ken-
1) you'll need to set overwrite attribute to true e.g.
<property
name="TestProperty" value="foo" overwrite="true"/>
2)The user MUST HAVE
write privileges to the folder in which he is writing
so user fu can overwrite bar.txt
----- Original Message
-----
Sent: Monday, March 03, 2008
11:06 AM
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
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
-------------------------------------------------------------------------
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