forked from idleberg/vscode-hopscotch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (55 loc) · 1.26 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
/*
* vscode-gulpfile.js
*
* Copyright (c) 2016, 2017 Jan T. Sott
* Licensed under the MIT license.
*/
// Dependencies
const gulp = require('gulp');
const debug = require('gulp-debug');
const jsonlint = require('gulp-jsonlint');
const raster = require('gulp-raster');
const rename = require('gulp-rename');
const xmlVal = require('gulp-xml-validator');
// Supported files
const jsonFiles = [
'package.json',
'snippets/*.json'
];
const xmlFiles = [
'syntaxes/*.tmLanguage'
];
const svgFiles = [
'src/logo.svg'
];
// Lint JSON
gulp.task('lint:json', gulp.series( (done) => {
gulp.src(jsonFiles)
.pipe(debug({title: 'json-lint'}))
.pipe(jsonlint())
.pipe(jsonlint.failAfterError())
.pipe(jsonlint.reporter());
done();
}));
// Validate XML
gulp.task('lint:xml', gulp.series( (done) => {
gulp.src(xmlFiles)
.pipe(debug({title: 'xml-validator'}))
.pipe(xmlVal());
done();
}));
// Convert SVG
gulp.task('convert:svg', gulp.series( (done) => {
gulp.src(svgFiles)
.pipe(raster())
.pipe(rename("logo.png"))
.pipe(gulp.dest('./images'));
done();
}));
// Available tasks
gulp.task('lint', gulp.parallel('lint:json', 'lint:xml', (done) => {
done();
}));
gulp.task('build', gulp.parallel('convert:svg', (done) => {
done();
}));