-
Notifications
You must be signed in to change notification settings - Fork 22
/
gulpfile.js
40 lines (34 loc) · 1.11 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
var gulp = require('gulp');
var shell = require('gulp-shell');
var del = require('del');
var path = require('path');
var fs = require('fs');
var xml2js = require('xml2js');
var packagesConfig = path.join(__dirname, 'packages.config');
var packageName = '';
// read nuget package version from packages.config
var xmlParser = new xml2js.Parser();
fs.readFile(packagesConfig, function (err, data) {
xmlParser.parseString(data, function (err, result) {
var pkg = result.packages.package.find(function (p) {
return p.$.id === 'Abp.Web.Resources';
});
packageName = pkg.$.id + '.' + pkg.$.version;
});
});
gulp.task('clean', function () {
return del([
'Abp',
'packages'
]);
});
gulp.task('nuget-install', ['clean'], shell.task([
'.nuget\\NuGet.exe install .\\packages.config -OutputDirectory .\\packages'
]))
gulp.task('copy-resources', function () {
var contentPath = './packages/' + packageName + '/content/**';
return gulp.src(contentPath).pipe(gulp.dest('./'));
});
gulp.task('default', ['nuget-install'], function () {
gulp.start('copy-resources');
});