-
Notifications
You must be signed in to change notification settings - Fork 1
build-logic 설정 #7
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d4aa0a6
feat: build-logic 및 Convention Plugin 도입
HamBeomJoon 9f5a944
feat: convention plugin 도입 및 빌드 시스템 구조 개선
HamBeomJoon c9a8f15
perf: Gradle 빌드 성능 최적화 설정 추가
HamBeomJoon 3783ffd
feat: build-logic 내 Kotlin/Android 공통 설정 추가 및 개선
HamBeomJoon 4616d94
build: Android Compose 공통 설정 추가
HamBeomJoon 2edb1e5
refactor: 컨벤션 플러그인 의존성 구조 개선
HamBeomJoon 1b4f257
chore: EOF Line 수정
HamBeomJoon 335326d
build: build-logic 구조 정리 및 Kotlin 설정 최적화
HamBeomJoon aa0ef88
chore: libs.versions.toml 의존성 네이밍 및 번들 수정
HamBeomJoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /build | ||
| /build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,64 +1,14 @@ | ||
| plugins { | ||
| alias(libs.plugins.android.application) | ||
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.kotlin.compose) | ||
| alias(libs.plugins.ktlint) | ||
| alias(libs.plugins.prezel.android.application) | ||
| alias(libs.plugins.prezel.android.application.compose) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.team.prezel" | ||
| compileSdk { | ||
| version = release(36) | ||
| } | ||
|
|
||
| defaultConfig { | ||
| applicationId = "com.team.prezel" | ||
| minSdk = 28 | ||
| targetSdk = 36 | ||
| versionCode = 1 | ||
| versionName = "1.0" | ||
|
|
||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = false | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro", | ||
| ) | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
| buildFeatures { | ||
| compose = true | ||
| } | ||
| } | ||
|
|
||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.androidx.activity.ktx) | ||
| 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) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| <resources> | ||
| <string name="app_name">Prezel</string> | ||
| </resources> | ||
| </resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
|
||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| group = "com.team.prezel.buildlogic.convention" | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
|
|
||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget = JvmTarget.JVM_21 | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| compileOnly(libs.android.gradleApiPlugin) | ||
| compileOnly(libs.compose.gradlePlugin) | ||
| compileOnly(libs.kotlin.gradlePlugin) | ||
| compileOnly(libs.ksp.gradlePlugin) | ||
| } | ||
|
|
||
| gradlePlugin { | ||
| plugins { | ||
| register("androidApplicationCompose") { | ||
| id = libs.plugins.prezel.android.application.compose | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidApplicationComposeConventionPlugin" | ||
| } | ||
| register("androidApplication") { | ||
| id = libs.plugins.prezel.android.application | ||
| .asProvider() | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidApplicationConventionPlugin" | ||
| } | ||
| register("androidLibraryCompose") { | ||
| id = libs.plugins.prezel.android.library.compose | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidLibraryComposeConventionPlugin" | ||
| } | ||
| register("androidLibrary") { | ||
| id = libs.plugins.prezel.android.library | ||
| .asProvider() | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidLibraryConventionPlugin" | ||
| } | ||
| register("androidFeatureImpl") { | ||
| id = libs.plugins.prezel.android.feature.impl | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidFeatureImplConventionPlugin" | ||
| } | ||
| register("androidFeatureApi") { | ||
| id = libs.plugins.prezel.android.feature.api | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidFeatureApiConventionPlugin" | ||
| } | ||
| register("hilt") { | ||
| id = libs.plugins.prezel.hilt | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.HiltConventionPlugin" | ||
| } | ||
| register("jvmLibrary") { | ||
| id = libs.plugins.prezel.jvm.library | ||
| .get() | ||
| .pluginId | ||
| implementationClass = "com.team.prezel.buildlogic.convention.plugin.JvmLibraryConventionPlugin" | ||
| } | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ld-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/AndroidCompose.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.team.prezel.buildlogic.convention | ||
|
|
||
| import com.android.build.api.dsl.CommonExtension | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.dependencies | ||
|
|
||
| /** | ||
| * Configure Compose-specific options | ||
| */ | ||
| internal fun Project.configureAndroidCompose(commonExtension: CommonExtension<*, *, *, *, *, *>) { | ||
| commonExtension.apply { | ||
| buildFeatures { | ||
| compose = true | ||
| } | ||
|
|
||
| dependencies { | ||
| val bom = libs.findLibrary("androidx-compose-bom").get() | ||
| "implementation"(platform(bom)) | ||
| "implementation"(libs.findBundle("android-compose").get()) | ||
| "androidTestImplementation"(platform(bom)) | ||
| "implementation"(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) | ||
| "debugImplementation"(libs.findLibrary("androidx-compose-ui-tooling").get()) | ||
| } | ||
| } | ||
| } |
67 changes: 67 additions & 0 deletions
67
...ild-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/KotlinAndroid.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package com.team.prezel.buildlogic.convention | ||
|
|
||
| import com.android.build.api.dsl.CommonExtension | ||
| import org.gradle.api.JavaVersion | ||
| import org.gradle.api.Project | ||
| import org.gradle.api.plugins.JavaPluginExtension | ||
| import org.gradle.kotlin.dsl.configure | ||
| import org.gradle.kotlin.dsl.dependencies | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
| import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension | ||
| import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
| import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
|
|
||
| /** | ||
| * Configure base Kotlin with Android options | ||
| */ | ||
| internal fun Project.configureKotlinAndroid(commonExtension: CommonExtension<*, *, *, *, *, *>) { | ||
| commonExtension.apply { | ||
| compileSdk = 36 | ||
|
|
||
| defaultConfig { | ||
| minSdk = 29 | ||
| } | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| isCoreLibraryDesugaringEnabled = true | ||
| } | ||
| } | ||
|
|
||
| extensions.configure<KotlinAndroidProjectExtension> { | ||
| compilerOptions.apply { | ||
| languageVersion.set(KotlinVersion.KOTLIN_2_3) | ||
| coreLibrariesVersion = libs.findVersion("kotlin").get().toString() | ||
| jvmTarget.set(JvmTarget.JVM_21) | ||
| allWarningsAsErrors.set(false) | ||
| freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi") | ||
| freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| "coreLibraryDesugaring"(libs.findLibrary("desugarJdk-libs").get()) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Configure base Kotlin options for JVM (non-Android) | ||
| */ | ||
| internal fun Project.configureKotlinJvm() { | ||
| extensions.configure<JavaPluginExtension> { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
|
|
||
| extensions.configure<KotlinJvmProjectExtension> { | ||
| compilerOptions.apply { | ||
| languageVersion.set(KotlinVersion.KOTLIN_2_3) | ||
| coreLibrariesVersion = libs.findVersion("kotlin").get().toString() | ||
| jvmTarget.set(JvmTarget.JVM_21) | ||
| allWarningsAsErrors.set(false) | ||
| freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi") | ||
| freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") | ||
| } | ||
| } | ||
| } | ||
9 changes: 9 additions & 0 deletions
9
...logic/convention/src/main/java/com/team/prezel/buildlogic/convention/ProjectExtensions.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.team.prezel.buildlogic.convention | ||
|
|
||
| import org.gradle.api.Project | ||
| import org.gradle.api.artifacts.VersionCatalog | ||
| import org.gradle.api.artifacts.VersionCatalogsExtension | ||
| import org.gradle.kotlin.dsl.getByType | ||
|
|
||
| val Project.libs | ||
| get(): VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs") |
20 changes: 20 additions & 0 deletions
20
...com/team/prezel/buildlogic/convention/plugin/AndroidApplicationComposeConventionPlugin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.team.prezel.buildlogic.convention.plugin | ||
|
|
||
| import com.android.build.api.dsl.ApplicationExtension | ||
| import com.team.prezel.buildlogic.convention.configureAndroidCompose | ||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.apply | ||
| import org.gradle.kotlin.dsl.getByType | ||
|
|
||
| class AndroidApplicationComposeConventionPlugin : Plugin<Project> { | ||
| override fun apply(target: Project) { | ||
| with(target) { | ||
| apply(plugin = "org.jetbrains.kotlin.plugin.compose") | ||
| apply(plugin = "prezel.android.application") | ||
|
|
||
| val extension = extensions.getByType<ApplicationExtension>() | ||
| configureAndroidCompose(extension) | ||
| } | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
...n/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationConventionPlugin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.team.prezel.buildlogic.convention.plugin | ||
|
|
||
| import com.android.build.api.dsl.ApplicationExtension | ||
| import com.team.prezel.buildlogic.convention.configureKotlinAndroid | ||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.apply | ||
| import org.gradle.kotlin.dsl.configure | ||
|
|
||
| class AndroidApplicationConventionPlugin : Plugin<Project> { | ||
| override fun apply(target: Project) { | ||
| with(target) { | ||
| apply(plugin = "com.android.application") | ||
| apply(plugin = "org.jetbrains.kotlin.android") | ||
|
|
||
| extensions.configure<ApplicationExtension> { | ||
| configureKotlinAndroid(this) | ||
| defaultConfig.targetSdk = 36 | ||
| testOptions.animationsDisabled = true | ||
| } | ||
| } | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
...in/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureApiConventionPlugin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.team.prezel.buildlogic.convention.plugin | ||
|
|
||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.apply | ||
| import org.gradle.kotlin.dsl.dependencies | ||
|
|
||
| class AndroidFeatureApiConventionPlugin : Plugin<Project> { | ||
| override fun apply(target: Project) { | ||
| with(target) { | ||
| apply(plugin = "prezel.android.library") | ||
| apply(plugin = "org.jetbrains.kotlin.plugin.serialization") | ||
|
|
||
| dependencies { | ||
| // "api"(project(":core:navigation")) | ||
| } | ||
| } | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
...n/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package com.team.prezel.buildlogic.convention.plugin | ||
|
|
||
| import com.android.build.api.dsl.LibraryExtension | ||
| import com.team.prezel.buildlogic.convention.libs | ||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.apply | ||
| import org.gradle.kotlin.dsl.configure | ||
| import org.gradle.kotlin.dsl.dependencies | ||
|
|
||
| class AndroidFeatureImplConventionPlugin : Plugin<Project> { | ||
| override fun apply(target: Project) { | ||
| with(target) { | ||
| apply(plugin = "prezel.android.library") | ||
| apply(plugin = "prezel.hilt") | ||
|
|
||
| extensions.configure<LibraryExtension> { | ||
| testOptions.animationsDisabled = true | ||
| } | ||
|
|
||
| dependencies { | ||
| // "implementation"(project(":core:ui")) | ||
| // "implementation"(project(":core:designsystem")) | ||
|
|
||
| "implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) | ||
| "implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) | ||
|
|
||
| "androidTestImplementation"( | ||
| libs.findLibrary("androidx.lifecycle.runtimeTesting").get(), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.