| apply plugin: 'com.android.application' |
| apply plugin: 'com.facebook.testing.screenshot' |
| |
| def leakcanary_version = '2.7' |
| |
| screenshots { |
| failureDir = "${rootProject.buildDir}/reports/diff_failures" |
| recordDir = "${rootProject.projectDir}/reports/screenshots" |
| } |
| |
| android { |
| lintOptions { |
| abortOnError true |
| checkAllWarnings true |
| showAll true |
| warningsAsErrors true |
| checkTestSources true |
| htmlReport false |
| xmlReport true |
| xmlOutput file("${rootProject.buildDir}/reports/lint-results.xml") |
| // UnpackedNativeCode can break stack unwinding - see b/193408481 |
| // NewerVersionAvailable and GradleDependency need to be taken care of |
| // by a roller rather than as part of CI. |
| // The others are irrelevant for a test application. |
| disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable','Registered' |
| } |
| compileSdkVersion 30 |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_8 |
| targetCompatibility JavaVersion.VERSION_1_8 |
| } |
| defaultConfig { |
| applicationId 'dev.flutter.scenarios' |
| minSdkVersion 18 |
| targetSdkVersion 30 |
| versionCode 1 |
| versionName '1.0' |
| testInstrumentationRunner 'dev.flutter.TestRunner' |
| testInstrumentationRunnerArgument 'listener', 'leakcanary.FailTestOnLeakRunListener' |
| testInstrumentationRunnerArguments clearPackageData: 'true' |
| } |
| buildTypes { |
| release { |
| minifyEnabled false |
| proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| } |
| } |
| sourceSets.main { |
| assets.srcDirs += "${project.buildDir}/assets" |
| if (project.hasProperty('libapp')) { |
| jni.srcDirs = [] |
| jniLibs.srcDirs = [project.property('libapp')] |
| } |
| } |
| } |
| |
| dependencies { |
| if (project.hasProperty('flutter_jar')) { |
| implementation files(project.property('flutter_jar')) |
| } |
| implementation 'com.facebook.testing.screenshot:layout-hierarchy-common:0.12.0' |
| implementation 'androidx.appcompat:appcompat:1.1.0' |
| implementation 'androidx.constraintlayout:constraintlayout:1.1.3' |
| implementation 'com.google.android.material:material:1.0.0' |
| implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0-alpha01' |
| implementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version" |
| implementation 'com.google.guava:guava:28.1-android' |
| testImplementation 'junit:junit:4.12' |
| androidTestImplementation 'androidx.test:runner:1.2.0' |
| androidTestImplementation 'androidx.test:rules:1.2.0' |
| androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' |
| androidTestImplementation "com.squareup.leakcanary:leakcanary-android-instrumentation:$leakcanary_version" |
| } |
| |
| tasks.register('generateLockfiles') { |
| rootProject.subprojects.each { subproject -> |
| def gradlew = "${rootProject.projectDir}/gradlew" |
| rootProject.exec { |
| workingDir rootProject.projectDir |
| executable gradlew |
| args ":${subproject.name}:dependencies", "--write-locks" |
| } |
| } |
| } |