Skip to content

Commit

Permalink
Merge pull request #66 from PLUB2022/feature/compose-setting
Browse files Browse the repository at this point in the history
Compose용 Presentation 모듈 생성
  • Loading branch information
jinukeu authored Oct 4, 2023
2 parents 1ecbf1a + b7d7d8e commit 6fdb30b
Show file tree
Hide file tree
Showing 23 changed files with 392 additions and 39 deletions.
9 changes: 6 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {

android {
compileSdk = Configs.COMPILE_SDK
namespace = "com.plub.plubandroid"

defaultConfig {
applicationId = "com.plub.plubandroid"
Expand All @@ -29,11 +30,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}

composeOptions {
Expand All @@ -49,6 +50,8 @@ android {
dependencies {
implementation(project(":domain"))
implementation(project(":data"))
implementation(project(":design-system"))
implementation(project(":presentation-compose"))

implementation(AndroidX.CORE_KTX)
implementation(AndroidX.APP_COMPAT)
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
}

buildscript {
repositories {
google()
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Configs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ object Configs {
const val KOTLIN_KAPT = "kotlin-kapt"

//Android Config
const val COMPILE_SDK = 33
const val COMPILE_SDK = 34

//Android Default Config
const val MIN_SDK = 23
const val MIN_SDK = 26
const val TARGET_SDK = 33
const val VERSION_CODE = 1
const val VERSION_NAME = "1.0.0"
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object Versions {
const val GRADLE = "7.3.1"
const val GRADLE = "8.1.1"

/* [ Kotlin ] */
const val KOTLIN_VERSION = "1.7.10"
const val KOTLIN_VERSION = "1.9.10"
const val KOTLIN_COROUTINE = "1.6.4"
const val KOTLIN_SERIALIZATION = "1.7.0"
const val KOTLIN_SERIALIZATION_JSON = "1.3.2"
Expand All @@ -25,7 +25,7 @@ object Versions {

/* [ Google ] */
const val GOOGLE_PLAY_SERVICE = "20.3.0"
const val HILT = "2.42"
const val HILT = "2.48"
const val MATERIAL = "1.6.1"
const val TINK = "1.7.0"
const val PROTOBUF = "3.21.7"
Expand Down
15 changes: 8 additions & 7 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ plugins {
id("com.android.library")
id("dagger.hilt.android.plugin")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.google.protobuf") version "0.8.19"
id("com.google.protobuf") version "0.9.1"
kotlin("android")
kotlin("kapt")
id("com.google.devtools.ksp")
}

android {
compileSdk = Configs.COMPILE_SDK
namespace = "com.plub.data"

defaultConfig {
minSdk = Configs.MIN_SDK
Expand All @@ -19,11 +21,11 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

Expand All @@ -41,7 +43,7 @@ dependencies {
implementation(AndroidX.PAGING3_COMMON_KTX)
implementation(AndroidX.ROOM)
implementation(AndroidX.ROOM_KTX)
kapt(AndroidX.ROOM_COMPILER)
ksp(AndroidX.ROOM_COMPILER)

implementation(Libraries.RETROFIT)
implementation(Libraries.RETROFIT_CONVERTER_GSON)
Expand All @@ -63,12 +65,11 @@ protobuf {
}
generateProtoTasks {
all().forEach { task ->
task.plugins {
task.builtins {
create("java") {
option("lite")
}
}

}
}
}
16 changes: 8 additions & 8 deletions data/src/main/java/com/plub/data/dao/RecentSearchDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ import kotlinx.coroutines.flow.Flow

@Dao
interface RecentSearchDao {
@Query("SELECT * FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime DESC LIMIT :count")
@Query("SELECT * FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime DESC LIMIT :arg0")
fun getSearches(count: Int): Flow<List<RecentSearchEntity>>

@Query("SELECT COUNT(*) FROM ${EntityTable.RECENT_SEARCH}")
suspend fun getSearchesCount(): Int
fun getSearchesCount(): Int

@Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE search = :search")
suspend fun deleteBySearch(search: String)
@Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE search = :arg0")
fun deleteBySearch(search: String): Int

@Insert(onConflict = REPLACE)
suspend fun insert(recentSearchEntity: RecentSearchEntity)
fun insert(recentSearchEntity: RecentSearchEntity)

@Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE saveTime IN (SELECT saveTime FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime ASC LIMIT :count )")
suspend fun deleteOldestSearch(count: Int)
@Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE saveTime IN (SELECT saveTime FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime ASC LIMIT :arg0 )")
fun deleteOldestSearch(count: Int): Int

@Query("DELETE FROM ${EntityTable.RECENT_SEARCH}")
suspend fun deleteAll()
fun deleteAll()
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ data class KakaoLocationInfoResponse(
data class KakaoLocationInfoDocument(
@SerialName("place_name")
val placeName: String = "",
@SerialName("x")
val placePositionX: String = "",
@SerialName("y")
val placePositionY: String = "",
@SerialName("address_name")
val addressName: String = "",
@SerialName("road_address_name")
val roadAddressName: String = ""
)

data class Meta(
Expand Down
12 changes: 4 additions & 8 deletions design-system/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("com.android.application")
id("com.android.library")
id("org.jetbrains.kotlin.android")
}

Expand All @@ -8,11 +8,7 @@ android {
compileSdk = 33

defaultConfig {
applicationId = "com.plub.design_system"
minSdk = 26
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -27,8 +23,8 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

buildFeatures {
Expand All @@ -40,7 +36,7 @@ android {
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

Expand Down
4 changes: 2 additions & 2 deletions domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Sep 10 10:41:11 KST 2022
#Wed Oct 04 15:15:31 KST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions presentation-compose/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
128 changes: 128 additions & 0 deletions presentation-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
plugins {
id("com.android.library")
id("dagger.hilt.android.plugin")
kotlin("android")
kotlin("kapt")
id("androidx.navigation.safeargs.kotlin")
id("com.google.gms.google-services")
id("kotlin-parcelize")
}

android {
namespace = "com.plub.presentation_compose"
compileSdk = 33

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPLIER
}


buildFeatures {
viewBinding = true
compose = true
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {
implementation(project(":domain"))
implementation(project(":design-system"))

implementation(Kotlin.KOTLIN_STDLIB)
implementation(Kotlin.COROUTINES_ANDROID)
implementation(Kotlin.COROUTINES_CORE)

implementation(AndroidX.APP_COMPAT)
implementation(AndroidX.CORE_KTX)
implementation(AndroidX.LIFECYCLE_RUNTIME_KTX)
implementation(AndroidX.CONSTRAINT_LAYOUT)
implementation(AndroidX.LIFECYCLE_VIEW_MODEL_KTX)
implementation(AndroidX.ACTIVITY_KTX)
implementation(AndroidX.FRAGMENT_KTX)
implementation(AndroidX.NAVIGATION_FRAGMENT_KTX)
implementation(AndroidX.NAVIGATION_UI_KTX)
implementation(AndroidX.LEGACY_SUPPORT)
implementation(AndroidX.RECYCLER_VIEW)
implementation(AndroidX.PAGING3_RUNTIME)
implementation(AndroidX.PAGING3_COMMON_KTX)

implementation(Libraries.CALENDAR_VIEW)
implementation(Libraries.COIL)
implementation(Libraries.TIMBER)
implementation(Libraries.LOTTIE)
implementation(Libraries.INDICATOR)
implementation(Libraries.KAKAO)
implementation(Libraries.TED_PERMISSION)
implementation(Libraries.THREE_TEN_ABP)
implementation(Libraries.IMAGE_CROPPER)
implementation(Libraries.POWER_MENU)

implementation(Google.MATERIAL)
implementation(Google.HILT_ANDROID)
implementation(Google.GOOGLE_PLAY_SERVICE)
implementation(Google.FLEX_BOX)
implementation(Google.FIREBASE_BOM)
implementation(Google.FCM)
implementation(Google.FCM_KTX)

implementation(Glide.GLIDE)
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.3")
implementation("androidx.navigation:navigation-ui-ktx:2.7.3")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
annotationProcessor(Glide.GLIDE_COMPILER)

implementation(Compose.COMPOSE_ACTIVITY)
implementation(Compose.COMPOSE_MATERIAL)
implementation(Compose.COMPOSE_PREVIEW)
implementation(Compose.COMPOSE_UI)
implementation(Compose.COMPOSE_NAV)
implementation(Compose.COMPOSE_ANI_NAV)
implementation(Compose.COMPOSE_UI_TOOL)
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

kapt(Google.HILT_ANDROID_COMPILER)
}
Empty file.
21 changes: 21 additions & 0 deletions presentation-compose/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 6fdb30b

Please sign in to comment.