This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gruntfile.js
130 lines (108 loc) · 4.94 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
module.exports = function(grunt) {
var NAME_MXMLC = 'mxmlc';
var PATH_MXMLC = '../../node_modules/flex-sdk/lib/flex_sdk/bin/' + NAME_MXMLC;
var TARGET_PLAYER = '11.9';
var sys = require('sys')
var exec = require('child_process').exec;
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks("grunt-bumpup");
grunt.loadNpmTasks("grunt-tagrelease");
grunt.config.init({
shell: {
'clean dist': {
command: 'rm -rf ./dist/'
},
'clean tmp': {
command: 'rm -rf ./tmp/'
},
'mkdir tmp': {
command: 'mkdir tmp',
},
'mkdir dist': {
command: 'mkdir dist',
},
'config': {
command: 'which ' + NAME_MXMLC,
options: {
callback: function(err, stdout, stderr, done) {
var pathOfCompiler = '';
if (err
||
// check against empty string
stdout == false) {
pathOfCompiler = PATH_MXMLC;
}
else{
pathOfCompiler = NAME_MXMLC;
}
// update path
// var cmdWaveWorker = grunt.config('shell.worker-wave.command')
// .replace(/_placeholder_/g, pathOfCompiler);
// console.log('wave worker compiling command to exec: ', cmdWaveWorker);
// grunt.config('shell.worker-wave.command', cmdWaveWorker);
// var cmdMP3 = grunt.config('shell.worker-mp3.command')
// .replace(/_placeholder_/g, pathOfCompiler);
// console.log('core compiling command to exec: ', cmdMP3);
// grunt.config('shell.worker-mp3.command', cmdMP3);
var cmdCore = grunt.config('shell.core.command')
.replace(/_placeholder_/g, pathOfCompiler);
console.log('core compiling command to exec: ', cmdCore);
grunt.config('shell.core.command', cmdCore);
done();
}
}
},
// 'worker-wave': {
// command: '_placeholder_ workers/encoders/Wave.as -debug=false -optimize=true -library-path+=../lib/ -output ../tmp/Worker.Encoder.Wave.swf -source-path+=./ -source-path+=../ext-src/promise-as3/src/ -source-path+=../ext-src/encoder-wave/src/ -target-player=' + TARGET_PLAYER,
// options: {
// stdout: true,
// stderr: true,
// failOnError: true,
// execOptions: {
// cwd: 'src'
// }
// }
// },
// 'worker-mp3': {
// command: '_placeholder_ workers/encoders/MP3.as -debug=false -optimize=true -library-path+=../lib/ -library-path+=../ext-src/encoder-mp3/lib/ -output ../tmp/Worker.Encoder.MP3.swf -source-path+=./ -source-path+=../ext-src/promise-as3/src/ -source-path+=../ext-src/encoder-wave/src/ -source-path+=../ext-src/encoder-mp3/src/ -target-player=' + TARGET_PLAYER,
// options: {
// stdout: true,
// stderr: true,
// failOnError: true,
// execOptions: {
// cwd: 'src'
// }
// }
// },
'core': {
command: '_placeholder_ Playcorder.as -debug=false -optimize=true -library-path+=../lib/ -library-path+=../tmp/ -library-path+=../ext-src/encoder-mp3/lib/ -source-path+=./ -source-path+=../tmp/ -source-path+=../ext-src/encoder-wave/src/ -source-path+=../ext-src/encoder-mp3/src/ -source-path+=../ext-src/uploader-multipart/src/ -source-path+=../ext-src/promise-as3/src/ -output ../dist/Playcorder.swf -target-player=' + TARGET_PLAYER,
options: {
stdout: true,
stderr: true,
failOnError: true,
execOptions: {
cwd: 'src'
}
}
}
},
tagrelease: {
file: 'package.json',
commit: true,
message: 'Release %version%',
prefix: '',
annotate: false
},
bumpup: {
files: ['package.json']
}
});
grunt.registerTask("default", "shell".split(' '));
grunt.registerTask("release", function (type) {
grunt.task.run('shell');
if (type != null && type != false){
grunt.task.run('bumpup:' + type);
grunt.task.run('tagrelease');
}
});
};