forked from flash2x/AnnieJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
92 lines (92 loc) · 2.67 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/**
* Created by anlun on 16/6/14.
*/
var gulp = require('gulp');
var ts = require('gulp-typescript');
var del = require('del');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var coreList =[
"annie/events/EventDispatcher.ts",
"annie/events/Event.ts",
"annie/events/MouseEvent.ts",
"annie/events/TouchEvent.ts",
"annie/geom/Point.ts",
"annie/geom/Matrix.ts",
"annie/geom/Rectangle.ts",
"annie/display/DisplayObject.ts",
"annie/display/bitmap.ts",
"annie/display/Shape.ts",
"annie/display/Sprite.ts",
"annie/media/Media.ts",
"annie/media/Sound.ts",
"annie/media/Video.ts",
"annie/media/ImageFrames.ts",
"annie/display/MovieClip.ts",
"annie/display/FloatDisplay.ts",
"annie/display/VideoPlayer.ts",
"annie/display/TextField.ts",
"annie/display/InputText.ts",
"annie/display/Stage.ts",
"annie/filters/Filters.ts",
"annie/render/IRender.ts",
"annie/render/CanvasRender.ts",
"annie/render/WGRender.ts",
"annie/net/URLLoader.ts",
"annie/utils/Flash2x.ts",
"annie/utils/Tween.ts",
"annie/utils/Timer.ts",
"annie/Annie.ts",
"annie/GlobalFunction.ts"
];
var uiList=[
"build/annieCore.d.ts",
"annie/ui/ScrollPage.ts",
"annie/ui/FacePhoto.ts",
"annie/ui/SlidePage.ts",
"annie/ui/FlipBook.ts",
"annie/ui/ScrollList.ts",
"annie/ui/DrawingBoard.ts",
"annie/ui/ScratchCard.ts"
];
var onBuildCore = function(){
var op = {
noImplicitAny: true,
declaration: true,
out: "annieCore.js",
target: "ES5"
};
var outDir = "build";
var tsResult = gulp.src(coreList).pipe(ts(op));
tsResult.dts.pipe(gulp.dest(outDir));
tsResult.js.pipe(gulp.dest(outDir)).pipe(uglify()).pipe(rename({ extname: '.min.js' })).pipe(gulp.dest(outDir));
};
var onBuildUI = function(){
var op = {
noImplicitAny: true,
declaration: true,
target: "ES5",
out: "annieUI.js"
};
var outDir = "build";
var tsResult = gulp.src(uiList).pipe(ts(op));
tsResult.dts.pipe(gulp.dest(outDir));
tsResult.js.pipe(gulp.dest(outDir)).pipe(uglify()).pipe(rename({ extname: '.min.js' })).pipe(gulp.dest(outDir));
};
var onBuildDoc = function (){
del([
'libs'
]);
var op = {
noImplicitAny: true,
declaration: true,
target: "ES5"
};
var outDir = "libs";
var tsResult = gulp.src(coreList.concat(uiList.slice(1))).pipe(ts(op));
tsResult.js.pipe(gulp.dest(outDir));
};
gulp.task('onBuildCore', onBuildCore);
gulp.task('onBuildUI', onBuildUI);
gulp.task("onBuildDoc", onBuildDoc);
gulp.task('onBuildAll',['onBuildCore','onBuildUI']);