Skip to content

Commit

Permalink
CB-7219: cordova.version now outputs same value as cordova.platformVe…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
stevengill committed Sep 24, 2014
1 parent 4a4c544 commit 93faee8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ Then from the repository root run:

grunt --platformVersion=3.6.0

To do just one platform, run:
To compile the js for just one platform, run:

grunt compile:android --platformVersion=3.6.0

To create the browserify version, run:
To create the browserify version of the js, run:

grunt compile-browserify --platformVersion=3.6.0

To compile the browserify version of the js for just one platform, run:

grunt compile-browserify:android --platformVersion=3.6.0


For integration, see the 'Integration' section below.

Expand Down
2 changes: 1 addition & 1 deletion src/cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function createEvent(type, data) {
var cordova = {
define:define,
require:require,
//version:CORDOVA_JS_BUILD_LABEL,
version:PLATFORM_VERSION_BUILD_LABEL,
platformVersion:PLATFORM_VERSION_BUILD_LABEL,
platformId:platform.id,
/**
Expand Down
2 changes: 1 addition & 1 deletion src/cordova_b.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function createEvent(type, data) {

var cordova = {
platformVersion:PLATFORM_VERSION_BUILD_LABEL,
//version:CORDOVA_JS_BUILD_LABEL,
version:PLATFORM_VERSION_BUILD_LABEL,
require: function(module) {
if(module === "cordova/exec") {
return cordova.exec;
Expand Down
2 changes: 1 addition & 1 deletion tasks/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function(grunt) {
});
if(!platformVersion){
console.log('please add a platform version flag and value');
console.log('ex: grunt compile-browserify --platformVersion=3.6.0');
console.log('ex: grunt compile --platformVersion=3.6.0');
throw new Error("platformVersion is required!");
}

Expand Down
1 change: 0 additions & 1 deletion tasks/lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = function bundle(platform, debug, commitId, platformVersion) {
// write header
output.push('/*', fs.readFileSync(licensePath, 'utf8'), '*/');
output.push(';(function() {');
//output.push("var CORDOVA_JS_BUILD_LABEL = '" + commitId + "';");
output.push("var PLATFORM_VERSION_BUILD_LABEL = '" + platformVersion + "';");

// write initial scripts
Expand Down
2 changes: 0 additions & 2 deletions tasks/lib/compute-commit-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ module.exports = function computeCommitId(callback, cachedGitVersion) {
return;
}

var versionFileId = fs.readFileSync('VERSION', { encoding: 'utf8' }).trim();

if (fs.existsSync('.git')) {
var gitPath = 'git';
var args = 'rev-list HEAD --max-count=1';
Expand Down
2 changes: 1 addition & 1 deletion tasks/lib/write-license-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = function(outStream, platform, commitId, platformVersion) {

outStream.write("// Platform: " + platform + "\n", 'utf8');
outStream.write("// " + commitId + "\n", 'utf8');
outStream.write("// browserify" + "\n", 'utf8');
outStream.write(licenseText, 'utf8');
//outStream.write("var CORDOVA_JS_BUILD_LABEL = '" + commitId + "';\n", 'utf8');
outStream.write("var PLATFORM_VERSION_BUILD_LABEL = '" + platformVersion + "';\n", 'utf8');
outStream.write("var define = {moduleMap: []};\n", 'utf8');

Expand Down

0 comments on commit 93faee8

Please sign in to comment.