Git Product home page Git Product logo

nant's Introduction

NAnt

What is it?

NAnt is a .NET-based build tool. In theory it is kind of like make without make's wrinkles. In practice it's a lot like Ant.

If you are not familiar with Jakarta Ant you can get more information at the Ant project web site (http://ant.apache.org/).

Why NAnt?

Because Ant was too Java-specific.

Because Ant needed the Java runtime. NAnt only needs the .NET or Mono runtime.

The Latest Version

Details of the latest version can be found on the NAnt project web site http://nant.sourceforge.net/

Files

File Purpose
README.md/txt This file
Makefile Makefile for compilation with GNU Make
Makefile.nmake Makefile for compilation with Microsoft NMake

Compilation and Installation

  • Windows (net-2.0): TeamCity CodeBetter
  • Windows (mono-2.0): TeamCity CodeBetter
  • Linux: Travis-ci.org

Overview

The compilation process uses NAnt to build NAnt.

The approach is to first compile a copy of NAnt (using make/nmake) for bootstrapping purpose. Next, the bootstrapped version of NAnt is used in conjunction with NAnt build file (NAnt.build) to build the full version.

Prerequisites

To build NAnt, you will need the following components:

Windows

  • A version of the Microsoft .NET Framework.

    Available from http://msdn.microsoft.com/netframework/

    You will need the .NET Framework SDK as well as the runtime components if you intend to compile programs.

    Note: NAnt currently supports versions 1.0, 1.1, 2.0, 3.5, and 4.0 of the Microsoft .NET Framework.

or

Linux/Unix

Building the Software

Build NAnt using Microsoft .NET:

  • GNU Make

      make install MONO= MCS=csc prefix=<installation path> [DESTDIR=<staging path>] [TARGET=<nant target>]
    

    eg. make install MONO= MCS=csc prefix="c:\Program Files" TARGET=net-2.0

  • NMake

      nmake -f Makefile.nmake install prefix=<installation path> [DESTDIR=<staging path>] [TARGET=<nant target>]
    

    eg. nmake -f Makefile.nmake install prefix="c:\Program Files" TARGET=net-4.0

Building NAnt using Mono:

  • GNU Make

      make install prefix=<installation path> [DESTDIR=<staging path>] [TARGET=<nant target>]
    

    eg. make install prefix="c:\Program Files" TARGET=mono-4.0

  • NMake

      nmake -f Makefile.nmake install MONO=mono CSC=mcs prefix=<installation path> [DESTDIR=<staging path>] [TARGET=<nant target>]
    

    eg. nmake -f Makefile.nmake install MONO=mono CSC=mcs prefix=/usr/local/

Note: These instructions only apply to the source distribution of NAnt, as the binary distribution contains pre-built assemblies.

Documentation

Documentation is available in HTML format, in the doc/ directory.

License

Copyright (C) 2001-2012 Gerry Shaw

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

As a special exception, the copyright holders of this software give you permission to link the assemblies with independent modules to produce new assemblies, regardless of the license terms of these independent modules, and to copy and distribute the resulting assemblies under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on these assemblies. If you modify this software, you may extend this exception to your version of the software, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

A copy of the GNU General Public License is available in the COPYING.txt file included with all NAnt distributions.

For more licensing information refer to the GNU General Public License on the GNU Project web site. http://www.gnu.org/copyleft/gpl.html

nant's People

Contributors

alexandersamoilov avatar bentolor avatar bszcz avatar charleswhchan avatar claytonharbour avatar dguder avatar drieseng avatar embedev avatar gkello avatar gshaw avatar imakowski avatar jkowalski avatar joshmccullough avatar jsargiot avatar juergenhoetzel avatar katlimruiz avatar kot-behemoth avatar krabicezpapundeklu avatar maliger avatar mtutty avatar nicor91 avatar player15 avatar rmboggs avatar scalder avatar shamar avatar tappsdev avatar x2048 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nant's Issues

"nant -projecthelp" ignores <include>d files

The "nant -projecthelp" command only displays targets in the main build file. If you use to include other files, the display doesn't show targets from them, because /src/Nant.Core/ConsoleDriver.cs:ShowProjectHelp() doesn't process the tasks.

Rename Directory

Currently the move task does not seem able to rename directories. It looks like there was an attempt to fix this just before the 0.91 release, but it was reverted.

Renaming directories (instead of moving the contents of one directory into another) can be an important feature for doing deployments.

<copy> case-sensitive issue with <include>

f.e. On Windows OS, you want to copy the folder "aaa\ccc" to "bbb\ccc", you might expect that this should work:

<copy todir="bbb">
  <fileset basedir="aaa">
    <include name="Ccc\" />
  </fileset>
</copy>

File got copied but not properly from a case-sensitive perspective, because the folder ends up as "bbb\Ccc".
I didn't set the casesensitive parameter, which means its value is the default value means "false". So I'd expect the folder matches the pattern and gets copied, but not changed to the pattern.

cheers
ppspace

Failed tests on Ubuntu/Mono

Trying to setup the project to run on Ubuntu/Mono, I get three tests failed with stacktraces as below. I'm not sure if this is the place to raise this, but wanted to see if it is just the set up I have that is causing this (especially because the error message says "missing Microsoft.VisualBasic.dll".

Thanks

 [exec]                [nunit2] Tests run: 16, Errors: 3, Failures: 0, Time: 4.437 seconds
 [exec]                [nunit2]   Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
 [exec]                [nunit2] 
 [exec]                [nunit2] Test Case Failures:
 [exec]                [nunit2] 1) Tests.NAnt.Console.NAntTest.Test_ShowProjectHelp : System.Xml.Xsl.XsltCompileException : XSLT compile error. Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found..
 [exec]                [nunit2]   ----> System.Xml.Xsl.XsltException : Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found.
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (IXPathNavigable stylesheet) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at NAnt.Core.ConsoleDriver.ShowProjectHelp (System.Xml.XmlDocument buildDoc) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.DoTestShowProjectHelp (System.String nantNamespace, System.String prefix) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.Test_ShowProjectHelp () [0x00000] in <filename unknown>:0
 [exec]                [nunit2] --XsltException
 [exec]                [nunit2] at Mono.Xml.Xsl.ScriptCompilerInfo.GetScriptClass (System.String code, System.String classSuffix, System.Xml.XPath.XPathNavigator scriptNode, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager+MSXslScript.Compile (System.Xml.XPath.XPathNavigator node) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager.AddScript (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.HandleTopLevelElement (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.ProcessTopLevelElements (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.Compile (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] 
 [exec]                [nunit2] 2) Tests.NAnt.Console.NAntTest.Test_ShowProjectHelpWithNamespace : System.Xml.Xsl.XsltCompileException : XSLT compile error. Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found..
 [exec]                [nunit2]   ----> System.Xml.Xsl.XsltException : Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found.
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (IXPathNavigable stylesheet) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at NAnt.Core.ConsoleDriver.ShowProjectHelp (System.Xml.XmlDocument buildDoc) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.DoTestShowProjectHelp (System.String nantNamespace, System.String prefix) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.Test_ShowProjectHelpWithNamespace () [0x00000] in <filename unknown>:0
 [exec]                [nunit2] --XsltException
 [exec]                [nunit2] at Mono.Xml.Xsl.ScriptCompilerInfo.GetScriptClass (System.String code, System.String classSuffix, System.Xml.XPath.XPathNavigator scriptNode, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager+MSXslScript.Compile (System.Xml.XPath.XPathNavigator node) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager.AddScript (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.HandleTopLevelElement (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.ProcessTopLevelElements (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.Compile (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] 
 [exec]                [nunit2] 3) Tests.NAnt.Console.NAntTest.Test_ShowProjectHelpWithNamespacePrefix : System.Xml.Xsl.XsltCompileException : XSLT compile error. Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found..
 [exec]                [nunit2]   ----> System.Xml.Xsl.XsltException : Stylesheet script compile error: 
 [exec]                [nunit2] 
 [exec]                [nunit2]  ERROR: CS0006: Metadata file `Microsoft.VisualBasic.dll' could not be found.
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at System.Xml.Xsl.XslTransform.Load (IXPathNavigable stylesheet) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at NAnt.Core.ConsoleDriver.ShowProjectHelp (System.Xml.XmlDocument buildDoc) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.DoTestShowProjectHelp (System.String nantNamespace, System.String prefix) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Tests.NAnt.Console.NAntTest.Test_ShowProjectHelpWithNamespacePrefix () [0x00000] in <filename unknown>:0
 [exec]                [nunit2] --XsltException
 [exec]                [nunit2] at Mono.Xml.Xsl.ScriptCompilerInfo.GetScriptClass (System.String code, System.String classSuffix, System.Xml.XPath.XPathNavigator scriptNode, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager+MSXslScript.Compile (System.Xml.XPath.XPathNavigator node) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.MSXslScriptManager.AddScript (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.HandleTopLevelElement (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.ProcessTopLevelElements (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.XslStylesheet.Compile (Mono.Xml.Xsl.Compiler c) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] at Mono.Xml.Xsl.Compiler.Compile (System.Xml.XPath.XPathNavigator nav, System.Xml.XmlResolver res, System.Security.Policy.Evidence evidence) [0x00000] in <filename unknown>:0
 [exec]                [nunit2] 
 [exec]                [nunit2] 
 [exec]                [nunit2] 

update nunit2 task to use latest nunit

nunit-2.2.8, which is used in nunit2 task, is too old. It doesn't support a lot of modern features, such as ExpectedExceptionAttribute, Assert.Pass() and so on, so a lot of unit tests, compiled with later version of nunit, fail. Also it skips tests without "public" definition, which is not required by later versions of nunit.

I'm sorry, I don't know how this issue can be labeled as "feature request".

AllowPartiallyTrustedCallers

I tried to add the assembly attribute 'AllowPartiallyTrustedCallers to asminfo task like so:

<target name="update-common-assemblyinfo">
    <echo message="Generating common AssemblyInfo file..." />
    <!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
    <attrib file="${root.dir}\src\CommonAssemblyInfo.cs" readonly="false" if="${file::exists('${root.dir}\src\CommonAssemblyInfo.cs')}" />
    <!-- generate the source file holding the common assembly-level attributes -->
    <asminfo output="${root.dir}\src\CommonAssemblyInfo.cs" language="CSharp">
    <imports>
        <import namespace="System" />
        <import namespace="System.Security" />
        <import namespace="System.Reflection" />
        <import namespace="System.Runtime.InteropServices" />
    </imports>
    <attributes>
        <attribute type="CLSCompliantAttribute" value="true" />
        <attribute type="ComVisibleAttribute" value="false" />
        <attribute type="AssemblyProductAttribute" value="${product.fullname}" />
        <attribute type="AssemblyCompanyAttribute" value="${product.url}" />
        <attribute type="AssemblyCopyrightAttribute" value="${product.copyright}" />
        <attribute type="AssemblyTrademarkAttribute" value="Apache License, Version 2.0" />
        <attribute type="AssemblyCultureAttribute" value="" />
        <attribute type="AssemblyVersionAttribute" value="${project.version}" />
        <attribute type="AssemblyConfigurationAttribute" value="${project.framework}; ${project.version}; ${project.buildtype}" />
        <attribute type="AllowPartiallyTrustedCallers" value="" />
    </attributes>
    </asminfo>
</target>

and received the following error while running the build script.

'…CommonAssemblyInfo.cs' could not be generated.
Assembly attribute with type 'AllowPartiallyTrustedCallers' could not be loaded.

Nant's webpage shows NAntContrib's release notes (for beta1)

I don't know if this really goes here... but just wanted to let you know...

NAnt webpage: http://nant.sourceforge.net/

"A complete list of changes and new features is available ."

Release notes link points to: http://nant.sourceforge.net/release/0.92-beta1/releasenotes.html which is correct, but the content is from NAntContrib.

NAntContrib webpage: http://nantcontrib.sourceforge.net/

Release notes for beta1 returns a 404.
http://nantcontrib.sourceforge.net/release/0.92-beta1/releasenotes.html

Thanks

.NET 1.1 is not detected on x64 windows

I see the error:

NAnt 0.92 (Build 0.92.4543.0; release; 09.06.2012)
Copyright (C) 2001-2012 Gerry Shaw
http://nant.sourceforge.net

Microsoft .NET Framework 1.1 (net-1.1) is not installed, or not correctly configured.

    Framework directory 'C:\Windows\Microsoft.NET\Framework64\v1.1.4322' does not exist.

I checked and noticed NAnt.exe executes under x64 environment and thus accesses x64 version of registry.

So if I added x86 execution flag to NAnt, it becomes able to read x86 version of registry and thus detect .NET 1.1.
I run it on Windows 7 x64, I have .NET 1.1, .NET 2.0, .NET 4.0+4.5, VS 2008, VS 2010 installed.

newlines and spaces in echo to a file

It appears now that if the content of the message after a trim is zero-length, the echo task is ignored.
I mean if i I want to add a space or a newline to a file, I must make a task like:
<echo message=" " file="..." append=true />
or
<echo message="${environment::newline()}" file="..." append=true />

But from some of the last nant revisions the behaviour has changed and these commands are ignored.

Force use of original .Net 4.0 when .Net 4.5 is installed

.Net 4.5 is an inplace upgrade for .Net 4.0. If you want to ensure that your software runs on a machine with only the original .Net 4.0 installed, you need to take care when building, so that you don't cause dependencies on .Net 4.5 versions of the assemblies.

This thread discuss the issue and there is a proposed solution that involves editing nant.exe.config to avoid referencing updated assemblies found under C:\Windows...:
http://stackoverflow.com/questions/11991383/nant-build-using-net-4-5-beta-assembly-references-despite-specifying-net-4-0

What are the nant developers' take on this? Is the solution on stack overflow the way to go? If so, should this be regarded as a bug in nant? It doesn't seem "proper" to edit nant.exe.config in a runtime installation.

This link has some additional information from MS:
http://blogs.msdn.com/b/msbuild/archive/2007/04/12/new-reference-assemblies-location.aspx

0.92-alpha1 Property name 'sys.env.ProgramFiles(x86)' is invalid.

I have looked at numerous articles and it appears there was a bug, but that in the version of nant I have it should no longer be an issue if someone has a solution for this it would be greatly appreciated if you could post the resolution :-) This is on a Windows Server 2008 R2 I will post a copy of my Console below:

X:\InsightBuild>nant /f:InsightWeb.build buildStage
NAnt 0.92 (Build 0.92.4543.0; release; 6/9/2012)
Copyright (C) 2001-2012 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///X:/InsightBuild/InsightWeb.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: buildStage

[sysinfo] Setting system information properties under sys.*

BUILD FAILED

Property name 'sys.env.ProgramFiles(x86)' is invalid.

Total time: 0.1 seconds.

New Function to retrieve directory's name

A couple of weeks ago I needed a function that, for a given path, e.g. C:\temp\package\folder1, it returned the "name" of that folder, in this case, "folder1".

A function which I thought would help me was path::get-directory-name, but it returns the entire path. ( see http://msdn.microsoft.com/es-es/library/system.io.path.getdirectoryname(v=vs.100).aspx)

Can we add a function that returns just the name of the directory?, in the meantime, I've added a custom function to fill the gap...

<script language="C#" prefix="build" >
  <code>
      <![CDATA[
          [Function("get-dir-name")]
          public static string Testfunc(string fullname) {
              return new DirectoryInfo(fullname).Name;
          }
      ]]>
  </code>
</script>

  <!-- ${dir} = "C:\somedir\someother\folder1"  -->
  <property name="name" value="${build::get-dir-name(dir)}" />
  <!-- ${name} = "folder1"  -->

Thanks

Thanks

asminfo task adding extra lines at end of file

I'm using StyleCop with WarningsAsErrors set to true so that stylecop warnings will break the build. I am using the task to set version numbers and such during the build process. The AssemblyInfo.cs file that is generated from the asminfo task has two blanks at the end of the file which cause one of the StyleCop rules to fail.

Also, is it possible to extend this class to allow other C# code to be pulled into this file. It's nice that the using, attributes, etc. are set up. But, I'd like to be able to include a block of code after that.

Eliminate NET_4_0 preprocessing statement in NUnit2TestDomain.CreateDomain

The current implementation of NUnit2TestDomain.CreateDomain has two different ways of creating an app domain, with one of them only being used via conditional compilation using the NET_4_0 symbol

Upon investigation by Ryan, the NET_4_0 section would in fact be appropriate for 2.0 (http://www.mail-archive.com/nant-users%40lists.sourceforge.net/msg12282.html)

Enabling the looser way of constructing the app domain will allow us to use the NUnit2 task to run unit tests against MVC3 controllers that are using ViewBag and other DLR constructs.

Cheers
Pete

<include> task does not support long path names for buildfile attribute

The <include> task fails in the case that the buildfile attribute length is greater than 260 characters.

In my case the normalised path is less than 260 characters, however the path has to remain relative as the current directory of the build file cannot be guaranteed.

Example:

default.build
...
<include buildfile="../../long_path_a_is_really_really_really_really_really_long/include.build" / >
...

output error:

Could not include build file '../../long_path_a_is_really_really_really_really_really_long/include.build'.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

NDoc task fails with a NullReferenceException

When building the documentation for an assembly containing generics latest NAnt build (0.92) fails with following error:

Error building Documentation.
Object reference not set to an instance of object.
Object reference not set to an instance of object

When removing the code using generics, the NDoc task works fine.

Create nunit-console task

There was an issue that came up on the nant mailing list a month or so ago where the user was trying to run nunit tests via NAnt which were targeting a different version of .NET than NAnt was running on (ie: NAnt was running on .NET 4.0 and the user was targeting 3.5). I'm thinking that if a new task was created which used the nunit-console app, users would be able to run situations similar to what was described above. I thought the name <nunit-console/> would be appropriate but I am open to suggestions.

It would be possible that in the future, this task would be preferred over the current setup.

Thanks,
Ryan

IIS virtual directory creation fails on IIS 7.0 / windows server 2008

When i tried to create a virtual directory in the remote server using Nant build script It could not create and shows the error msg below,

"The webservice at 'remote_machine' does not exist or is not reachable"

The OS of remote server is Windows server 2008. Here i have used nant 0.92 and natcontrib 0.92.

It is working for local machine but not for the remote. Any suggestion Please.

Add attribute to the nunit2 task to set the logging level

We have realized that with the upgrade to version 2.6 of nunit that our tests log a whole lot more than it used to. We are using nhibernate which causes all the logging. I did a bit of poking around and I set the logging level for the nunit2 task to ERROR which allowed us to run the test in an acceptable time span, thus I would like to request a new attribute to set the logging level for the task. It might be worthwhile to generalized this to all tasks.

I have tried other avenues like creating a custom task ourselves but that started to create more problems for us (code management related). I'm willing to listen for any suggestion if you feel that this is not appropriate.

"include" with "asis" disregard "basedir".

Includes with "asis" disregard the basedir on the fileset (and even on the project), causing unexpected behavior when the buildfile is invoked from another buildfile (the script looks for the file in the directory where the command was run apparently).

mail task fails when tolist is terminated with semicolon

Using 0.92, when the tolist parameter of the mail task is terminated with a semicolon:

  tolist="[email protected];"
  from="[email protected]"
  subject="Build Success"
  mailhost="somemailserver"
  isbodyhtml="true"
  message="blah"

then the following exception is raised:

System.ArgumentException: The parameter 'address' cannot be an empty string.
Parameter name: address
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at NAnt.Core.Tasks.MailTask.ConvertStringToMailAddress(String address)
at NAnt.Core.Tasks.MailTask.ParseAddresses(String addresses)
at NAnt.Core.Tasks.MailTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()

32-bit build on 64-bit system is broken

I've got my .build setup as <csc platform='x86' target='winexe' output='${validate.file}' debug='${debug}' warnaserror='true'> but I get

  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'System.Data.OracleClient.dll' targets a different processor
  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'System.EnterpriseServices.dll' targets a different processor
  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'System.Transactions.dll' targets a different processor
  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'System.Web.dll' targets a different processor
  [csc] error CS1607: Warning as Error: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor

I noticed External Program Failed: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe (return code was 1) when I use NAnt .92. If I use NAnt .91 everything works. How do I update my .build to work with .92? I'm building on Win7 64Bit.

Under NAnt .91 with the exact same .build file, the external program used is C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe. Note the Framework, not Framework64. It looks like NAnt .92 uses the wrong framework when plateform='x86' is selected.

/*.* behaves like /**/*.*

Our scripts make a lot use of /. and /**/..
The first copies all top level files in the folder, but no subfolders, the second one additionally also includes subfolders
This has worked fine until we have upgraded to version 0.9.2, but after upgrading /. now also copies includes the subfolders, so that the only way to only copy all the top-level files in a folder withouth also copying the subfolders, is, to specify every used file-ending separately. This can be reprocuded, by for example switching back to an older nant version like 0.91-alpha2 - the same unchanged scripts work correctly again, but only until switching forward to 0.92 again. i have not tried with any version between 0.91-alpha2 and 0.92, so I can't tell the exact version, that has introduced that bug.

Delete directory fails on first attempt...timing issue?

When I build my project the first step in my build is:


When running this I regularly see this:
clean:

     [delete] Deleting directory 'C:\data\enlistments\ProjName\src\output'.

  BUILD FAILED

  C:\data\enlistments\ProjName\src\all.build(26,4):
  Cannot delete directory 'C:\data\enlistments\ProjName\src\output'.
      The directory is not empty.

The directory is actually emptied but not deleted when this happens. If I run the entire job again, it works. This doesn't happen 100% of the time, but it happens a lot. At least 50% of the time. The % seems to be rising as my project gets larger.

This seems to have been observed before: http://nant.2279214.n2.nabble.com/nant-Bugs-2972505-Directory-not-empty-error-td4956685.html

Is the workaround mentioned in this article (ignore failure for this step) considered the best practice? Seems ugly and error prone to me. I can debug further if needed...

Thx!

Enable xmlpoke to replace nodes

The xmlpoke task can only replace the contents of a particular node. Imagine an Xml document like this:

<a>
  <b key="x"/>
  <b key="y"/>
  <c key="u"/>
  <b key="z"/>
  <c key="v"/>
</a>

With xmlpoke, it is not possible (as far as I can see) to replace <c key="u"/> with <b key="u"/>.

Proposed solution: Add a new "replaceContents" parameter to xmlpoke that defaults to "true". When set to "false", the node(s) designated by the XPath expression will be replaced, rather than its/their contents.

Please let me know if you consider this useful, and if such an extension is being worked on - otherwise, I might like to look into creating and submitting a patch ... though I suspect that adding the parameter and replacing line XmlPokeTask.cs:300 with something like

if (replaceContents) {
  node.InnerXml = value;
} else {
  StringBuilder newInnerXml = new StringBuilder();
  foreach (XmlNode currentNode in node.ParentNode.ChildNodes) {
    if (currentNode == node) {
      newInnerXml.Append(value);
    } else {
      newInnerXml.Append(currentNode.OuterXml);
    }
  }
  node.ParentNode.InnerXml = newInnerXml.ToString();
}

might be all that's needed.

Thanks a lot!

Find replacement for NDoc

NDoc has not been maintained in years. It would be great if it could be replaced with something like NDoc3, Monodoc, and/or Sandcastle.

Permissions error on Windows 7 Home

Downloaded nant 0.91 binary, installed per the instructions (copied to C:\Program Files\Nant). Also tried Program Files (x86). Both times I get the following error:

C:\Program Files\NAnt\bin>nant.exe
log4net:ERROR XmlConfiguratorAttribute: Exception getting ConfigurationFileLocat
ion. Must be able to resolve ConfigurationFileLocation when ConfigFile and Confi
gFileExtension properties are not set.
System.Security.SecurityException: Request for the permission of type 'System.Se
curity.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, S
tackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.AppDomainSetup.VerifyDir(String dir, Boolean normalize)
at log4net.Util.SystemInfo.get_ConfigurationFileLocation()
at log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(Assembly sourceA
ssembly, ILoggerRepository targetRepository)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Internet

Unhandled Exception: System.Security.SecurityException: Request for Configuratio
nPermission failed while attempting to access configuration section 'nant'. To a
llow all callers to access the data for this section, set section attribute 'req
uirePermission' equal 'false' in the configuration file where this section is de
clared. ---> System.Security.SecurityException: Request for the permission of ty
pe 'System.Configuration.ConfigurationPermission, System.Configuration, Version=
4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, S
tackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String
configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String
configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Intern
al.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at NAnt.Console.ConsoleStub.Framework.GetRuntimeFramework()
at NAnt.Console.ConsoleStub.Main(String[] args)

Looks like a permissions problem. I'm running Windows 7 Home as a non-admin.

Move to an Apache or BSD-style license

Not sure how feasible this is or if it is even worth the effort but it was on NAnt's original release plan so I know there was interest in this in the past.

NAnt plugins

Look into creating/updating plug ins for the various .NET/Mono IDEs that are available. Such as Monodevelop, VS.NET, etc.

xmlpoke with failonerror=true does not fail when xpath matches zero nodes

The behaviour between xmlpeek and xmlpoke is different, with regards to the xpath node matches. In both cases, if failonerror=false, a Warning is logged and processing continues (expected behaviour). Likewise, with failonerror=true, if there are zero nodes found with the xpath match in xmlpeek, it fails processing (also expected behaviour). Intuitively I would expect xmlpoke to also fail if zero nodes are matched and failonerror=true... however it does not. Instead it just does the same behaviour as when failonerror=false.

Arguable whether this is a bug or a "feature" now that it has existed like this for so long. Personally I'd call it a bug. I plan to submit a patch that corrects the behaviour of xmlpoke when failonerror=true and zero nodes are matched by the xpath... and if people want xmlpoke to continue with it's current behaviour they can always just set failonerror=false.

Website updates

It would be nice to revamp the website layout with an updated look and feel.

Improve NAnt's app.config file format

With all of the .NET/Mono versions available and more coming in the future, NAnt's app.config is becoming bloated and very difficult to manage. It would be ideal to find a better way of handling all of the .NET/Mono versions while keeping the app.config file manageable.

Support for builinding Visual Studio 2012 solutions

Hi there,

We are in the progress of moving from VS2010 to VS2012 and found that Nant is not able to load VS 2012 solutions (but VS2010 SP1 can do it):

NAnt 0.91 (Build 0.91.4312.0; release; 22.10.2011)
Copyright (C) 2001-2011 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///...
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: build

init:
build:
 [solution] Starting solution build.

BUILD FAILED
Solution format of file 'd:\dev\encodo\sandbox\Sandbox.sln' is not supported.

Is there support for VS2012 solution files on the road-map?

Regards,
Marc

Get task needs to apply Timeout value to ReadWriteTimeout for HttpWebRequest

If in the Get task, we are referencing an Http or Https Url, the request will timeout after 5 minutes (300000 ms) regardless of Timeout being set on task definition. It turns out the HttpWebRequest.ReadWriteTimeout has a default of 5 minutes and will cause a timeout exception (WebExpection.ProtocolError) even if Timeout has been set for a longer period. The fix is very easy, and I hope to contribute it after submitting this ticket.

          // if HTTP, cast to an HttpWebRequest so that IfModifiedSince can be set
          if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) {
            HttpWebRequest httpRequest = (HttpWebRequest) WebRequest.Create(uri);

            //modify the headers
            if (!fileLastModified.Equals(new DateTime())) {                                      
                // IfModifiedSince is an HTTP request header field for
                // conditionally downloading only resource modified after 
                // the specific time. If the resource has not been modified
                // since the specific time, then a 304 response will be 
                // returned.
                // By default all System.Net writes out the property in 
                // GMT/UTC format. For good measure, 1 second is added to 
                // make sure the the resource is newer.
                DateTime utcTime = fileLastModified.ToUniversalTime().AddSeconds(1);                   
                httpRequest.IfModifiedSince = utcTime;

                //REVISIT: at this point even non HTTP connections may support the if-modified-since
                //behaviour -we just check the date of the content and skip the write if it is not
                //newer. Some protocols (FTP) dont include dates, of course.
            }

            // associate security certificates
            foreach (string certificate in Certificates.FileNames) {
                httpRequest.ClientCertificates.Add(
                    X509Certificate.CreateFromCertFile(certificate));
            }

            httpRequest.ReadWriteTimeout = Timeout;
            webRequest = httpRequest;

Update README file

Fix the readme file to reflect all of the recent changes that have gone into NAnt.

.NET 3.5 localization satellite assemblies error

nant build .NET 3.5 application with localization (satellite assemblies) that this application fail on start.
(For .NET 4.0 all is ok)

(System.IO.FileNotFoundException was unhandled
Message="Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. File not found."
Source="mscorlib"
FileName="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
FusionLog="WRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].\r\n")

source:
http://dl.dropbox.com/u/24494019/Code/Localization.zip

Maybe I am doing something wrong...
Thanks

Better unzip/zip

SharpZipLib appears to be somewhat out of date, in that it doesn't support anything other than Deflate and Store methods when using ZipInputStream as NAnt is doing. A better library would be nice! SevenZipSharp (http://sevenzipsharp.codeplex.com/) looks interesting, but I haven't investigated it yet.

Add colored output to console

Setup the output of the build results to be displayed in color depending on the outcome of the build script tasks. For example, green output for successful runs, yellow output for warnings, and red output for errors.

Logo update

Like the website, the logo could use a face lift as well. Not sure where original logo came from or what rights the NAnt project has in using it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.