Skip to content

Commit

Permalink
Merge pull request #10 from meongmory/feature/gradle
Browse files Browse the repository at this point in the history
[feature/gradle] Gradle Dependencies Separate
  • Loading branch information
SsongSik authored Jul 11, 2023
2 parents 1c8d501 + 89d4cdc commit a75f638
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 88 deletions.
67 changes: 0 additions & 67 deletions app/build.gradle

This file was deleted.

69 changes: 69 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
}

android {
namespace = "com.meongmoryteam.meongmory"
compileSdk = 33

defaultConfig {
applicationId = "com.meongmoryteam.meongmory"
minSdk = 28
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
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 = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {
implementation(libs.core.ktx)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.activity.compose)
implementation(platform(libs.compose.bom))
implementation(libs.ui)
implementation(libs.ui.graphics)
implementation(libs.ui.tooling.preview)
implementation(libs.material3)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
19 changes: 0 additions & 19 deletions build.gradle

This file was deleted.

24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}

dependencies {
classpath(libs.kotlin.gradleplugin)
classpath(libs.agp)
}
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.android.library) apply false
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
70 changes: 70 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[versions]
agp = "8.0.2"
kotlin = "1.8.21"
core-ktx = "1.10.1"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
lifecycle-runtime-ktx = "2.6.1"
activity-compose = "1.7.2"
compose-bom = "2023.06.01"

dagger-hilt = "2.46.1"
hilt-compose = "1.0.0-alpha03"

okhttp = "4.11.0"
retrofit = "2.9.0"
serialization = "1.5.1"
kotlin-serilization = "1.0.0"

[libraries]
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
ui = { group = "androidx.compose.ui", name = "ui" }
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
material3 = { group = "androidx.compose.material3", name = "material3" }

# Kotlin
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlin-gradleplugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }

# dagger-hilt
hilt = { module = "com.google.dagger:hilt-android", version.ref = "dagger-hilt" }
hilt-kapt = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger-hilt" }
hilt-plugin = { group = "com.google.dagger", name = "hilt-android-gradle-plugin", version.ref = "dagger-hilt" }
hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "dagger-hilt" }
hilt-testing-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger-hilt" }
hilt-core = { module = "com.google.dagger:hilt-core", version.ref = "dagger-hilt" }
hilt-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt-compose" }

# Retrofit
okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp"}
okhttp-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }

# Serialization
serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
kotlin-serilization = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "kotlin-serilization" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-kapt = { id = "kotlin-kapt", version.ref = "kotlin" }
dagger-hilt = { id = "dagger.hilt.android.plugin", version.ref = "dagger-hilt" }
kotlin-android-plugin = { id = "kotlin-android", version.ref = "kotlin" }
kotlin-serilization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

[bundles]

2 changes: 1 addition & 1 deletion settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencyResolutionManagement {
}
}
rootProject.name = "meongmory"
include ':app'
include(":app")

0 comments on commit a75f638

Please sign in to comment.