Skip to content

Commit ddd5159

Browse files
Merge pull request #44 from SpineEventEngine/bump-base
Bump dependencies, introduce `BomsPlugin`
2 parents 030ce7d + 92bc50f commit ddd5159

File tree

91 files changed

+2402
-1242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2402
-1242
lines changed

.gitignore

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#
2-
# Copyright 2020, TeamDev. All rights reserved.
2+
# Copyright 2025, TeamDev. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
77
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
8+
# https://www.apache.org/licenses/LICENSE-2.0
99
#
1010
# Redistribution and use in source and/or binary forms, with or without
1111
# modification, must retain the above copyright notice and the following
@@ -36,7 +36,9 @@
3636

3737
# Internal tool directories.
3838
.fleet/
39-
.kotlin/
39+
40+
# Kotlin temp directories.
41+
**/.kotlin/
4042

4143
# IntelliJ IDEA modules and interim config files.
4244
*.iml
@@ -56,16 +58,20 @@
5658
# Gradle interim configs
5759
**/.gradle/**
5860

61+
# Temp directory for Gradle TestKit runners
62+
**/.gradle-test-kit/**
63+
5964
# Generated source code
6065
**/generated/**
66+
**/*.pb.dart
67+
**/*.pbenum.dart
68+
**/*.pbserver.dart
69+
**/*.pbjson.dart
6170

6271
# Gradle build files
6372
**/build/**
6473
!**/src/**/build/**
6574

66-
# Do not ignore `build` dependency objects.
67-
!**/buildSrc/src/main/kotlin/io/spine/dependency/build/**
68-
6975
# Build files produced by the IDE
7076
**/out/**
7177

@@ -84,9 +90,6 @@ gradle-app.setting
8490
# Spine internal directory for storing intermediate artifacts
8591
**/.spine/**
8692

87-
# Spine model compiler auto-generated resources
88-
/tools/gradle-plugins/model-compiler/src/main/resources/spine-protoc.gradle
89-
9093
# Login details to Maven repository.
9194
# Each workstation should have developer's login defined in this file.
9295
credentials.tar
@@ -110,3 +113,8 @@ hs_err_pid*
110113

111114
.packages
112115
pubspec.lock
116+
117+
# Ignore the `tmp` directory used for building dependant repositories.
118+
/tmp
119+
120+
.gradle-test-kit/

.idea/codeStyles/Project.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/common.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@
2626

2727
@file:Suppress("RemoveRedundantQualifierName")
2828

29+
import io.spine.dependency.boms.BomsPlugin
2930
import io.spine.dependency.build.Dokka
31+
import io.spine.dependency.build.JSpecify
3032
import io.spine.dependency.lib.KotlinPoet
31-
import io.spine.dependency.lib.KotlinX
32-
import io.spine.dependency.test.JUnit
3333
import io.spine.dependency.lib.Protobuf
34-
import io.spine.dependency.local.Spine
3534
import io.spine.dependency.local.Base
35+
import io.spine.dependency.local.CoreJava
3636
import io.spine.dependency.local.Logging
3737
import io.spine.dependency.local.ProtoData
38-
import io.spine.dependency.local.TestLib
3938
import io.spine.dependency.local.ToolBase
4039
import io.spine.dependency.local.Validation
4140
import io.spine.gradle.VersionWriter
@@ -45,9 +44,9 @@ import io.spine.gradle.publish.IncrementGuard
4544
import io.spine.gradle.publish.PublishingRepos
4645
import io.spine.gradle.publish.PublishingRepos.gitHub
4746
import io.spine.gradle.publish.spinePublishing
47+
import io.spine.gradle.repo.standardToSpineSdk
4848
import io.spine.gradle.report.license.LicenseReporter
4949
import io.spine.gradle.report.pom.PomGenerator
50-
import io.spine.gradle.standardToSpineSdk
5150

5251
buildscript {
5352
apply(from = "$projectDir/version.gradle.kts")
@@ -75,17 +74,20 @@ buildscript {
7574
plugins {
7675
`jvm-module`
7776
protobuf
77+
ksp
78+
`module-testing`
7879
}
80+
apply<BomsPlugin>()
7981

8082
// Cannot use `id()` syntax for McJava because it's not yet published to the Plugin Portal
81-
// and is added to the build classpath via `buildScript` block above.
83+
// and is added to the build classpath via the `buildScript` block above.
8284
apply(plugin = "io.spine.mc-java")
8385

8486
apply<IncrementGuard>()
8587
apply<VersionWriter>()
8688

89+
8790
apply(from = "$projectDir/version.gradle.kts")
88-
val baseVersion: String by extra
8991
val versionToPublish: String by extra
9092

9193
group = "io.spine"
@@ -102,13 +104,7 @@ configurations {
102104
all {
103105
resolutionStrategy {
104106
force(
105-
KotlinX.Coroutines.bom,
106-
KotlinX.Coroutines.core,
107-
KotlinX.Coroutines.coreJvm,
108-
KotlinX.Coroutines.debug,
109-
KotlinX.Coroutines.jdk8,
110-
KotlinX.Coroutines.test,
111-
KotlinX.Coroutines.testJvm,
107+
JSpecify.annotations,
112108
KotlinPoet.lib,
113109
Dokka.BasePlugin.lib,
114110
Protobuf.compiler,
@@ -117,7 +113,7 @@ configurations {
117113
ToolBase.lib,
118114
ProtoData.api,
119115
Validation.runtime,
120-
JUnit.runner,
116+
CoreJava.server,
121117
)
122118
}
123119
}
@@ -126,9 +122,6 @@ configurations {
126122
dependencies {
127123
implementation(Base.lib)
128124
implementation(Validation.runtime)
129-
130-
testImplementation(JUnit.runner)
131-
testImplementation(TestLib.lib)
132125
}
133126

134127
spinePublishing {
@@ -150,3 +143,7 @@ JavadocConfig.applyTo(project)
150143
PomGenerator.applyTo(project)
151144
LicenseReporter.generateReportIn(project)
152145
LicenseReporter.mergeAllReports(project)
146+
147+
afterEvaluate {
148+
protoDataRemoteDebug(enabled = false)
149+
}

buildSrc/build.gradle.kts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ repositories {
5353
* Please keep this value in sync with [io.spine.dependency.lib.Jackson.version].
5454
* It is not a requirement but would be good in terms of consistency.
5555
*/
56-
val jacksonVersion = "2.15.3"
56+
val jacksonVersion = "2.18.3"
5757

