aboutsummaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-04-17 15:32:32 -0700
committerGitHub <noreply@github.com>2021-04-17 15:32:32 -0700
commit12f4725a90762aeeca8936b6449445e800b2f09a (patch)
tree584d1347abf542361c327519942080c75c16a889 /sample
parent3ec75195a25f6e502ceca7a89aa66f6313e263e6 (diff)
parent1057b6a113c7b2fa1320ce0378e34484f901ee2f (diff)
downloadkau-12f4725a90762aeeca8936b6449445e800b2f09a.tar.gz
kau-12f4725a90762aeeca8936b6449445e800b2f09a.tar.bz2
kau-12f4725a90762aeeca8936b6449445e800b2f09a.zip
Merge pull request #261 from AllanWang/versions
Diffstat (limited to 'sample')
-rw-r--r--sample/build.gradle11
-rw-r--r--sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt2
-rw-r--r--sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt4
-rw-r--r--sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt9
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt6
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml6
6 files changed, 23 insertions, 15 deletions
diff --git a/sample/build.gradle b/sample/build.gradle
index a39ee2d..9f2162f 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -3,7 +3,7 @@ import kau.Dependencies
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
-apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-parcelize'
//apply plugin: 'com.bugsnag.android.gradle'
apply plugin: 'com.github.triplet.play'
apply plugin: 'dagger.hilt.android.plugin'
@@ -31,8 +31,8 @@ android {
multiDexEnabled true
testInstrumentationRunner "ca.allanwang.kau.sample.SampleTestRunner"
}
- buildFeatures {
- viewBinding = true
+ viewBinding {
+ enabled true
}
def releaseSigning = file("../files/kau.properties")
@@ -86,6 +86,7 @@ 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 {
@@ -148,6 +149,6 @@ dependencies {
androidTestImplementation Dependencies.espresso("contrib")
androidTestImplementation Dependencies.testRules
androidTestImplementation Dependencies.testRunner
- testImplementation Dependencies.hiltTest
- kaptTest Dependencies.hiltCompiler
+ androidTestImplementation Dependencies.hiltTest
+ kaptAndroidTest Dependencies.hiltCompiler
}
diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
index cc45b4e..fb360b9 100644
--- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
+++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
@@ -28,7 +28,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import ca.allanwang.kau.sample.test.BaseTest
import dagger.hilt.android.testing.HiltAndroidTest
-import dagger.hilt.android.testing.UninstallModules
import javax.inject.Inject
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -50,7 +49,6 @@ import org.junit.runner.RunWith
*/
@RunWith(AndroidJUnit4::class)
@HiltAndroidTest
-@UninstallModules(PrefFactoryModule::class)
class KPrefViewTest : BaseTest() {
val activity: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java)
diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt
index 89e74c7..f6ffdb1 100644
--- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt
+++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt
@@ -22,8 +22,8 @@ import androidx.test.runner.AndroidJUnitRunner
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.android.EntryPointAccessors
-import dagger.hilt.android.components.ApplicationComponent
import dagger.hilt.android.testing.HiltTestApplication
+import dagger.hilt.components.SingletonComponent
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
@@ -41,7 +41,7 @@ class SampleTestRunner : AndroidJUnitRunner() {
class SampleTestRule : TestRule {
@EntryPoint
- @InstallIn(ApplicationComponent::class)
+ @InstallIn(SingletonComponent::class)
interface SampleTestRuleEntryPoint {
fun pref(): KPrefSample
}
diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt
index 74da014..1615d2f 100644
--- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt
+++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt
@@ -17,13 +17,16 @@ package ca.allanwang.kau.sample.test
import ca.allanwang.kau.kpref.KPrefFactory
import ca.allanwang.kau.kpref.KPrefFactoryInMemory
+import ca.allanwang.kau.sample.PrefFactoryModule
import dagger.Module
import dagger.Provides
-import dagger.hilt.InstallIn
-import dagger.hilt.android.components.ApplicationComponent
+import dagger.hilt.components.SingletonComponent
+import dagger.hilt.testing.TestInstallIn
@Module
-@InstallIn(ApplicationComponent::class)
+@TestInstallIn(
+ components = [SingletonComponent::class],
+ replaces = [PrefFactoryModule::class])
object PrefFactoryTestModule {
@Provides
fun factory(): KPrefFactory = KPrefFactoryInMemory
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
index ee39184..970d3eb 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
@@ -23,8 +23,8 @@ import ca.allanwang.kau.kpref.KPrefFactoryAndroid
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
-import dagger.hilt.android.components.ApplicationComponent
import dagger.hilt.android.qualifiers.ApplicationContext
+import dagger.hilt.components.SingletonComponent
/**
* Created by Allan Wang on 2017-06-07.
@@ -44,14 +44,14 @@ class KPrefSample(factory: KPrefFactory) : KPref("pref_sample", factory = factor
}
@Module
-@InstallIn(ApplicationComponent::class)
+@InstallIn(SingletonComponent::class)
object PrefModule {
@Provides
fun pref(factory: KPrefFactory): KPrefSample = KPrefSample(factory)
}
@Module
-@InstallIn(ApplicationComponent::class)
+@InstallIn(SingletonComponent::class)
object PrefFactoryModule {
@Provides
fun factory(@ApplicationContext context: Context): KPrefFactory = KPrefFactoryAndroid(context)
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index e88d697..c1648b0 100644
--- a/sample/src/main/res/xml/kau_changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -6,6 +6,12 @@
<item text="" />
-->
+ <version title="v6.2.0" />
+ <item text="Add support for Android 4.2" />
+ <item text="Remove all usages of kotlin synthetics" />
+ <item text="Many version bumps" />
+ <item text="Added Hilt dep" />
+
<version title="v6.1.0" />
<item text="Add support for Android 4.1 RC03" />
<item text="Breaking: Updated iconics, buganizer, and spotless dependencies (major version bump)" />