cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [40/50] git commit: CB-3445: Read project.properties to configure gradle libraries
Date Thu, 28 Aug 2014 19:03:54 GMT
CB-3445: Read project.properties to configure gradle libraries


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/c6f47be9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/c6f47be9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/c6f47be9

Branch: refs/heads/master
Commit: c6f47be9cb35e8c597ba2a47e568a95d0149a980
Parents: 12ec1b3
Author: Ian Clelland <iclelland@chromium.org>
Authored: Wed Aug 20 10:44:48 2014 -0400
Committer: Archana Naik <naika@lab126.com>
Committed: Thu Aug 28 11:11:24 2014 -0700

----------------------------------------------------------------------
 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-amazon-fireos/blob/c6f47be9/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 0f0014c..870f76c 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -124,7 +124,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-amazon-fireos/blob/c6f47be9/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-amazon-fireos/blob/c6f47be9/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-amazon-fireos/blob/c6f47be9/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 ':'


Mime
View raw message