forked from mikeobrien/HidLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (50 loc) · 1.56 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
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('src/*.sln')
.pipe(msbuild({
toolsVersion: 4.0,
targets: ['Clean', 'Build'],
errorOnFail: true,
stdout: true
}));
});
gulp.task('test', ['build'], function () {
return gulp
.src(['**/bin/**/*Tests.dll'], { read: false })
.pipe(nunit({
teamcity: true
}));
});
gulp.task('nuget-package', ['build'], function() {
gulp.src('src/HidLibrary/bin/Release/HidLibrary.*')
.pipe(gulp.dest('package/lib'));
return Nuget()
.pack({
spec: 'HidLibrary.nuspec',
basePath: 'package',
version: args.buildVersion
});
});
gulp.task('nuget-push', ['nuget-package'], function() {
return Nuget({ apiKey: args.nugetApiKey }).push('*.nupkg');
});