2014-09-23 09:35:39 +08:00
|
|
|
/* 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.
|
2014-09-05 01:49:43 +08:00
|
|
|
*/
|
|
|
|
|
2014-08-18 21:40:33 +08:00
|
|
|
buildscript {
|
2021-07-06 14:38:28 +08:00
|
|
|
apply from: 'cordova.gradle'
|
2021-03-27 23:11:56 +08:00
|
|
|
apply from: 'repositories.gradle'
|
2021-07-06 14:38:28 +08:00
|
|
|
|
2021-03-27 23:11:56 +08:00
|
|
|
repositories repos
|
2014-08-18 21:40:33 +08:00
|
|
|
|
2015-08-11 07:43:41 +08:00
|
|
|
dependencies {
|
2021-07-03 12:04:13 +08:00
|
|
|
// Android Gradle Plugin (AGP) Build Tools
|
2021-07-06 14:38:28 +08:00
|
|
|
classpath "com.android.tools.build:gradle:${cordovaConfig.AGP_VERSION}"
|
2014-08-18 21:40:33 +08:00
|
|
|
}
|
2022-05-18 22:18:33 +08:00
|
|
|
|
|
|
|
cdvHelpers.verifyCordovaConfigForBuild()
|
2014-08-18 21:40:33 +08:00
|
|
|
}
|
|
|
|
|
2019-04-06 12:33:04 +08:00
|
|
|
allprojects {
|
2021-08-02 13:19:40 +08:00
|
|
|
def hasRepositoriesGradle = file('repositories.gradle').exists()
|
|
|
|
if (hasRepositoriesGradle) {
|
|
|
|
apply from: 'repositories.gradle'
|
|
|
|
} else {
|
|
|
|
apply from: "${project.rootDir}/repositories.gradle"
|
|
|
|
}
|
|
|
|
|
2021-03-27 23:11:56 +08:00
|
|
|
repositories repos
|
2019-04-06 12:33:04 +08:00
|
|
|
}
|
|
|
|
|
2016-06-24 13:07:09 +08:00
|
|
|
apply plugin: 'com.android.library'
|
2017-02-14 08:37:39 +08:00
|
|
|
|
2014-08-18 21:40:33 +08:00
|
|
|
android {
|
2023-04-12 13:39:47 +08:00
|
|
|
namespace 'org.apache.cordova'
|
|
|
|
|
2022-05-18 22:18:33 +08:00
|
|
|
compileSdkVersion cordovaConfig.COMPILE_SDK_VERSION
|
2021-07-06 14:38:28 +08:00
|
|
|
buildToolsVersion cordovaConfig.BUILD_TOOLS_VERSION
|
2014-08-18 21:40:33 +08:00
|
|
|
|
|
|
|
compileOptions {
|
2017-11-16 03:39:32 +08:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
2014-08-18 21:40:33 +08:00
|
|
|
}
|
|
|
|
|
2020-11-19 01:48:46 +08:00
|
|
|
// For the Android Cordova Lib, we allow changing the minSdkVersion, but it is at the users own risk
|
2019-04-06 12:28:25 +08:00
|
|
|
defaultConfig {
|
2021-07-06 14:38:28 +08:00
|
|
|
minSdkVersion cordovaConfig.MIN_SDK_VERSION
|
2019-04-06 12:28:25 +08:00
|
|
|
}
|
|
|
|
|
2014-08-18 21:40:33 +08:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
|
|
java.srcDirs = ['src']
|
|
|
|
resources.srcDirs = ['src']
|
|
|
|
aidl.srcDirs = ['src']
|
|
|
|
renderscript.srcDirs = ['src']
|
|
|
|
res.srcDirs = ['res']
|
|
|
|
assets.srcDirs = ['assets']
|
|
|
|
}
|
|
|
|
}
|
2017-02-14 08:37:39 +08:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/LICENSE.txt'
|
|
|
|
exclude 'META-INF/DEPENDENCIES'
|
|
|
|
exclude 'META-INF/NOTICE'
|
|
|
|
}
|
2022-10-15 12:39:47 +08:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
singleVariant('release') {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
}
|
2017-02-14 08:37:39 +08:00
|
|
|
}
|
|
|
|
|
2021-04-16 05:52:14 +08:00
|
|
|
dependencies {
|
2022-10-15 12:39:47 +08:00
|
|
|
api "androidx.appcompat:appcompat:${cordovaConfig.ANDROIDX_APP_COMPAT_VERSION}"
|
2021-07-06 21:38:16 +08:00
|
|
|
implementation "androidx.webkit:webkit:${cordovaConfig.ANDROIDX_WEBKIT_VERSION}"
|
2022-06-30 09:49:10 +08:00
|
|
|
implementation "androidx.core:core-splashscreen:${cordovaConfig.ANDROIDX_CORE_SPLASHSCREEN_VERSION}"
|
2021-04-16 05:52:14 +08:00
|
|
|
}
|
|
|
|
|
2021-07-06 21:38:16 +08:00
|
|
|
/**
|
|
|
|
* In a project created though CLI, the `cordova-publish.gradle` file is not copied to the `framework` dir.
|
|
|
|
* App development (CLI) projects can not and should not publish our framework.
|
|
|
|
* In this case, there is no need for the gradle build process to know about the publish process.
|
|
|
|
*/
|
|
|
|
def cordovaPublishGradle = './cordova-publish.gradle'
|
|
|
|
if(file(cordovaPublishGradle).exists()) {
|
|
|
|
apply from: cordovaPublishGradle
|
2021-04-22 20:32:14 +08:00
|
|
|
}
|