5858
/**
5959
* The version of Google Artifact Registry used by `buildSrc`.
@@ -75,15 +75,15 @@ val grGitVersion = "4.1.1"
7575
* This version may change from the [version of Kotlin][io.spine.dependency.lib.Kotlin.version]
7676
* used by the project.
7777
*/
78-
val kotlinVersion = "2.1.20"
78+
val kotlinEmbeddedVersion = "2.1.20"
7979

8080
/**
8181
* The version of Guava used in `buildSrc`.
8282
*
8383
* Always use the same version as the one specified in [io.spine.dependency.lib.Guava].
8484
* Otherwise, when testing Gradle plugins, clashes may occur.
8585
*/
86-
val guavaVersion = "32.1.3-jre"
86+
val guavaVersion = "33.4.8-jre"
8787

8888
/**
8989
* The version of ErrorProne Gradle plugin.
@@ -93,7 +93,7 @@ val guavaVersion = "32.1.3-jre"
9393
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
9494
* Error Prone Gradle Plugin Releases</a>
9595
*/
96-
val errorPronePluginVersion = "4.1.0"
96+
val errorPronePluginVersion = "4.2.0"
9797

9898
/**
9999
* The version of Protobuf Gradle Plugin.
@@ -113,7 +113,7 @@ val protobufPluginVersion = "0.9.4"
113113
* @see <a href="https://github.com/Kotlin/dokka/releases">
114114
* Dokka Releases</a>
115115
*/
116-
val dokkaVersion = "1.9.20"
116+
val dokkaVersion = "2.0.0"
117117

118118
/**
119119
* The version of Detekt Gradle Plugin.
@@ -130,7 +130,7 @@ val kotestJvmPluginVersion = "0.4.10"
130130
/**
131131
* @see [io.spine.dependency.test.Kover]
132132
*/
133-
val koverVersion = "0.7.2"
133+
val koverVersion = "0.9.1"
134134

