com.ullink.gradle:gradle-nuget-plugin

Gradle plugin for NuGet, to package, upload artifacts and restore packages.

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.ullink.gradle
ArtifactId

ArtifactId

gradle-nuget-plugin
Last Version

Last Version

2.18
Release Date

Release Date

Type

Type

jar
Description

Description

com.ullink.gradle:gradle-nuget-plugin
Gradle plugin for NuGet, to package, upload artifacts and restore packages.
Project URL

Project URL

https://github.com/Ullink/gradle-nuget-plugin
Source Code Management

Source Code Management

https://github.com/Ullink/gradle-nuget-plugin.git

Download gradle-nuget-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.ullink.gradle/gradle-nuget-plugin/ -->
<dependency>
    <groupId>com.ullink.gradle</groupId>
    <artifactId>gradle-nuget-plugin</artifactId>
    <version>2.18</version>
</dependency>
// https://jarcasting.com/artifacts/com.ullink.gradle/gradle-nuget-plugin/
implementation 'com.ullink.gradle:gradle-nuget-plugin:2.18'
// https://jarcasting.com/artifacts/com.ullink.gradle/gradle-nuget-plugin/
implementation ("com.ullink.gradle:gradle-nuget-plugin:2.18")
'com.ullink.gradle:gradle-nuget-plugin:jar:2.18'
<dependency org="com.ullink.gradle" name="gradle-nuget-plugin" rev="2.18">
  <artifact name="gradle-nuget-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ullink.gradle', module='gradle-nuget-plugin', version='2.18')
)
libraryDependencies += "com.ullink.gradle" % "gradle-nuget-plugin" % "2.18"
[com.ullink.gradle/gradle-nuget-plugin "2.18"]

Dependencies

compile (1)

Group / Artifact Type Version
commons-io : commons-io jar 2.5

Project Modules

There are no modules declared in this project.

Gradle NuGet Plugin Build status Build Status

This plugin allows to execute NuGet.exe from a gradle build. It also supports pack & push commands through built-in tasks, nugetPack, nugetPush & nugetRestore.

nugetPack

You can see this plugin being used for real on il-repack project. (together with msbuild one)

nugetSpec

The task is to generate nuspec file by custom configuration.

Sample usage:

buildscript {
    repositories {
      mavenCentral()
    }

    dependencies {
        classpath "com.ullink.gradle:gradle-nuget-plugin:2.17"
    }
}

apply plugin: 'nuget'

nuget {
    // nuget.exe version to use, defaults to 4.9.4

    // there are three different mutually excluded options for Nuget binary downloading:

    // first: define nuget version for download.
    // available versions can be found [here](https://dist.nuget.org/index.html)
    version = '4.9.4'

    // second - set nuget location, which will be used for download:
    nugetExePath = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

    // third: define nuget executable file, which is already downloaded previously:
    nugetExePath = "C:\\Tools\\Nuget\\nuget.exe"
}

nugetSpec {
    // Array, Map and Closure could be used to generate nuspec XML, for details please check NuGetSpecTest
    nuspec = [
        metadata: [
            title:          'project title',
            authors:        'Francois Valdy',
            // id:          default is project.name
            // version:     default is project.version
            // description: default is project.description
            // ...
        ]
        files: [
            { file (src: 'somefile1', target: 'tools') },
            { file (src: 'somefile2', target: 'tools') }
        ]
    ]
}

nugetRestore

Nuget restore is used to retrieve missing packages before starting the build.

Sample usage:

nugetRestore {
    solutionDirectory = path\to\project
    packagesDirectory = location\for\package\restore
}

Where

  • solutionDirectory - could either contain the .sln file or the repositories.config file
  • packagesDirectory - used only if a folder with repositories.config is used

nugetSources

Nuget sources is used to add, remove, update, enable, disable nuget feeds.

Sample usage:

nugetSources {
    operation = 'add'
    sourceName = 'localNuGetFeed'
    sourceUrl = 'http://foo.com'
    username = 'optional username'
    password = 'optional password'
    configFile = 'nuget.config'
}

Where

  • operation - could be add, remove, update, enable, disable and list
  • sourceName - name of the nuget feed
  • sourceUrl - url of the nuget feed
  • username - optional username for nuget sources that require http basic authentication
  • password - optional password for nuget sources that require http basic authentication
  • configFile - optional NuGet.config file to modify

See also

Gradle Msbuild plugin - Allows to build VS projects & solutions.

Gradle NUnit plugin - Allows to execute NUnit tests from CI (used with this plugin to build the projects prior to UT execution)

Gradle OpenCover plugin - Allows to execute the UTs through OpenCover for coverage reports.

You can see these 4 plugins in use on ILRepack project (build.gradle).

License

All these plugins are licensed under the Apache License, Version 2.0 with no warranty (expressed or implied) for any purpose.

com.ullink.gradle

Itiviti

Follow us on our new Github! https://github.com/Itiviti

Versions

Version
2.18
2.12
2.11
2.10
2.9
2.8
2.7
2.5
2.4
2.3
2.2
2.1
2.0
1.3
1.1