You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/01/24 19:45:24 UTC
[2/2] git commit: Fix for android configuration.
Updated Branches:
refs/heads/master 07bcd0b6e -> b194da1df
Fix for android configuration.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/b194da1d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/b194da1d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/b194da1d
Branch: refs/heads/master
Commit: b194da1dfcee71fdc7030a3cc552dfa21cef9526
Parents: c0bd2e5
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Jan 24 10:48:32 2013 -0800
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jan 24 10:48:32 2013 -0800
----------------------------------------------------------------------
.gitignore | 3 +++
bootstrap.js | 42 +++++++++++++++++++++++++++---------------
2 files changed, 30 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b194da1d/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 4c59a50..7c3253a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,6 @@ npm-debug.log
temp
.DS_Store
spec/fixtures/projects/native
+lib/cordova-android/bin/templates/cordova/appinfo.jar
+lib/cordova-android/framework/bin
+lib/cordova-android/framework/project.properties
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b194da1d/bootstrap.js
----------------------------------------------------------------------
diff --git a/bootstrap.js b/bootstrap.js
index d0beea0..9bc77c7 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -1,6 +1,6 @@
/**
- * TEST BOOTSTRAP FILE
- * Runs through any bs to make sure the tests are good to go.
+ * BOOTSTRAP
+ * Runs through any bs to make sure the libraries and tests are good to go.
**/
var util = require('./src/util'),
@@ -8,18 +8,30 @@ var util = require('./src/util'),
shell = require('shelljs'),
platforms = require('./platforms');
-// Create native projects using bin/create
-var tempDir = path.join(__dirname, 'spec', 'fixtures', 'projects', 'native');
-shell.rm('-rf', tempDir);
-shell.mkdir('-p', tempDir);
+var android = path.join(__dirname, 'lib', 'cordova-android', 'framework');
-platforms.forEach(function(platform) {
- var fix_path = path.join(tempDir, platform + '_fixture');
- var create = path.join(util.libDirectory, 'cordova-' + platform, 'bin', 'create');
- console.log('Creating cordova-' + platform + ' project using live project lib for tests...');
- var cmd = create + ' "' + fix_path + '" org.apache.cordova.cordovaExample cordovaExample';
- if (platform == 'blackberry') cmd = create + ' "' + fix_path + '" cordovaExample';
- var create_result = shell.exec(cmd, {silent:true});
- if (create_result.code > 0) throw ('Could not create a native ' + platform + ' project test fixture: ' + create_result.output);
- console.log('.. complete.');
+// Update cordova-android based on local sdk
+shell.exec('cd ' + android + ' && android update project -p . -t android-17', {silent:true, async:true}, function(code, output) {
+ if (code > 0) {
+ console.error('ERROR! Could not configure Android properties. Are you sure you have the Android SDK installed and the tools available on your PATH? (make sure you can run `android` from your command-line). Error output to follow:');
+ console.error(output);
+ process.exit(1);
+ } else {
+ // Create native projects using bin/create
+ var tempDir = path.join(__dirname, 'spec', 'fixtures', 'projects', 'native');
+ shell.rm('-rf', tempDir);
+ shell.mkdir('-p', tempDir);
+
+ platforms.forEach(function(platform) {
+ var fix_path = path.join(tempDir, platform + '_fixture');
+ var create = path.join(util.libDirectory, 'cordova-' + platform, 'bin', 'create');
+ console.log('Creating cordova-' + platform + ' project using live project lib for tests...');
+ var cmd = create + ' "' + fix_path + '" org.apache.cordova.cordovaExample cordovaExample';
+ if (platform == 'blackberry') cmd = create + ' "' + fix_path + '" cordovaExample';
+ var create_result = shell.exec(cmd, {silent:true});
+ if (create_result.code > 0) throw ('Could not create a native ' + platform + ' project test fixture: ' + create_result.output);
+ console.log('.. complete.');
+ });
+ }
});
+