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/09/23 04:35:47 UTC

[1/7] android commit: CB-7512 Make gradle build only a single config for sub-libraries (release vs debug)

Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x b09f97323 -> 363fc8deb
  refs/heads/master 879da0343 -> ddac192c4


CB-7512 Make gradle build only a single config for sub-libraries (release vs debug)


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

Branch: refs/heads/4.0.x
Commit: 2b128b85f7a29c6e7c9b0232cc9a04a72f36cd01
Parents: 879da03
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 22 20:54:28 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 20:54:28 2014 -0400

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 21 ++++++++++++---------
 framework/build.gradle             |  1 +
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2b128b85/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 6de8c54..41984fa 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -34,15 +34,12 @@ buildscript {
     }
 }
 
-ext.multiarch=false
-
-dependencies {
-    compile fileTree(dir: 'libs', include: '*.jar')
-    for (subproject in getProjectList()) {
-        compile project(subproject)
-    }
+task wrapper(type: Wrapper) {
+    gradleVersion = '1.12'
 }
 
+ext.multiarch=false
+
 android {
     sourceSets {
         main {
@@ -112,10 +109,16 @@ android {
     }
 }
 
-task wrapper(type: Wrapper) {
-    gradleVersion = '1.12'
+dependencies {
+    compile fileTree(dir: 'libs', include: '*.jar')
+    // https://code.google.com/p/android/issues/detail?id=52962
+    for (subproject in getProjectList()) {
+        releaseCompile project(path: subproject, configuration: 'release')
+        debugCompile project(path: subproject, configuration: 'debug')
+    }
 }
 
+
 def promptForPassword(msg) {
     if (System.console() == null) {
         def ret = null

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2b128b85/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index 6ca284d..85295f8 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -39,6 +39,7 @@ apply plugin: 'android-library'
 android {
     compileSdkVersion cordova.cordovaSdkVersion
     buildToolsVersion cordova.cordovaBuildToolsVersion
+    publishNonDefault true
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7


[6/7] android commit: Added gradle distribution URL updating.

Posted by ag...@apache.org.
Added gradle distribution URL updating.

Conflicts:
	bin/templates/cordova/lib/build.js
	framework/build.gradle


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

Branch: refs/heads/4.0.x
Commit: ddac192c4a3a32e57d0c11159b895c94fc9b2905
Parents: 69a03c2
Author: Max Woghiren <ma...@gmail.com>
Authored: Mon Sep 22 16:04:24 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 22:27:43 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 8 ++++++++
 framework/build.gradle             | 1 +
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ddac192c/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 5fc378c..89556fe 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -223,6 +223,14 @@ var builders = {
                 shell.mkdir('-p', path.join(projectPath, 'gradle'));
                 shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle'));
 
+                // If the gradle distribution URL is set, make sure it points to version 1.12.
+                // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
+                // For some reason, using ^ and $ don't work.  This does the job, though.
+                var distributionUrlRegex = /distributionUrl.*zip/;
+                var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip';
+                var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
+                shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath);
+
                 // Update the version of build.gradle in each dependent library.
                 var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
                 var subProjects = extractSubProjectPaths();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ddac192c/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index e9d06ea..b9e9cdf 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -32,6 +32,7 @@ buildscript {
         // * 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.+'
     }
 }


[4/7] android commit: CB-7512 Use a standard build.gradle for all plugins

Posted by ag...@apache.org.
CB-7512 Use a standard build.gradle for all plugins

Plugins can extend it by providing a "build-extras.gradle"


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

Branch: refs/heads/4.0.x
Commit: 69a03c2e162eeffd59eead602c82e1074c7bea2d
Parents: 2b128b8
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 22 21:35:39 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 22:27:43 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js            |  7 +++
 bin/templates/cordova/lib/plugin-build.gradle | 63 ++++++++++++++++++++++
 framework/build.gradle                        | 38 ++++++-------
 3 files changed, 90 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 18a2f3b..5fc378c 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -222,6 +222,13 @@ var builders = {
                 shell.rm('-rf', path.join(projectPath, 'gradle', 'wrapper'));
                 shell.mkdir('-p', path.join(projectPath, 'gradle'));
                 shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle'));
+
+                // Update the version of build.gradle in each dependent library.
+                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'));
+                }
             });
         },
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/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
new file mode 100644
index 0000000..bf706c4
--- /dev/null
+++ b/bin/templates/cordova/lib/plugin-build.gradle
@@ -0,0 +1,63 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+*/
+
+// GENERATED FILE! DO NOT EDIT!
+
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+
+    dependencies {
+        classpath 'com.android.tools.build:gradle:0.12.+'
+    }
+}
+
+apply plugin: 'android-library'
+
+dependencies {
+    compile fileTree(dir: 'libs', include: '*.jar')
+}
+
+android {
+    compileSdkVersion cordova.cordovaSdkVersion
+    buildToolsVersion cordova.cordovaBuildToolsVersion
+    publishNonDefault true
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+
+    sourceSets {
+        main {
+            manifest.srcFile 'AndroidManifest.xml'
+            java.srcDirs = ['src']
+            resources.srcDirs = ['src']
+            aidl.srcDirs = ['src']
+            renderscript.srcDirs = ['src']
+            res.srcDirs = ['res']
+            assets.srcDirs = ['assets']
+            jniLibs.srcDirs = ['libs']
+        }
+    }
+}
+
+if (file('build-extras.gradle').exists()) {
+    apply from: 'build-extras.gradle'
+}

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index 85295f8..e9d06ea 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -1,20 +1,19 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
+/* Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
 */
 
 
@@ -29,7 +28,10 @@ buildscript {
         // 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).
-        // Be sure to also update the value in bin/templates/project.
+        // 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
         classpath 'com.android.tools.build:gradle:0.12.+'
     }
 }


[3/7] android commit: CB-7512 Use a standard build.gradle for all plugins

Posted by ag...@apache.org.
CB-7512 Use a standard build.gradle for all plugins

Plugins can extend it by providing a "build-extras.gradle"


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

Branch: refs/heads/master
Commit: 69a03c2e162eeffd59eead602c82e1074c7bea2d
Parents: 2b128b8
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 22 21:35:39 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 22:27:43 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js            |  7 +++
 bin/templates/cordova/lib/plugin-build.gradle | 63 ++++++++++++++++++++++
 framework/build.gradle                        | 38 ++++++-------
 3 files changed, 90 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 18a2f3b..5fc378c 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -222,6 +222,13 @@ var builders = {
                 shell.rm('-rf', path.join(projectPath, 'gradle', 'wrapper'));
                 shell.mkdir('-p', path.join(projectPath, 'gradle'));
                 shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle'));
+
+                // Update the version of build.gradle in each dependent library.
+                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'));
+                }
             });
         },
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/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
new file mode 100644
index 0000000..bf706c4
--- /dev/null
+++ b/bin/templates/cordova/lib/plugin-build.gradle
@@ -0,0 +1,63 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+*/
+
+// GENERATED FILE! DO NOT EDIT!
+
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+
+    dependencies {
+        classpath 'com.android.tools.build:gradle:0.12.+'
+    }
+}
+
+apply plugin: 'android-library'
+
+dependencies {
+    compile fileTree(dir: 'libs', include: '*.jar')
+}
+
+android {
+    compileSdkVersion cordova.cordovaSdkVersion
+    buildToolsVersion cordova.cordovaBuildToolsVersion
+    publishNonDefault true
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+
+    sourceSets {
+        main {
+            manifest.srcFile 'AndroidManifest.xml'
+            java.srcDirs = ['src']
+            resources.srcDirs = ['src']
+            aidl.srcDirs = ['src']
+            renderscript.srcDirs = ['src']
+            res.srcDirs = ['res']
+            assets.srcDirs = ['assets']
+            jniLibs.srcDirs = ['libs']
+        }
+    }
+}
+
+if (file('build-extras.gradle').exists()) {
+    apply from: 'build-extras.gradle'
+}

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a03c2e/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index 85295f8..e9d06ea 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -1,20 +1,19 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
+/* Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
 */
 
 
@@ -29,7 +28,10 @@ buildscript {
         // 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).
-        // Be sure to also update the value in bin/templates/project.
+        // 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
         classpath 'com.android.tools.build:gradle:0.12.+'
     }
 }


[2/7] android commit: CB-7512 Make gradle build only a single config for sub-libraries (release vs debug)

Posted by ag...@apache.org.
CB-7512 Make gradle build only a single config for sub-libraries (release vs debug)


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

Branch: refs/heads/master
Commit: 2b128b85f7a29c6e7c9b0232cc9a04a72f36cd01
Parents: 879da03
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 22 20:54:28 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 20:54:28 2014 -0400

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 21 ++++++++++++---------
 framework/build.gradle             |  1 +
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2b128b85/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 6de8c54..41984fa 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -34,15 +34,12 @@ buildscript {
     }
 }
 
-ext.multiarch=false
-
-dependencies {
-    compile fileTree(dir: 'libs', include: '*.jar')
-    for (subproject in getProjectList()) {
-        compile project(subproject)
-    }
+task wrapper(type: Wrapper) {
+    gradleVersion = '1.12'
 }
 
+ext.multiarch=false
+
 android {
     sourceSets {
         main {
@@ -112,10 +109,16 @@ android {
     }
 }
 
-task wrapper(type: Wrapper) {
-    gradleVersion = '1.12'
+dependencies {
+    compile fileTree(dir: 'libs', include: '*.jar')
+    // https://code.google.com/p/android/issues/detail?id=52962
+    for (subproject in getProjectList()) {
+        releaseCompile project(path: subproject, configuration: 'release')
+        debugCompile project(path: subproject, configuration: 'debug')
+    }
 }
 
+
 def promptForPassword(msg) {
     if (System.console() == null) {
         def ret = null

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2b128b85/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index 6ca284d..85295f8 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -39,6 +39,7 @@ apply plugin: 'android-library'
 android {
     compileSdkVersion cordova.cordovaSdkVersion
     buildToolsVersion cordova.cordovaBuildToolsVersion
+    publishNonDefault true
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7


[7/7] android commit: Merge branch 'master' into 4.0.x (gradle plugin template)

Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x (gradle plugin template)

Conflicts:
	bin/templates/cordova/lib/build.js
	framework/build.gradle


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

Branch: refs/heads/4.0.x
Commit: 363fc8deb56d739e8630c2799a713a95e3803cbc
Parents: b09f973 ddac192
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 22 22:28:59 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 22:28:59 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js            |  7 +++
 bin/templates/cordova/lib/plugin-build.gradle | 63 ++++++++++++++++++++++
 bin/templates/project/build.gradle            | 21 ++++----
 framework/build.gradle                        | 42 ++++++++-------
 4 files changed, 104 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[5/7] android commit: Added gradle distribution URL updating.

Posted by ag...@apache.org.
Added gradle distribution URL updating.

Conflicts:
	bin/templates/cordova/lib/build.js
	framework/build.gradle


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

Branch: refs/heads/master
Commit: ddac192c4a3a32e57d0c11159b895c94fc9b2905
Parents: 69a03c2
Author: Max Woghiren <ma...@gmail.com>
Authored: Mon Sep 22 16:04:24 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 22 22:27:43 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 8 ++++++++
 framework/build.gradle             | 1 +
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ddac192c/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 5fc378c..89556fe 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -223,6 +223,14 @@ var builders = {
                 shell.mkdir('-p', path.join(projectPath, 'gradle'));
                 shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle'));
 
+                // If the gradle distribution URL is set, make sure it points to version 1.12.
+                // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
+                // For some reason, using ^ and $ don't work.  This does the job, though.
+                var distributionUrlRegex = /distributionUrl.*zip/;
+                var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip';
+                var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
+                shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath);
+
                 // Update the version of build.gradle in each dependent library.
                 var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
                 var subProjects = extractSubProjectPaths();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ddac192c/framework/build.gradle
----------------------------------------------------------------------
diff --git a/framework/build.gradle b/framework/build.gradle
index e9d06ea..b9e9cdf 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -32,6 +32,7 @@ buildscript {
         // * 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.+'
     }
 }