apply plugin: 'com.android.application' apply plugin: 'com.osacky.fladle' android { compileSdk = 33 namespace = "com.osacky.flank.gradle.sample" defaultConfig { applicationId "com.osacky.flank.gradle.sample" minSdk 23 targetSdk 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } testOptions { execution 'ANDROIDX_TEST_ORCHESTRATOR' } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } } java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } fladle { async = true flankVersion = "23.+" serviceAccountCredentials = project.layout.projectDirectory.file("flank-gradle-5cf02dc90531.json") // Project Id is not needed if serviceAccountCredentials are set. // projectId("flank-gradle") useOrchestrator = true environmentVariables = [ "clearPackageData": "true" ] testTargets = [ "class com.osacky.flank.gradle.sample.ExampleInstrumentedTest#seeView" ] devices = [ [ "model": "SmallPhone.arm", "version": "26" ], [ "model": "MediumPhone.arm", "version": "33" ] ] localResultsDir = "foo" smartFlankGcsPath = "gs://test-lab-yr9w6qsdvy45q-iurp80dm95h8a/flank/test_app_android.xml" configs { oranges { // Cannot use = syntax: https://github.com/gradle/gradle/issues/9987 useOrchestrator.set(false) testTargets.set(project.provider { [ "class com.osacky.flank.gradle.sample.ExampleInstrumentedTest#runAndFail" ] }) flakyTestAttempts.set(3) } additionalTests { useOrchestrator.set(false) testTargets.set(project.provider { [ "class com.osacky.flank.gradle.sample.ExampleInstrumentedTest#runAndFail" ] }) flakyTestAttempts.set(3) additionalTestApks.value(project.provider { [ "app: ../main/app/build/output/apk/debug/app.apk", "test: ../main/app/build/output/apk/androidTest/debug/app-test.apk", "app: ../sample/app/build/output/apk/debug/sample-app.apk", "test: ../sample/app/build/output/apk/androidTest/debug/sample-app-test.apk", "test: ../feature/room/build/output/apk/androidTest/debug/feature-room-test.apk", "test: ../library/databases/build/output/apk/androidTest/debug/sample-databases-test.apk" ]}) } perfTests { devices.set([[ "model" : "SmallPhone.arm", "version" : "28" ], ["model" : "MediumPhone.arm", "version": "33"]]) testTargets.set([ "class com.sample.MyPerformanceTest" ]) } regressionTests { devices.set([[ "model" : "SmallPhone.arm", "version" : "28" ]]) testTargets.set([ "class com.sample.MyRegressionTest" ]) } } flakyTestAttempts = 1 } fulladleModuleConfig { clientDetails = [ "test-type": "PR", "build-number": "132" ] } dependencies { implementation(libs.appcompat) implementation(libs.navigation.fragment.ktx) implementation(libs.constraintlayout) testImplementation(libs.junit) androidTestImplementation(libs.androidx.test.rules) androidTestImplementation(libs.androidx.test.ext.junit) androidTestImplementation(libs.espresso.core) }