-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (58 loc) · 1.34 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
64
65
66
var
concat = require('gulp-concat'),
gulp = require('gulp'),
jasmine = require('gulp-jasmine-phantom'),
uglify = require('gulp-uglify');
var srcFiles = [
'src/renderer.js',
'src/display.js',
'src/stage.js',
'src/sprite.js',
'src/camera.js',
'src/text.js',
'src/text_field.js',
'src/sheet.js',
'src/sequence.js',
'src/scene.js',
'src/resizable.js',
'src/rectanlge.js',
'src/multiline_text.js',
'src/image.js',
'src/graphic.js',
'src/fluid_text.js',
'src/fluid_multiline_text.js',
'src/circle.js'
];
var specFiles= [
'spec/renderer.js',
'spec/display.js',
'spec/graphic.js',
'spec/image.js',
'spec/sprite.js',
'spec/sheet.js',
'spec/stage.js'
];
gulp.task('dist', function () {
var stream = gulp.src(srcFiles)
.pipe(uglify())
.pipe(concat('oak-canvas.min.js'))
.pipe(gulp.dest('dist/'));
var stream = gulp.src(srcFiles)
.pipe(concat('oak-canvas.js'))
.pipe(gulp.dest('dist/'));
return stream;
});
gulp.task('spec', function () {
var files = srcFiles.concat(specFiles);
files.unshift('bower_components/**/**/*.js');
return gulp.src(files)
.pipe(jasmine({
integration: true,
verbose: true
}));
});
gulp.task('watch', function () {
var watcher = gulp.watch('{src,spec}/*.js', ['spec']);
return watcher;
});
gulp.task('default', ['spec', 'dist', 'docs']);