From 2c3f2441a45ef02df6c9bf1c80b3ec7e248a9225 Mon Sep 17 00:00:00 2001 From: JunJangE Date: Thu, 11 Jul 2024 23:10:38 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20gradle=20minSdk=2026=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d44748625..180a6f03c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -10,7 +10,7 @@ android { defaultConfig { applicationId = "com.woowacourse.friendogly" - minSdk = 24 + minSdk = 26 targetSdk = 34 versionCode = 1 versionName = "1.0" From 728b1bd85782e3b8153fc20588e8303a4d6ebe0c Mon Sep 17 00:00:00 2001 From: JunJangE Date: Thu, 11 Jul 2024 23:11:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20ci=20ktlint=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android-pull-request-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/android-pull-request-ci.yml b/.github/workflows/android-pull-request-ci.yml index fb3b3d2f1..2a8135641 100644 --- a/.github/workflows/android-pull-request-ci.yml +++ b/.github/workflows/android-pull-request-ci.yml @@ -3,6 +3,8 @@ name: Android Pull Request CI on: push: branches: [ develop ] + paths: + - 'android/**' pull_request: branches: [ develop ] paths: @@ -42,6 +44,9 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Lint Check + run: ./gradlew ktlintCheck + - name: Run unit tests env: LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }} From 488552a32790946472fed503095fc11cfae588f3 Mon Sep 17 00:00:00 2001 From: JunJangE Date: Thu, 11 Jul 2024 23:34:51 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20gradle=20ktlint=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle.kts | 5 +++++ android/gradle/libs.versions.toml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index ce50b6d78..f6cf443dc 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -13,4 +13,9 @@ plugins { alias(libs.plugins.androidApplication) apply false alias(libs.plugins.jetbrainsKotlinAndroid) apply false alias(libs.plugins.android.library) apply false + alias(libs.plugins.ktlint) apply false +} + +allprojects { + apply(plugin = "org.jlleitschuh.gradle.ktlint") } diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 713da9f1c..bffb92424 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -15,6 +15,7 @@ junit-jupiter = "5.10.2" assertj-core = "3.25.3" kotest-runner-junit5 = "5.8.0" mockk = "1.13.10" +ktlint = "12.1.0" # android-library datastore = "1.1.1" @@ -89,6 +90,9 @@ retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.r okhttp-core = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" } +#ktlint +ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" } + [bundles] kotlin = ["lifecycle-runtime-ktx", "lifecycle-extensions", "coroutines-core"] android = ["androidx-constraintlayout", "androidx-activity", "androidx-appcompat", "androidx-core-ktx", "material", "image-cropper", "glide", "paging-runtime-ktx"] @@ -103,3 +107,4 @@ test = ["junit", "junit-jupiter", "assertj", "kotest", "mockk"] androidApplication = { id = "com.android.application", version.ref = "agp" } jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android-library = { id = "com.android.library", version.ref = "agp" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } From d94d2d9193a98f260a1f9a282ef644316ef64cef Mon Sep 17 00:00:00 2001 From: JunJangE Date: Thu, 11 Jul 2024 23:35:09 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20ktlint=20=EA=B2=80=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 2 +- .../com/woowacourse/friendogly/ExampleInstrumentedTest.kt | 6 ++---- .../com/woowacourse/friendogly/data/{empty.kt => Empty} | 0 .../src/main/java/com/woowacourse/friendogly/domain/Empty | 1 + .../main/java/com/woowacourse/friendogly/domain/empty.kt | 2 -- .../src/main/java/com/woowacourse/friendogly/local/Empty | 1 + .../main/java/com/woowacourse/friendogly/local/empty.kt | 2 -- .../friendogly/presentation/base/BaseFragment.kt | 7 ++++--- .../src/main/java/com/woowacourse/friendogly/remote/Empty | 1 + .../main/java/com/woowacourse/friendogly/remote/empty.kt | 2 -- .../java/com/woowacourse/friendogly/ExampleUnitTest.kt | 3 +-- 11 files changed, 11 insertions(+), 16 deletions(-) rename android/app/src/main/java/com/woowacourse/friendogly/data/{empty.kt => Empty} (100%) create mode 100644 android/app/src/main/java/com/woowacourse/friendogly/domain/Empty delete mode 100644 android/app/src/main/java/com/woowacourse/friendogly/domain/empty.kt create mode 100644 android/app/src/main/java/com/woowacourse/friendogly/local/Empty delete mode 100644 android/app/src/main/java/com/woowacourse/friendogly/local/empty.kt create mode 100644 android/app/src/main/java/com/woowacourse/friendogly/remote/Empty delete mode 100644 android/app/src/main/java/com/woowacourse/friendogly/remote/empty.kt diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 180a6f03c..37039cbcb 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -23,7 +23,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } diff --git a/android/app/src/androidTest/java/com/woowacourse/friendogly/ExampleInstrumentedTest.kt b/android/app/src/androidTest/java/com/woowacourse/friendogly/ExampleInstrumentedTest.kt index c0fdba5b8..45c9e8105 100644 --- a/android/app/src/androidTest/java/com/woowacourse/friendogly/ExampleInstrumentedTest.kt +++ b/android/app/src/androidTest/java/com/woowacourse/friendogly/ExampleInstrumentedTest.kt @@ -1,13 +1,11 @@ package com.woowacourse.friendogly -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * diff --git a/android/app/src/main/java/com/woowacourse/friendogly/data/empty.kt b/android/app/src/main/java/com/woowacourse/friendogly/data/Empty similarity index 100% rename from android/app/src/main/java/com/woowacourse/friendogly/data/empty.kt rename to android/app/src/main/java/com/woowacourse/friendogly/data/Empty diff --git a/android/app/src/main/java/com/woowacourse/friendogly/domain/Empty b/android/app/src/main/java/com/woowacourse/friendogly/domain/Empty new file mode 100644 index 000000000..81b1f992e --- /dev/null +++ b/android/app/src/main/java/com/woowacourse/friendogly/domain/Empty @@ -0,0 +1 @@ +package com.woowacourse.friendogly.data diff --git a/android/app/src/main/java/com/woowacourse/friendogly/domain/empty.kt b/android/app/src/main/java/com/woowacourse/friendogly/domain/empty.kt deleted file mode 100644 index 262279dbc..000000000 --- a/android/app/src/main/java/com/woowacourse/friendogly/domain/empty.kt +++ /dev/null @@ -1,2 +0,0 @@ -package com.woowacourse.friendogly.domain - diff --git a/android/app/src/main/java/com/woowacourse/friendogly/local/Empty b/android/app/src/main/java/com/woowacourse/friendogly/local/Empty new file mode 100644 index 000000000..81b1f992e --- /dev/null +++ b/android/app/src/main/java/com/woowacourse/friendogly/local/Empty @@ -0,0 +1 @@ +package com.woowacourse.friendogly.data diff --git a/android/app/src/main/java/com/woowacourse/friendogly/local/empty.kt b/android/app/src/main/java/com/woowacourse/friendogly/local/empty.kt deleted file mode 100644 index 5f5de1609..000000000 --- a/android/app/src/main/java/com/woowacourse/friendogly/local/empty.kt +++ /dev/null @@ -1,2 +0,0 @@ -package com.woowacourse.friendogly.local - diff --git a/android/app/src/main/java/com/woowacourse/friendogly/presentation/base/BaseFragment.kt b/android/app/src/main/java/com/woowacourse/friendogly/presentation/base/BaseFragment.kt index 4c79926d0..210838f71 100644 --- a/android/app/src/main/java/com/woowacourse/friendogly/presentation/base/BaseFragment.kt +++ b/android/app/src/main/java/com/woowacourse/friendogly/presentation/base/BaseFragment.kt @@ -25,9 +25,10 @@ abstract class BaseFragment( container: ViewGroup?, savedInstanceState: Bundle?, ): View { - _binding = DataBindingUtil.inflate(inflater, layoutResourceId, container, false).apply { - lifecycleOwner = viewLifecycleOwner - } + _binding = + DataBindingUtil.inflate(inflater, layoutResourceId, container, false).apply { + lifecycleOwner = viewLifecycleOwner + } return binding.root } diff --git a/android/app/src/main/java/com/woowacourse/friendogly/remote/Empty b/android/app/src/main/java/com/woowacourse/friendogly/remote/Empty new file mode 100644 index 000000000..81b1f992e --- /dev/null +++ b/android/app/src/main/java/com/woowacourse/friendogly/remote/Empty @@ -0,0 +1 @@ +package com.woowacourse.friendogly.data diff --git a/android/app/src/main/java/com/woowacourse/friendogly/remote/empty.kt b/android/app/src/main/java/com/woowacourse/friendogly/remote/empty.kt deleted file mode 100644 index 09a727d03..000000000 --- a/android/app/src/main/java/com/woowacourse/friendogly/remote/empty.kt +++ /dev/null @@ -1,2 +0,0 @@ -package com.woowacourse.friendogly.remote - diff --git a/android/app/src/test/java/com/woowacourse/friendogly/ExampleUnitTest.kt b/android/app/src/test/java/com/woowacourse/friendogly/ExampleUnitTest.kt index 8118b0a83..86d1c82f0 100644 --- a/android/app/src/test/java/com/woowacourse/friendogly/ExampleUnitTest.kt +++ b/android/app/src/test/java/com/woowacourse/friendogly/ExampleUnitTest.kt @@ -1,9 +1,8 @@ package com.woowacourse.friendogly +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). *