Files
deflock-app/android/app/build.gradle.kts
Doug Borg b6bcd23667 chore(android): bump Dart SDK floor, desugar_jdk_libs, and fix Kotlin DSL deprecation
- Bump Dart SDK constraint from >=3.8.0 to >=3.10.3 to match resolved dependency floor
- Upgrade desugar_jdk_libs from 2.0.4 to 2.1.5 (adds Stream.toList(), better locale support)
- Migrate deprecated kotlinOptions { jvmTarget } to kotlin { compilerOptions { jvmTarget } }
- Remove stale comments and non-breaking space characters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 15:32:00 -07:00

80 lines
2.2 KiB
Kotlin

import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
id("kotlin-android")
// Flutter plugin *must* be applied last.
id("dev.flutter.flutter-gradle-plugin")
}
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android {
namespace = "me.deflock.deflockapp"
compileSdk = 36
// NDK only needed if you build native plugins; keep your pinned version
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
defaultConfig {
// Application ID (package name)
applicationId = "me.deflock.deflockapp"
// oauth2_client 4.x & flutter_web_auth_2 5.x require minSdk 23
minSdk = maxOf(flutter.minSdkVersion, 23)
targetSdk = 36
// Flutter tool injects these during `flutter build`
versionCode = flutter.versionCode
versionName = flutter.versionName
}
signingConfigs {
if (keystorePropertiesFile.exists()) {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
}
}
}
buildTypes {
release {
if (keystorePropertiesFile.exists()) {
signingConfig = signingConfigs.getByName("release")
} else {
// Fall back to debug signing for development builds
signingConfig = signingConfigs.getByName("debug")
}
}
}
}
flutter {
// Path up to the Flutter project directory
source = "../.."
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}