Skip to content

Commit 63179df

Browse files
committed
[Gruntfile] Refactor to eliminate needless mxmlc.options
None of this information was being forwarded to build!
1 parent 6af8525 commit 63179df

File tree

1 file changed

+15
-111
lines changed

1 file changed

+15
-111
lines changed

Gruntfile.js

Lines changed: 15 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -9,107 +9,6 @@ module.exports = function (grunt) {
99
}
1010
},
1111
mxmlc: {
12-
options: {
13-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_16.html
14-
metadata: {
15-
// `-title "Adobe Flex Application"`
16-
title: 'VideoJS SWF',
17-
// `-description "http://www.adobe.com/flex"`
18-
description: 'http://www.videojs.com',
19-
// `-publisher "The Publisher"`
20-
publisher: 'Brightcove, Inc.',
21-
// `-creator "The Author"`
22-
creator: 'Brightcove, Inc.',
23-
// `-language=EN`
24-
// `-language+=klingon`
25-
language: 'EN',
26-
// `-localized-title "The Color" en-us -localized-title "The Colour" en-ca`
27-
localizedTitle: null,
28-
// `-localized-description "Standardized Color" en-us -localized-description "Standardised Colour" en-ca`
29-
localizedDescription: null,
30-
// `-contributor "Contributor #1" -contributor "Contributor #2"`
31-
contributor: null,
32-
// `-date "Mar 10, 2013"`
33-
date: null
34-
},
35-
36-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_18.html
37-
application: {
38-
// `-default-size 240 240`
39-
layoutSize: {
40-
width: 640,
41-
height: 360
42-
},
43-
// `-default-frame-rate=24`
44-
frameRate: 30,
45-
// `-default-background-color=0x869CA7`
46-
backgroundColor: 0x000000,
47-
// `-default-script-limits 1000 60`
48-
scriptLimits: {
49-
maxRecursionDepth: 1000,
50-
maxExecutionTime: 60
51-
}
52-
},
53-
54-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_19.html
55-
// `-library-path+=libraryPath1 -library-path+=libraryPath2`
56-
libraries: ['libs/*.*'],
57-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
58-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_17.html
59-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_20.html
60-
// http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html
61-
compiler: {
62-
// `-accessible=false`
63-
'accessible': false,
64-
// `-actionscript-file-encoding=UTF-8`
65-
'actionscriptFileEncoding': null,
66-
// `-allow-source-path-overlap=false`
67-
'allowSourcePathOverlap': false,
68-
// `-as3=true`
69-
'as3': true,
70-
// `-benchmark=true`
71-
'benchmark': true,
72-
// `-context-root context-path`
73-
'contextRoot': null,
74-
// `-debug=false`
75-
'debug': !!process.env.VIDEO_JS_SWF_DEBUG,
76-
// `-defaults-css-files filePath1 ...`
77-
'defaultsCssFiles': [],
78-
// `-defaults-css-url http://example.com/main.css`
79-
'defaultsCssUrl': null,
80-
// `-define=CONFIG::debugging,true -define=CONFIG::release,false`
81-
// `-define+=CONFIG::bool2,false -define+=CONFIG::and1,"CONFIG::bool2 && false"
82-
// `-define+=NAMES::Company,"'Adobe Systems'"`
83-
'defines': {},
84-
// `-es=true -as3=false`
85-
'es': false,
86-
// `-externs className1 ...`
87-
'externs': [],
88-
// `-external-library-path+=pathElement`
89-
'externalLibraries': [],
90-
'fonts': {
91-
// `-fonts.advanced-anti-aliasing=false`
92-
advancedAntiAliasing: false,
93-
// `-fonts.languages.language-range "Alpha and Plus" "U+0041-U+007F,U+002B"`
94-
// USAGE:
95-
// ```
96-
// languages: [{
97-
// lang: 'Alpha and Plus',
98-
// range: ['U+0041-U+007F', 'U+002B']
99-
// }]
100-
// ```
101-
languages: [],
102-
// `-fonts.local-fonts-snapsnot filePath`
103-
localFontsSnapshot: null,
104-
// `-fonts.managers flash.fonts.JREFontManager flash.fonts.BatikFontManager flash.fonts.AFEFontManager`
105-
// NOTE: FontManager preference is in REVERSE order (prefers LAST array item).
106-
// For more info, see http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_06.html
107-
managers: []
108-
},
109-
// `-incremental=false`
110-
'incremental': false
111-
}
112-
},
11312
videojs_swf: {
11413
files: {
11514
'dist/video-js.swf': ['src/VideoJS.as']
@@ -168,6 +67,7 @@ module.exports = function (grunt) {
16867
watch: {
16968
files: [
17069
'modules/flashls/src/org/mangui/hls/**/*', // See mxmlc task
70+
'modules/flashls/src/com/pivotshare/**/*', // See mxmlc task
17171
'src/**/*'
17272
],
17373
tasks: ['dist'],
@@ -186,7 +86,11 @@ module.exports = function (grunt) {
18686
grunt.registerTask('dist', ['mxmlc']);
18787
grunt.registerTask('default', ['dist']);
18888

89+
/*
90+
* MXMLC Task
91+
*/
18992
grunt.registerMultiTask('mxmlc', 'Compiling SWF', function () {
93+
19094
// Merge task-specific and/or target-specific options with these defaults.
19195
var childProcess = require('child_process');
19296
var flexSdk = require('flex-sdk');
@@ -213,9 +117,6 @@ module.exports = function (grunt) {
213117
}
214118
});
215119

216-
// Whether Flash should be built with debug flag
217-
var isDebug = grunt.config.get('mxmlc').options.compiler.debug || false;
218-
219120
//
220121
// COMPC Options (FlasHLS)
221122
//
@@ -224,14 +125,14 @@ module.exports = function (grunt) {
224125
var flashlsDest = 'libs/flashls.swc';
225126

226127
var compcCmdLineOpts = [
227-
'-define=CONFIG::LOGGING,' + isDebug,
128+
'-define=CONFIG::LOGGING,' + !!process.env.VIDEO_JS_SWF_DEBUG,
228129
'-define=CONFIG::FLASH_11_1,false',
229130
'-optimize=true',
230131
'-use-network=false',
231132
'-library-path+=' + flashlsRoot + 'lib/blooddy_crypto.swc',
232-
'-include-sources=' + flashlsRoot + 'src/org/mangui/hls',
133+
'-include-sources=' + flashlsRoot + 'src/org/mangui/hls,' + flashlsRoot + 'src/com/pivotshare',
233134
'-output=' + flashlsDest,
234-
'-target-player=10.1'
135+
'-target-player=15.0',
235136
];
236137

237138
grunt.verbose.writeln('compc path: ' + flexSdk.bin.compc);
@@ -241,16 +142,19 @@ module.exports = function (grunt) {
241142
// MXMLC Options
242143
//
243144

244-
var cmdLineOpts = [];
145+
var cmdLineOpts = [
146+
'-library-path+=' + flashlsDest,
147+
'-define=CONFIG::version, "' + pkg.version + '"',
148+
'-swf-version=26'
149+
];
150+
151+
// TODO: Add telemetry on debug
245152

246153
if (f.dest) {
247154
cmdLineOpts.push('-output');
248155
cmdLineOpts.push(f.dest);
249156
}
250157

251-
cmdLineOpts.push('-library-path+=' + flashlsDest);
252-
253-
cmdLineOpts.push('-define=CONFIG::version, "' + pkg.version + '"');
254158
cmdLineOpts.push('--');
255159
cmdLineOpts.push.apply(cmdLineOpts, srcList);
256160

0 commit comments

Comments
 (0)