Skip to content

Commit 92e38f0

Browse files
authored
Merge pull request #7 from YAPP-Github/chore/NDGL-16
[NDGL-16] detekt, ktlint 적용 및 CI/CD 구성
2 parents b5ee9d5 + 5b19517 commit 92e38f0

36 files changed

Lines changed: 277 additions & 184 deletions

File tree

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git add:*)",
5+
"Bash(git rebase:*)",
6+
"Bash(git fetch:*)"
7+
]
8+
}
9+
}

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
max_line_length = 150
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{kt,kts}]
12+
ij_kotlin_allow_trailing_comma = true
13+
ij_kotlin_allow_trailing_comma_on_call_site = true
14+
ktlint_function_naming_ignore_when_annotated_with = Composable

.github/workflows/android_ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Gradle
17+
uses: gradle/actions/setup-gradle@v4
18+
with:
19+
gradle-home-cache-cleanup: true
20+
21+
- name: Set up JDK 21
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '21'
25+
distribution: 'temurin'
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Set up local.properties
31+
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties
32+
33+
- name: Code style checks
34+
run: ./gradlew ktlintCheck detekt
35+
36+
- name: Run build
37+
run: ./gradlew assembleDebug --stacktrace

app/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ plugins {
44

55
android {
66
namespace = Configuration.APPLICATION_ID
7+
8+
buildTypes {
9+
release {
10+
isMinifyEnabled = true
11+
}
12+
}
713
}
814

915
dependencies {

app/src/main/java/com/yapp/ndgl/MainActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ class MainActivity : ComponentActivity() {
2020
}
2121
}
2222
}
23-

app/src/main/java/com/yapp/ndgl/navigation/BottomNavTab.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.yapp.ndgl.navigation
22

33
import androidx.annotation.DrawableRes
4-
import com.yapp.ndgl.navigation.Route
54
import com.yapp.ndgl.core.ui.R
65

76
enum class BottomNavTab(
@@ -24,5 +23,4 @@ enum class BottomNavTab(
2423
label = "여행",
2524
route = Route.Travel,
2625
),
27-
;
2826
}

app/src/main/java/com/yapp/ndgl/ui/BottomNavigationBar.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import com.yapp.ndgl.navigation.Route
1212

1313
@Composable
1414
internal fun BottomNavigationBar(
15-
currentTab : Route,
16-
onTabSelected : (Route) -> Unit,
15+
currentTab: Route,
16+
onTabSelected: (Route) -> Unit,
1717
) {
1818
// FIXME 네비게이션 바 디자인 수정 및 추상화
1919
NavigationBar {
@@ -24,10 +24,10 @@ internal fun BottomNavigationBar(
2424
icon = {
2525
Icon(
2626
imageVector = ImageVector.vectorResource(id = topLevelRoute.icon),
27-
contentDescription = topLevelRoute.label
27+
contentDescription = topLevelRoute.label,
2828
)
2929
},
30-
label = { Text(text = topLevelRoute.label) }
30+
label = { Text(text = topLevelRoute.label) },
3131
)
3232
}
3333
}

app/src/main/java/com/yapp/ndgl/ui/NDGLApp.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ import androidx.compose.runtime.remember
99
import androidx.compose.ui.Modifier
1010
import androidx.navigation3.runtime.entryProvider
1111
import androidx.navigation3.ui.NavDisplay
12-
import com.yapp.ndgl.feature.travelhelper.navigation.travelHelperEntry
1312
import com.yapp.ndgl.feature.home.navigation.homeEntry
13+
import com.yapp.ndgl.feature.travel.navigation.travelEntry
14+
import com.yapp.ndgl.feature.travelhelper.navigation.travelHelperEntry
1415
import com.yapp.ndgl.navigation.BottomNavTab
1516
import com.yapp.ndgl.navigation.Navigator
1617
import com.yapp.ndgl.navigation.Route
1718
import com.yapp.ndgl.navigation.rememberNavigationState
1819
import com.yapp.ndgl.navigation.toEntries
19-
import com.yapp.ndgl.feature.travel.navigation.travelEntry
2020

2121
@Composable
2222
fun NDGLApp() {
2323
val navigationState = rememberNavigationState(
24-
startRoute = Route.Home, topLevelKeys = BottomNavTab.entries.map { it.route }.toSet(),
24+
startRoute = Route.Home,
25+
topLevelKeys = BottomNavTab.entries.map { it.route }.toSet(),
2526
)
2627
val navigator = remember { Navigator(navigationState) }
2728

@@ -31,7 +32,8 @@ fun NDGLApp() {
3132
travelHelperEntry(navigator)
3233
}
3334

34-
val shouldShowBottomBar = remember(navigationState.currentKey) { navigationState.currentKey in navigationState.topLevelKeys }
35+
val shouldShowBottomBar =
36+
remember(navigationState.currentKey) { navigationState.currentKey in navigationState.topLevelKeys }
3537

3638
Scaffold(
3739
modifier = Modifier.fillMaxSize(),
@@ -55,4 +57,3 @@ fun NDGLApp() {
5557
)
5658
}
5759
}
58-

build-logic/src/main/kotlin/NDGLAndroidLibraryPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import convention.configureComposeAndroid
22
import convention.configureFirebase
3-
import extensions.configureAndroidLibrary
3+
import convention.configureKotlinAndroid
44
import org.gradle.api.Plugin
55
import org.gradle.api.Project
66
import org.gradle.kotlin.dsl.dependencies
@@ -13,7 +13,7 @@ class NDGLAndroidLibraryPlugin : Plugin<Project> {
1313
apply("org.jetbrains.kotlin.android")
1414
}
1515

16-
configureAndroidLibrary()
16+
configureKotlinAndroid()
1717
configureFirebase()
1818
configureComposeAndroid()
1919

build-logic/src/main/kotlin/NDGLApplicationPlugin.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import convention.configureComposeAndroid
22
import convention.configureHiltAndroid
33
import convention.configureKotlinAndroid
44
import convention.configureTimber
5-
import extensions.configureAndroidApplication
65
import org.gradle.api.Plugin
76
import org.gradle.api.Project
87

@@ -13,7 +12,6 @@ class NDGLApplicationPlugin : Plugin<Project> {
1312
}
1413

1514
configureKotlinAndroid()
16-
configureAndroidApplication()
1715
configureHiltAndroid()
1816
configureTimber()
1917
configureComposeAndroid()

0 commit comments

Comments
 (0)