-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
51 lines (41 loc) · 1.41 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = function(grunt) {
var path = require('path');
var pkg = grunt.file.readJSON('package.json');
var projectRoot = 'src/' + pkg.name + '/';
var assembly = grunt.file.readJSON(projectRoot + 'Properties/AssemblyInfo.json');
var version = assembly.informationalVersion ? assembly.informationalVersion : assembly.version;
grunt.initConfig({
pkg: pkg,
zip: {
release: {
router: function (filepath) {
filepath = filepath.replace(projectRoot, '');
var filename = path.basename(filepath);
return filepath.match(/^bin\//) ? 'bin/' + filename : filepath;
},
src: [
projectRoot + 'bin/Release/Skybrud.Social.dll',
projectRoot + 'bin/Release/Skybrud.Social.xml',
projectRoot + 'bin/Release/Skybrud.WebApi.Json.dll',
projectRoot + 'bin/Release/Skybrud.WebApi.Json.xml',
projectRoot + 'bin/Release/' + pkg.name + '.dll',
projectRoot + 'bin/Release/' + pkg.name + '.xml',
projectRoot + 'App_Plugins/**/*.*'
],
dest: 'releases/' + pkg.name + '.v' + version + '.zip'
}
},
nugetpack: {
dist: {
src: 'src/' + pkg.name + '/' + pkg.name + '.csproj',
dest: 'nuget/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-nuget');
grunt.loadNpmTasks('grunt-zip');
grunt.registerTask('dev', ['zip', 'nugetpack']);
grunt.registerTask('release', ['zip', 'nugetpack']);
grunt.registerTask('default', ['dev']);
};