-
Notifications
You must be signed in to change notification settings - Fork 32
/
gulpfile.js
67 lines (58 loc) · 1.8 KB
/
gulpfile.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
var gulp = require('gulp'),
args = require('yargs').argv,
assemblyInfo = require('gulp-dotnet-assembly-info'),
msbuild = require('gulp-msbuild'),
nunit = require('gulp-nunit-runner'),
Nuget = require('nuget-runner');
gulp.task('deploy', ['nuget-push']);
gulp.task('ci', ['nuget-package']);
gulp.task('assemblyInfo', function() {
return gulp
.src('**/AssemblyInfo.cs')
.pipe(assemblyInfo({
version: args.buildVersion,
fileVersion: args.buildVersion,
copyright: function(value) {
return 'Copyright © ' + new Date().getFullYear() + ' Ultraviolet Catastrophe.';
}
}))
.pipe(gulp.dest('.'));
});
gulp.task('build', ['assemblyInfo'], function() {
return gulp
.src('**/*.sln')
.pipe(msbuild({
toolsVersion: 15.0,
targets: ['Clean', 'Build'],
errorOnFail: true,
stdout: true
}));
});
gulp.task('test', ['build'], function () {
return gulp
.src(['**/bin/**/*Tests.dll'], { read: false })
.pipe(nunit({
executable: 'nunit3-console.exe',
options: {
framework: 'net-4.5',
where: 'cat != Performance',
teamcity: true
}
}));
});
gulp.task('nuget-package', ['test'], function() {
gulp.src('src/TDMSReader/bin/Release/TDMSReader.*')
.pipe(gulp.dest('package/lib'));
return Nuget()
.pack({
spec: 'TDMSReader.nuspec',
basePath: 'package',
version: args.buildVersion
});
});
gulp.task('nuget-push', ['nuget-package'], function() {
return Nuget({
apiKey: args.nugetApiKey,
source: ['https://www.nuget.org/api/v2/package']
}).push('*.nupkg');
});