tauri/tooling/cli/templates/mobile/android/app/build.gradle.kts
AHQ bfc49cc7a1
refactor(android): Remove targetSdk from gradle config (#10558)
* refactor: remove targetSdk as it is being removed in DSL 9.0

* note

* fix: typo

* update: changelog

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-08-11 07:06:14 -03:00

74 lines
2.2 KiB
Plaintext

import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
{{~#each android-app-plugins}}
id("{{this}}"){{/each}}
}
val tauriProperties = Properties().apply {
val propFile = file("tauri.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}
android {
compileSdk = 34
namespace = "{{reverse-domain app.identifier}}"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "{{reverse-domain app.identifier}}"
minSdk = {{android.min-sdk-version}}
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging {
{{~#each abi-list}}
jniLibs.keepDebugSymbols.add("*/{{this}}/*.so")
{{/each}}
}
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
}
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
}
rust {
rootDirRel = "{{root-dir-rel}}"
}
dependencies {
{{~#each android-app-dependencies-platform}}
implementation(platform("{{this}}")){{/each}}
{{~#each android-app-dependencies}}
implementation("{{this}}"){{/each}}
implementation("androidx.webkit:webkit:1.6.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")