-
Notifications
You must be signed in to change notification settings - Fork 0
[setting/#1] 프로젝트 기본세팅 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2c43215
e748505
aece5c4
4e2122c
5b2b458
669cfe1
de7ca5b
ac6fdb2
38dd2a1
9af5fc2
02ca0e1
6612260
dc6e207
88ff03c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| #Fri Oct 10 14:17:17 KST 2025 | ||
| java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home | ||
| #Mon Oct 13 17:27:02 KST 2025 | ||
| java.home=C\:\\Program Files\\Android\\Android Studio\\jbr | ||
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
|---|---|---|
| @@ -1,21 +1,32 @@ | ||
| import java.util.Properties | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.android.application) | ||
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.jetbrains.kotlin.android) | ||
| alias(libs.plugins.kotlin.compose) | ||
| alias(libs.plugins.kotlin.serialization) | ||
| alias(libs.plugins.devtools.ksp) | ||
| alias(libs.plugins.dagger.hilt) | ||
|
|
||
|
|
||
| } | ||
|
|
||
| val properties = Properties().apply { | ||
| load(project.rootProject.file("local.properties").inputStream()) | ||
| } | ||
|
Comment on lines
+14
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: BASE_URL loading will fail in other environments. Loading Consider these alternatives: Option 1: BuildConfig with flavor-specific defaults android {
namespace = "com.hsLink.hslink"
compileSdk = libs.versions.compileSdk.get().toInt()
+ flavorDimensions += "environment"
+ productFlavors {
+ create("dev") {
+ dimension = "environment"
+ buildConfigField("String", "BASE_URL", "\"https://dev-api.example.com\"")
+ }
+ create("prod") {
+ dimension = "environment"
+ buildConfigField("String", "BASE_URL", "\"https://api.example.com\"")
+ }
+ }
+
defaultConfig {
applicationId = "com.hsLink.hslink"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.versionName.get()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- buildConfigField("String", "BASE_URL", properties["base.url"].toString())
}Option 2: Environment variables with local.properties fallback -val properties = Properties().apply {
- load(project.rootProject.file("local.properties").inputStream())
-}
+val localProperties = Properties()
+val localPropertiesFile = rootProject.file("local.properties")
+if (localPropertiesFile.exists()) {
+ localProperties.load(localPropertiesFile.inputStream())
+}
+val baseUrl = System.getenv("BASE_URL")
+ ?: localProperties.getProperty("base.url")
+ ?: "\"https://api.example.com\""
android {
// ...
defaultConfig {
// ...
- buildConfigField("String", "BASE_URL", properties["base.url"].toString())
+ buildConfigField("String", "BASE_URL", baseUrl)
}Also applies to: 29-29 🤖 Prompt for AI Agents |
||
| android { | ||
| namespace = "com.hsLink.hslink" | ||
| compileSdk = 36 | ||
| compileSdk = libs.versions.compileSdk.get().toInt() | ||
|
|
||
| defaultConfig { | ||
| applicationId = "com.hsLink.hslink" | ||
| minSdk = 24 | ||
| targetSdk = 36 | ||
| versionCode = 1 | ||
| versionName = "1.0" | ||
| minSdk = libs.versions.minSdk.get().toInt() | ||
| targetSdk = libs.versions.targetSdk.get().toInt() | ||
| versionCode = libs.versions.versionCode.get().toInt() | ||
| versionName = libs.versions.versionName.get() | ||
|
|
||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
| buildConfigField("String", "BASE_URL", properties["base.url"].toString()) | ||
| } | ||
|
|
||
| buildTypes { | ||
|
|
@@ -36,24 +47,36 @@ android { | |
| } | ||
| buildFeatures { | ||
| compose = true | ||
| buildConfig = true | ||
| } | ||
|
|
||
| } | ||
|
|
||
| dependencies { | ||
|
|
||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.lifecycle.runtime.ktx) | ||
| implementation(libs.androidx.activity.compose) | ||
| implementation(platform(libs.androidx.compose.bom)) | ||
| implementation(libs.androidx.compose.ui) | ||
| implementation(libs.androidx.compose.ui.graphics) | ||
| implementation(libs.androidx.compose.ui.tooling.preview) | ||
| implementation(libs.androidx.compose.material3) | ||
| testImplementation(libs.junit) | ||
| androidTestImplementation(libs.androidx.junit) | ||
| androidTestImplementation(libs.androidx.espresso.core) | ||
| androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
| androidTestImplementation(libs.androidx.compose.ui.test.junit4) | ||
| debugImplementation(libs.androidx.compose.ui.tooling) | ||
| debugImplementation(libs.androidx.compose.ui.test.manifest) | ||
| androidTestImplementation(libs.bundles.test) | ||
|
|
||
| debugImplementation(libs.bundles.debug) | ||
|
|
||
| implementation(libs.bundles.androidx) | ||
| implementation(platform(libs.androidx.compose.bom)) | ||
|
|
||
| implementation(libs.kotlinx.immutable) | ||
|
|
||
| implementation(platform(libs.okhttp.bom)) | ||
| implementation(libs.bundles.okhttp) | ||
| implementation(libs.bundles.retrofit) | ||
| implementation(libs.kotlinx.serialization.json) | ||
|
|
||
| implementation(libs.bundles.hilt) | ||
| ksp(libs.hilt.compiler) | ||
|
|
||
| implementation(libs.coil.compose) | ||
|
|
||
| implementation(libs.timber) | ||
|
|
||
| implementation(libs.accompanist.systemuicontroller) | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.hsLink.hslink | ||
|
|
||
| import android.app.Application | ||
| import androidx.appcompat.app.AppCompatDelegate | ||
| import dagger.hilt.android.HiltAndroidApp | ||
| import timber.log.Timber | ||
|
|
||
|
|
||
| @HiltAndroidApp | ||
| class HsuConnectApplication : Application() { | ||
| override fun onCreate() { | ||
| super.onCreate() | ||
|
|
||
| setTimber() | ||
| setDarkMode() | ||
| } | ||
|
|
||
| private fun setTimber() { | ||
| if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) | ||
| } | ||
|
|
||
| private fun setDarkMode() { | ||
| AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Remove this file from version control.
.gradle/config.propertiescontains machine-specific configuration (Java home path) and should not be committed to the repository. This file is automatically generated by Gradle and differs across development environments.Add this file to
.gitignore:🤖 Prompt for AI Agents