Skip to content

Commit

Permalink
[Chore] migrate build.gradle.kts & lib.version.toml (#194)
Browse files Browse the repository at this point in the history
* chore: migrate build.gradle.kts & lib.version.toml

* chore: toml use kebab-case
  • Loading branch information
HI-JIN2 authored Aug 19, 2024
1 parent d372413 commit c99b420
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 147 deletions.
133 changes: 0 additions & 133 deletions app/build.gradle

This file was deleted.

150 changes: 150 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import java.util.Properties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-parcelize")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("kotlin-android")
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
}

android {
namespace = "com.eatssu.android"
compileSdk = 34

defaultConfig {
applicationId = "com.eatssu.android"
minSdk = 23
targetSdk = 34
versionCode = 17
versionName = "1.1.14"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
buildConfig = true
viewBinding = true
dataBinding = true
}

buildTypes {
release {
val p = Properties()
p.load(project.rootProject.file("local.properties").reader())

val baseUrl: String = p.getProperty("PROD_BASE_URL")
buildConfigField("String", "BASE_URL", baseUrl)

val kakaoKey: String = p.getProperty("KAKAO_NATIVE_APP_KEY")
buildConfigField("String", "KAKAO_NATIVE_APP_KEY", "\"$kakaoKey\"")
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] = kakaoKey

isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

}

debug {
val p = Properties()
p.load(project.rootProject.file("local.properties").reader())

val baseUrl: String = p.getProperty("DEV_BASE_URL")
buildConfigField("String", "BASE_URL", baseUrl)

val kakaoKey: String = p.getProperty("KAKAO_NATIVE_APP_KEY")
buildConfigField("String", "KAKAO_NATIVE_APP_KEY", "\"$kakaoKey\"")
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] = kakaoKey
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

splits {
abi {
isEnable = true
reset()
isUniversalApk = true
}
}

lint {
abortOnError = false
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.constraintlayout)
implementation(libs.threetenabp)
implementation(libs.material.calendarview)
implementation(libs.recyclerview)
implementation(libs.transport.runtime)
implementation(libs.activity)
implementation(libs.fragment)

// Testing libraries
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)

//retrofit2: 서버통신
implementation(libs.retrofit)
implementation(libs.converter.gson)

// Gson for JSON parsing
implementation(libs.gson)

//OkHttp: 통신 로그 확인하기 위함
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)

//glide: 사진 업로드
implementation(libs.glide)
kapt(libs.glide.compiler)

//compressor: 이미지 압축
implementation(libs.compressor)

// Coroutines for concurrency
implementation(libs.coroutines)
implementation(libs.coroutines.core)
implementation(libs.lifecycle.runtime)

// Kakao login SDK
implementation(libs.kakao.login)

// Hilt for Dependency Injection
implementation(libs.hilt)
kapt(libs.hilt.compiler)

// ViewModel and LiveData
implementation(libs.lifecycle.viewmodel)
implementation(libs.lifecycle.livedata)

// Firebase
implementation(libs.play.services.base)
implementation(libs.firebase.config)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)


// Timber for logging
implementation(libs.timber)
}

kapt {
correctErrorTypes = true
}
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
3 changes: 1 addition & 2 deletions app/src/main/java/com/eatssu/android/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.eatssu.android.di


import com.eatssu.android.BuildConfig
import com.eatssu.android.BuildConfig.BASE_URL
import com.eatssu.android.data.service.InquiryService
import com.eatssu.android.data.service.OauthService
import com.eatssu.android.data.service.UserService
Expand Down Expand Up @@ -35,8 +36,6 @@ class NullOnEmptyConverterFactory : Converter.Factory() {
@InstallIn(SingletonComponent::class)
object NetworkModule {

private const val BASE_URL = BuildConfig.BASE_URL

@Singleton
@Provides
fun provideOkHttpClient(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/eatssu/android/util/RetrofitImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.util.Log
import android.widget.Toast
import com.eatssu.android.App
import com.eatssu.android.BuildConfig
import com.eatssu.android.BuildConfig.BASE_URL
import com.eatssu.android.base.BaseResponse
import com.eatssu.android.data.dto.response.TokenResponse
import com.eatssu.android.di.network.TokenInterceptor
Expand All @@ -25,7 +26,6 @@ import java.io.IOException
import java.lang.reflect.Type

object RetrofitImpl {
private const val BASE_URL = BuildConfig.BASE_URL

val size = 10 * 1024 * 1024 // 10MB Cache size

Expand Down
9 changes: 0 additions & 9 deletions build.gradle

This file was deleted.

9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.hilt.android) apply false
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ kotlin.code.style=official
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
Loading

0 comments on commit c99b420

Please sign in to comment.