This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.mjs
81 lines (69 loc) · 1.71 KB
/
gulpfile.mjs
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
import gulp from 'gulp';
import msbuild from 'gulp-msbuild';
import nuget from 'gulp-nuget';
import { deleteAsync } from 'del';
import minimist from 'minimist';
import pkg from './package.json' assert { type: 'json' };
const argv = minimist(process.argv.slice(2));
function mj(path) {
return 'node_modules/mathjax' + path;
}
let files = [
mj('/MathJax.js'),
mj('/LICENSE'),
mj('/config/*.js'),
mj('/extensions/**/*.js'),
mj('/fonts/**/*.{woff,txt}'),
mj('/jax/**/*.js'),
mj('/localization/**/*.js'),
];
let version = pkg.version;
let source = argv.src || 'VisualOnStaging';
if (argv.build) {
version += '-' + argv.build;
}
export function clean() {
return deleteAsync(['bin', 'MathJax.WSP/Layouts/MathJax/**/*.*']);
}
export function copy() {
return gulp
.src(files, { base: mj() })
.pipe(gulp.dest('MathJax.WSP/Layouts/MathJax'));
}
export function compile() {
return gulp.src('MathJax.WSP/MathJax.WSP.csproj').pipe(
msbuild({
errorOnFail: true,
stdout: true,
targets: ['Package'],
toolsVersion: 'auto',
configuration: 'Release',
verbosity: 'minimal',
properties: { BasePackagePath: '..\\bin\\' },
})
);
}
export function pack() {
return gulp
.src('MathJax.nuspec')
.pipe(
nuget.pack({
nuget: 'nuget.exe',
version: version,
properties:
'configuration=Release;author=VisualOn GmbH;year=' +
new Date().getUTCFullYear(),
})
)
.pipe(gulp.dest('bin/'));
}
export function push() {
return gulp.src('bin/*.nupkg').pipe(
nuget.push({
nuget: 'nuget.exe',
source: source,
})
);
}
export const build = gulp.series(clean, copy, compile, pack);
export default build;