Bugs item #1238256, was opened at 2005-07-14 22:58
Message generated for change (Comment added) made by henryl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1238256&group_id=31650
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Henry (henryl)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch to allow scripts to have embedded properties
Initial Comment:
Nant scripts do not use property substition. Attached
is a patch to enable property substitution and a unit test.
I wanted property substitution when generating tasks
that depended on the build configuration.
eg:
<script language="C#" prefix="test" >
<code>
<![CDATA[
[
TaskName("buildsln")]
public class BuildTask :
NAnt.Core.Tasks.ExternalProgramBase {
private string _logDirectory =
"${string::replace(OutputLogDir, '\', '\')}";
private string _buildConfiguration =
"${Target}";
...
There were two other options;
* Pass this information through as properties every
time the task was used, which is redundent and error prone.
* Allow scripts to be set in an attribute, enabling
property substition. eg: <script language="c#"
prefix="test" code="${SomeCodeProperty}" />.
----------------------------------------------------------------------
>Comment By: Henry (henryl)
Date: 2005-07-15 15:02
Message:
Logged In: YES
user_id=1083163
The existing way is a lot more consistent... I prefer it to
my patch. Thanks for the tip.
----------------------------------------------------------------------
Comment By: Troy Laurin (fiontan)
Date: 2005-07-15 11:54
Message:
Logged In: YES
user_id=1062940
Scripts and custom tasks have access to properties through
their Project member/parameter:
Project.Properties["SomeCodeProperty"]
I'm not sure if there's a similar mechanism for accessing
NAnt functions... if not, then that would probably be useful.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1238256&group_id=31650
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
nant-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-developers