135135
/**
136136
* The version of the Shadow Plugin.
@@ -148,9 +148,9 @@ configurations.all {
148148
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
149149

150150
// Force Kotlin lib versions avoiding using those bundled with Gradle.
151-
"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion",
152-
"org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion",
153-
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
151+
"org.jetbrains.kotlin:kotlin-stdlib:$kotlinEmbeddedVersion",
152+
"org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinEmbeddedVersion",
153+
"org.jetbrains.kotlin:kotlin-reflect:$kotlinEmbeddedVersion"
154154
)
155155
}
156156
}
@@ -167,6 +167,7 @@ kotlin {
167167

168168
dependencies {
169169
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
170+
api(platform("org.jetbrains.kotlin:kotlin-bom:$kotlinEmbeddedVersion"))
170171
dependOnAuthCommon()
171172

172173
listOf(
@@ -175,17 +176,17 @@ dependencies {
175176
"com.github.jk1:gradle-license-report:$licenseReportVersion",
176177
"com.google.guava:guava:$guavaVersion",
177178
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
178-
"gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}",
179+
"gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion",
179180
"io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion",
180181
"io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion",
181182
// https://github.com/srikanth-lingala/zip4j
182183
"net.lingala.zip4j:zip4j:2.10.0",
183-
"net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}",
184-
"org.ajoberstar.grgit:grgit-core:${grGitVersion}",
185-
"org.jetbrains.dokka:dokka-base:${dokkaVersion}",
184+
"net.ltgt.gradle:gradle-errorprone-plugin:$errorPronePluginVersion",
185+
"org.ajoberstar.grgit:grgit-core:$grGitVersion",
186+
"org.jetbrains.dokka:dokka-base:$dokkaVersion",
186187
"org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}",
187-
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
188-
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
188+
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinEmbeddedVersion",
189+
"org.jetbrains.kotlin:kotlin-reflect:$kotlinEmbeddedVersion",
189190
"org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion"
190191
).forEach {
191192
implementation(it)

buildSrc/src/main/kotlin/BuildExtensions.kt

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
import io.spine.dependency.build.ErrorProne
3030
import io.spine.dependency.build.GradleDoctor
3131
import io.spine.dependency.build.Ksp
32+
import io.spine.dependency.build.PluginPublishPlugin
3233
import io.spine.dependency.lib.Protobuf
3334
import io.spine.dependency.local.McJava
3435
import io.spine.dependency.local.ProtoData
3536
import io.spine.dependency.local.ProtoTap
3637
import io.spine.dependency.test.Kotest
3738
import io.spine.dependency.test.Kover
38-
import io.spine.gradle.standardToSpineSdk
39+
import io.spine.gradle.repo.standardToSpineSdk
3940
import org.gradle.api.Project
4041
import org.gradle.api.Task
4142
import org.gradle.api.tasks.JavaExec
@@ -66,7 +67,7 @@ import org.gradle.plugin.use.PluginDependencySpec
6667
private const val ABOUT_DEPENDENCY_EXTENSIONS = ""
6768

6869
/**
69-
* Applies [standard][standardToSpineSdk] repositories to this `buildscript`.
70+
* Applies [standard][io.spine.gradle.repo.standardToSpineSdk] repositories to this `buildscript`.
7071
*/
7172
fun ScriptHandlerScope.standardSpineSdkRepositories() {
7273
repositories.standardToSpineSdk()
@@ -150,6 +151,9 @@ val PluginDependenciesSpec.kover: PluginDependencySpec
150151
val PluginDependenciesSpec.ksp: PluginDependencySpec
151152
get() = id(Ksp.id).version(Ksp.version)
152153

154+
val PluginDependenciesSpec.`plugin-publish`: PluginDependencySpec
155+
get() = id(PluginPublishPlugin.id).version(PluginPublishPlugin.version)
156+
153157
/**
154158
* Configures the dependencies between third-party Gradle tasks
155159
* and those defined via ProtoData and Spine Model Compiler.
@@ -226,7 +230,29 @@ fun Project.configureTaskDependencies() {
226230
* By convention, such modules are for integration tests and should be treated differently.
227231
*/
228232
val Project.productionModules: Iterable<Project>
229-
get() = rootProject.subprojects.filter { !it.name.contains("-tests") }
233+
get() = rootProject.subprojects.filterNot { subproject ->
234+
subproject.name.run {
235+
contains("-tests")
236+
|| contains("test-fixtures")
237+
|| contains("integration-tests")
238+
}
239+
}
240+
241+
/**
242+
* Obtains the names of the [productionModules].
243+
*
244+
* The extension could be useful for excluding modules from standard publishing:
245+
* ```kotlin
246+
* spinePublishing {
247+
* val customModule = "my-custom-module"
248+
* modules = productionModuleNames.toSet().minus(customModule)
249+
* modulesWithCustomPublishing = setOf(customModule)
250+
* //...
251+
* }
252+
* ```
253+
*/
254+
val Project.productionModuleNames: List<String>
255+
get() = productionModules.map { it.name }
230256

231257
/**
232258
* Sets the remote debug option for this [JavaExec] task.

buildSrc/src/main/kotlin/BuildSettings.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3535
object BuildSettings {
3636
private const val JVM_VERSION = 17
3737
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION)
38+
@Suppress("unused")
3839
val javaVersionCompat = JavaVersion.toVersion(JVM_VERSION)
3940
val jvmTarget = JvmTarget.JVM_17
4041
const val REMOTE_DEBUG_PORT = 5566

0 commit comments

Comments
 (0)