You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/08/20 17:49:07 UTC

[1/4] android commit: CB-7325 Fix error message in android_sdk_version.js when missing SDK on windows

Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x 4c1942e3f -> 7caa96abc


CB-7325 Fix error message in android_sdk_version.js when missing SDK on windows

github: close #113


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

Branch: refs/heads/4.0.x
Commit: 94943a9a84546dff5f4416115572b92bd9781fac
Parents: 71e72f2
Author: Refael Ackermann <re...@empeeric.com>
Authored: Mon Aug 18 14:53:07 2014 +0300
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 20 11:20:02 2014 -0400

----------------------------------------------------------------------
 bin/lib/android_sdk_version.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/94943a9a/bin/lib/android_sdk_version.js
----------------------------------------------------------------------
diff --git a/bin/lib/android_sdk_version.js b/bin/lib/android_sdk_version.js
index d03e1e7..e592378 100755
--- a/bin/lib/android_sdk_version.js
+++ b/bin/lib/android_sdk_version.js
@@ -51,7 +51,7 @@ get_sdks = function() {
 
         return Q();
     }, function(stderr) {
-        if (stderr.match(/command\snot\sfound/)) {
+        if (stderr.match(/command\snot\sfound/) || stderr.match(/'android' is not recognized/)) {
             return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.'));
         } else {
             return Q.reject(new Error('An error occurred while listing Android targets'));


[4/4] android commit: Fix previous merges

Posted by ia...@apache.org.
Fix previous merges

Build scripts (create and build) were mangled somewhat by the previous
merge commits. This resets them to (almost) exactly the same state as
the 3.6.x (master) branch.

Conflicts:
	bin/lib/create.js


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

Branch: refs/heads/4.0.x
Commit: 7caa96abcdfee71712a7a4e8aa65b128e3f6efc4
Parents: b277626
Author: Ian Clelland <ic...@chromium.org>
Authored: Wed Aug 20 11:17:04 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Wed Aug 20 11:45:35 2014 -0400

----------------------------------------------------------------------
 bin/lib/create.js                  | 18 ------------------
 bin/templates/cordova/lib/build.js |  1 -
 2 files changed, 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/7caa96ab/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 6a5fe57..4b340c6 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -119,7 +119,6 @@ function writeProjectProperties(projectPath, target_api, shared) {
 
 function copyBuildRules(projectPath) {
     var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
-    shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
 
     shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath);
     shell.cp('-f', path.join(srcDir, 'settings.gradle'), projectPath);
@@ -139,13 +138,6 @@ function copyScripts(projectPath) {
     shell.cp(path.join(ROOT, 'bin', 'lib', 'android_sdk_version.js'), path.join(projectPath, 'cordova', 'lib', 'android_sdk_version.js'));
 }
 
-function copyGradleWrapper(sdkPath, projectPath) {
-    var wrapperDir = path.join(sdkPath, 'tools', 'templates','gradle','wrapper');
-    shell.cp(path.join(wrapperDir, 'gradlew'), projectPath);
-    shell.cp(path.join(wrapperDir, 'gradlew.bat'), projectPath);
-    shell.cp('-r', path.join(wrapperDir, 'gradle'), projectPath);
-}
-
 /**
  * Test whether a package name is acceptable for use as an android project.
  * Returns a promise, fulfilled if the package name is acceptable; rejected
@@ -254,16 +246,6 @@ exports.createProject = function(project_path, package_name, project_name, proje
             shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
             shell.cp(path.join(project_template_dir, 'gitignore'), path.join(project_path, '.gitignore'));
 
-            shell.cp('-f', path.join(project_template_dir, 'build.gradle'), project_path);
-            shell.cp('-f', path.join(project_template_dir, 'libraries.gradle'), project_path);
-            shell.cp('-f', path.join(project_template_dir, 'settings.gradle'), project_path);
-            check_reqs.sdk_dir().then(function(dir) {
-                console.log("Copying Gradle wrapper from " + dir);
-                copyGradleWrapper(dir, project_path);
-            }).catch(function(err) {
-                console.log("Cannot find Android SDK. Not installing Gradle wrapper.");
-            });
-
             // Manually create directories that would be empty within the template (since git doesn't track directories).
             shell.mkdir(path.join(project_path, 'libs'));
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/7caa96ab/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 7d8828d..1f4810d 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -24,7 +24,6 @@ var shell   = require('shelljs'),
     Q       = require('q'),
     path    = require('path'),
     fs      = require('fs'),
-    which   = require('which'),
     ROOT    = path.join(__dirname, '..', '..');
 var check_reqs = require('./check_reqs');
 


[3/4] android commit: Merge branch 'master' into 4.0.x (Gradle library dependencies)

Posted by ia...@apache.org.
Merge branch 'master' into 4.0.x (Gradle library dependencies)


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

Branch: refs/heads/4.0.x
Commit: b2776269cf032ce48977e2f0933a3a24a99b4f05
Parents: 4c1942e b6c5a5f
Author: Ian Clelland <ic...@chromium.org>
Authored: Wed Aug 20 11:43:58 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Wed Aug 20 11:43:58 2014 -0400

----------------------------------------------------------------------
 bin/lib/android_sdk_version.js         |  2 +-
 bin/lib/create.js                      |  1 -
 bin/templates/project/build.gradle     | 16 ++++++++++++++--
 bin/templates/project/libraries.gradle |  7 -------
 bin/templates/project/settings.gradle  | 19 ++++++++++++++++++-
 5 files changed, 33 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b2776269/bin/lib/create.js
----------------------------------------------------------------------


[2/4] android commit: CB-3445: Read project.properties to configure gradle libraries

Posted by ia...@apache.org.
CB-3445: Read project.properties to configure gradle libraries


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

Branch: refs/heads/4.0.x
Commit: b6c5a5fc9a274135d373285855120dfbecbac8fd
Parents: 94943a9
Author: Ian Clelland <ic...@chromium.org>
Authored: Wed Aug 20 10:44:48 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Wed Aug 20 11:42:04 2014 -0400

----------------------------------------------------------------------
 bin/lib/create.js                      |  1 -
 bin/templates/project/build.gradle     | 16 ++++++++++++++--
 bin/templates/project/libraries.gradle |  7 -------
 bin/templates/project/settings.gradle  | 19 ++++++++++++++++++-
 4 files changed, 32 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b6c5a5fc/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 0e929e3..c4c6f1b 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -122,7 +122,6 @@ function copyBuildRules(projectPath) {
     shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
 
     shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath);
-    shell.cp('-f', path.join(srcDir, 'libraries.gradle'), projectPath);
     shell.cp('-f', path.join(srcDir, 'settings.gradle'), projectPath);
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b6c5a5fc/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 4b34e48..dcebbc5 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -15,9 +15,10 @@ buildscript {
 ext.multiarch=false
 
 dependencies {
-    compile project(':CordovaLib')
+    for (subproject in getProjectList()) {
+        compile project(subproject)
+    }
 }
-apply from: 'libraries.gradle'
 
 android {
     sourceSets {
@@ -79,3 +80,14 @@ def getVersionCodeFromManifest() {
     matcher.find()
     return Integer.parseInt(matcher.group(1))
 }
+
+def getProjectList() {
+    def manifestFile = file("project.properties")
+    def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
+    def matcher = pattern.matcher(manifestFile.getText())
+    def projects = []
+    while (matcher.find()) {
+      projects.add(":" + matcher.group(2).replace("/",":"))
+    }
+    return projects
+}

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b6c5a5fc/bin/templates/project/libraries.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/libraries.gradle b/bin/templates/project/libraries.gradle
deleted file mode 100644
index f497543..0000000
--- a/bin/templates/project/libraries.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-dependencies {
-// This file contains no plugins by default.
-// To add a third-party library project, add a line to this file like
-//    compile project(':library_dir_name')
-}
-// If multiple ndk architectures are provided, uncomment this line
-//ext.multiarch=true

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b6c5a5fc/bin/templates/project/settings.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/settings.gradle b/bin/templates/project/settings.gradle
index b938ccc..baa1714 100644
--- a/bin/templates/project/settings.gradle
+++ b/bin/templates/project/settings.gradle
@@ -1 +1,18 @@
-include ':CordovaLib', ':'
+import java.util.regex.Pattern
+
+def getProjectList() {
+    def manifestFile = file("project.properties")
+    def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
+    def matcher = pattern.matcher(manifestFile.getText())
+    def projects = []
+    while (matcher.find()) {
+      projects.add(":" + matcher.group(2).replace("/",":"))
+    }
+    return projects
+}
+
+for (subproject in getProjectList()) {
+    include subproject
+}
+
+include ':'