-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from BCSDLab/feature/gradle-cleanup
Migration Groovy to Kotlin DSL
- Loading branch information
Showing
23 changed files
with
409 additions
and
372 deletions.
There are no files selected for viewing
This file contains 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
12 changes: 7 additions & 5 deletions
12
build-logic/convention/src/main/java/AndroidApplicationHiltConventionPlugin.kt
This file contains 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
26 changes: 26 additions & 0 deletions
26
build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt
This file contains 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,26 @@ | ||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.android.build.api.dsl.LibraryExtension | ||
import `in`.koreatech.convention.configureAndroidLibrary | ||
import `in`.koreatech.convention.configureAndroidTest | ||
import `in`.koreatech.convention.configureTest | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
internal class AndroidLibraryConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("org.jetbrains.kotlin.kapt") | ||
apply("org.jetbrains.kotlin.android") | ||
} | ||
extensions.configure<LibraryExtension> { | ||
configureAndroidLibrary(this) | ||
configureTest() | ||
configureAndroidTest() | ||
} | ||
} | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
build-logic/convention/src/main/java/FirebaseConventionPlugin.kt
This file contains 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,22 @@ | ||
import `in`.koreatech.convention.implementation | ||
import `in`.koreatech.convention.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.extra | ||
|
||
internal class FirebaseConventionPlugin: Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.google.firebase.crashlytics") | ||
apply("com.google.firebase.appdistribution") | ||
} | ||
dependencies { | ||
implementation(platform(libs.findLibrary("firebase-bom").get())) | ||
implementation(libs.findBundle("firebase").get()) | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
build-logic/convention/src/main/java/JavaLibraryConventionPlugin.kt
This file contains 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 @@ | ||
import `in`.koreatech.convention.configureKotlinJvm | ||
import `in`.koreatech.convention.implementation | ||
import `in`.koreatech.convention.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.dependencies | ||
|
||
class JavaLibraryConventionPlugin: Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("java-library") | ||
} | ||
dependencies { | ||
implementation(libs.findLibrary("javax-inject").get()) | ||
} | ||
configureKotlinJvm() | ||
} | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
build-logic/convention/src/main/java/in/koreatech/convention/AndoriodHilt.kt
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
build-logic/convention/src/main/java/in/koreatech/convention/AndroidLibrary.kt
This file contains 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,41 @@ | ||
package `in`.koreatech.convention | ||
|
||
import com.android.build.api.dsl.CommonExtension | ||
import com.android.build.api.dsl.LibraryExtension | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
|
||
internal fun Project.configureAndroidLibrary( | ||
commonExtension: CommonExtension<*, *, *, *>, | ||
) { | ||
(commonExtension as? LibraryExtension)?.let { | ||
it.defaultConfig.targetSdk = 34 | ||
} | ||
|
||
commonExtension.apply { | ||
(this as? LibraryExtension)?.let { | ||
it.defaultConfig.targetSdk = 34 | ||
} | ||
|
||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_11.toString() | ||
} | ||
|
||
packagingOptions { | ||
resources.excludes += "DebugProbesKt.bin" | ||
} | ||
} | ||
} |
This file contains 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
14 changes: 14 additions & 0 deletions
14
build-logic/convention/src/main/java/in/koreatech/convention/KotlinAndroid.kt
This file contains 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,14 @@ | ||
package `in`.koreatech.convention | ||
|
||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.kotlin.dsl.configure | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
|
||
internal fun Project.configureKotlinJvm() { | ||
extensions.configure<JavaPluginExtension> { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
} |
This file contains 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.