Skip to content

Commit

Permalink
Merge pull request #16 from team-haribo/feature/15-data-module-separa…
Browse files Browse the repository at this point in the history
…tion

🔀 :: (#15) - architectural restructuring
  • Loading branch information
minStone-dev authored Jan 15, 2024
2 parents d401cab + b85b97a commit 9a2e968
Show file tree
Hide file tree
Showing 46 changed files with 324 additions and 24 deletions.
6 changes: 5 additions & 1 deletion .idea/gradle.xml

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

1 change: 1 addition & 0 deletions .idea/misc.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 @@ -14,9 +14,11 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {

dependencies {
add("implementation", project(":core:model"))
add("implementation", project(":core:ui"))
add("implementation", project(":core:design-system"))
add("implementation", project(":core:data:repository"))
add("implementation", project(":core:data"))
add("implementation", project(":core:domain"))
add("implementation", project(":core:datastore"))

add("implementation", libs.findLibrary("coil.kt").get())

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

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

implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.json)
Expand Down
17 changes: 0 additions & 17 deletions core/data/repository/build.gradle.kts

This file was deleted.

File renamed without changes.
33 changes: 33 additions & 0 deletions core/datastore-proto/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("goms.android.core")
id("goms.android.hilt")
alias(libs.plugins.protobuf)
}

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

protobuf {
protoc {
artifact = libs.protobuf.protoc.get().toString()
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
register("java") {
option("lite")
}
register("kotlin") {
option("lite")
}
}
}
}
}

dependencies {
implementation(libs.androidx.dataStore.core)
implementation(libs.protobuf.kotlin.lite)
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.goms.datastore_proto

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.datastore_proto.test", appContext.packageName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.goms.datastore_proto

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/datastore/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
17 changes: 17 additions & 0 deletions core/datastore/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("goms.android.core")
id("goms.android.hilt")
}

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

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

implementation(libs.androidx.dataStore.core)
implementation(libs.protobuf.kotlin.lite)
}
File renamed without changes.
21 changes: 21 additions & 0 deletions core/datastore/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
@@ -1,4 +1,4 @@
package com.goms.repository
package com.goms.datastore

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.goms.repository.test", appContext.packageName)
assertEquals("com.goms.datastore.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions core/datastore/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>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.goms.repository
package com.goms.datastore

import org.junit.Test

Expand Down
2 changes: 1 addition & 1 deletion core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
}

dependencies {
implementation(project(":core:data:repository"))
implementation(project(":core:data"))
implementation(project(":core:model"))

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

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

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

implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.json)
//okhttp
implementation(libs.okhttp.logging)
//retrofit
implementation(libs.retrofit.core)
implementation(libs.retrofit.kotlin.serialization)
implementation(libs.retrofit.moshi.converter)
}
File renamed without changes.
21 changes: 21 additions & 0 deletions core/network/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.network

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.network.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions core/network/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/network/src/test/java/com/goms/network/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.goms.network

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/notifications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
8 changes: 8 additions & 0 deletions core/notifications/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("goms.jvm.library")
}

dependencies {
implementation(libs.kotlinx.datetime)
}
Empty file.
4 changes: 4 additions & 0 deletions core/notifications/src/main/java/com/goms/notifications/Ci.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.goms.notifications

class Ci {
}
1 change: 1 addition & 0 deletions core/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
19 changes: 19 additions & 0 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("goms.android.core")
id("goms.android.compose")
}

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

dependencies {
implementation(project(":core:design-system"))
implementation(project(":core:model"))

implementation(libs.androidx.activity.compose)
implementation(libs.coil.kt)
implementation(libs.coil.kt.compose)
implementation(libs.kotlinx.datetime)
}
Empty file added core/ui/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions core/ui/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
Loading

0 comments on commit 9a2e968

Please sign in to comment.