Create nuget package with grunt.
Since this module is for personal use it is not listed in npm repository. Please add the next code to your package.json file
"devDependencies": {
"grunt-nuget": "https://github.com/atma/grunt-nuget/archive/master.tar.gz"
}
Then install grunt-nuget with: npm install
And add this line to your project's Gruntfile.js
grunt.loadNpmTasks('grunt-nuget');
Run this task with the grunt nuget
command.
Task targets and files may be specified according to the grunt Configuring tasks guide.
Type: String
Repository server url to push to.
Type: String
API key associated with your account on a remote server. If you use official repository please go to nuget.org and register an account. Once you do that, click on "My Account" to see an API Key that was generated for you.
Type: Bool
Publish automatically?
Type: Array
An array of package dependencies where id
is an unique package id registered on the server and version
is a nuget version reference.
Type: String
Since nuget package name will be generated automatically using pkg.name
and pkg.version
from your package.json file, you can generate unique packages suffixed by .pkgIdentity
. This can be helpful when the same code will be used in projects with different file structure. As a result we can generate a few packages with the same content but different by structure.
Do not forget to specify a pkg
in your gruntfile
. Ex: grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), ...
.
nuget: {
local: {
files: [
{
src: ['dist/**'],
dest: 'content/Content/'
}
]
},
publish: {
files: [
{
src: ['src/**'],
dest: 'src/'
}
],
server: 'http://your.local.repo/',
apikey: 'nuget-apikey',
publish: true,
pkgIdentity: 'Sources',
dependencies: [
{
id: 'jquery', version: '[1.7,1.9)'
}
]
}
}
This will create two nuget packages in nuget_packages directory. The second will be published automatically to repository indicated by server
param.
Copyright (c) 2013 Oleh Burkhay
Licensed under the MIT license.