Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 4c7c1c8

Browse files
committed
Rename Lib and Plugin to plural Libs and Plugins
1 parent 2c6e538 commit 4c7c1c8

File tree

9 files changed

+40
-38
lines changed

9 files changed

+40
-38
lines changed

api-compose/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
plugin(Plugin.Android.Library)
3-
plugin(Plugin.Kotlin.Android)
2+
plugin(Plugins.Android.Library)
3+
plugin(Plugins.Kotlin.Android)
44
`publishing-config`
55
}
66

@@ -31,7 +31,7 @@ android {
3131
}
3232

3333
composeOptions {
34-
kotlinCompilerExtensionVersion = Lib.Compose.Version
34+
kotlinCompilerExtensionVersion = Libs.Compose.Version
3535
}
3636

3737
publishing {
@@ -44,5 +44,5 @@ android {
4444

4545
dependencies {
4646
api(project(":api"))
47-
api(Lib.Navigation.Compose)
47+
api(Libs.Navigation.Compose)
4848
}

api/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
plugin(Plugin.Android.Library)
3-
plugin(Plugin.Kotlin.Android)
2+
plugin(Plugins.Android.Library)
3+
plugin(Plugins.Kotlin.Android)
44
`publishing-config`
55
}
66

@@ -41,6 +41,6 @@ android {
4141
}
4242

4343
dependencies {
44-
api(Lib.Navigation.Runtime)
45-
testImplementation(Lib.Kotest.RunnerJunit5)
44+
api(Libs.Navigation.Runtime)
45+
testImplementation(Libs.Kotest.RunnerJunit5)
4646
}

build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
22

33
plugins {
4-
plugin(Plugin.NexusPublishing)
5-
plugin(Plugin.BenManesVersions)
4+
plugin(Plugins.NexusPublishing)
5+
plugin(Plugins.BenManesVersions)
66
}
77

88
tasks.withType<DependencyUpdatesTask> {

buildSrc/src/main/kotlin/Lib.kt buildSrc/src/main/kotlin/Libs.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Lib {
1+
object Libs {
22

33
object Ksp {
44
const val SymbolProcessingApi = "com.google.devtools.ksp:symbol-processing-api:1.6.10-1.0.4"

buildSrc/src/main/kotlin/Plugin.kt buildSrc/src/main/kotlin/Plugins.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fun PluginDependenciesSpec.plugin(pluginSpec: PluginSpec) {
77
id(pluginSpec.id) version (pluginSpec.version)
88
}
99

10-
object Plugin {
10+
object Plugins {
1111
object Android {
1212
private const val Version = "7.1.2"
1313
val Application = PluginSpec("com.android.application", Version)

buildSrc/src/main/kotlin/VersionStabilityLevel.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import java.util.*
22

33
enum class VersionStabilityLevel {
4-
UNKNOWN,
54
ALPHA,
65
BETA,
76
RC,
8-
RELEASE
7+
RELEASE,
8+
UNKNOWN
99
}
1010

1111
fun stabilityLevel(version: String) = version.toLowerCase(Locale.ROOT).let { lowercaseVersion ->
1212
when {
1313
isRelease(lowercaseVersion) -> VersionStabilityLevel.RELEASE
14-
lowercaseVersion.contains("rc") -> VersionStabilityLevel.RC
14+
listOf("rc", "m").any { lowercaseVersion.contains(it) } -> VersionStabilityLevel.RC
1515
lowercaseVersion.contains("beta") -> VersionStabilityLevel.BETA
1616
lowercaseVersion.contains("alpha") -> VersionStabilityLevel.ALPHA
17-
else -> VersionStabilityLevel.UNKNOWN
17+
else -> VersionStabilityLevel.UNKNOWN.also {
18+
println("Unknown stability level: $version")
19+
}
1820
}
1921
}
2022

ksp/build.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
plugins {
4-
plugin(Plugin.Kotlin.Jvm)
4+
plugin(Plugins.Kotlin.Jvm)
55
`publishing-config`
66
}
77

@@ -19,8 +19,8 @@ tasks.withType<KotlinCompile> {
1919
}
2020

2121
dependencies {
22-
implementation(Lib.Ksp.SymbolProcessingApi)
23-
implementation(Lib.KotlinPoet.Ksp) {
22+
implementation(Libs.Ksp.SymbolProcessingApi)
23+
implementation(Libs.KotlinPoet.Ksp) {
2424
exclude(module = "kotlin-reflect")
2525
}
2626
}

sample/build.gradle.kts

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
plugin(Plugin.Android.Application)
3-
plugin(Plugin.Kotlin.Android)
4-
plugin(Plugin.Ksp)
2+
plugin(Plugins.Android.Application)
3+
plugin(Plugins.Kotlin.Android)
4+
plugin(Plugins.Ksp)
55
}
66

77
android {
@@ -32,7 +32,7 @@ android {
3232
}
3333

3434
composeOptions {
35-
kotlinCompilerExtensionVersion = Lib.Compose.Version
35+
kotlinCompilerExtensionVersion = Libs.Compose.Version
3636
}
3737

3838
packagingOptions {
@@ -61,15 +61,15 @@ dependencies {
6161
implementation(project(":api-compose"))
6262
ksp(project(":ksp"))
6363

64-
implementation(Lib.Compose.Material)
65-
debugImplementation(Lib.Compose.UiTooling)
66-
implementation(Lib.Compose.UiToolingPreview)
67-
implementation(Lib.Activity.Compose)
68-
implementation(Lib.Navigation.Compose)
69-
implementation(Lib.Lifecycle.ViewModel.Ktx)
70-
implementation(Lib.Lifecycle.ViewModel.Compose)
71-
implementation(Lib.Lifecycle.ViewModel.SavedState)
64+
implementation(Libs.Compose.Material)
65+
debugImplementation(Libs.Compose.UiTooling)
66+
implementation(Libs.Compose.UiToolingPreview)
67+
implementation(Libs.Activity.Compose)
68+
implementation(Libs.Navigation.Compose)
69+
implementation(Libs.Lifecycle.ViewModel.Ktx)
70+
implementation(Libs.Lifecycle.ViewModel.Compose)
71+
implementation(Libs.Lifecycle.ViewModel.SavedState)
7272

73-
androidTestImplementation(Lib.Test.Core)
74-
androidTestImplementation(Lib.Compose.UiTestJunit4)
73+
androidTestImplementation(Libs.Test.Core)
74+
androidTestImplementation(Libs.Compose.UiTestJunit4)
7575
}

tests/build.gradle.kts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
plugin(Plugin.Android.Library)
3-
plugin(Plugin.Kotlin.Android)
4-
plugin(Plugin.Ksp)
2+
plugin(Plugins.Android.Library)
3+
plugin(Plugins.Kotlin.Android)
4+
plugin(Plugins.Ksp)
55
}
66

77
android {
@@ -45,6 +45,6 @@ android {
4545
dependencies {
4646
implementation(project(":api-compose"))
4747
ksp(project(":ksp"))
48-
testImplementation(Lib.Kotest.RunnerJunit5)
49-
testImplementation(Lib.Kotest.FrameworkDataset)
48+
testImplementation(Libs.Kotest.RunnerJunit5)
49+
testImplementation(Libs.Kotest.FrameworkDataset)
5050
}

0 commit comments

Comments
 (0)