GithubHelp home page GithubHelp logo

nant / nantcontrib Goto Github PK

View Code? Open in Web Editor NEW
50.0 11.0 34.0 4.16 MB

NAntContrib is the project for tasks and tools that haven't made it into the main NAnt distribution yet or for whatever reason don't belong there.

Home Page: nantcontrib.sourceforge.net

License: GNU Lesser General Public License v2.1

Makefile 0.11% C# 91.81% XSLT 4.48% CSS 0.20% JavaScript 0.18% Batchfile 0.04% HTML 3.18%

nantcontrib's Introduction

NAntContrib

What is it?
-----------
NAntContrib is the project for tasks and tools that haven't made it into the main NAnt distribution 
yet or for whatever reason don't belong there.


How to use NAntContrib tasks in NAnt?
-------------------------------------
In order to use NAntContrib tasks in NAnt, you can use one of the following procedures:

1. Use the <loadtasks> task in your build file(s) to tell NAnt which assembly to scan for tasks

For example:

<project name="NAntContrib" default"test">
    <target name="test">
        <loadtasks assembly="c:/nantcontrib-0.86/bin/NAnt.Contrib.Tasks.dll" />
        ...
    </target>
</project>

In order to avoid updating all build files when you move the NAnt.Contrib.Tasks assembly to another
directory, you could register the directory containing the NAnt.Contrib.Tasks assembly in an 
environment variable and then use the value of that environment variable in your build files.

For example:

<project name="NAntContrib" default"test">
    <target name="test">
        <loadtasks assembly="${path::combine(environment::get-variable('NANTCONTRIB_DIR'), 'bin/NAnt.Contrib.Tasks.dll')}" />
        ...
    </target>
</project>

This example assumes you've registered an environment variable named "NANTCONTRIB_DIR", holding the 
path to NAntContrib (eg. c:\nantcontrib-0.86).

2. Copy the content of the NAntContrib bin directory to the NAnt directory

In order to make certain tasks available to every build file, you can copy the
extensions assembly to the following directory:

    <nant>\bin\extensions\common\neutral\NAntContrib

and copy the third-party assemblies to directory:

    <nant>\bin\lib\common\neutral\NAntContrib

You should eventually end up with the following directory structure:

<nant>\
    bin\
        extensions\
            common\
                neutral\
                    NAntContrib\
                        NAnt.Contrib.Tasks.dll
                        NAnt.Contrib.Tasks.pdb (not available for releases)
                        NAnt.Contrib.Tasks.xml
        lib\
            common\
                neutral\
                    NAntContrib\
                        CollectionGen.dll
                        Interop.MsmMergeTypeLib.dll
                        Interop.StarTeam.dll
                        Interop.WindowsInstaller.dll
                        SLiNgshoT.Core.dll
                        SourceSafe.Interop.dll

Note: you might have to manually create the directories.

3. Modify NAnt configuration file (not recommended)

An <include> element can be added to the <task-assemblies> node in the <framework> node for the
.NET Framework version that you intend to use. The "name" attribute of the <include> element 
should hold the absolute path to NAnt.Contrib.Tasks.dll.

For example:

    <framework 
            name="net-1.1" 
                family="net" 
                version="1.1"
                description="Microsoft .NET Framework 1.1"
        ....
    >
            <task-assemblies>
            ...
            <include name="c:/nantcontrib-0.86/bin/NAnt.Contrib.Tasks.dll" />
            ...
                </task-assemblies>
        ....
    </framework>

You would need to repeat this for all .NET Framework versions that you intend to use.

Note: The NAnt configuration file (NAnt.exe.config) is considered internal, and might change without
      noticed.


How to build.
-------------
To build NAntContrib, the following procedure should be followed:


1. Download and extract a binary distribution of NAnt from http://nant.sourceforge.net

2. Change to the NAntContrib directory

3. Run NAntContrib.build using the version of NAnt that you downloaded

    eg.  c:\NAnt-0.86\bin\NAnt.exe -D:nant.dir=c:\NAnt -f:NAntContrib.build

