incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject android commit: CB-1359 set target SDK to the highest available
Date Sat, 29 Sep 2012 01:18:18 GMT
Updated Branches:
  refs/heads/master d406e2ed2 -> 17a4b5155


CB-1359 set target SDK to the highest available


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/17a4b515
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/17a4b515
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/17a4b515

Branch: refs/heads/master
Commit: 17a4b5155e1a68a08ca9a5bf84f52932e03aa967
Parents: d406e2e
Author: Anis Kadri <anis.kadri@gmail.com>
Authored: Fri Sep 28 18:18:11 2012 -0700
Committer: Anis Kadri <anis.kadri@gmail.com>
Committed: Fri Sep 28 18:18:11 2012 -0700

----------------------------------------------------------------------
 bin/create.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/17a4b515/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 40bce8f..c6d05bb 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -37,6 +37,10 @@ function setTarget() {
     var targets = shell.Exec('android.bat list targets').StdOut.ReadAll().match(/id:\s\d+/g);
     return targets[targets.length - 1].replace(/id: /, ""); // TODO: give users the option
to set their target 
 }
+function setApiLevel() {
+    var targets = shell.Exec('android.bat list targets').StdOut.ReadAll().match(/API level:\s\d+/g);
+    return targets[targets.length - 1].replace(/API level: /, "");
+}
 function write(filename, contents) {
     var fso=WScript.CreateObject("Scripting.FileSystemObject");
     var f=fso.OpenTextFile(filename, 2, true);
@@ -145,6 +149,7 @@ var PACKAGE_AS_PATH=PACKAGE.replace(/\./g, '\\');
 var ACTIVITY_PATH=PROJECT_PATH+'\\src\\'+PACKAGE_AS_PATH+'\\'+ACTIVITY+'.java';
 var MANIFEST_PATH=PROJECT_PATH+'\\AndroidManifest.xml';
 var TARGET=setTarget();
+var API_LEVEL=setApiLevel();
 var VERSION=read(ROOT+'\\VERSION').replace(/\r\n/,'').replace(/\n/,'');
 // create the project
 WScript.Echo("Creating new android project...");
@@ -205,5 +210,6 @@ replaceInFile(ACTIVITY_PATH, /__ID__/, PACKAGE);
 
 replaceInFile(MANIFEST_PATH, /__ACTIVITY__/, ACTIVITY);
 replaceInFile(MANIFEST_PATH, /__PACKAGE__/, PACKAGE);
+replaceInFile(MANIFEST_PATH, /__APILEVEL__/, API_LEVEL);
 
 cleanup();


Mime
View raw message