-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
90 lines (75 loc) · 2.36 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
'use strict';
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
grunt.initConfig({
// Set this variables for different projects
projectName: 'h-resolution',
// These variables shouldn't be changed, but sometimes it might be necessary
srcPath: './',
solutionName: '<%= projectName %>.sln',
dotNetVersion: '4.5.0',
platform: 'Any CPU',
styleCopRules: 'Settings.StyleCop',
ruleSet: 'rules.ruleset',
pkg: grunt.file.readJSON('package.json'),
assemblyinfo: {
options: {
files: ['<%= srcPath %><%= solutionName %>'],
info: {
version: '<%= pkg.version %>',
fileVersion: '<%= pkg.version %>',
company: 'hylasoft',
copyright: ' ',
product: '<%= projectName %>'
}
}
},
msbuild: {
release: {
src: ['<%= srcPath %><%= solutionName %>'],
options: {
projectConfiguration: 'Release',
platform: '<%= platform %>',
targets: ['Clean', 'Rebuild'],
buildParameters: {
StyleCopEnabled: false
}
}
},
debug: {
src: ['<%= srcPath %><%= solutionName %>'],
options: {
projectConfiguration: 'Debug',
platform: '<%= platform %>',
targets: ['Clean', 'Rebuild'],
buildParameters: {
StyleCopEnabled: true,
StyleCopTreatErrorsAsWarnings: false,
StyleCopOverrideSettingsFile: process.cwd() + '/<%= styleCopRules %>',
RunCodeAnalysis: true,
CodeAnalysisRuleSet: process.cwd() + '/<%= ruleSet %>',
TreatWarningsAsErrors: true
},
}
}
},
mstest: {
debug: {
src: ['<%= srcPath %>/**/bin/Debug/*.dll', '<%= srcPath %>/**/bin/Debug/*.exe'] // Points to test dll
}
},
nugetrestore: {
restore: {
src: '<%= srcPath %><%= solutionName %>',
dest: 'packages/'
}
}
});
grunt.registerTask('default', ['build']);
grunt.registerTask('build', ['nugetrestore','msbuild:release']);
grunt.registerTask('test', ['nugetrestore','msbuild:debug', 'mstest']);
grunt.registerTask('release', ['assemblyinfo', 'test', 'build']);
};