mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
Merge branch 'master' into 4.0.x (gradle plugin template)
Conflicts: bin/templates/cordova/lib/build.js framework/build.gradle
This commit is contained in:
commit
363fc8deb5
7
bin/templates/cordova/lib/build.js
vendored
7
bin/templates/cordova/lib/build.js
vendored
@ -230,6 +230,13 @@ var builders = {
|
|||||||
var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip';
|
var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip';
|
||||||
var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
||||||
shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath);
|
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();
|
||||||
|
for (var i = 0; i < subProjects.length; ++i) {
|
||||||
|
shell.cp('-f', pluginBuildGradle, path.join(ROOT, subProjects[i], 'build.gradle'));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
63
bin/templates/cordova/lib/plugin-build.gradle
Normal file
63
bin/templates/cordova/lib/plugin-build.gradle
Normal file
@ -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'
|
||||||
|
}
|
@ -34,15 +34,12 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.multiarch=false
|
task wrapper(type: Wrapper) {
|
||||||
|
gradleVersion = '1.12'
|
||||||
dependencies {
|
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
|
||||||
for (subproject in getProjectList()) {
|
|
||||||
compile project(subproject)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext.multiarch=false
|
||||||
|
|
||||||
android {
|
android {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -112,10 +109,16 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
dependencies {
|
||||||
gradleVersion = '1.12'
|
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) {
|
def promptForPassword(msg) {
|
||||||
if (System.console() == null) {
|
if (System.console() == null) {
|
||||||
def ret = null
|
def ret = null
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
/*
|
/* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
or more contributor license agreements. See the NOTICE file
|
||||||
or more contributor license agreements. See the NOTICE file
|
distributed with this work for additional information
|
||||||
distributed with this work for additional information
|
regarding copyright ownership. The ASF licenses this file
|
||||||
regarding copyright ownership. The ASF licenses this file
|
to you under the Apache License, Version 2.0 (the
|
||||||
to you under the Apache License, Version 2.0 (the
|
"License"); you may not use this file except in compliance
|
||||||
"License"); you may not use this file except in compliance
|
with the License. You may obtain a copy of the License at
|
||||||
with the License. You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing,
|
Unless required by applicable law or agreed to in writing,
|
||||||
software distributed under the License is distributed on an
|
software distributed under the License is distributed on an
|
||||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
KIND, either express or implied. See the License for the
|
KIND, either express or implied. See the License for the
|
||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -29,9 +28,11 @@ buildscript {
|
|||||||
// It can affect things like where the .apk is generated.
|
// It can affect things like where the .apk is generated.
|
||||||
// It also dictates what the minimum android build-tools version
|
// It also dictates what the minimum android build-tools version
|
||||||
// that you need (Set in bin/templates/project/cordova.gradle).
|
// that you need (Set in bin/templates/project/cordova.gradle).
|
||||||
// Be sure to also update the value in:
|
// Make sure the value is the same in all locations:
|
||||||
// (1) bin/templates/project/build.gradle, and
|
// * framework/build.gradle
|
||||||
// (2) the distribution URL in bin/templates/cordova/lib/build.js.
|
// * 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.+'
|
classpath 'com.android.tools.build:gradle:0.12.+'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,6 +42,7 @@ apply plugin: 'android-library'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion cordova.cordovaSdkVersion
|
compileSdkVersion cordova.cordovaSdkVersion
|
||||||
buildToolsVersion cordova.cordovaBuildToolsVersion
|
buildToolsVersion cordova.cordovaBuildToolsVersion
|
||||||
|
publishNonDefault true
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
|
Loading…
Reference in New Issue
Block a user