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") } android { namespace = "com.example.smol_mail" compileSdk = flutter.compileSdkVersion ndkVersion = "27.0.12077973" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } signingConfigs { create("release") { storeFile = file(System.getenv("KEYSTORE_PATH") ?: "debug.jks") storePassword = System.getenv("STORE_PASSWORD") ?: "" keyAlias = System.getenv("KEY_ALIAS") ?: "" keyPassword = System.getenv("KEY_PASSWORD") ?: "" } } defaultConfig { applicationId = "com.app.smol_mail" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName // The Android Test Orchestrator (with clearPackageData) wipes the // integration flavor's app data between test runs, and the flavor // installs it beside — never over — the real app, so every patrol run // starts at onboarding with a fresh identity. testInstrumentationRunner = "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments["clearPackageData"] = "true" } testOptions { execution = "ANDROIDX_TEST_ORCHESTRATOR" } flavorDimensions += "test" productFlavors { // The real app: the identity the alpha testers hold, no suffix. // With a flavor dimension every build must name its flavor, so // shipping builds are `flutter build apk --flavor prod`. create("prod") { dimension = "test" } // The patrol test app, installed beside — never over — the real one. create("integration") { dimension = "test" applicationIdSuffix = ".integration" versionNameSuffix = "-integration" } } buildTypes { release { signingConfig = signingConfigs.getByName( if (System.getenv("KEYSTORE_PATH") != null) "release" else "debug" ) isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } } flutter { source = "../.." } dependencies { // The orchestrator referenced by testOptions.execution above. The patrol // native library itself comes from the patrol pub package's android // module (a plugin subproject), not from a Maven artifact. androidTestUtil("androidx.test:orchestrator:1.5.1") }