Skip to content

Commit

Permalink
Merge pull request #18 from team-haribo/feature/17-add-corecommon-module
Browse files Browse the repository at this point in the history
🔀 :: (#17) - add corecommon module
  • Loading branch information
minStone-dev authored Jan 15, 2024
2 parents 9a2e968 + 364500d commit 7066bb1
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 12 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
add("implementation", project(":core:design-system"))
add("implementation", project(":core:data"))
add("implementation", project(":core:domain"))
add("implementation", project(":core:common"))
add("implementation", project(":core:datastore"))

add("implementation", libs.findLibrary("coil.kt").get())
Expand Down
1 change: 1 addition & 0 deletions core/common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
14 changes: 14 additions & 0 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("goms.android.core")
id("goms.android.hilt")
}

android {
namespace = "com.goms.common"
}

dependencies {
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.turbine)
}
Empty file added core/common/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions core/common/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.goms.common

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.goms.common.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions core/common/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions core/common/src/test/java/com/goms/common/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.goms.common

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
1 change: 1 addition & 0 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {
}

dependencies {
implementation(project(":core:common"))
implementation(project(":core:model"))
implementation(project(":core:network"))

Expand Down
1 change: 1 addition & 0 deletions core/datastore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {
}

dependencies {
implementation(project(":core:common"))
implementation(project(":core:model"))
implementation(project(":core:datastore-proto"))

Expand Down
1 change: 1 addition & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {
}

dependencies {
implementation(project(":core:common"))
implementation(project(":core:model"))

implementation(libs.kotlinx.datetime)
Expand Down
27 changes: 15 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ firebaseBom = "31.2.0"
firebaseCrashlyticsPlugin = "2.9.2"
firebasePerfPlugin = "1.4.2"
gmsPlugin = "4.3.14"
moshi = "2.9.0"
gauth = "v1.1.2"
hilt = "2.48"
hiltExt = "1.1.0"
junit4 = "4.13.2"
Expand All @@ -38,16 +38,18 @@ kotlinxDateTime = "0.4.0"
kotlinxSerializationJson = "1.5.1"
ksp = "1.8.10-1.0.9"
lint = "31.2.1"
lifecycle-runtime-ktx = "2.6.2"
material = "1.2.0-alpha02"
moshi = "2.9.0"
okhttp = "4.11.0"
org-jetbrains-kotlin-android = "1.8.10"
protobuf = "3.24.0"
protobufPlugin = "0.9.4"
retrofit = "2.9.0"
retrofitKotlinxSerializableJson = "1.0.0"
room = "2.6.1"
org-jetbrains-kotlin-android = "1.8.10"
lifecycle-runtime-ktx = "2.6.2"
gauth = "v1.1.2"
turbine = "1.0.0"


[libraries]
#Define Library
Expand Down Expand Up @@ -83,6 +85,7 @@ androidx-window-manager = { module = "androidx.window:window", version.ref = "an
coil-kt = { group = "io.coil-kt", name = "coil", version.ref = "coil" }
coil-kt-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
coil-kt-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil" }
gauth = { group = "com.github.GSM-MSG", name = "GAuth-Signin-Android", version.ref = "gauth" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" }
hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
Expand All @@ -104,16 +107,16 @@ retrofit-kotlin-serialization = { group = "com.jakewharton.retrofit", name = "re
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
gauth = { group = "com.github.GSM-MSG", name = "GAuth-Signin-Android", version.ref = "gauth" }
turbine = { group = "app.cash.turbine", name = "turbine", version.ref = "turbine" }

#Define Dependeicies used in build-logic
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
ui = { group = "androidx.compose.ui", name = "ui" }
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
Expand All @@ -128,14 +131,14 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "org-jetbrains-kotlin-android" }
protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }

[bundles]
#Define Bundles
kotlinx-coroutines = ["kotlinx-coroutines-android", "kotlinx-coroutines-guava", "kotlinx-coroutines-test"]
hilt = ["hilt-android", "hilt-android-testing", "hilt-compiler", "hilt-ext-compiler", "hilt-ext-work"]
compose = ["androidx-activity-compose", "androidx-navigation-compose", "androidx-compose-bom", "coil-kt-compose",
"androidx-hilt-navigation-compose", "androidx-compose-material3", "androidx-compose-material3-windowSizeClass",
"androidx-compose-foundation", "androidx-compose-foundation-layout", "androidx-compose-ui-tooling", "androidx-compose-ui-tooling-preview", "androidx-compose-ui-util", "androidx-compose-runtime",
"androidx-compose-runtime-livedata", "androidx-compose-runtime-tracing"]
"androidx-compose-runtime-livedata", "androidx-compose-runtime-tracing"]
hilt = ["hilt-android", "hilt-android-testing", "hilt-compiler", "hilt-ext-compiler", "hilt-ext-work"]
kotlinx-coroutines = ["kotlinx-coroutines-android", "kotlinx-coroutines-guava", "kotlinx-coroutines-test"]
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ include(":core:datastore")
include(":core:ui")
include(":core:notifications")
include(":core:datastore-proto")
include(":core:common")

0 comments on commit 7066bb1

Please sign in to comment.