diff options
Diffstat (limited to 'sample/build.gradle')
-rw-r--r-- | sample/build.gradle | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/sample/build.gradle b/sample/build.gradle index 47baed2..ff25f50 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,9 +1,14 @@ import kau.Dependencies +import kau.Versions apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-kapt' +apply plugin: 'kotlin-parcelize' +//apply plugin: 'com.bugsnag.android.gradle' apply plugin: 'com.github.triplet.play' +apply plugin: 'dagger.hilt.android.plugin' +apply plugin: 'com.mikepenz.aboutlibraries.plugin' play { serviceAccountCredentials = file('../files/gplay-keys.json') @@ -11,8 +16,7 @@ play { } android { - compileSdkVersion kau.Versions.targetSdk - buildToolsVersion kau.Versions.buildTools + compileSdkVersion Versions.targetSdk androidGitVersion { codeFormat = 'MMNNPPXX' @@ -21,15 +25,15 @@ android { defaultConfig { applicationId "ca.allanwang.kau.sample" - minSdkVersion kau.Versions.minSdk - targetSdkVersion kau.Versions.targetSdk + minSdkVersion Versions.minSdk + targetSdkVersion Versions.targetSdk versionName androidGitVersion.name() versionCode androidGitVersion.code() multiDexEnabled true - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "ca.allanwang.kau.sample.SampleTestRunner" } viewBinding { - enabled = true + enabled true } def releaseSigning = file("../files/kau.properties") @@ -63,6 +67,7 @@ android { versionNameSuffix "-debug" signingConfig signingConfigs.debug resValue "string", "app_name", "KAU Debug" + ext.enableBugsnag = false } release { @@ -82,11 +87,16 @@ android { pickFirst 'META-INF/core_release.kotlin_module' pickFirst 'META-INF/library_release.kotlin_module' pickFirst 'META-INF/library-core_release.kotlin_module' + exclude "**/module-info.class" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility Versions.java + targetCompatibility Versions.java + } + + kotlinOptions { + jvmTarget = Versions.java.toString() } sourceSets { @@ -96,25 +106,15 @@ android { main.res.srcDirs += 'src/main/res-public' } - testOptions.unitTests { - // Don't throw runtime exceptions for android calls that are not mocked - returnDefaultValues = true - - // Always show the result of every unit test, even if it passes. - all { - testLogging { - events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' - } - } - } + testOptions { + unitTests { + // Don't throw runtime exceptions for android calls that are not mocked + returnDefaultValues = true - // See https://github.com/facebook/flipper/issues/146 - configurations.all { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - def requested = details.requested - if (requested.group == "com.android.support") { - if (!requested.name.startsWith("multidex")) { - details.useVersion "26.+" + // Always show the result of every unit test, even if it passes. + all { + testLogging { + events 'skipped', 'failed', 'standardOut', 'standardError' } } } @@ -132,10 +132,17 @@ dependencies { implementation project(':searchview') implementation project(':mediapicker') + implementation Dependencies.hilt + kapt Dependencies.hiltCompiler + + implementation Dependencies.bugsnag + implementation Dependencies.materialDialog("input") testImplementation Dependencies.kotlinTest testImplementation Dependencies.junit + testImplementation Dependencies.hiltTest + kaptTest Dependencies.hiltCompiler androidTestImplementation Dependencies.kotlinTest androidTestImplementation Dependencies.espresso @@ -143,4 +150,6 @@ dependencies { androidTestImplementation Dependencies.espresso("contrib") androidTestImplementation Dependencies.testRules androidTestImplementation Dependencies.testRunner + androidTestImplementation Dependencies.hiltTest + kaptAndroidTest Dependencies.hiltCompiler } |