2021-06-25 15:45:16 +02:00
|
|
|
// Gradle build config for Godot Engine's Android port.
|
2022-05-31 20:10:15 +02:00
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
}
|
2021-06-25 15:45:16 +02:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation libraries.kotlinStdLib
|
|
|
|
implementation libraries.androidxFragment
|
|
|
|
implementation project(":lib")
|
2022-06-01 08:26:03 +02:00
|
|
|
|
|
|
|
implementation "androidx.window:window:1.0.0"
|
2021-06-25 15:45:16 +02:00
|
|
|
}
|
|
|
|
|
2022-09-12 06:33:17 +02:00
|
|
|
ext {
|
|
|
|
// Build number added as a suffix to the version code, and incremented for each build/upload to
|
|
|
|
// the Google Play store.
|
|
|
|
// This should be reset on each stable release of Godot.
|
|
|
|
editorBuildNumber = 0
|
|
|
|
// Value by which the Godot version code should be offset by to make room for the build number
|
|
|
|
editorBuildNumberOffset = 100
|
|
|
|
}
|
|
|
|
|
|
|
|
def generateVersionCode() {
|
|
|
|
int libraryVersionCode = getGodotLibraryVersionCode()
|
|
|
|
return (libraryVersionCode * editorBuildNumberOffset) + editorBuildNumber
|
|
|
|
}
|
|
|
|
|
|
|
|
def generateVersionName() {
|
|
|
|
String libraryVersionName = getGodotLibraryVersionName()
|
|
|
|
return libraryVersionName + ".$editorBuildNumber"
|
|
|
|
}
|
|
|
|
|
2021-06-25 15:45:16 +02:00
|
|
|
android {
|
|
|
|
compileSdkVersion versions.compileSdk
|
|
|
|
buildToolsVersion versions.buildTools
|
|
|
|
ndkVersion versions.ndkVersion
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
// The 'applicationId' suffix allows to install Godot 3.x(v3) and 4.x(v4) on the same device
|
|
|
|
applicationId "org.godotengine.editor.v4"
|
2022-09-12 06:33:17 +02:00
|
|
|
versionCode generateVersionCode()
|
|
|
|
versionName generateVersionName()
|
2021-06-25 15:45:16 +02:00
|
|
|
minSdkVersion versions.minSdk
|
2021-07-11 03:39:31 +02:00
|
|
|
targetSdkVersion versions.targetSdk
|
2021-06-25 15:45:16 +02:00
|
|
|
|
|
|
|
missingDimensionStrategy 'products', 'editor'
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility versions.javaVersion
|
|
|
|
targetCompatibility versions.javaVersion
|
|
|
|
}
|
|
|
|
|
2022-05-31 20:10:15 +02:00
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = versions.javaVersion
|
|
|
|
}
|
|
|
|
|
2021-06-25 15:45:16 +02:00
|
|
|
buildTypes {
|
|
|
|
dev {
|
|
|
|
initWith debug
|
|
|
|
applicationIdSuffix ".dev"
|
|
|
|
}
|
|
|
|
|
|
|
|
debug {
|
|
|
|
initWith release
|
|
|
|
|
|
|
|
// Need to swap with the release signing config when this is ready for public release.
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
}
|
|
|
|
|
|
|
|
release {
|
|
|
|
// This buildtype is disabled below.
|
|
|
|
// The editor can't be used with target=release only, as debugging tools are then not
|
|
|
|
// included, and it would crash on errors instead of reporting them.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
// 'doNotStrip' is enabled for development within Android Studio
|
|
|
|
if (shouldNotStrip()) {
|
|
|
|
doNotStrip '**/*.so'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Disable 'release' buildtype.
|
|
|
|
// The editor can't be used with target=release only, as debugging tools are then not
|
|
|
|
// included, and it would crash on errors instead of reporting them.
|
|
|
|
variantFilter { variant ->
|
|
|
|
if (variant.buildType.name == "release") {
|
|
|
|
setIgnore(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
variant.outputs.all { output ->
|
|
|
|
def suffix = variant.name == "dev" ? "_dev" : ""
|
|
|
|
output.outputFileName = "android_editor${suffix}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|