parent
1b06dc97ea
commit
1411b1576b
@ -1,65 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# You can control the set of applied configuration files using the
|
|
||||||
# proguardFiles setting in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
|
||||||
# debugging stack traces.
|
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
|
||||||
# hide the original source file name.
|
|
||||||
#-renamesourcefileattribute SourceFile
|
|
||||||
|
|
||||||
|
|
||||||
# Keep `Companion` object fields of serializable classes.
|
|
||||||
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
|
|
||||||
-if @kotlinx.serialization.Serializable class **
|
|
||||||
-keepclassmembers class <1> {
|
|
||||||
static <1>$Companion Companion;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keep `serializer()` on companion objects (both default and named) of serializable classes.
|
|
||||||
-if @kotlinx.serialization.Serializable class ** {
|
|
||||||
static **$* *;
|
|
||||||
}
|
|
||||||
-keepclassmembers class <1>$<3> {
|
|
||||||
kotlinx.serialization.KSerializer serializer(...);
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keep `INSTANCE.serializer()` of serializable objects.
|
|
||||||
-if @kotlinx.serialization.Serializable class ** {
|
|
||||||
public static ** INSTANCE;
|
|
||||||
}
|
|
||||||
-keepclassmembers class <1> {
|
|
||||||
public static <1> INSTANCE;
|
|
||||||
kotlinx.serialization.KSerializer serializer(...);
|
|
||||||
}
|
|
||||||
|
|
||||||
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
|
|
||||||
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
|
|
||||||
|
|
||||||
# Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`.
|
|
||||||
# If you have any, uncomment and replace classes with those containing named companion objects.
|
|
||||||
#-keepattributes InnerClasses # Needed for `getDeclaredClasses`.
|
|
||||||
#-if @kotlinx.serialization.Serializable class
|
|
||||||
#com.example.myapplication.HasNamedCompanion, # <-- List serializable classes with named companions.
|
|
||||||
#com.example.myapplication.HasNamedCompanion2
|
|
||||||
#{
|
|
||||||
# static **$* *;
|
|
||||||
#}
|
|
||||||
#-keepnames class <1>$$serializer { # -keepnames suffices; class is kept when serializer() is kept.
|
|
||||||
# static <1>$$serializer INSTANCE;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Enable protobuf-related optimizations.
|
|
||||||
-shrinkunusedprotofields
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.google.samples.apps.nowinandroid.di
|
|
||||||
|
|
||||||
import androidx.datastore.core.DataStore
|
|
||||||
import androidx.datastore.core.DataStoreFactory
|
|
||||||
import com.google.samples.apps.nowinandroid.data.UserPreferences
|
|
||||||
import com.google.samples.apps.nowinandroid.data.UserPreferencesSerializer
|
|
||||||
import com.google.samples.apps.nowinandroid.data.fake.FakeNewsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.fake.FakeTopicsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.repository.NewsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.repository.TopicsRepository
|
|
||||||
import dagger.Binds
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.Provides
|
|
||||||
import dagger.hilt.components.SingletonComponent
|
|
||||||
import dagger.hilt.testing.TestInstallIn
|
|
||||||
import javax.inject.Singleton
|
|
||||||
import kotlinx.serialization.json.Json
|
|
||||||
import org.junit.rules.TemporaryFolder
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The [TestAppModule] replaces [AppModule] during instrumentation tests. It creates test doubles
|
|
||||||
* where necessary. It also includes logic to prevent multiple data stores with the same file name
|
|
||||||
* from being created during one test execution context.
|
|
||||||
*/
|
|
||||||
@Module
|
|
||||||
@TestInstallIn(
|
|
||||||
components = [SingletonComponent::class],
|
|
||||||
replaces = [AppModule::class]
|
|
||||||
)
|
|
||||||
interface TestAppModule {
|
|
||||||
|
|
||||||
// Use a fake repository as a test double, so we don't have a network dependency.
|
|
||||||
@Binds
|
|
||||||
fun bindsTopicRepository(fakeTopicsRepository: FakeTopicsRepository): TopicsRepository
|
|
||||||
|
|
||||||
// Use a fake repository as a test double, so we don't have a network dependency.
|
|
||||||
@Binds
|
|
||||||
fun bindsNewsResourceRepository(fakeNewsRepository: FakeNewsRepository): NewsRepository
|
|
||||||
|
|
||||||
// Use the default dispatchers. For the high-level UI tests, we don't want to override these.
|
|
||||||
@Binds
|
|
||||||
fun bindsNiaDispatchers(defaultNiaDispatchers: DefaultNiaDispatchers): NiaDispatchers
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
fun providesUserPreferencesDataStore(
|
|
||||||
userPreferencesSerializer: UserPreferencesSerializer,
|
|
||||||
tmpFolder: TemporaryFolder
|
|
||||||
): DataStore<UserPreferences> {
|
|
||||||
return DataStoreFactory.create(
|
|
||||||
serializer = userPreferencesSerializer,
|
|
||||||
) {
|
|
||||||
tmpFolder.newFile("user_preferences_test.pb")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
fun providesNetworkJson(): Json = Json {
|
|
||||||
ignoreUnknownKeys = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.google.samples.apps.nowinandroid.di
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.datastore.core.DataStore
|
|
||||||
import androidx.datastore.core.DataStoreFactory
|
|
||||||
import androidx.datastore.dataStoreFile
|
|
||||||
import com.google.samples.apps.nowinandroid.data.UserPreferences
|
|
||||||
import com.google.samples.apps.nowinandroid.data.UserPreferencesSerializer
|
|
||||||
import com.google.samples.apps.nowinandroid.data.fake.FakeNewsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.fake.FakeNiANetwork
|
|
||||||
import com.google.samples.apps.nowinandroid.data.fake.FakeTopicsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.network.NiANetwork
|
|
||||||
import com.google.samples.apps.nowinandroid.data.repository.NewsRepository
|
|
||||||
import com.google.samples.apps.nowinandroid.data.repository.TopicsRepository
|
|
||||||
import dagger.Binds
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.Provides
|
|
||||||
import dagger.hilt.InstallIn
|
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
|
||||||
import dagger.hilt.components.SingletonComponent
|
|
||||||
import javax.inject.Singleton
|
|
||||||
import kotlinx.serialization.json.Json
|
|
||||||
|
|
||||||
@Module
|
|
||||||
@InstallIn(SingletonComponent::class)
|
|
||||||
interface AppModule {
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
fun bindsNiANetwork(
|
|
||||||
fakeNiANetwork: FakeNiANetwork
|
|
||||||
): NiANetwork
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
fun bindsTopicRepository(
|
|
||||||
fakeTopicsRepository: FakeTopicsRepository
|
|
||||||
): TopicsRepository
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
fun bindsNewsResourceRepository(
|
|
||||||
fakeNewsRepository: FakeNewsRepository
|
|
||||||
): NewsRepository
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
fun bindsNiaDispatchers(defaultNiaDispatchers: DefaultNiaDispatchers): NiaDispatchers
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
fun providesUserPreferencesDataStore(
|
|
||||||
@ApplicationContext context: Context,
|
|
||||||
userPreferencesSerializer: UserPreferencesSerializer
|
|
||||||
): DataStore<UserPreferences> =
|
|
||||||
DataStoreFactory.create(
|
|
||||||
serializer = userPreferencesSerializer
|
|
||||||
) {
|
|
||||||
context.dataStoreFile("user_preferences.pb")
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
fun providesNetworkJson(): Json = Json {
|
|
||||||
ignoreUnknownKeys = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.common">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
alias(libs.plugins.ksp)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
|
||||||
|
implementation libs.room.runtime
|
||||||
|
implementation libs.room.ktx
|
||||||
|
ksp libs.room.compiler
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
implementation libs.kotlinx.datetime
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.database">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-datastore')
|
||||||
|
implementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.androidx.dataStore
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
kaptAndroidTest libs.hilt.compiler
|
||||||
|
|
||||||
|
configurations.configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
// Temporary workaround for https://issuetracker.google.com/174733673
|
||||||
|
force 'org.objenesis:objenesis:2.6'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.datastore.test">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.samples.apps.nowinandroid.core.datastore.test
|
||||||
|
|
||||||
|
import androidx.datastore.core.DataStore
|
||||||
|
import androidx.datastore.core.DataStoreFactory
|
||||||
|
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferences
|
||||||
|
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferencesSerializer
|
||||||
|
import com.google.samples.apps.nowinandroid.core.datastore.di.DataStoreModule
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import dagger.hilt.testing.TestInstallIn
|
||||||
|
import javax.inject.Singleton
|
||||||
|
import org.junit.rules.TemporaryFolder
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@TestInstallIn(
|
||||||
|
components = [SingletonComponent::class],
|
||||||
|
replaces = [DataStoreModule::class]
|
||||||
|
)
|
||||||
|
object TestDataStoreModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun providesUserPreferencesDataStore(
|
||||||
|
userPreferencesSerializer: UserPreferencesSerializer,
|
||||||
|
tmpFolder: TemporaryFolder
|
||||||
|
): DataStore<UserPreferences> {
|
||||||
|
return DataStoreFactory.create(
|
||||||
|
serializer = userPreferencesSerializer,
|
||||||
|
) {
|
||||||
|
tmpFolder.newFile("user_preferences_test.pb")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
alias(libs.plugins.protobuf)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup protobuf configuration, generating lite Java and Kotlin classes
|
||||||
|
protobuf {
|
||||||
|
protoc {
|
||||||
|
artifact = libs.protobuf.protoc.get()
|
||||||
|
}
|
||||||
|
generateProtoTasks {
|
||||||
|
all().each { task ->
|
||||||
|
task.builtins {
|
||||||
|
java {
|
||||||
|
option "lite"
|
||||||
|
}
|
||||||
|
kotlin {
|
||||||
|
option "lite"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
|
||||||
|
implementation libs.androidx.dataStore
|
||||||
|
implementation libs.protobuf.kotlin.lite
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
kaptAndroidTest libs.hilt.compiler
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.datastore">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.samples.apps.nowinandroid.core.datastore.di
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.datastore.core.DataStore
|
||||||
|
import androidx.datastore.core.DataStoreFactory
|
||||||
|
import androidx.datastore.dataStoreFile
|
||||||
|
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferences
|
||||||
|
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferencesSerializer
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(SingletonComponent::class)
|
||||||
|
object DataStoreModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun providesUserPreferencesDataStore(
|
||||||
|
@ApplicationContext context: Context,
|
||||||
|
userPreferencesSerializer: UserPreferencesSerializer
|
||||||
|
): DataStore<UserPreferences> =
|
||||||
|
DataStoreFactory.create(
|
||||||
|
serializer = userPreferencesSerializer
|
||||||
|
) {
|
||||||
|
context.dataStoreFile("user_preferences.pb")
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'kotlinx-serialization'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
implementation project(':core-datastore')
|
||||||
|
implementation project(':core-network')
|
||||||
|
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
implementation libs.kotlinx.serialization.json
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.domain">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.samples.apps.nowinandroid.core.domain.di
|
||||||
|
|
||||||
|
import com.google.samples.apps.nowinandroid.core.domain.repository.FakeNewsRepository
|
||||||
|
import com.google.samples.apps.nowinandroid.core.domain.repository.FakeTopicsRepository
|
||||||
|
import com.google.samples.apps.nowinandroid.core.domain.repository.NewsRepository
|
||||||
|
import com.google.samples.apps.nowinandroid.core.domain.repository.TopicsRepository
|
||||||
|
import dagger.Binds
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(SingletonComponent::class)
|
||||||
|
interface DomainModule {
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
fun bindsTopicRepository(
|
||||||
|
fakeTopicsRepository: FakeTopicsRepository
|
||||||
|
): TopicsRepository
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
fun bindsNewsResourceRepository(
|
||||||
|
fakeNewsRepository: FakeNewsRepository
|
||||||
|
): NewsRepository
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlinx-serialization'
|
||||||
|
alias(libs.plugins.ksp)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.room.runtime
|
||||||
|
implementation libs.room.ktx
|
||||||
|
ksp libs.room.compiler
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
implementation libs.kotlinx.datetime
|
||||||
|
implementation libs.kotlinx.serialization.json
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.model">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'kotlinx-serialization'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
implementation libs.kotlinx.serialization.json
|
||||||
|
implementation libs.kotlinx.datetime
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.network">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.samples.apps.nowinandroid.core.network.di
|
||||||
|
|
||||||
|
import com.google.samples.apps.nowinandroid.core.network.DefaultNiaDispatchers
|
||||||
|
import com.google.samples.apps.nowinandroid.core.network.NiANetwork
|
||||||
|
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers
|
||||||
|
import com.google.samples.apps.nowinandroid.core.network.fake.FakeNiANetwork
|
||||||
|
import dagger.Binds
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import javax.inject.Singleton
|
||||||
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(SingletonComponent::class)
|
||||||
|
interface NetworkModule {
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
fun bindsNiANetwork(
|
||||||
|
fakeNiANetwork: FakeNiANetwork
|
||||||
|
): NiANetwork
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
fun bindsNiaDispatchers(defaultNiaDispatchers: DefaultNiaDispatchers): NiaDispatchers
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun providesNetworkJson(): Json = Json {
|
||||||
|
ignoreUnknownKeys = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-domain')
|
||||||
|
implementation project(':core-model')
|
||||||
|
|
||||||
|
api libs.junit4
|
||||||
|
api libs.mockk
|
||||||
|
api libs.androidx.test.core
|
||||||
|
api libs.kotlinx.coroutines.test
|
||||||
|
api libs.turbine
|
||||||
|
|
||||||
|
api libs.androidx.test.espresso.core
|
||||||
|
api libs.androidx.test.runner
|
||||||
|
api libs.androidx.test.rules
|
||||||
|
api libs.androidx.compose.ui.test
|
||||||
|
api libs.hilt.android.testing
|
||||||
|
|
||||||
|
debugApi libs.androidx.compose.ui.testManifest
|
||||||
|
|
||||||
|
configurations.configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
// Temporary workaround for https://issuetracker.google.com/174733673
|
||||||
|
force 'org.objenesis:objenesis:2.6'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.testing">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
compose true
|
||||||
|
}
|
||||||
|
composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion libs.versions.androidxCompose.get()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
|
||||||
|
implementation libs.androidx.core.ktx
|
||||||
|
implementation libs.kotlinx.datetime
|
||||||
|
|
||||||
|
api libs.androidx.compose.foundation.layout
|
||||||
|
// TODO (M3): Remove this dependency when all components are available
|
||||||
|
api libs.androidx.compose.material
|
||||||
|
api libs.androidx.compose.material.iconsExtended
|
||||||
|
api libs.androidx.compose.material3
|
||||||
|
debugApi libs.androidx.compose.ui.tooling
|
||||||
|
api libs.androidx.compose.ui.tooling.preview
|
||||||
|
api libs.androidx.compose.ui.util
|
||||||
|
api libs.androidx.compose.runtime
|
||||||
|
api libs.androidx.compose.runtime.livedata
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.core.ui">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright 2021 Google LLC
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<string name="bookmark">Bookmark</string>
|
||||||
|
<string name="unbookmark">Unbookmark</string>
|
||||||
|
</resources>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
|
||||||
|
testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
compose true
|
||||||
|
}
|
||||||
|
composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion libs.versions.androidxCompose.get()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
implementation project(':core-ui')
|
||||||
|
implementation project(':core-domain')
|
||||||
|
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
androidTestImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
|
||||||
|
implementation libs.androidx.hilt.navigation.compose
|
||||||
|
implementation libs.androidx.lifecycle.viewModelCompose
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
|
||||||
|
// androidx.test is forcing JUnit, 4.12. This forces it to use 4.13
|
||||||
|
configurations.configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
force libs.junit4
|
||||||
|
// Temporary workaround for https://issuetracker.google.com/174733673
|
||||||
|
force 'org.objenesis:objenesis:2.6'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.feature.following">
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright 2022 Google LLC
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<string name="following">Following</string>
|
||||||
|
<string name="following_loading">Loading topics</string>
|
||||||
|
<string name="following_error_header">"Error loading topics"</string>
|
||||||
|
<string name="following_topic_card_icon_content_desc">Topic icon</string>
|
||||||
|
<string name="following_topic_card_follow_button_content_desc">Follow Topic button</string>
|
||||||
|
<string name="following_topic_card_unfollow_button_content_desc">Unfollow Topic button</string>
|
||||||
|
</resources>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk buildConfig.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk buildConfig.minSdk
|
||||||
|
targetSdk buildConfig.targetSdk
|
||||||
|
|
||||||
|
testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
compose true
|
||||||
|
}
|
||||||
|
composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion libs.versions.androidxCompose.get()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':core-model')
|
||||||
|
implementation project(':core-ui')
|
||||||
|
implementation project(':core-domain')
|
||||||
|
|
||||||
|
testImplementation project(':core-testing')
|
||||||
|
androidTestImplementation project(':core-testing')
|
||||||
|
|
||||||
|
implementation libs.kotlinx.coroutines.android
|
||||||
|
|
||||||
|
implementation libs.androidx.hilt.navigation.compose
|
||||||
|
implementation libs.androidx.lifecycle.viewModelCompose
|
||||||
|
|
||||||
|
implementation libs.accompanist.flowlayout
|
||||||
|
|
||||||
|
implementation libs.hilt.android
|
||||||
|
kapt libs.hilt.compiler
|
||||||
|
|
||||||
|
// androidx.test is forcing JUnit, 4.12. This forces it to use 4.13
|
||||||
|
configurations.configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
force libs.junit4
|
||||||
|
// Temporary workaround for https://issuetracker.google.com/174733673
|
||||||
|
force 'org.objenesis:objenesis:2.6'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.google.samples.apps.nowinandroid.feature.foryou">
|
||||||
|
|
||||||
|
</manifest>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue