mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Merge branch 'master' into 4.0.x (Gradle library dependencies)
This commit is contained in:
commit
b2776269cf
@ -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'));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
@ -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 ':'
|
||||
|
Loading…
Reference in New Issue
Block a user