cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject android commit: [CB-3392] Fix a problem with the Windows jscript runtime
Date Tue, 14 May 2013 23:20:32 GMT
Updated Branches:
  refs/heads/master e1f930282 -> 230c635a5


[CB-3392] Fix a problem with the Windows jscript runtime

The problem is with this line in "create.js":

var ACTIVITY_PATH=PROJECT_PATH+'\\src\\'+PACKAGE_AS_PATH+'\\'+ACTIVITY+'.java';
[...]
exec('%comspec% /c copy "'+ROOT+'"\\bin\\templates\\project\\Activity.java '+ ACTIVITY_PATH
+' /Y');

The Windows "copy" command will not create directories that don't exist, so the command above
fails because "src\PACKAGE_AS_PATH" doesn't exist.  This can be fixed with:

Also update cordova.js reference


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

Branch: refs/heads/master
Commit: 230c635a54ced58f1519c7204f9b3b541e77b87c
Parents: e1f9302
Author: macdonst <simon.macdonald@gmail.com>
Authored: Mon May 13 22:18:45 2013 -0300
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue May 14 19:19:10 2013 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/230c635a/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 3979594..b1de5fe 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -190,7 +190,8 @@ if(fso.FolderExists(PROJECT_PATH)) {
 }
 
 var PACKAGE_AS_PATH=PACKAGE.replace(/\./g, '\\');
-var ACTIVITY_PATH=PROJECT_PATH+'\\src\\'+PACKAGE_AS_PATH+'\\'+ACTIVITY+'.java';
+var ACTIVITY_DIR=PROJECT_PATH + '\\src\\' + PACKAGE_AS_PATH;
+var ACTIVITY_PATH=ACTIVITY_DIR+'\\'+ACTIVITY+'.java';
 var MANIFEST_PATH=PROJECT_PATH+'\\AndroidManifest.xml';
 var TARGET=setTarget();
 var API_LEVEL=setApiLevel();
@@ -201,7 +202,7 @@ exec('android.bat create project --target "'+TARGET+'" --path "'+PROJECT_PATH+'"
 
 // build from source. distro should have these files
 if (!fso.FileExists(ROOT+'\\cordova-'+VERSION+'.jar') &&
-    !fso.FileExists(ROOT+'\\cordova-'+VERSION+'.js')) {
+    !fso.FileExists(ROOT+'\\cordova.js')) {
     Log("Building jar and js files...");
     // update the cordova framework project to a target that exists on this machine
     exec('android.bat update project --target "'+TARGET+'" --path "'+ROOT+'\\framework"');
@@ -215,18 +216,19 @@ Log("Copying template files...");
 exec('%comspec% /c xcopy "'+ ROOT + '\\bin\\templates\\project\\res" "'+PROJECT_PATH+'\\res\\"
/E /Y');
 exec('%comspec% /c xcopy "'+ ROOT + '\\bin\\templates\\project\\assets" "'+PROJECT_PATH+'\\assets\\"
/E /Y');
 exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\project\\AndroidManifest.xml" "' + PROJECT_PATH
+ '\\AndroidManifest.xml" /Y');
-exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\project\\Activity.java" "'+ ACTIVITY_PATH
+'" /Y');
+exec('%comspec% /c mkdir "' + ACTIVITY_DIR + '"');
+exec('%comspec% /c copy "' + ROOT + '"\\bin\\templates\\project\\Activity.java "' + ACTIVITY_PATH
+ '" /Y');
 
 // check if we have the source or the distro files
 Log("Copying js, jar & config.xml files...");
 if(fso.FolderExists(ROOT + '\\framework')) {
-    exec('%comspec% /c copy "'+ROOT+'\\framework\\assets\\www\\cordova-'+VERSION+'.js" "'+PROJECT_PATH+'\\assets\\www\\cordova-'+VERSION+'.js"
/Y');
+    exec('%comspec% /c copy "'+ROOT+'\\framework\\assets\\www\\cordova.js" "'+PROJECT_PATH+'\\assets\\www\\cordova.js"
/Y');
     exec('%comspec% /c copy "'+ROOT+'\\framework\\cordova-'+VERSION+'.jar" "'+PROJECT_PATH+'\\libs\\cordova-'+VERSION+'.jar"
/Y');
     fso.CreateFolder(PROJECT_PATH + '\\res\\xml');
     exec('%comspec% /c copy "'+ROOT+'\\framework\\res\\xml\\config.xml" "' + PROJECT_PATH
+ '\\res\\xml\\config.xml" /Y');
 } else {
     // copy in cordova.js
-    exec('%comspec% /c copy "'+ROOT+'\\cordova-'+VERSION+'.js" "'+PROJECT_PATH+'\\assets\\www\\cordova-'+VERSION+'.js"
/Y');
+    exec('%comspec% /c copy "'+ROOT+'\\cordova.js" "'+PROJECT_PATH+'\\assets\\www\\cordova.js"
/Y');
     // copy in cordova.jar
     exec('%comspec% /c copy "'+ROOT+'\\cordova-'+VERSION+'.jar" "'+PROJECT_PATH+'\\libs\\cordova-'+VERSION+'.jar"
/Y');
     // copy in xml
@@ -240,7 +242,7 @@ fso.CreateFolder(PROJECT_PATH + '\\cordova\\lib');
 createAppInfoJar();
 Log("Copying cordova command tools...");
 exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\appinfo.jar" "' + PROJECT_PATH
+ '\\cordova\\appinfo.jar" /Y');
-exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\cordova.js" "' + PROJECT_PATH
+ '\\cordova\\cordova.js" /Y');
+exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\lib\\cordova.js" "' + PROJECT_PATH
+ '\\cordova\\lib\\cordova.js" /Y');
 exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\lib\\install-device.bat" "' +
PROJECT_PATH + '\\cordova\\lib\\install-device.bat" /Y');
 exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\lib\\install-emulator.bat" "'
+ PROJECT_PATH + '\\cordova\\lib\\install-emulator.bat" /Y');
 exec('%comspec% /c copy "'+ROOT+'\\bin\\templates\\cordova\\lib\\list-emulator-images.bat"
"' + PROJECT_PATH + '\\cordova\\lib\\list-emulator-images.bat" /Y');


Mime
View raw message