Skip to content

Commit

Permalink
add nuget grunt tasks and nuspec files
Browse files Browse the repository at this point in the history
  • Loading branch information
itajaja committed Oct 16, 2014
1 parent 20e8906 commit f93f977
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
36 changes: 33 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = function(grunt) {
platform: 'Any CPU',
styleCopRules: 'Settings.StyleCop',
ruleSet: 'rules.ruleset',
nuspecFile: 'package.nuspec',

pkg: grunt.file.readJSON('package.json'),

Expand All @@ -42,7 +43,10 @@ module.exports = function(grunt) {
options: {
projectConfiguration: 'Release',
platform: '<%= platform %>',
targets: ['Clean', 'Rebuild']
targets: ['Clean', 'Rebuild'],
buildParameters: {
StyleCopEnabled: false
}
}
},
debug: {
Expand All @@ -65,14 +69,40 @@ module.exports = function(grunt) {

mstest: {
debug: {
src: ['<%= srcPath %>/**/bin/Debug/*.dll','<%= srcPath %>/**/bin/Debug/*.exe'] // Points to test dll
src: ['<%= srcPath %>/**/bin/Debug/*.dll', '<%= srcPath %>/**/bin/Debug/*.exe'] // Points to test dll
}
},

nugetpack: {
dist: {
src: '<%= nuspecFile %>',
dest: '.',

options: {
version: '<%= pkg.version %>',
basePath: '<%= srcPath %>/h-behavior/bin/Release',
includeReferencedProjects: true,
excludeEmptyDirectories: true,
verbose: true,
symbols: true
}
}
}
},

nugetpush: {
src: '*.<%= pkg.version %>.nupkg',
options: {}
},

clean: {
nuget: ['*.nupkg'],
},

});

grunt.registerTask('default', ['build']);
grunt.registerTask('build', ['msbuild:release']);
grunt.registerTask('test', ['msbuild:debug', 'mstest']);
grunt.registerTask('release', ['test', 'assemblyinfo']);
grunt.registerTask('publishNuget', ['release', 'msbuild:release', 'nugetpack', 'nugetpush', 'clean:nuget']);
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"grunt-msbuild": "^0.2.2",
"grunt-mstest": "^0.1.5",
"load-grunt-tasks": "^0.6.0",
"time-grunt": "^1.0.0"
"time-grunt": "^1.0.0",
"grunt-nuget": "~0.1.3",
"grunt-contrib-clean": "~0.6.0"
},
"engines": {
"node": ">=0.8.0"
Expand Down
20 changes: 20 additions & 0 deletions package.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Hylasoft.Behavior</id>
<version>0.0</version> <!-- Not important, gets overridden by the grunt task -->
<title>Hylasoft.Behavior</title>
<description>Behavior Driven Development (BDD) wrapper for .NET MsTests</description>
<authors>Giacomo Tagliabue</authors>
<language>en-US</language>
<owners>Hylasoft Usa</owners>
<licenseUrl>https://github.com/hylasoft-usa/h-behavior/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/hylasoft-usa/h-behavior/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>Test BDD Spec Behavior Hyla Hylasoft</tags>
</metadata>
<files>
<file src="h-behavior.dll" target="lib"/>
<file src="h-behavior.xml" target="lib"/>
</files>
</package>

0 comments on commit f93f977

Please sign in to comment.