forked from totvs/oe-test-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpFile.js
56 lines (49 loc) · 1.66 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
const gulp = require('gulp');
/**
* clean:
* Delete the "dist" directory for a clean build.
*/
gulp.task('clean', () => require('del')(['./dist/', './test/**/*.js']));
/**
* copy:
* Copy the ABL and Robot compiled files to the "dist" directory.
*/
gulp.task('copy', () => gulp
.src(['package*.json', 'README.md', './src/**/*.r', './src/**/*.exe'])
.pipe(gulp.dest('./dist')));
/**
* compile:
* Compile TypeScript sources and move the compiled files to the "dist"
* directory.
*/
gulp.task('compile', gulp.series(() => {
const ts = require('gulp-typescript');
const tsProject = ts.createProject('./tsconfig.json');
return gulp.src(['./src/**/*.ts']).pipe(tsProject()).pipe(gulp.dest('./dist'));
}));
/**
* build:
* Compile TypeScript sources and copy all resources files. Both compiled and
* resource files are copied to "dist" directory.
*/
gulp.task('build', gulp.series('compile', 'copy', () => {
const uglify = require('gulp-uglify-es').default;
return gulp.src('./dist/**/*.js').pipe(uglify()).pipe(gulp.dest((file) => file.base));
}));
/**
* compile-test:
* Compile TypeScript test sources.
*/
gulp.task('testcompile', () => {
const ts = require('gulp-typescript');
const tsProject = ts.createProject('./tsconfig.json');
return gulp.src(['./test/**/*.ts']).pipe(tsProject()).pipe(gulp.dest('./test'));
});
/**
* test:
* Build all necessary test sources and execute the test file.
*/
gulp.task('test', gulp.series('testcompile', () => {
const protractor = require('gulp-protractor').protractor;
return gulp.src('./test/*.spec.js').pipe(protractor({ configFile: './test/conf.js' }));
}));