cordova-android/framework/build.gradle

145 lines
4.5 KiB
Groovy
Raw Normal View History

/* 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.
*/
2017-02-14 16:31:27 -08:00
ext {
apply from: 'cordova.gradle'
cdvCompileSdkVersion = privateHelpers.getProjectTarget()
cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
if (project.hasProperty('cdvMinSdkVersion') && cdvMinSdkVersion.isInteger()) {
cdvMinSdkVersion = cdvMinSdkVersion as int
println '[Cordova] cdvMinSdkVersion is overridden, try it at your own risk.'
} else {
cdvMinSdkVersion = 22; // current Cordova's default
}
if (project.hasProperty('cdvAndroidXAppCompatVersion')) {
cdvAndroidXAppCompatVersion = cdvAndroidXAppCompatVersion
println '[Cordova] cdvAndroidXAppCompatVersion is overridden, try it at your own risk.'
} else {
cdvAndroidXAppCompatVersion = "1.2.0"; // current Cordova's default
}
2017-02-14 16:31:27 -08:00
}
buildscript {
apply from: 'repositories.gradle'
repositories repos
2015-08-10 16:43:41 -07:00
dependencies {
// Android Gradle Plugin (AGP) Build Tools
classpath 'com.android.tools.build:gradle:4.2.1'
// @todo remove this abandoned plugin. maven-publish-plugin is now supported by Android Gradle plugin 3.6.0 and higher
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
apply from: 'repositories.gradle'
repositories repos
}
apply plugin: 'com.android.library'
// @todo remove this abandoned plugin. maven-publish-plugin is now supported by Android Gradle plugin 3.6.0 and higher
apply plugin: 'com.github.dcendents.android-maven'
group = 'org.apache.cordova'
version = '10.0.0-dev'
android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For the Android Cordova Lib, we allow changing the minSdkVersion, but it is at the users own risk
defaultConfig {
minSdkVersion cdvMinSdkVersion
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
}
// @todo after removing abandoned plugin "com.github.dcendents.android-maven". figure out what to do with this.
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'Cordova'
url 'https://cordova.apache.org'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
2017-02-14 16:31:27 -08:00
id 'stevengill'
name 'Steve Gill'
}
}
scm {
connection 'scm:git:https://github.com/apache/cordova-android.git'
developerConnection 'scm:git:git@github.com:apache/cordova-android.git'
url 'https://github.com/apache/cordova-android'
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
dependencies {
implementation "androidx.appcompat:appcompat:$cdvAndroidXAppCompatVersion"
}
artifacts {
archives sourcesJar
}
dependencies {
implementation 'androidx.webkit:webkit:1.3.0'
}