97 lines
3.0 KiB
Groovy
97 lines
3.0 KiB
Groovy
plugins {
|
|
id "com.android.application"
|
|
id "kotlin-android"
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id "dev.flutter.flutter-gradle-plugin"
|
|
}
|
|
|
|
def localProperties = new Properties()
|
|
def localPropertiesFile = rootProject.file("local.properties")
|
|
if (localPropertiesFile.exists()) {
|
|
localPropertiesFile.withReader("UTF-8") { reader ->
|
|
localProperties.load(reader)
|
|
}
|
|
}
|
|
|
|
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
|
|
if (flutterVersionCode == null) {
|
|
flutterVersionCode = "1"
|
|
}
|
|
|
|
def flutterVersionName = localProperties.getProperty("flutter.versionName")
|
|
if (flutterVersionName == null) {
|
|
flutterVersionName = "1.0"
|
|
}
|
|
|
|
android {
|
|
namespace = "me.movenext.bang_navigator"
|
|
compileSdk = 35
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '17'
|
|
}
|
|
|
|
defaultConfig {
|
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
applicationId = "me.movenext.bang_navigator"
|
|
// https://api.flutter.dev/flutter/widgets/AndroidView-class.html
|
|
//https://inappwebview.dev/docs/intro/#setup-android
|
|
minSdk = 23
|
|
targetSdk = 35
|
|
versionCode = flutterVersionCode.toInteger()
|
|
versionName = flutterVersionName
|
|
}
|
|
|
|
dependencies {
|
|
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
// implementation 'androidx.glance:glance-appwidget:1.0.0'
|
|
implementation 'com.google.android.material:material:1.12.0'
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
keyAlias System.getenv("KEY_ALIAS")
|
|
keyPassword System.getenv("KEY_PASSWORD")
|
|
storeFile System.getenv("KEY_PATH") ? file(System.getenv("KEY_PATH")) : null
|
|
storePassword System.getenv("KEY_PASSWORD")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// TODO: Add your own signing config for the release build.
|
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
signingConfig = signingConfigs.release
|
|
}
|
|
}
|
|
|
|
//Exclude dependenciesInfo for f-droid
|
|
dependenciesInfo {
|
|
// Disables dependency metadata when building APKs.
|
|
includeInApk = false
|
|
// Disables dependency metadata when building Android App Bundles.
|
|
includeInBundle = false
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|
|
|
|
//Override version code for f-droid
|
|
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
|
import com.android.build.OutputFile
|
|
android.applicationVariants.all { variant ->
|
|
variant.outputs.each { output ->
|
|
def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
|
|
if (abiVersionCode != null) {
|
|
output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode
|
|
}
|
|
}
|
|
} |