@@ -44,15 +44,24 @@ module.exports = function (grunt){
44
44
port : 9001 ,
45
45
base : '.'
46
46
}
47
- }
48
- } ,
47
+ } ,
48
+ standalone : {
49
+ options : {
50
+ hostname : '*' ,
51
+ keepalive : true ,
52
+ port : 9001 ,
53
+ base : '.'
54
+ }
55
+ }
56
+ } ,
49
57
50
58
qunit : {
51
59
all : {
52
60
options : {
53
61
timeout : 5 * 60 * 1000 , // 5min
54
62
files : {
55
63
'1px.gif' : [ 'tests/files/1px.gif' ]
64
+ , 'big.jpg' : [ 'tests/files/big.jpg' ]
56
65
, 'hello.txt' : [ 'tests/files/hello.txt' ]
57
66
, 'image.jpg' : [ 'tests/files/image.jpg' ]
58
67
, 'dino.png' : [ 'tests/files/dino.png' ]
@@ -65,7 +74,7 @@ module.exports = function (grunt){
65
74
66
75
concat : {
67
76
options : {
68
- banner : '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
77
+ banner : '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
69
78
' * <%= pkg.description %>\n' +
70
79
' */\n\n' ,
71
80
@@ -83,7 +92,7 @@ module.exports = function (grunt){
83
92
, 'lib/FileAPI.Camera.js'
84
93
, 'lib/FileAPI.Flash.js'
85
94
] ,
86
- dest : 'dist/<%= pkg.name %>.js'
95
+ dest : 'dist/<%= pkg.exportName %>.js'
87
96
} ,
88
97
89
98
html5 : {
@@ -96,21 +105,81 @@ module.exports = function (grunt){
96
105
, 'lib/FileAPI.XHR.js'
97
106
, 'lib/FileAPI.Camera.js'
98
107
] ,
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
+ }
101
139
} ,
102
140
103
141
uglify : {
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' } ,
105
143
dist : {
106
144
files : {
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 %>' ]
109
149
}
110
150
}
111
151
} ,
112
152
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 : {
114
183
scripts : {
115
184
files : 'lib/**/*.js' ,
116
185
tasks : [ 'concat' ] ,
@@ -127,12 +196,12 @@ module.exports = function (grunt){
127
196
grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
128
197
grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
129
198
grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
130
-
199
+ grunt . loadNpmTasks ( 'grunt-mxmlc' ) ;
131
200
// Load custom QUnit task, based on grunt-contrib-qunit, but support "files" option.
132
201
grunt . loadTasks ( './tests/grunt-task/' ) ;
133
202
134
203
// "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' ] ) ;
137
206
grunt . registerTask ( 'default' , [ 'tests' , 'build' ] ) ;
138
207
} ;
0 commit comments