You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/04/24 23:11:07 UTC
[22/45] js commit: adding debug flag to support sourcemaps
adding debug flag to support sourcemaps
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/061d7d21
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/061d7d21
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/061d7d21
Branch: refs/heads/master
Commit: 061d7d21090fffe78d2ddef4247867c917aaeafb
Parents: db8b15d
Author: Anis Kadri <an...@apache.org>
Authored: Wed Feb 5 19:16:23 2014 -0800
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Mar 27 15:20:21 2014 +0100
----------------------------------------------------------------------
tasks/lib/bundle-browserify.js | 2 +-
tasks/lib/packager-browserify.js | 32 ++++++++++++++++++--------------
2 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/061d7d21/tasks/lib/bundle-browserify.js
----------------------------------------------------------------------
diff --git a/tasks/lib/bundle-browserify.js b/tasks/lib/bundle-browserify.js
index e678bcf..0dda5d3 100644
--- a/tasks/lib/bundle-browserify.js
+++ b/tasks/lib/bundle-browserify.js
@@ -26,7 +26,7 @@ var root = path.join(__dirname, '..', '..')
module.exports = function bundle(platform, debug, commitId) {
// FIXME: need to find a way to void ignore missing
- var b = browserify();
+ var b = browserify({debug: debug});
// XXX plugin_list is not present at this stage
b.ignore(path.join(root, 'src', 'common', 'plugin_list'));
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/061d7d21/tasks/lib/packager-browserify.js
----------------------------------------------------------------------
diff --git a/tasks/lib/packager-browserify.js b/tasks/lib/packager-browserify.js
index e3407cf..04b982d 100644
--- a/tasks/lib/packager-browserify.js
+++ b/tasks/lib/packager-browserify.js
@@ -24,7 +24,8 @@ var computeCommitId = require('./compute-commit-id');
module.exports = function generate(platform, useWindowsLineEndings, callback) {
computeCommitId(function(commitId) {
- var outFile, outFileStream;
+ var outReleaseFile, outReleaseFileStream,
+ outDebugFile, outDebugFileStream;
var time = new Date().valueOf();
var libraryRelease = bundle(platform, false, commitId);
@@ -32,28 +33,31 @@ module.exports = function generate(platform, useWindowsLineEndings, callback) {
// if(useWindowsLineEndings) {
// libraryRelease = "\ufeff" + libraryRelease.split(/\r?\n/).join("\r\n");
// }
- //var libraryDebug = bundle(platform, true, commitId);
+ var libraryDebug = bundle(platform, true, commitId);
- time = new Date().valueOf() - time;
if (!fs.existsSync('pkg')) {
fs.mkdirSync('pkg');
}
- // if(!fs.existsSync('pkg/debug')) {
- // fs.mkdirSync('pkg/debug');
- // }
- //libraryRelease.bundle().pipe(process.stdout);
+ if(!fs.existsSync('pkg/debug')) {
+ fs.mkdirSync('pkg/debug');
+ }
- outFile = path.join('pkg', 'cordova.' + platform + '.js');
- outFileStream = fs.createWriteStream(outFile);
- libraryRelease.bundle().pipe(outFileStream);
+ outReleaseFile = path.join('pkg', 'cordova.' + platform + '.js');
+ outReleaseFileStream = fs.createWriteStream(outReleaseFile);
+ libraryRelease.bundle().pipe(outReleaseFileStream);
libraryRelease.bundle().on('end', function() {
- console.log('generated cordova.' + platform + '.js @ ' + commitId + ' in ' + time + 'ms');
+ var newtime = new Date().valueOf() - time;
+ console.log('generated cordova.' + platform + '.js @ ' + commitId + ' in ' + newtime + 'ms');
callback();
});
- // outFile = path.join('pkg', 'debug', 'cordova.' + platform + '-debug.js');
- // outFileStream = fs.createWriteStream(outFile);
- // libraryDebug.bundle().pipe(outFileStream);
+ outDebugFile = path.join('pkg', 'debug', 'cordova.' + platform + '-debug.js');
+ outDebugFileStream = fs.createWriteStream(outDebugFile);
+ libraryDebug.bundle().on('end', function() {
+ var newtime = new Date().valueOf() - time;
+ console.log('generated cordova.' + platform + '-debug.js @ ' + commitId + ' in ' + newtime + 'ms');
+ callback();
+ });
});
}