Note: 

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


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

nantcontrib's People

Contributors

bryce-l avatar claytonharbour avatar dguder avatar drieseng avatar nikhilgg avatar rbirkby avatar rmboggs 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nantcontrib's Issues

Website updates

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

Add support for msbuild.exe v12.0 to the msbuild task

I would like to be able to use the msbuild task to build Visual Studio 2013 solutions and projects.

Currently, specifying:

<property name="nant.settings.currentframework" value="net-4.0"/>
<msbuild
  project="C:\Test\Test.sln"
  target="Build"
  verbosity="Detailed">
  <property name="Configuration" value="Debug" />
  <property name="Platform" value="Mixed Platforms" />
</msbuild>

Will execute msbuild.exe from "C:\Windows\Microsoft.NET\Framework\v4.0.30319".

With Visual Studio 2013, the path to msbuild.exe has changed.
See "What's New in MSBuild 12.0" here: http://msdn.microsoft.com/en-us/library/hh162058.aspx
MSBuild is now installed directly under %ProgramFiles%—for example, in C:\Program Files\MSBuild.

For example, for Visual Studio 2013/MSBuild 12.0, "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" should be used.

Thank you.

<link> task does not fail on unexisting library

Hello,

I use NAnt 0.92 for Windows builds. I noticed that if some library which is listed in the task does not exist (the path is wrong for example) then NAnt does not fail. Instead, it tries to link less number of libraries and of course fails later with "undefined symbols".
This is annoying, because one can spend much time to investigate why exact symbols are missing before discovers the fact that the library was not passed correctly to the linker.
I would like to have at least a parameter for task to fail on unexisting libraries.

--
Best Regards,
Alexander Samoilov,
CI Engineer, Compart AG (Germany)

Cannot Compile On VS2012

I have VS2012 installed. While try to compile NAntContrib via command:

  • D:\nant-0.92\bin\NAnt.exe -D:nant.dir=D:\nant-0.92 -f:NAntContrib.build

I got the following error message

compile.schemas:

      [xsd] Compiling XML Schema 'D:\workspace\nantcontrib\src\Tasks\Msi\MsiTask.xsd' into Microsoft.NET classes.

BUILD FAILED

D:\workspace\nantcontrib\NAntContrib.build(164,14):
Error compiling XML Schema.
    The SDK for the 'net-4.0' framework is not available or not configured.

Is it because I have to specify the SDK install path? Or Is it that NAntContrib hasn't prepared to be compiled on .NET 4.0 yet?

Can anyone help? Thanks!

execution of iisapppool task on remote machine fails with "access denied"

I don't know is it bug of nant-0.91 or nantcontrib-0.91, but it works fine with nant-0.85 + nantcontrib-0.85, and task is a part of nantcontrib project.

        Failed stopping application pool "PoolName" on "machinename".
            Access denied

In event log of remote machine there is:


Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 5605
Date: 16.12.2011
Time: 11:47:10
User: N/A
Computer: computername
Description:
Access to the root\MicrosoftIISv2 namespace was denied. The namespace is marked with RequiresEncryption but the client connection was attempted with an authentication level below Pkt_Privacy. Re try the connection using Pkt_Privacy authentication level.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

I think it refers to the old one unresolved issue http://sourceforge.net/tracker/index.php?func=detail&aid=1729572&group_id=31650&atid=402868

VSS task - using old interop dll

VSS task is referencing the old interop dll - SourceSafeTypeLib

it should refer to Microsoft.VisualStudio.SourceSafe.Interop . when i tried to run VSSGET it failed in 64 bit machine.

may be we need a new VSS Get task ? to keep the library compatible .

Add Sandcastle task

Would be nice to have a task to build documentation through sandcastle. Would probably require work on msbuild task.

reverse a string list

Something like this, so we don't have to code it in C#. Useful if you have to stop and start services or deploy something in a particular order.

  <script language="C#">
