You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/12/11 19:48:22 UTC

[1/7] android commit: CB-7881 Android tooling shouldn't lock application directory

Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x 87cdc5ad1 -> f086ef5ca


CB-7881 Android tooling shouldn't lock application directory

Close #130


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

Branch: refs/heads/4.0.x
Commit: 268fea58ee96b9561dd690e9b1102f0f7d6fc012
Parents: ba140a8
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Oct 27 17:14:35 2014 +0300
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:02:48 2014 -0500

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js    |  3 ++-
 bin/templates/cordova/lib/device.js   |  9 +++++----
 bin/templates/cordova/lib/emulator.js | 15 ++++++++-------
 bin/templates/cordova/lib/log.js      |  3 ++-
 4 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/268fea58/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index fead206..7bc20f6 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -24,6 +24,7 @@ var shell   = require('shelljs'),
     Q       = require('q'),
     path    = require('path'),
     fs      = require('fs'),
+    os      = require('os'),
     ROOT    = path.join(__dirname, '..', '..');
 var check_reqs = require('./check_reqs');
 var exec  = require('./exec');
@@ -400,7 +401,7 @@ module.exports.run = function(options, optResolvedTarget) {
  */
 module.exports.detectArchitecture = function(target) {
     function helper() {
-        return exec('adb -s ' + target + ' shell cat /proc/cpuinfo')
+        return exec('adb -s ' + target + ' shell cat /proc/cpuinfo', os.tmpdir())
         .then(function(output) {
             if (/intel/i.exec(output)) {
                 return 'x86';

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/268fea58/bin/templates/cordova/lib/device.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/device.js b/bin/templates/cordova/lib/device.js
index 6430d73..9516ba4 100644
--- a/bin/templates/cordova/lib/device.js
+++ b/bin/templates/cordova/lib/device.js
@@ -22,6 +22,7 @@
 var exec  = require('./exec'),
     Q     = require('q'),
     path  = require('path'),
+    os    = require('os'),
     build = require('./build'),
     appinfo = require('./appinfo'),
     ROOT = path.join(__dirname, '..', '..');
@@ -32,7 +33,7 @@ var exec  = require('./exec'),
  */
 module.exports.list = function(lookHarder) {
     function helper() {
-        return exec('adb devices')
+        return exec('adb devices', os.tmpdir())
         .then(function(output) {
             var response = output.split('\n');
             var device_list = [];
@@ -100,19 +101,19 @@ module.exports.install = function(target, buildResults) {
         console.log('Using apk: ' + apk_path);
         console.log('Installing app on device...');
         var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
-        return exec(cmd)
+        return exec(cmd, os.tmpdir())
         .then(function(output) {
             if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
 
             //unlock screen
             var cmd = 'adb -s ' + resolvedTarget.target + ' shell input keyevent 82';
-            return exec(cmd);
+            return exec(cmd, os.tmpdir());
         }, function(err) { return Q.reject('ERROR: Failed to install apk to device: ' + err); })
         .then(function() {
             // launch the application
             console.log('Launching application...');
             var cmd = 'adb -s ' + resolvedTarget.target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
-            return exec(cmd);
+            return exec(cmd, os.tmpdir());
         }).then(function() {
             console.log('LAUNCH SUCCESS');
         }, function(err) {

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/268fea58/bin/templates/cordova/lib/emulator.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js
index 8cf58e2..70e0305 100644
--- a/bin/templates/cordova/lib/emulator.js
+++ b/bin/templates/cordova/lib/emulator.js
@@ -23,6 +23,7 @@ var shell = require('shelljs'),
     exec  = require('./exec'),
     Q     = require('q'),
     path  = require('path'),
+    os    = require('os'),
     appinfo = require('./appinfo'),
     build = require('./build'),
     ROOT  = path.join(__dirname, '..', '..'),
@@ -108,7 +109,7 @@ module.exports.best_image = function() {
 
 // Returns a promise.
 module.exports.list_started = function() {
-    return exec('adb devices')
+    return exec('adb devices', os.tmpdir())
     .then(function(output) {
         var response = output.split('\n');
         var started_emulator_list = [];
@@ -123,7 +124,7 @@ module.exports.list_started = function() {
 
 // Returns a promise.
 module.exports.list_targets = function() {
-    return exec('android list targets')
+    return exec('android list targets', os.tmpdir())
     .then(function(output) {
         var target_out = output.split('\n');
         var targets = [];
@@ -201,7 +202,7 @@ module.exports.start = function(emulator_ID) {
         console.log('BOOT COMPLETE');
 
         //unlock screen
-        return exec('adb -s ' + emulator_id + ' shell input keyevent 82');
+        return exec('adb -s ' + emulator_id + ' shell input keyevent 82', os.tmpdir());
     }).then(function() {
         //return the new emulator id for the started emulators
         return emulator_id;
@@ -231,7 +232,7 @@ module.exports.wait_for_emulator = function(num_running) {
  */
 module.exports.wait_for_boot = function(emulator_id) {
     var self = this;
-    return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim')
+    return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim', os.tmpdir())
     .then(function(output) {
         if (output.match(/stopped/)) {
             return;
@@ -309,7 +310,7 @@ module.exports.install = function(target, buildResults) {
         var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
         console.log('Installing app on emulator...');
         console.log('Using apk: ' + apk_path);
-        return exec('adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"')
+        return exec('adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"', os.tmpdir())
         .then(function(output) {
             if (output.match(/Failure/)) {
                 return Q.reject('Failed to install apk to emulator: ' + output);
@@ -319,13 +320,13 @@ module.exports.install = function(target, buildResults) {
             return Q.reject('Failed to install apk to emulator: ' + err);
         }).then(function() {
             //unlock screen
-            return exec('adb -s ' + resolvedTarget.target + ' shell input keyevent 82');
+            return exec('adb -s ' + resolvedTarget.target + ' shell input keyevent 82', os.tmpdir());
         }).then(function() {
             // launch the application
             console.log('Launching application...');
             var launchName = appinfo.getActivityName();
             cmd = 'adb -s ' + resolvedTarget.target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
-            return exec(cmd);
+            return exec(cmd, os.tmpdir());
         }).then(function(output) {
             console.log('LAUNCH SUCCESS');
         }, function(err) {

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/268fea58/bin/templates/cordova/lib/log.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/log.js b/bin/templates/cordova/lib/log.js
index 329dfc9..d61023e 100644
--- a/bin/templates/cordova/lib/log.js
+++ b/bin/templates/cordova/lib/log.js
@@ -21,6 +21,7 @@
 
 var shell = require('shelljs'),
     path  = require('path'),
+    os  = require('os'),
     Q     = require('q'),
     child_process = require('child_process'),
     ROOT  = path.join(__dirname, '..', '..');
@@ -32,7 +33,7 @@ var shell = require('shelljs'),
 module.exports.run = function() {
     var cmd = 'adb logcat | grep -v nativeGetEnabledTags';
     var d = Q.defer();
-    var adb = child_process.spawn('adb', ['logcat']);
+    var adb = child_process.spawn('adb', ['logcat'], {cwd: os.tmpdir()});
 
     adb.stdout.on('data', function(data) {
         var lines = data ? data.toString().split('\n') : [];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[7/7] android commit: Merge branch 'master' into 4.0.x (adb CWD & build --unknown-flag)

Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x (adb CWD & build --unknown-flag)

Conflicts:
	framework/src/org/apache/cordova/SplashScreenInternal.java


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

Branch: refs/heads/4.0.x
Commit: f086ef5cad1351b0f7790102d3f2723f7d3c68a7
Parents: 87cdc5a 56a3ee5
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Dec 11 13:47:07 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Dec 11 13:47:07 2014 -0500

----------------------------------------------------------------------
 CONTRIBUTING.md                                      |  5 +++--
 bin/templates/cordova/lib/build.js                   | 12 +++++++++---
 bin/templates/cordova/lib/device.js                  |  9 +++++----
 bin/templates/cordova/lib/emulator.js                | 15 ++++++++-------
 bin/templates/cordova/lib/log.js                     |  3 ++-
 .../src/org/apache/cordova/CordovaPreferences.java   |  3 +++
 6 files changed, 30 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f086ef5c/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/7] android commit: Close #137 (already merged).

Posted by ag...@apache.org.
Close #137 (already merged).


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

Branch: refs/heads/4.0.x
Commit: f7c717e393d913ce4b3297873a9a6b866c799e5d
Parents: 268fea5
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:06:38 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:02:57 2014 -0500

----------------------------------------------------------------------
 CONTRIBUTING.md | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f7c717e3/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f7dbcab..0ed4e63 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,8 +25,8 @@ Anyone can contribute to Cordova. And we need your contributions.
 
 There are multiple ways to contribute: report bugs, improve the docs, and
 contribute code.
-
-For instructions on this, start with the 
+ 
+For instructions on this, start with the
 [contribution overview](http://cordova.apache.org/#contribute).
 
 The details are explained there, but the important items are:
@@ -35,3 +35,4 @@ The details are explained there, but the important items are:
  - Run the tests so your patch doesn't break existing functionality.
 
 We look forward to your contributions!
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/7] android commit: CB-8147 Have corodva/build warn about unrecognized flags rather than fail

Posted by ag...@apache.org.
CB-8147 Have corodva/build warn about unrecognized flags rather than fail

Close #127


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

Branch: refs/heads/4.0.x
Commit: 3aca14d5306811985354486a434d7819ea2357cc
Parents: aa2d396
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:30:59 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:02:57 2014 -0500

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3aca14d5/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 7bc20f6..3dc3b3d 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -339,14 +339,19 @@ function parseOpts(options, resolvedTarget) {
                 case 'gradle':
                     ret.buildMethod = option;
                     break;
+                case 'device':
+                case 'emulator':
+                    // Don't need to do anything special to when building for device vs emulator.
+                    // iOS uses this flag to switch on architecture.
+                    break;
                 case 'nobuild' :
                     ret.buildMethod = 'none';
                     break;
                 default :
-                    return Q.reject('Build option \'' + options[i] + '\' not recognized.');
+                    console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
             }
         } else {
-            return Q.reject('Build option \'' + options[i] + '\' not recognized.');
+            console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[5/7] android commit: Fix syntax error in 3aca14d53068

Posted by ag...@apache.org.
Fix syntax error in 3aca14d53068


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

Branch: refs/heads/4.0.x
Commit: d80d532a2a24e67573d9116b06d62c6c5187aa61
Parents: 3aca14d
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 21:16:18 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:16:54 2014 -0500

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d80d532a/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 3dc3b3d..461af3b 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -348,10 +348,10 @@ function parseOpts(options, resolvedTarget) {
                     ret.buildMethod = 'none';
                     break;
                 default :
-                    console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
+                    console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).');
             }
         } else {
-            console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
+            console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).');
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/7] android commit: Close #126 (not-a-problem)

Posted by ag...@apache.org.
Close #126 (not-a-problem)


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

Branch: refs/heads/4.0.x
Commit: aa2d3962bfab3a4f3e746ff30a228360e5fc595d
Parents: f7c717e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:59:51 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:02:57 2014 -0500

----------------------------------------------------------------------
 CONTRIBUTING.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/aa2d3962/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ed4e63..f34ecff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,7 @@ Anyone can contribute to Cordova. And we need your contributions.
 
 There are multiple ways to contribute: report bugs, improve the docs, and
 contribute code.
- 
+  
 For instructions on this, start with the
 [contribution overview](http://cordova.apache.org/#contribute).
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[6/7] android commit: CB-8079 Use activity class package name, but fallback to application package name when looking for splash screen drawable

Posted by ag...@apache.org.
CB-8079 Use activity class package name, but fallback to application
package name when looking for splash screen drawable

Close #136


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

Branch: refs/heads/4.0.x
Commit: 56a3ee5fe66c4eb0ac67b2f258d4f1f9a0536ff8
Parents: d80d532
Author: Daniel Toplak <d....@cadenas.de>
Authored: Wed Nov 26 08:31:45 2014 +0100
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 10 21:19:28 2014 -0500

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaPreferences.java   | 3 +++
 framework/src/org/apache/cordova/SplashScreenInternal.java | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/56a3ee5f/framework/src/org/apache/cordova/CordovaPreferences.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaPreferences.java b/framework/src/org/apache/cordova/CordovaPreferences.java
index 536f25a..ed0b9b8 100644
--- a/framework/src/org/apache/cordova/CordovaPreferences.java
+++ b/framework/src/org/apache/cordova/CordovaPreferences.java
@@ -133,6 +133,9 @@ public class CordovaPreferences {
             } else if (name.equals("splashscreen")) {
                 // Note: We should probably pass in the classname for the variable splash on splashscreen!
                 int resource = action.getResources().getIdentifier(value, "drawable", action.getClass().getPackage().getName());
+                if(resource == 0) {
+                    resource = action.getResources().getIdentifier(value, "drawable", action.getPackageName());
+                }
                 action.getIntent().putExtra(name, resource);
             }
             else if(name.equals("backgroundcolor")) {

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/56a3ee5f/framework/src/org/apache/cordova/SplashScreenInternal.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/SplashScreenInternal.java b/framework/src/org/apache/cordova/SplashScreenInternal.java
index 605fce7..715e418 100644
--- a/framework/src/org/apache/cordova/SplashScreenInternal.java
+++ b/framework/src/org/apache/cordova/SplashScreenInternal.java
@@ -54,6 +54,9 @@ public class SplashScreenInternal extends CordovaPlugin {
             String splashResource = preferences.getString("SplashScreen", null);
             if (splashResource != null) {
                 drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
+                if (drawableId == 0) {
+                    drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName());
+                }
                 preferences.set("SplashDrawableId", drawableId);
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org