Permalink
Browse files

file api refactorings and fixes

  • Loading branch information...
1 parent 626abaa commit ae66a27223acd08f0ad5f60d49938d9d03e3778c Mikhail Bezoyan committed Jan 27, 2014
View
@@ -44,15 +44,24 @@ module.exports = function (grunt){
port: 9001,
base: '.'
}
- }
- },
+ },
+ standalone: {
+ options: {
+ hostname: '*',
+ keepalive: true,
+ port: 9001,
+ base: '.'
+ }
+ }
+ },
qunit: {
all: {
options: {
timeout: 5 * 60 * 1000, // 5min
files: {
'1px.gif': ['tests/files/1px.gif']
+ , 'big.jpg': ['tests/files/big.jpg']
, 'hello.txt': ['tests/files/hello.txt']
, 'image.jpg': ['tests/files/image.jpg']
, 'dino.png': ['tests/files/dino.png']
@@ -65,7 +74,7 @@ module.exports = function (grunt){
concat: {
options: {
- banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
+ banner: '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
' * <%= pkg.description %>\n' +
' */\n\n',
@@ -83,7 +92,7 @@ module.exports = function (grunt){
, 'lib/FileAPI.Camera.js'
, 'lib/FileAPI.Flash.js'
],
- dest: 'dist/<%= pkg.name %>.js'
+ dest: 'dist/<%= pkg.exportName %>.js'
},
html5: {
@@ -96,21 +105,81 @@ module.exports = function (grunt){
, 'lib/FileAPI.XHR.js'
, 'lib/FileAPI.Camera.js'
],
- dest: 'dist/<%= pkg.name %>.html5.js'
- }
+ dest: 'dist/<%= pkg.exportName %>.html5.js'
+ },
+
+ ok: {
+ src: [
+ 'lib/FileAPI.header.js'
+ , 'lib/canvas-to-blob.js'
+ , 'lib/FileAPI.core.js'
+ , 'lib/FileAPI.Image.js'
+ , 'lib/load-image-ios.js'
+ , 'lib/FileAPI.Form.js'
+ , 'lib/FileAPI.XHR.js'
+ , 'plugins/FileAPI.exif.js'
+ , 'lib/FileAPI.Flash.js'
+ ],
+ dest: 'dist/<%= pkg.exportName %>.ok.js'
+ },
+
+ html5ok: {
+ src: [
+ 'lib/FileAPI.header.js'
+ , 'lib/canvas-to-blob.js'
+ , 'lib/FileAPI.core.js'
+ , 'lib/FileAPI.Image.js'
+ , 'lib/load-image-ios.js'
+ , 'lib/FileAPI.Form.js'
+ , 'lib/FileAPI.XHR.js'
+ , 'plugins/FileAPI.exif.js'
+ ],
+ dest: 'dist/<%= pkg.exportName %>.html5ok.js'
+ }
},
uglify: {
- options: { banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n' },
+ options: { banner: '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n' },
dist: {
files: {
- 'dist/<%= pkg.name %>.min.js': ['<%= concat.all.dest %>']
- , 'dist/<%= pkg.name %>.html5.min.js': ['<%= concat.html5.dest %>']
+ 'dist/<%= pkg.exportName %>.min.js': ['<%= concat.all.dest %>']
+ , 'dist/<%= pkg.exportName %>.html5.min.js': ['<%= concat.html5.dest %>']
+ , 'dist/<%= pkg.exportName %>.ok.min.js': ['<%= concat.ok.dest %>']
+ , 'dist/<%= pkg.exportName %>.html5ok.min.js': ['<%= concat.html5ok.dest %>']
}
}
},
- watch: {
+ mxmlc: {
+ core: {
+ options: {
+ rawConfig: '-static-link-runtime-shared-libraries=true -compiler.debug=true' +
+ ' -library-path+=flash/core/lib/blooddy_crypto.swc -library-path+=flash/core/lib/EnginesLibrary.swc'
+ },
+ files: {
+ 'dist/<%= pkg.exportName %>.flash.swf': ['flash/core/src/FileAPI_flash.as']
+ }
+ },
+ image: {
+ options: {
+ rawConfig: '-static-link-runtime-shared-libraries=true -compiler.debug=true' +
+ ' -library-path+=flash/image/lib/blooddy_crypto.swc'
+ },
+ files: {
+ 'dist/<%= pkg.exportName %>.flash.image.swf': ['flash/image/src/FileAPI_flash_image.as']
+ }
+ },
+ camera: {
+ options: {
+ rawConfig: '-static-link-runtime-shared-libraries=true -compiler.debug=true'
+ },
+ files: {
+ 'dist/<%= pkg.exportName %>.flash.camera.swf': ['flash/camera/src/FileAPI_flash_camera.as']
+ }
+ }
+ },
+
+ watch: {
scripts: {
files: 'lib/**/*.js',
tasks: ['concat'],
@@ -127,12 +196,12 @@ module.exports = function (grunt){
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
-
+ grunt.loadNpmTasks('grunt-mxmlc');
// Load custom QUnit task, based on grunt-contrib-qunit, but support "files" option.
grunt.loadTasks('./tests/grunt-task/');
// "npm build" runs these tasks
- grunt.registerTask('tests', ['jshint', 'concat', 'connect', 'qunit']);
- grunt.registerTask('build', ['version', 'concat', 'uglify']);
+ grunt.registerTask('tests', ['jshint', 'concat', 'connect:server', 'qunit']);
+ grunt.registerTask('build', ['version', 'concat', 'uglify', 'mxmlc']);
grunt.registerTask('default', ['tests', 'build']);
};
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit ae66a27

Please sign in to comment.