<code><![CDATA[
    public static void ScriptMain(Project project) 
    {
                string str = project.Properties["original.string"];
                String[] myList = str.Split(',');
                Array.Reverse(myList);
                project.Properties["original.string.reverse"] = String.Join(",", myList);
    }
  ]]>
</code>
  </script>

waitforexit cannot capture failures

Currently to speed up a build tasks must be executed in parallel. The lack of <parallel> (from Ant) forces lesser solutions like <exec ...> followed by <waitforexit>.

The major problem is that neither <exec> nor <waitforexit> can help check the program didn't throw an error (even with failonexit or resultproperty). I know the documentation says it's the current behavior but that's very limiting.

Example:

<project>
<target name="foo">
    <exec spawn="true" pidproperty="pid" failonerror="false" resultproperty="result" program="cmd" commandline="/c girbish" />
    <waitforexit pid="${pid}" />
    <echo>${result}</echo>
</target>
</project>

This will always display -1000 and never fail.

Consider Migrate to .NET 3.5+?

Is there any migration plan for NAntContrib?

I'd like to contribute a feature to NAntContrib: NAntFind. But because NAntContrib is still based on .NET Framework 2.0, some new features provided in newer .NET Framework versions (like LINQ) cannot be used. I can change my code, but it would acceleratte development if NAntContrib can be migrated to higher .NET version.

WaitForExitTask System.Security.SecurityException: Request failed

I've tried nantcontrib-0.92-bin.zip and the most recent nightly build and calling waitforexit fails.

<exec program="${msbuild.exe}" pidproperty="exec.pid" spawn="true" >
<!-- args --></exec>
<echo message="pid: ${exec.pid}" />
<waitforexit pid="${exec.pid}" />

log output;

     [echo] LogFile: msbuild.log 
     [echo] pid: 5188

BUILD FAILED

INTERNAL ERROR

System.Security.SecurityException: Request failed.
   at NAnt.Contrib.Tasks.WaitForExitTask.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()
The action that failed was:
LinkDemand
The type of the first permission that failed was:
System.Security.PermissionSet
The demand was for:
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet" version="1">
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Access="Open"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Allowed="ApplicationIsolationByUser" UserQuota="1024000"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Execution"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Window="SafeTopLevelWindows" Clipboard="OwnClipboard"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Url="file:///C:/Projects/ddev/build/nant/extensions/common/neutral/NantContrib/NAnt.Contrib.Tasks.dll"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Zone="Internet"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1" Level="SafePrinting"/>
<IPermission class="System.Security.Permissions.MediaPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" version="1" Audio="SafeAudio" Video="SafeVideo" Image="SafeImage"/>
<IPermission class="System.Security.Permissions.WebBrowserPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" version="1" Level="Safe"/>
</PermissionSet>

The assembly or AppDomain that failed was:
NAnt.Contrib.Tasks, Version=0.93.4764.0, Culture=neutral, PublicKeyToken=null
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
file:///C:/Projects/ddev/build/nant/extensions/common/neutral/NantContrib/NAnt.Contrib.Tasks.dll

Add Ssh/Scp Tasks

I would like to add tasks for ssh and scp commands to the nant/nantcontrib project. This would definitely be helpful during the nant release process as well.

Ant Examples:
SshExec
Scp

Possible .NET/Mono Lib references:
Ssh.net
SharpSsh

Otherwise, if there are encryption restrictions/concerns, then it may be best to use exernalprogrambase class and just call the command line programs.

Amazing spell mistake.

Hi,

I know this is not a very big mistake. But its important.
Please have a look at your website : http://nantcontrib.sourceforge.net/

            <p>
                <img alt=">" src="bullet.gif" />
                Download the latest <a href="http://sourceforge.net/project/showfiles.php?group_id=54790">stable release</a>
                or a <a href="http://nantcontrib.sourceforge.net/nightly/">nightly build</a>
            </p>
            <p>
                <img alt=">" src="bullet.gif" />
                Read the user documentation for the latest <a href="release/latest/help/">release</a>
                or the <a href="nightly/latest/help/">nighty build</a>
            </p>

