cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [07/12] cordova-amazon-fireos git commit: CB-7881 Android tooling shouldn't lock application directory
Date Mon, 22 Dec 2014 15:53:04 GMT
CB-7881 Android tooling shouldn't lock application directory

Close #130


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/0ed7d273
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/0ed7d273
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/0ed7d273

Branch: refs/heads/master
Commit: 0ed7d2735298378480b670a1e4658a0bf73331d5
Parents: df49aca
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Mon Oct 27 17:14:35 2014 +0300
Committer: Ajitha <ajithas@amazon.com>
Committed: Sat Dec 13 19:02:24 2014 +0000

----------------------------------------------------------------------
 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-amazon-fireos/blob/0ed7d273/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-amazon-fireos/blob/0ed7d273/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-amazon-fireos/blob/0ed7d273/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-amazon-fireos/blob/0ed7d273/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


Mime
View raw message