-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update version catalog & build-logic
- Loading branch information
Showing
30 changed files
with
497 additions
and
600 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ build/ | |
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
.kotlin | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
plugins { | ||
alias(libs.plugins.murjune.kotlin.module) | ||
alias(libs.plugins.murjune.jvm.library) | ||
alias(libs.plugins.murjune.unit.test) | ||
} | ||
|
||
group = "com.murjune.practice.algorithm" |
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 |
---|---|---|
@@ -1,70 +1,57 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
group = "com.murjune.practice.buildlogic" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
kotlin { | ||
compilerOptions { | ||
jvmTarget = JvmTarget.JVM_17 | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly(libs.kotlin.gradleplugin) | ||
compileOnly(libs.agp) | ||
compileOnly(libs.android.gradlePlugin) | ||
compileOnly(libs.kotlin.gradlePlugin) | ||
compileOnly(libs.ksp.gradlePlugin) | ||
compileOnly(libs.room.gradlePlugin) | ||
compileOnly(libs.compose.gradlePlugin) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("android-application") { | ||
id = "com.murjune.practice.application" | ||
id = libs.plugins.murjune.android.application.get().pluginId | ||
implementationClass = | ||
"com.murjune.practice.plugins.AndroidApplicationPlugin" | ||
} | ||
create("android-library") { | ||
id = "com.murjune.practice.library" | ||
implementationClass = "com.murjune.practice.plugins.AndroidLibraryPlugin" | ||
"AndroidApplicationPlugin" | ||
} | ||
create("android-feature") { | ||
id = "com.murjune.practice.feature" | ||
implementationClass = "com.murjune.practice.plugins.AndroidFeaturePlugin" | ||
} | ||
create("android-hilt") { | ||
id = "com.murjune.practice.hilt" | ||
implementationClass = "com.murjune.practice.plugins.AndroidHiltPlugin" | ||
id = libs.plugins.murjune.android.feature.get().pluginId | ||
implementationClass = "AndroidFeaturePlugin" | ||
} | ||
create("android-test") { | ||
id = "com.murjune.practice.android.test" | ||
implementationClass = "com.murjune.practice.plugins.AndroidTestPlugin" | ||
} | ||
create("compose") { | ||
id = "com.murjune.practice.compose" | ||
implementationClass = "com.murjune.practice.plugins.ComposePlugin" | ||
create("android-library") { | ||
id = libs.plugins.murjune.android.library.get().pluginId | ||
implementationClass = "AndroidLibraryPlugin" | ||
} | ||
create("compose-test") { | ||
id = "com.murjune.practice.compose.test" | ||
implementationClass = "com.murjune.practice.plugins.ComposeTestPlugin" | ||
create("android-compose") { | ||
id = libs.plugins.murjune.android.compose.get().pluginId | ||
implementationClass = "ComposePlugin" | ||
} | ||
create("kotlin-serialization") { | ||
id = "com.murjune.practice.kotlinx_serialization" | ||
create("kotlinx-serialization") { | ||
id = libs.plugins.murjune.kotlinx.serialization.get().pluginId | ||
implementationClass = | ||
"com.murjune.practice.plugins.KotlinSerializationPlugin" | ||
"KotlinSerializationPlugin" | ||
} | ||
|
||
register("kotlin-module") { | ||
id = "com.murjune.practice.kotlin.module" | ||
implementationClass = "com.murjune.practice.plugins.KotlinModulePlugin" | ||
} | ||
|
||
create("unit-test") { | ||
id = "com.murjune.practice.unit.test" | ||
implementationClass = "com.murjune.practice.plugins.UnitTestPlugin" | ||
id = libs.plugins.murjune.unit.test.get().pluginId | ||
implementationClass = "UnitTestPlugin" | ||
} | ||
|
||
register("jvm-library") { | ||
id = "com.murjune.practice.jvm.library" | ||
implementationClass = "com.murjune.practice.plugins.JvmLibraryPlugin" | ||
id = libs.plugins.murjune.jvm.library.get().pluginId | ||
implementationClass = "JvmLibraryPlugin" | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
build-logic/convention/src/main/kotlin/AndroidApplicationPlugin.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,69 @@ | ||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.android.build.gradle.BaseExtension | ||
import com.murjune.practice.plugins.configureAndroidCompose | ||
import com.murjune.practice.plugins.configureKotlinAndroid | ||
import com.murjune.practice.plugins.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 | ||
import org.gradle.kotlin.dsl.getByType | ||
|
||
class AndroidApplicationPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
apply(plugin = "com.android.application") | ||
apply(plugin = "org.jetbrains.kotlin.plugin.compose") | ||
apply(plugin = "kotlin-android") | ||
|
||
extensions.getByType<BaseExtension>().apply { | ||
buildFeatures.apply { | ||
buildConfig = true | ||
} | ||
} | ||
|
||
extensions.configure<ApplicationExtension> { | ||
configureKotlinAndroid(this) | ||
configureAndroidCompose(this) | ||
defaultConfig.targetSdk = | ||
libs.findVersion("targetSdk").get().requiredVersion.toInt() | ||
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
defaultConfig.testInstrumentationRunnerArguments["runnerBuilder"] = | ||
"de.mannodermaus.junit5.AndroidJUnit5Builder" | ||
|
||
packaging { | ||
resources.excludes.apply { | ||
add("META-INF/**") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
"implementation"(libs.findLibrary("androidx.core.ktx").get()) | ||
"implementation"(libs.findLibrary("androidx.activity.compose").get()) | ||
"implementation"(libs.findLibrary("androidx.navigation.compose").get()) | ||
"implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) | ||
"implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) | ||
"implementation"(libs.findLibrary("kotlinx.coroutines.android").get()) | ||
"implementation"(libs.findLibrary("kotlinx.datetime").get()) | ||
"implementation"(libs.findLibrary("timber").get()) | ||
|
||
"testImplementation"(libs.findLibrary("androidx.navigation.testing").get()) | ||
"testImplementation"(libs.findBundle("unit.test").get()) | ||
"testRuntimeOnly"(libs.findLibrary("junit5.vintage").get()) | ||
|
||
"androidTestImplementation"(libs.findBundle("androidx.android.test").get()) | ||
"androidTestImplementation"(libs.findBundle("unit.test").get()) | ||
"androidTestImplementation"(libs.findLibrary("junit5.android.test.core").get()) | ||
"androidTestImplementation"( | ||
libs.findLibrary("androidx.lifecycle.runtimeTesting").get() | ||
) | ||
"androidTestImplementation"(libs.findLibrary("androidx.navigation.testing").get()) | ||
"androidTestImplementation"(libs.findLibrary("androidx.test.core").get()) | ||
"androidTestImplementation"(libs.findLibrary("androidx.test.espresso.core").get()) | ||
"androidTestRuntimeOnly"(libs.findLibrary("junit5.android.test.runner").get()) | ||
} | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
build-logic/convention/src/main/kotlin/AndroidFeaturePlugin.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,24 @@ | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.apply | ||
import org.gradle.kotlin.dsl.dependencies | ||
import com.murjune.practice.plugins.libs | ||
|
||
class AndroidFeaturePlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
apply<AndroidLibraryPlugin>() | ||
apply<KotlinSerializationPlugin>() | ||
|
||
dependencies { | ||
"implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) | ||
"implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) | ||
"implementation"(libs.findLibrary("androidx.navigation.compose").get()) | ||
"testImplementation"(libs.findLibrary("androidx.navigation.testing").get()) | ||
"androidTestImplementation"( | ||
libs.findLibrary("androidx.lifecycle.runtimeTesting").get(), | ||
) | ||
} | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
build-logic/convention/src/main/kotlin/AndroidLibraryPlugin.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,50 @@ | ||
import com.android.build.gradle.BaseExtension | ||
import com.android.build.gradle.LibraryExtension | ||
import com.murjune.practice.plugins.configureKotlinAndroid | ||
import com.murjune.practice.plugins.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 | ||
import org.gradle.kotlin.dsl.getByType | ||
|
||
class AndroidLibraryPlugin : Plugin<Project> { | ||
override fun apply(target: Project) = | ||
with(target) { | ||
apply(plugin = "com.android.library") | ||
apply(plugin = "kotlin-android") | ||
|
||
extensions.getByType<BaseExtension>().apply { | ||
buildFeatures.apply { | ||
buildConfig = true | ||
} | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureKotlinAndroid(this) | ||
defaultConfig.targetSdk = | ||
libs.findVersion("targetSdk").get().requiredVersion.toInt() | ||
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
defaultConfig.testInstrumentationRunnerArguments["runnerBuilder"] = | ||
"de.mannodermaus.junit5.AndroidJUnit5Builder" | ||
|
||
packaging { | ||
resources.excludes.apply { | ||
add("META-INF/**") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
"implementation"(libs.findLibrary("kotlinx.coroutines.android").get()) | ||
"implementation"(libs.findLibrary("kotlinx.datetime").get()) | ||
"testImplementation"(libs.findBundle("unit.test").get()) | ||
"testRuntimeOnly"(libs.findLibrary("junit5.vintage").get()) | ||
"androidTestImplementation"(libs.findBundle("androidx.android.test").get()) | ||
"androidTestImplementation"(libs.findBundle("unit.test").get()) | ||
"androidTestImplementation"(libs.findLibrary("junit5.android.test.core").get()) | ||
"androidTestRuntimeOnly"(libs.findLibrary("junit5.android.test.runner").get()) | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
build-logic/convention/src/main/kotlin/ComposeLibraryPlugin.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,16 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import com.murjune.practice.plugins.configureAndroidCompose | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.apply | ||
import org.gradle.kotlin.dsl.getByType | ||
|
||
class ComposeLibraryPlugin : Plugin<Project> { | ||
override fun apply(target: Project) = with(target) { | ||
apply(plugin = "com.android.library") | ||
apply(plugin = "org.jetbrains.kotlin.plugin.compose") | ||
|
||
val extension = extensions.getByType<LibraryExtension>() | ||
configureAndroidCompose(extension) | ||
} | ||
} |
7 changes: 1 addition & 6 deletions
7
...june/practice/plugins/JvmLibraryPlugin.kt → ...ntion/src/main/kotlin/JvmLibraryPlugin.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
5 changes: 1 addition & 4 deletions
5
...tice/plugins/KotlinSerializationPlugin.kt → .../main/kotlin/KotlinSerializationPlugin.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
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
36 changes: 0 additions & 36 deletions
36
...logic/convention/src/main/kotlin/com/murjune/practice/plugins/AndroidApplicationPlugin.kt
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
build-logic/convention/src/main/kotlin/com/murjune/practice/plugins/AndroidFeaturePlugin.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.