First is correct . Says Nightly build.
But the second one goes : Nighty builds.

Please correct.
Its a silly mistake. But since I love nant.
It makes my work way easier,

Thanks,
Siddharth.

Import cvs task from NAnt

It would probably be a good idea to move the cvs task to NAntContrib. It needs work and it is probably not being used much anymore due to the popularity of other source control programs, such as svn, git, and mercurial.

p4Info task throws System.NullReferenceException - BUG

p4Info executes ToString() on the values Perforce.GetP4Info(find) returns without checking if ithey are not nulls. Taking into account that Perforce.GetP4Info(find) returns an array of string it's not needed at all and introduces a bug only.

protected override void ExecuteTask()
{
string[] find = {"User name:", "Client name:", "Client host:", "Client root:"};
string[] results = Perforce.GetP4Info(find);

Project.Properties[User] = results[0].ToString();            <-- BUG
Project.Properties[Client] = results[1].ToString();           <-- BUG 
Project.Properties[Host] = results[2].ToString();            <-- BUG
Project.Properties[Root] = results[3].ToString();            <-- BUG

}

nunit2report counts ignored tests as "errors".

The nunit2report task has a summary column called "Errors". According to the XSLT code, that's the count of tests that were not executed ("count(child::results/test-case[@executed='False'])"). This means that tests that were ignored (e.g., because they are tagged as [Ignore]) are incorrectly flagged.

NUnit does not document what the "executed='False'" attribute actually means, but I believe the only way it can be set is if the test is explicitly skipped.

Can you please change the column to "Ignored" or "Skipped"? That's what NUnit's GUI would represent these as.

Which codepage the code used?

My Computer is Windows8 Chinese Culture。And my VS2010 is Chinese Culture too.
When use the follow command to install nantcontrib, I got an error.
nant -D:nant.dir="C:\Program Files\NAnt" -f:NAntContrib.build install

the error was:
[csc] Compiling 191 files to 'D:\OpenSource\github\nantcontrib\build\nantc
ontrib-debug\bin\NAnt.Contrib.Tasks.dll'.
[csc] d:\OpenSource\github\nantcontrib\src\Tasks\Mks\History.cs(156,57): e
rror CS1010: 常量中有换行符
[csc] d:\OpenSource\github\nantcontrib\src\Tasks\Mks\History.cs(164,67): e
rror CS1010: 常量中有换行符

BUILD FAILED

when I try other codepage, the error was the same.
nant -D:nant.dir="C:\Program Files\NAnt" -D:codepage=20106 -f:NAntContrib.build install

which codepage should I use?

IIS web tasks do not support sites with secure bindings

The web tasks which derive from NAnt.Contrib.Tasks.Web.WebBase have the iisserver attribute which allows the correct server to be identified as "{hostname}:{port}" e.g. "localhost:80".

However this does not work if the server concerned uses a secure (HTTPS) binding e.g. "localhost:443". It fails to find the server and this results in a "No website is bound to {port}" exception.

The cause of this is in the FindServerInstance method of WebBase which enumerates bindings found under the "ServerBindings" property. Secure bindings do not get added to this collection but are present in the "SecureBindings" property instead msdn reference.

This method should be amended to enumerate both SecureBindings and ServerBindings collections when searching for the server.

Powershell script task

I wrote a small extension task that embeds a powershell script. We will be using it for complex build tasks. The script can access the Nant project object (get and set properties etc.). It also supports named powershell runspaces - so you can continue executing a script after setting up the parameters.

Anyone interested in this? I haven't contributed anything before - not sure if it is worthy or how to go about it.

Here is an example of the task in NAnt

The top level build file. $var = "this is the script" $myvar.Properties["tmpLog"] = "Hello" $myvar.Project.ProjectName $var = "running from a new runspace" $var $var

Rework subversion <svn> tasks

Now would be a good time to upgrade the tasks to use SharpSvn libs so it no longer relies on using the exec task.

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.