diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 22ffc66..ac18d15 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -12,6 +12,8 @@
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 1ac20e3..1cdec58 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -63,8 +63,12 @@ spotless {
ext {
dagger = "2.27"
+ room = "2.2.6"
+ glide = "4.11.0"
}
dependencies {
+ implementation project(path: ':di')
+ implementation project(path: ':dummy')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.3.0-alpha02"
@@ -75,8 +79,17 @@ dependencies {
implementation "com.google.dagger:dagger-android-support:$dagger"
implementation "org.jetbrains.anko:anko-commons:0.10.4"
-
// Dagger
kapt "com.google.dagger:dagger-android-processor:$dagger"
kapt "com.google.dagger:dagger-compiler:$dagger"
+
+ // Room
+ implementation "androidx.room:room-runtime:$room"
+ implementation "androidx.room:room-rxjava2:$room"
+ implementation "androidx.room:room-ktx:$room"
+ kapt "androidx.room:room-compiler:$room"
+
+ // Glide
+ implementation "com.github.bumptech.glide:glide:$glide"
+ kapt "com.github.bumptech.glide:compiler:$glide"
}
diff --git a/app/src/main/java/io/avs/android/GlobalGlideModule.kt b/app/src/main/java/io/avs/android/GlobalGlideModule.kt
new file mode 100644
index 0000000..423bb11
--- /dev/null
+++ b/app/src/main/java/io/avs/android/GlobalGlideModule.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2018 DuckDuckGo
+ *
+ * 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
+ *
+ * http://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 io.avs.android
+
+import com.bumptech.glide.annotation.GlideModule
+import com.bumptech.glide.module.AppGlideModule
+
+@GlideModule
+class GlobalGlideModule : AppGlideModule()
diff --git a/app/src/main/java/io/avs/android/di/AppComponent.kt b/app/src/main/java/io/avs/android/di/AppComponent.kt
index 0cfc9be..8285dab 100644
--- a/app/src/main/java/io/avs/android/di/AppComponent.kt
+++ b/app/src/main/java/io/avs/android/di/AppComponent.kt
@@ -23,12 +23,16 @@ import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import io.avs.android.App
import io.avs.android.di.scopes.AppScope
+import io.avs.dummy.DummyModule
import javax.inject.Singleton
@Singleton
@MergeComponent(
scope = AppScope::class,
- modules = [AndroidSupportInjectionModule::class]
+ modules = [
+ AndroidSupportInjectionModule::class,
+ DummyModule::class
+ ]
)
interface AppComponent : AndroidInjector {
@Component.Builder
diff --git a/di/.gitignore b/di/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/di/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/di/build.gradle b/di/build.gradle
new file mode 100644
index 0000000..71b1a42
--- /dev/null
+++ b/di/build.gradle
@@ -0,0 +1,44 @@
+plugins {
+ id 'com.android.library'
+ id 'kotlin-android'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.1"
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+}
+
+dependencies {
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation 'androidx.core:core-ktx:1.3.2'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+}
\ No newline at end of file
diff --git a/di/consumer-rules.pro b/di/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/di/proguard-rules.pro b/di/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/di/proguard-rules.pro
@@ -0,0 +1,21 @@
+# 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
\ No newline at end of file
diff --git a/di/src/main/AndroidManifest.xml b/di/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..5b6f5bb
--- /dev/null
+++ b/di/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/io/avs/android/di/scopes/AppScope.kt b/di/src/main/java/io/avs/android/di/scopes/AppScope.kt
similarity index 100%
rename from app/src/main/java/io/avs/android/di/scopes/AppScope.kt
rename to di/src/main/java/io/avs/android/di/scopes/AppScope.kt
diff --git a/app/src/main/java/io/avs/android/di/scopes/MainScope.kt b/di/src/main/java/io/avs/android/di/scopes/MainScope.kt
similarity index 100%
rename from app/src/main/java/io/avs/android/di/scopes/MainScope.kt
rename to di/src/main/java/io/avs/android/di/scopes/MainScope.kt
diff --git a/dummy/.gitignore b/dummy/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/dummy/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/dummy/build.gradle b/dummy/build.gradle
new file mode 100644
index 0000000..d4a6bca
--- /dev/null
+++ b/dummy/build.gradle
@@ -0,0 +1,66 @@
+plugins {
+ id 'com.android.library'
+ id 'kotlin-android'
+// id 'com.squareup.anvil'
+ id 'kotlin-kapt'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.1"
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+}
+
+ext {
+ dagger = "2.27"
+ room = "2.2.6"
+}
+
+dependencies {
+ implementation project(path: ':di')
+
+ implementation "com.jakewharton.timber:timber:4.7.1"
+
+ // Dagger
+ implementation "com.google.dagger:dagger-android:$dagger"
+ implementation "com.google.dagger:dagger-android-support:$dagger"
+ kapt "com.google.dagger:dagger-android-processor:$dagger"
+ kapt "com.google.dagger:dagger-compiler:$dagger"
+
+ // Room
+ implementation "androidx.room:room-runtime:$room"
+ implementation "androidx.room:room-rxjava2:$room"
+ implementation "androidx.room:room-ktx:$room"
+ kapt "androidx.room:room-compiler:$room"
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation 'androidx.core:core-ktx:1.3.2'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+}
\ No newline at end of file
diff --git a/dummy/consumer-rules.pro b/dummy/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/dummy/proguard-rules.pro b/dummy/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/dummy/proguard-rules.pro
@@ -0,0 +1,21 @@
+# 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
\ No newline at end of file
diff --git a/dummy/src/main/AndroidManifest.xml b/dummy/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c4e41b7
--- /dev/null
+++ b/dummy/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/dummy/src/main/java/io/avs/dummy/DummyModule.kt b/dummy/src/main/java/io/avs/dummy/DummyModule.kt
new file mode 100644
index 0000000..f8686c9
--- /dev/null
+++ b/dummy/src/main/java/io/avs/dummy/DummyModule.kt
@@ -0,0 +1,25 @@
+package io.avs.dummy
+
+import dagger.Module
+import dagger.Provides
+import timber.log.Timber
+import javax.inject.Singleton
+
+//@ContributesTo(
+// scope = AppScope::class
+//)
+@Module
+//@MergeModules(
+// scope = AppScope::class
+//)
+class DummyModule {
+ @Provides
+ @Singleton
+ fun provideDummy() = Dummy()
+}
+
+class Dummy {
+ fun dummy() {
+ Timber.d("")
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index c79cb55..2736257 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,4 @@
+include ':dummy'
+include ':di'
include ':app'
rootProject.name = "android-scaffolding"
\ No newline at end of file