Download nuget packages
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-nugetter --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-nugetter');
In your project's Gruntfile, add a section named nugetter
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
nugetter: {
options: {
// Task-specific options go here.
}
},
});
Type: String
Default value: ''
The id of the nuget package you want to download.
Type: String
Default value: ''
The optional version you would like to download. If not given, downloads latest.
Type: String
Default value: 'http://nuget.org/api/v2/'
Allows you to point to internal nuget server.
Type: String
Default value: '%(id)s.zip'
Where the unzipped files should be stored. Option supports referencing other options as a named parameter.
Type: String
Default value: '%(id)s.zip'
Where the package sholud be temporarily stored. Option supports referencing other options as a named parameter. File is automatically deleted if tmpDelete is true.
Type: Boolean
Default value: true
Whether the temporary package is automatically deleted.
This is the most basic example, using default locations and server to download the jQuery NuGet package.
grunt.initConfig({
nugetter: {
options: {
packages: [
{
id: 'jQuery'
}
]
}
}
});
This example shows how to use a custom server, custom destination, and multiple packages.
grunt.initConfig({
nugetter: {
options: {
packages: [
{
id: 'jQuery'
},
{
id: 'CustomPackage',
dest: '_source/nuget/%(id)s'
server: 'http://my-custom-server/api/'
}
]
}
},
});