Search code examples
.netjenkinsnugetnant

How I get 3. th party dependencies from my NuGet Server in NAnt?


I have some questions about .NET process automation. My idea is to use NAnt as Build Automation Tool for the Jenkins CI Server. The Jenkins is running in a Tomcat on a Debian Linux.

In my project I have some dependencies e.g. the Entity Framework. The dependencies are managed in our own NuGet Server. I need also the benefit of versioning, because not all sub projects works with the newest library version.

Question : How I get 3rd party dependencies from my NuGet Server in NAnt to run a compile?

I know there is a custom NAnt task for NuGet but I can find any documentation how to use this task.

Thanks for your advices.


Solution

  • Even if there is no document, you can check the source code of NAnt extension. As long as you are familiar with C#, you will find the code are self-describing.

    If you are asking about nuget-update, from the source you can see:

    [TaskName("nuget-update")]
    public class NugetUpdateTask : Task
    {
        [TaskAttribute("solution-dir", Required = true)]
        public DirectoryInfo SolutionDir { get; set; }
    
        [TaskAttribute("repository", Required = false)]
        public DirectoryInfo RepositoryPath { get; set; }
        //...
    

    Usage would be:

    <nuget-update solution-dir="file:///your/solution/dir" repository="file:///your-repository" />
    

    And you probably already noticed, solution-dir is required, but repository is not.

    Same for nuget-get-files.