cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [01/12] android commit: CB-8229 Gradle: Add CordovaLib as a dependency to all plugin sub-projects
Date Wed, 31 Dec 2014 04:01:04 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x 4f3ae2317 -> c6b171ba9
  refs/heads/master 7cfb33d0e -> 480af2644


CB-8229 Gradle: Add CordovaLib as a dependency to all plugin sub-projects


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

Branch: refs/heads/4.0.x
Commit: ecd2e068834d128cd61c47153830e55d01e2c7d9
Parents: 7cfb33d
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Dec 30 22:56:43 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Dec 30 22:56:43 2014 -0500

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js            |  4 +++-
 bin/templates/cordova/lib/plugin-build.gradle | 20 ++++++++++++++--
 framework/build.gradle                        | 27 ++++++++++++++--------
 3 files changed, 38 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ecd2e068/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index b507c5e..3a08c3d 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -227,7 +227,9 @@ var builders = {
                 var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
                 var subProjects = extractSubProjectPaths();
                 for (var i = 0; i < subProjects.length; ++i) {
-                    shell.cp('-f', pluginBuildGradle, path.join(ROOT, subProjects[i], 'build.gradle'));
+                    if (subProjects[i] !== 'CordovaLib') {
+                        shell.cp('-f', pluginBuildGradle, path.join(ROOT, subProjects[i],
'build.gradle'));
+                    }
                 }
 
                 var subProjectsAsGradlePaths = subProjects.map(function(p) { return ':' +
p.replace(/[/\\]/g, ':') });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ecd2e068/bin/templates/cordova/lib/plugin-build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/plugin-build.gradle b/bin/templates/cordova/lib/plugin-build.gradle
index fd4d855..f062588 100644
--- a/bin/templates/cordova/lib/plugin-build.gradle
+++ b/bin/templates/cordova/lib/plugin-build.gradle
@@ -23,8 +23,22 @@ buildscript {
         mavenCentral()
     }
 
-    dependencies {
-        classpath 'com.android.tools.build:gradle:0.12.+'
+    // Switch the Android Gradle plugin version requirement depending on the
+    // installed version of Gradle. This dependency is documented at
+    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
+    // and https://issues.apache.org/jira/browse/CB-8143
+    if (gradle.gradleVersion >= "2.2") {
+        dependencies {
+            classpath 'com.android.tools.build:gradle:1.0.0+'
+        }
+    } else if (gradle.gradleVersion >= "2.1") {
+        dependencies {
+            classpath 'com.android.tools.build:gradle:0.14.0+'
+        }
+    } else {
+        dependencies {
+            classpath 'com.android.tools.build:gradle:0.12.0+'
+        }
     }
 }
 
@@ -32,6 +46,8 @@ apply plugin: 'android-library'
 
 dependencies {
     compile fileTree(dir: 'libs', include: '*.jar')
+    debugCompile project(path: ":CordovaLib", configuration: "debug")
+    releaseCompile project(path: ":CordovaLib", configuration: "release")
 }
 
 android {

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ecd2e068/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index e048edd..f1585d3 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -24,16 +24,23 @@ buildscript {
     }
 
     dependencies {
-        // This should be updated with each cordova-android release.
-        // It can affect things like where the .apk is generated.
-        // It also dictates what the minimum android build-tools version
-        // that you need (Set in bin/templates/project/cordova.gradle).
-        // Make sure the value is the same in all locations:
-        // * framework/build.gradle
-        // * bin/templates/project/cordova.gradle
-        // * bin/templates/cordova/lib/plugin-build.gradle
-        // * distributionUrl within bin/templates/cordova/lib/build.js.
-        classpath 'com.android.tools.build:gradle:0.12.+'
+        // Switch the Android Gradle plugin version requirement depending on the
+        // installed version of Gradle. This dependency is documented at
+        // http://tools.android.com/tech-docs/new-build-system/version-compatibility
+        // and https://issues.apache.org/jira/browse/CB-8143
+        if (gradle.gradleVersion >= "2.2") {
+            dependencies {
+                classpath 'com.android.tools.build:gradle:1.0.0+'
+            }
+        } else if (gradle.gradleVersion >= "2.1") {
+            dependencies {
+                classpath 'com.android.tools.build:gradle:0.14.0+'
+            }
+        } else {
+            dependencies {
+                classpath 'com.android.tools.build:gradle:0.12.0+'
+            }
+        }
     }
 }
 


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


Mime
View raw message