2019-09-03 02:31:51 +02:00
|
|
|
// Gradle build config for Godot Engine's Android port.
|
|
|
|
apply from: 'config.gradle'
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
apply from: 'config.gradle'
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath libraries.androidGradlePlugin
|
2020-02-25 17:18:36 +01:00
|
|
|
classpath libraries.kotlinGradlePlugin
|
2019-09-03 02:31:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
google()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-01-27 19:45:25 +01:00
|
|
|
implementation libraries.supportCoreUtils
|
2020-02-25 17:18:36 +01:00
|
|
|
implementation libraries.kotlinStdLib
|
2019-10-18 18:59:04 +02:00
|
|
|
implementation libraries.v4Support
|
2020-01-27 18:56:27 +01:00
|
|
|
|
2019-09-03 02:31:51 +02:00
|
|
|
if (rootProject.findProject(":lib")) {
|
|
|
|
implementation project(":lib")
|
2019-10-18 18:59:04 +02:00
|
|
|
} else if (rootProject.findProject(":godot:lib")) {
|
|
|
|
implementation project(":godot:lib")
|
2019-09-03 02:31:51 +02:00
|
|
|
} else {
|
|
|
|
// Custom build mode. In this scenario this project is the only one around and the Godot
|
|
|
|
// library is available through the pre-generated godot-lib.*.aar android archive files.
|
|
|
|
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar', '*.aar'])
|
|
|
|
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar', '*.aar'])
|
|
|
|
}
|
2019-10-18 18:59:04 +02:00
|
|
|
|
|
|
|
// Godot prebuilt plugins
|
|
|
|
implementation fileTree(dir: 'libs/plugins', include: ["GodotPayment*.aar"])
|
|
|
|
|
|
|
|
// Godot user plugins dependencies
|
|
|
|
String pluginsDir = getGodotPluginsDirectory()
|
|
|
|
String[] pluginsBinaries = getGodotPluginsBinaries()
|
|
|
|
if (pluginsDir != null && !pluginsDir.isEmpty() &&
|
|
|
|
pluginsBinaries != null && pluginsBinaries.size() > 0) {
|
|
|
|
implementation fileTree(dir: pluginsDir, include: pluginsBinaries)
|
|
|
|
}
|
2019-09-03 02:31:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion versions.compileSdk
|
|
|
|
buildToolsVersion versions.buildTools
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
// Feel free to modify the application id to your own.
|
2019-12-13 01:52:57 +01:00
|
|
|
applicationId getExportPackageName()
|
2019-09-03 02:31:51 +02:00
|
|
|
minSdkVersion versions.minSdk
|
|
|
|
targetSdkVersion versions.targetSdk
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
disable 'MissingTranslation', 'UnusedResources'
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/NOTICE'
|
2020-03-08 12:34:44 +01:00
|
|
|
doNotStrip '**/*.so'
|
2019-09-03 02:31:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Both signing and zip-aligning will be done at export time
|
|
|
|
buildTypes.all { buildType ->
|
|
|
|
buildType.zipAlignEnabled false
|
|
|
|
buildType.signingConfig null
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
2019-10-18 18:59:04 +02:00
|
|
|
java.srcDirs = ['src']
|
|
|
|
res.srcDirs = ['res']
|
|
|
|
aidl.srcDirs = ['aidl']
|
|
|
|
assets.srcDirs = ['assets']
|
2019-09-03 02:31:51 +02:00
|
|
|
}
|
2019-10-18 18:59:04 +02:00
|
|
|
debug.jniLibs.srcDirs = ['libs/debug']
|
|
|
|
release.jniLibs.srcDirs = ['libs/release']
|
2019-09-03 02:31:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
variant.outputs.all { output ->
|
|
|
|
output.outputFileName = "android_${variant.name}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|