-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/#127 QA build variant 추가 #128
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
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,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.yapp.app.setNamespace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.gradle.internal.extensions.stdlib.capitalized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.Properties | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plugins { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id("yapp.android.library") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -14,6 +15,25 @@ android { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildFeatures { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildConfig = true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildTypes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val localProperties = Properties() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localProperties.load( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| project.rootProject.file("local.properties").bufferedReader() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getByName("debug") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.debug"]}\"") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getByName("release") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.release"]}\"") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| create("qa") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| initWith(getByName("release")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matchingFallbacks += listOf("release") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+36
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. 🧹 Nitpick (assertive) 새로운 QA 빌드 타입 추가 local.properties 파일에서 각 빌드 타입별 BASE_URL 값을 읽어와 빌드 타입별로 다른 서버 환경을 사용할 수 있도록 설정했습니다. 특히 QA 빌드 타입을 release 빌드 타입 기반으로 생성하고, matchingFallbacks을 통해 의존성 해결에 필요한 빌드 타입 설정을 올바르게 구성했습니다. 그러나 local.properties 파일의 값이 없는 경우에 대한 예외 처리가 없습니다. 다음과 같이 기본값 설정이나 예외 처리 로직을 추가하는 것이 좋겠습니다. buildTypes {
val localProperties = Properties()
localProperties.load(
project.rootProject.file("local.properties").bufferedReader()
)
+ val defaultDebugUrl = "https://dev-yappuworld.yapp.co.kr/"
+ val defaultReleaseUrl = "https://api-yappuworld.yapp.co.kr/"
+ val defaultQaUrl = "https://dev-yappuworld.yapp.co.kr/"
+
getByName("debug") {
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.debug"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.debug", defaultDebugUrl)}\"")
}
getByName("release") {
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.release"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.release", defaultReleaseUrl)}\"")
}
create("qa") {
initWith(getByName("release"))
matchingFallbacks += listOf("release")
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.qa", defaultQaUrl)}\"")
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| protobuf { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
현재 QA 의 initWith 값이 릴리즈를 바라보는 이유를 알 수 있을까요 ?
현재는 Base URL 뿐이긴 한데 추가되면 릴리즈를 전부 바라보게 될거 같아서요
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.
릴리즈로 빌드되지만 BASE_URL은 개발 서버를 바라보도록 해야한다고 하셔서release 환경과 동일하되, BASE_URL만 덮어쓰기하는 방식으로 했습니다!