-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathGruntfile.js
51 lines (48 loc) · 1.65 KB
/
Gruntfile.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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
options: {
stderr: false
},
target: {
command: 'egret build -sourcemap'
},
quick: {
command: 'egret quickbuild -sourcemap'
},
rebuild:{
command: 'egret build -e'
},
publish:{
command: 'egret publish & open ./release'
},
reveal:{
command: 'open ./'
},
native:{
command: 'egret build --runtime native -e'
},
runtime:{
command: 'egret publish -compile --runtime native'
}
},
watch: {
//监听文件变化,分别有src下非skins目录的ts文件,skins的exml文件,以及launcher目录中的两个html及里面所有js
files: ['src/**/*.ts','!src/skins*/**','src/*.js','src/**/*.exml'],
tasks: ['shell:target']
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch')
// 默认被执行的任务列表。
grunt.registerTask('default', ['shell:target']);//编译
grunt.registerTask('quick', ['shell:quick']);//编译
grunt.registerTask('rebuild', ['shell:rebuild']);//重建
grunt.registerTask('publish', ['shell:publish']);//发布并打开release目录,打开目录仅Mac
grunt.registerTask('open', ['shell:reveal']);//打开当前目录,仅Mac
grunt.registerTask('runtime', ['shell:runtime']);//runtime
grunt.registerTask('native', ['shell:native']);//runtime
};
//egret create_app G1_iOS -f G1 -t egret-ios-support