nant

 

TipAndTricks

Page history last edited by Anonymous 4 yrs ago

Set the [nant.onsuccess] and [nant.onfailure] properties to target names that you want executed when the build file is done.


 

File sets have an undocumented "asis" boolean attribute that by default is set to "false". This behavior is there to support regular expressions. But if, for example, you are using csc with specific files and want the task to throw an error if the file is not on disk, you can specify asis="true". This can happen when someone forgets to check a library source file into source control.


 

You may find it useful to list all properties at some point. Here is a sample of how:

 

<project>
<script language="C#">
<code><![CDATA[
public static void ScriptMain(Project project) {
project.Log(Level.Info, "Properties:");
foreach (DictionaryEntry entry in project.Properties) {
project.Log(Level.Info, "{0}={1}", entry.Key, entry.Value);
}
}
]]></code>
</script>
</project>


Q: How can I access all of my files in a directory? Even those in subdirectories? Right now I have

<sources>
<include name="Project*.vb" />
<include name="ProjectExceptionManagement*.vb" />
<include name="ProjectFileManagement*.vb" />
<include name="ProjectPatterns*.vb" />
</sources>

 

Is there a way to have something like:

<sources>
<include name="Project***.vb" />
</sources>

Where ** is somekind of folder wildkey?

 

A: I am sure there is a better way but here is what I got to work.

<sources>
<include name="Project*.vb" />
<include name="Project***.vb" />
</sources>

 

http://www.fogwater.com/Dotnet/ManagingSourceCodewithNAn.html

States that you can use

<sources>
<include name="***.vb" />
</sources>

Comments (0)

You don't have permission to comment on this page.