You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/06/13 00:02:16 UTC

[6/8] webworks commit: [CB-3604] target and create script mods for repo level target script

[CB-3604] target and create script mods for repo level target script

create script copies target script and repo level targets.json to project level to support
1. additional targets added at project level without presence of repo
2. prevent breakage due to moving repo
3. allow easy migration of project to another location or system without breakage


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/b9928228
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/b9928228
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/b9928228

Branch: refs/heads/master
Commit: b992822898edc5a61c4df60437a29ad141e18847
Parents: 8060b52
Author: lorinbeer <lo...@adobe.com>
Authored: Tue Jun 11 09:26:20 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Jun 12 15:01:58 2013 -0700

----------------------------------------------------------------------
 blackberry10/bin/create.js     | 7 +++++++
 blackberry10/bin/lib/target.js | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b9928228/blackberry10/bin/create.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/create.js b/blackberry10/bin/create.js
index b454d37..6264e87 100644
--- a/blackberry10/bin/create.js
+++ b/blackberry10/bin/create.js
@@ -38,6 +38,7 @@ var build,
     MODULES_PROJECT_DIR = path.join(__dirname, "..", "node_modules"),
     BOOTSTRAP_PROJECT_DIR = path.join(__dirname, "..", "framework", "bootstrap"),
     FRAMEWORK_LIB_PROJECT_DIR = path.join(__dirname, "..", "framework", "lib"),
+    BIN_DIR = path.join(__dirname),
     BUILD_DIR = path.join(__dirname, "build"),
     CORDOVA_JS_SRC = path.join(__dirname, "..", "javascript", "cordova.blackberry10.js"),
     update_dir = path.join(project_path, "lib", "cordova." + version),
@@ -117,6 +118,12 @@ function copyFilesToProject() {
     wrench.mkdirSyncRecursive(project_path, 0777);
     wrench.copyDirSyncRecursive(TEMPLATE_PROJECT_DIR, project_path);
 
+    // copy repo level target tool to project
+    utils.copyFile(path.join(BIN_DIR, "target"), path.join(project_path, "cordova"));
+    utils.copyFile(path.join(BIN_DIR, "target.bat"), path.join(project_path, "cordova"));
+    utils.copyFile(path.join(BIN_DIR, "lib", "target.js"), path.join(project_path, "cordova", "lib"));
+    utils.copyFile(path.join(BIN_DIR, "lib", "targets.json"), path.join(project_path, "cordova", "lib"));
+
     // change file permission for cordova scripts because ant copy doesn't preserve file permissions
     wrench.chmodSyncRecursive(path.join(project_path,"cordova"), 0700);
 

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b9928228/blackberry10/bin/lib/target.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/target.js b/blackberry10/bin/lib/target.js
index d66d5ec..b099c3e 100644
--- a/blackberry10/bin/lib/target.js
+++ b/blackberry10/bin/lib/target.js
@@ -16,7 +16,7 @@
  */
 
 var path = require('path'),
-    propertiesFile = './targets.json',
+    propertiesFile = path.join(__dirname,'targets.json'),
     properties = require(propertiesFile),
     fs = require('fs'),
     commander = require('commander'),