@@ -44,15 +44,24 @@ module.exports = function (grunt){
4444port : 9001 ,
4545base : '.'
4646}
47- }
48- } ,
47+ } ,
48+ standalone : {
49+ options : {
50+ hostname : '*' ,
51+ keepalive : true ,
52+ port : 9001 ,
53+ base : '.'
54+ }
55+ }
56+ } ,
4957
5058qunit : {
5159all : {
5260options : {
5361timeout : 5 * 60 * 1000 , // 5min
5462files : {
5563 '1px.gif' :[ 'tests/files/1px.gif' ]
64+ , 'big.jpg' :[ 'tests/files/big.jpg' ]
5665, 'hello.txt' :[ 'tests/files/hello.txt' ]
5766, 'image.jpg' :[ 'tests/files/image.jpg' ]
5867, 'dino.png' :[ 'tests/files/dino.png' ]
@@ -65,7 +74,7 @@ module.exports = function (grunt){
6574
6675concat : {
6776options : {
68- banner : '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
77+ banner : '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
6978' * <%= pkg.description %>\n' +
7079' */\n\n' ,
7180
@@ -83,7 +92,7 @@ module.exports = function (grunt){
8392, 'lib/FileAPI.Camera.js'
8493, 'lib/FileAPI.Flash.js'
8594] ,
86- dest : 'dist/<%= pkg.name %>.js'
95+ dest : 'dist/<%= pkg.exportName %>.js'
8796} ,
8897
8998html5 : {
@@ -96,21 +105,81 @@ module.exports = function (grunt){
96105, 'lib/FileAPI.XHR.js'
97106, 'lib/FileAPI.Camera.js'
98107] ,
99- dest : 'dist/<%= pkg.name %>.html5.js'
100- }
108+ dest : 'dist/<%= pkg.exportName %>.html5.js'
109+ } ,
110+
111+ ok : {
112+ src : [
113+ 'lib/FileAPI.header.js'
114+ , 'lib/canvas-to-blob.js'
115+ , 'lib/FileAPI.core.js'
116+ , 'lib/FileAPI.Image.js'
117+ , 'lib/load-image-ios.js'
118+ , 'lib/FileAPI.Form.js'
119+ , 'lib/FileAPI.XHR.js'
120+ , 'plugins/FileAPI.exif.js'
121+ , 'lib/FileAPI.Flash.js'
122+ ] ,
123+ dest : 'dist/<%= pkg.exportName %>.ok.js'
124+ } ,
125+
126+ html5ok : {
127+ src : [
128+ 'lib/FileAPI.header.js'
129+ , 'lib/canvas-to-blob.js'
130+ , 'lib/FileAPI.core.js'
131+ , 'lib/FileAPI.Image.js'
132+ , 'lib/load-image-ios.js'
133+ , 'lib/FileAPI.Form.js'
134+ , 'lib/FileAPI.XHR.js'
135+ , 'plugins/FileAPI.exif.js'
136+ ] ,
137+ dest : 'dist/<%= pkg.exportName %>.html5ok.js'
138+ }
101139} ,
102140
103141uglify : {
104- options : { banner : '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n' } ,
142+ options : { banner : '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n' } ,
105143dist : {
106144files : {
107- 'dist/<%= pkg.name %>.min.js' : [ '<%= concat.all.dest %>' ]
108- , 'dist/<%= pkg.name %>.html5.min.js' : [ '<%= concat.html5.dest %>' ]
145+ 'dist/<%= pkg.exportName %>.min.js' : [ '<%= concat.all.dest %>' ]
146+ , 'dist/<%= pkg.exportName %>.html5.min.js' : [ '<%= concat.html5.dest %>' ]
147+ , 'dist/<%= pkg.exportName %>.ok.min.js' : [ '<%= concat.ok.dest %>' ]
148+ , 'dist/<%= pkg.exportName %>.html5ok.min.js' : [ '<%= concat.html5ok.dest %>' ]
109149}
110150}
111151} ,
112152
113- watch : {
153+ mxmlc : {
154+ core : {
155+ options : {
156+ rawConfig : '-static-link-runtime-shared-libraries=true -compiler.debug=true' +
157+ ' -library-path+=flash/core/lib/blooddy_crypto.swc -library-path+=flash/core/lib/EnginesLibrary.swc'
158+ } ,
159+ files : {
160+ 'dist/<%= pkg.exportName %>.flash.swf' : [ 'flash/core/src/FileAPI_flash.as' ]
161+ }
162+ } ,
163+ image : {
164+ options : {
165+ rawConfig : '-static-link-runtime-shared-libraries=true -compiler.debug=true' +
166+ ' -library-path+=flash/image/lib/blooddy_crypto.swc'
167+ } ,
168+ files : {
169+ 'dist/<%= pkg.exportName %>.flash.image.swf' : [ 'flash/image/src/FileAPI_flash_image.as' ]
170+ }
171+ } ,
172+ camera : {
173+ options : {
174+ rawConfig : '-static-link-runtime-shared-libraries=true -compiler.debug=true'
175+ } ,
176+ files : {
177+ 'dist/<%= pkg.exportName %>.flash.camera.swf' : [ 'flash/camera/src/FileAPI_flash_camera.as' ]
178+ }
179+ }
180+ } ,
181+
182+ watch : {
114183scripts : {
115184files : 'lib/**/*.js' ,
116185tasks : [ 'concat' ] ,
@@ -127,12 +196,12 @@ module.exports = function (grunt){
127196grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
128197grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
129198grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
130-
199+ grunt . loadNpmTasks ( 'grunt-mxmlc' ) ;
131200// Load custom QUnit task, based on grunt-contrib-qunit, but support "files" option.
132201grunt . loadTasks ( './tests/grunt-task/' ) ;
133202
134203// "npm build" runs these tasks
135- grunt . registerTask ( 'tests' , [ 'jshint' , 'concat' , 'connect' , 'qunit' ] ) ;
136- grunt . registerTask ( 'build' , [ 'version' , 'concat' , 'uglify' ] ) ;
204+ grunt . registerTask ( 'tests' , [ 'jshint' , 'concat' , 'connect:server ' , 'qunit' ] ) ;
205+ grunt . registerTask ( 'build' , [ 'version' , 'concat' , 'uglify' , 'mxmlc' ] ) ;
137206grunt . registerTask ( 'default' , [ 'tests' , 'build' ] ) ;
138207} ;
0 commit comments