import java.util.regex.Pattern
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")
}
// The local key file is deliberately outside the tracked app sources. It is
// read only while Gradle builds the native manifest and never returned by the
// WordPress public configuration endpoint.
val googleMapsKeyFile = rootProject.file("../../../../mapsapikey.md")
val googleMapsApiKey = if (googleMapsKeyFile.isFile) {
Pattern.compile("AIza[0-9A-Za-z_-]{20,}")
.matcher(googleMapsKeyFile.readText())
.takeIf { it.find() }
?.group()
.orEmpty()
} else {
""
}
android {
namespace = "de.meinweimar.consumer_app"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "de.meinweimar.consumer_app"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
manifestPlaceholders["googleMapsApiKey"] = googleMapsApiKey
}
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.getByName("debug")
}
}
}
flutter {
source = "../.."
}
