Skip to content

Commit 905b2fc

Browse files
Merge branch 'feature/core' into develop
2 parents e4284d8 + ee4e1df commit 905b2fc

33 files changed

Lines changed: 1446 additions & 3 deletions

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ dependencies {
106106

107107
implementation(project(Modules.AndroidLibrary.DATA))
108108
implementation(project(Modules.AndroidLibrary.DOMAIN))
109+
implementation(project(Modules.AndroidLibrary.CORE))
109110

110111
addAppModuleDependencies()
111112

libraries/core/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

libraries/core/build.gradle.kts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import extension.addCoreModuleDependencies
2+
import extension.addInstrumentationTestDependencies
3+
import extension.addUnitTestDependencies
4+
5+
plugins {
6+
id(Plugins.ANDROID_LIBRARY_PLUGIN)
7+
id(Plugins.KOTLIN_ANDROID_PLUGIN)
8+
id(Plugins.KOTLIN_ANDROID_EXTENSIONS_PLUGIN)
9+
id(Plugins.KOTLIN_KAPT_PLUGIN)
10+
id(Plugins.DAGGER_HILT_PLUGIN)
11+
}
12+
13+
android {
14+
15+
compileSdkVersion(AndroidVersion.COMPILE_SDK_VERSION)
16+
defaultConfig {
17+
minSdkVersion(AndroidVersion.MIN_SDK_VERSION)
18+
targetSdkVersion(AndroidVersion.TARGET_SDK_VERSION)
19+
versionCode = AndroidVersion.VERSION_CODE
20+
versionName = AndroidVersion.VERSION_NAME
21+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
22+
}
23+
24+
buildTypes {
25+
getByName("release") {
26+
isMinifyEnabled = false
27+
proguardFiles(
28+
getDefaultProguardFile("proguard-android-optimize.txt"),
29+
"proguard-rules.pro"
30+
)
31+
}
32+
}
33+
34+
android.buildFeatures.dataBinding = true
35+
36+
compileOptions {
37+
sourceCompatibility = JavaVersion.VERSION_1_8
38+
targetCompatibility = JavaVersion.VERSION_1_8
39+
}
40+
41+
kotlinOptions {
42+
jvmTarget = "1.8"
43+
}
44+
45+
testOptions {
46+
unitTests.isIncludeAndroidResources = true
47+
}
48+
}
49+
50+
dependencies {
51+
52+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
53+
54+
implementation(project(Modules.AndroidLibrary.DOMAIN))
55+
implementation(project(Modules.AndroidLibrary.DATA))
56+
57+
addCoreModuleDependencies()
58+
59+
addUnitTestDependencies()
60+
testImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
61+
62+
addInstrumentationTestDependencies()
63+
androidTestImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
64+
}

libraries/core/consumer-rules.pro

Whitespace-only changes.

libraries/core/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.kts.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.smarttoolfactory.core
2+
3+
import androidx.test.ext.junit.runners.AndroidJUnit4
4+
import androidx.test.platform.app.InstrumentationRegistry
5+
import org.junit.Assert.assertEquals
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
/**
10+
* Instrumented test, which will execute on an Android device.
11+
*
12+
* See [testing documentation](http://d.android.com/tools/testing).
13+
*/
14+
@RunWith(AndroidJUnit4::class)
15+
class ExampleInstrumentedTest {
16+
@Test
17+
fun useAppContext() {
18+
// Context of the app under test.
19+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
20+
assertEquals("com.smarttoolfactory.core.test", appContext.packageName)
21+
}
22+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.smarttoolfactory.core">
4+
5+
</manifest>

libraries/core/src/main/assets/construction_process.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

libraries/core/src/main/assets/under_construction.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.smarttoolfactory.core.di
2+
3+
import com.smarttoolfactory.domain.dispatcher.UseCaseDispatchers
4+
import dagger.Module
5+
import dagger.Provides
6+
import dagger.hilt.InstallIn
7+
import dagger.hilt.android.components.ApplicationComponent
8+
import javax.inject.Singleton
9+
import kotlinx.coroutines.CoroutineScope
10+
import kotlinx.coroutines.Dispatchers
11+
import kotlinx.coroutines.SupervisorJob
12+
13+
@InstallIn(ApplicationComponent::class)
14+
@Module(includes = [DataModule::class])
15+
class CoreModule {
16+
17+
@Singleton
18+
@Provides
19+
fun provideCoroutineScope() = CoroutineScope(Dispatchers.Main.immediate + SupervisorJob())
20+
21+
@Provides
22+
fun provideUseCaseDispatchers(): UseCaseDispatchers {
23+
return UseCaseDispatchers(Dispatchers.IO, Dispatchers.Default, Dispatchers.Main)
24+
}
25+
}

0 commit comments

Comments
 (0)