-
Notifications
You must be signed in to change notification settings - Fork 36
/
gulpfile.ts
60 lines (52 loc) · 1.24 KB
/
gulpfile.ts
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
import del from 'del'
import gulp from 'gulp'
import gulpTypeScript from 'gulp-typescript'
import sonarqubeScanner from 'sonarqube-scanner'
import { Gulpclass, SequenceTask, Task } from 'gulpclass'
const project = gulpTypeScript.createProject('tsconfig.json')
const dist = './dist'
@Gulpclass()
export class Gulpfile {
@Task('scan')
scan(cb: Function) {
sonarqubeScanner(
{
options: {},
serverUrl: 'http://10.177.157.45:3000/',
token: '8cfe2cd380b8a8d908f0dc4a179469e27920eae1',
},
cb
)
}
@Task('del-dist')
clean() {
return del('./dist/**')
}
@Task('compile-project')
compileProject() {
const tsResult = gulp.src('src/**/*.ts').pipe(project())
return tsResult.js.pipe(gulp.dest(dist))
}
@Task('copy-package')
copyPackageJson() {
return gulp.src('./package.json').pipe(gulp.dest(dist))
}
@Task('copy-json')
copyJson() {
return gulp.src('src/**/*.json').pipe(gulp.dest(dist))
}
@Task('copy-assets')
copyAssets() {
return gulp.src('src/assets/**/*').pipe(gulp.dest(`${dist}/assets`))
}
@SequenceTask('build')
build() {
return [
'del-dist',
'compile-project',
'copy-package',
'copy-json',
'copy-assets',
]
}
}