mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 23:03:11 +08:00
CB-8229 Gradle: Add CordovaLib as a dependency to all plugin sub-projects
This commit is contained in:
parent
7cfb33d0ef
commit
ecd2e06883
4
bin/templates/cordova/lib/build.js
vendored
4
bin/templates/cordova/lib/build.js
vendored
@ -227,7 +227,9 @@ var builders = {
|
|||||||
var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
|
var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
|
||||||
var subProjects = extractSubProjectPaths();
|
var subProjects = extractSubProjectPaths();
|
||||||
for (var i = 0; i < subProjects.length; ++i) {
|
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, ':') });
|
var subProjectsAsGradlePaths = subProjects.map(function(p) { return ':' + p.replace(/[/\\]/g, ':') });
|
||||||
|
@ -23,8 +23,22 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
// Switch the Android Gradle plugin version requirement depending on the
|
||||||
classpath 'com.android.tools.build:gradle:0.12.+'
|
// 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 {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
compile fileTree(dir: 'libs', include: '*.jar')
|
||||||
|
debugCompile project(path: ":CordovaLib", configuration: "debug")
|
||||||
|
releaseCompile project(path: ":CordovaLib", configuration: "release")
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -24,16 +24,23 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// This should be updated with each cordova-android release.
|
// Switch the Android Gradle plugin version requirement depending on the
|
||||||
// It can affect things like where the .apk is generated.
|
// installed version of Gradle. This dependency is documented at
|
||||||
// It also dictates what the minimum android build-tools version
|
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
|
||||||
// that you need (Set in bin/templates/project/cordova.gradle).
|
// and https://issues.apache.org/jira/browse/CB-8143
|
||||||
// Make sure the value is the same in all locations:
|
if (gradle.gradleVersion >= "2.2") {
|
||||||
// * framework/build.gradle
|
dependencies {
|
||||||
// * bin/templates/project/cordova.gradle
|
classpath 'com.android.tools.build:gradle:1.0.0+'
|
||||||
// * bin/templates/cordova/lib/plugin-build.gradle
|
}
|
||||||
// * distributionUrl within bin/templates/cordova/lib/build.js.
|
} else if (gradle.gradleVersion >= "2.1") {
|
||||||
classpath 'com.android.tools.build:gradle:0.12.+'
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:0.14.0+'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:0.12.0+'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user