Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
# indices, external-storage toggles) — so `.idea/*.xml` above keeps it ignored.
# `./config/pull` (via `migrate`) untracks any copy an earlier pull committed.

# `.idea/kotlinc.xml` is likewise NOT re-included. It records the Kotlin compiler
# settings IDEA rewrites on its own (JVM target, bundled plugin version), so it
# churns per machine and per IDE build — `.idea/*.xml` above keeps it ignored.

# Do not ignore the following IDEA settings
!.idea/codeStyleSettings.xml
!.idea/codeStyles/
Expand Down
39 changes: 0 additions & 39 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,9 @@

@file:Suppress("RemoveRedundantQualifierName") // To prevent IDEA replacing FQN imports.

import io.spine.dependency.lib.Grpc
import io.spine.dependency.lib.KotlinPoet
import io.spine.dependency.lib.Roaster
import io.spine.dependency.local.Base
import io.spine.dependency.local.Compiler
import io.spine.dependency.local.CoreJvm
import io.spine.dependency.local.Logging
import io.spine.dependency.local.Spine
import io.spine.dependency.local.Time
import io.spine.dependency.local.ToolBase
import io.spine.dependency.local.Validation
import io.spine.gradle.publish.PublishingRepos
import io.spine.gradle.publish.spinePublishing
import io.spine.gradle.repo.standardToSpineSdk
Expand Down Expand Up @@ -109,37 +101,6 @@ allprojects {
repositories.standardToSpineSdk()
group = Spine.toolsGroup
version = extra["validationVersion"]!!

configurations.all {
exclude(group = "io.spine", module = "spine-flogger-api")
exclude(group = "io.spine", module = "spine-logging-backend")

resolutionStrategy {
@Suppress("DEPRECATION") // `Kotlin.stdLibJdk7` is a transitive dependency.
force(
Base.lib,
Compiler.api,
Compiler.backend,
Compiler.gradleApi,
Compiler.jvm,
Compiler.params,
Compiler.pluginLib,
CoreJvm.client,
CoreJvm.server,
Grpc.bom,
KotlinPoet.lib,
Logging.lib,
Roaster.api,
Roaster.jdt,
Time.lib,
Time.javaExtensions,
Time.kotlinExtensions,
ToolBase.lib,
ToolBase.pluginBase,
Validation.javaBundle,
)
}
}
}

KoverConfig.applyTo(rootProject)
Expand Down
16 changes: 14 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ repositories {
/**
* The version of Jackson used by `buildSrc`.
*
* Please keep this value in sync with [io.spine.dependency.lib.Jackson.version].
* It is not a requirement but would be good in terms of consistency.
* This value is deliberately decoupled from [io.spine.dependency.lib.Jackson.version],
* which now points to Jackson 3.x. The `buildSrc` sources still use the Jackson 2.x API
* (`com.fasterxml.jackson.*`), so they must stay on a 2.x version until they are migrated
* to `tools.jackson.*`. Any maintained 2.x release will do — bump this only when `buildSrc`
* itself needs a fix from a later 2.x, not to track the newest one.
*/
val jacksonVersion = "2.18.3"

Expand Down Expand Up @@ -210,11 +213,20 @@ dependencies {
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation(gradleTestKit())
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.test {
useJUnitPlatform()

// Functional tests run real Gradle builds via TestKit and inject the production
// classes of `buildSrc` into the build script classpath of those builds.
// The argument provider defers resolving the classpath to execution time.
val mainClasspath = sourceSets.main.get().runtimeClasspath
jvmArgumentProviders.add(CommandLineArgumentProvider {
Comment thread
alexander-yevsyukov marked this conversation as resolved.
listOf("-DbuildSrc.classpath=${mainClasspath.asPath}")
})
}

dependOnBuildSrcJar()
Expand Down
11 changes: 6 additions & 5 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,12 @@ fun Project.allowDuplicationInSourcesJar() {
*
* Build script classpaths pin the module to the version used by the Kotlin
* runtime embedded into Gradle (`strictly 13.0`, "Pinned to the embedded
* Kotlin"), while `kotlinx-coroutines` and other transitive dependencies of
* this plugin require `23.0.0`. Gradle 9.6 may fail to reconcile the two
* declarations — the outcome depends on the shape of the consumer's dependency
* graph — making the plugin unresolvable without a consumer-side workaround,
* such as forcing the module version on the build script classpath.
* Kotlin"), while `kotlinx-coroutines` and other transitive dependencies require
* later versions such as `23.0.0`.
* Gradle 9.6 may fail to reconcile the two declarations — the outcome depends on
* the shape of the consumer's dependency graph — making the plugin unresolvable
* without a consumer-side workaround, such as forcing the module version on
* the build script classpath.
*
* The annotations are compile-time metadata, not needed at runtime.
* Consumers still receive version `13.0` through the `kotlin-stdlib`
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/ForcePlugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fun ScriptHandlerScope.forceCodegenPlugins() {

dependencies {
CoreJvmCompiler.run {
classpath(pluginLib(version))
classpath(gradlePlugin(version))
}
spineCompiler.run {
classpath(pluginLib(version))
Expand All @@ -59,7 +59,7 @@ fun ScriptHandlerScope.forceCodegenPlugins() {
spineCompiler.backend,
spineCompiler.protocPlugin,

CoreJvmCompiler.pluginsArtifact
CoreJvmCompiler.compilerPlugins
)
}
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/io/spine/dependency/boms/Boms.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package io.spine.dependency.boms

import io.spine.dependency.DependencyWithBom
import io.spine.dependency.kotlinx.Coroutines
import io.spine.dependency.lib.Jackson
import io.spine.dependency.lib.JacksonV2
import io.spine.dependency.lib.Kotlin
import io.spine.dependency.lib.Grpc
import io.spine.dependency.test.JUnit
Expand Down Expand Up @@ -60,7 +60,7 @@ object Boms {
* Technology-based BOMs.
*/
object Optional {
val jackson = Jackson.bom
val jackson = JacksonV2.bom
val grpc = Grpc.bom
}
}
87 changes: 64 additions & 23 deletions buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,35 @@ package io.spine.dependency.lib
import io.spine.dependency.Dependency
import io.spine.dependency.DependencyWithBom

// https://github.com/FasterXML/jackson/wiki/Jackson-Releases
@Suppress("unused")
/**
* Jackson library dependencies.
*
* Jackson 3.x uses the `tools.jackson` group ID and the matching `tools.jackson.*`
* packages ([JSTEP-1](https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-1)).
* The sole exception is `jackson-annotations`: Jackson 3.x keeps
* consuming the 2.x artifact, so both its coordinates and its
* `com.fasterxml.jackson.annotation` package stay unchanged.
*
* The Jackson 2.x artifacts, which some of our dependencies still consume,
* are declared by [JacksonV2].
*
* See:
* - [Jackson Releases](https://github.com/FasterXML/jackson/wiki/Jackson-Releases)
* - [Migrating to Jackson 3](https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md)
*/
@Suppress("unused", "ConstPropertyName")
object Jackson : DependencyWithBom() {
override val group = "com.fasterxml.jackson"
override val version = "2.22.1"

// https://github.com/FasterXML/jackson-annotations?tab=readme-ov-file#release-notes
override val group = "tools.jackson"
override val version = "3.2.1"

/**
* The version of `jackson-annotations`, which Jackson 3.x deliberately keeps
* on the 2.x line.
*
* Must match the `jackson.version.annotations` property declared by the [JacksonV2.bom].
*
* See: https://github.com/FasterXML/jackson-annotations?tab=readme-ov-file#release-notes
*/
const val annotationsVersion = "2.22"

// https://github.com/FasterXML/jackson-bom
Expand All @@ -54,19 +76,23 @@ object Jackson : DependencyWithBom() {
val databind = "$coreGroup:jackson-databind"

// https://github.com/FasterXML/jackson-annotations
val annotations = "$coreGroup:jackson-annotations:$annotationsVersion"
val annotations = "com.fasterxml.jackson.core:jackson-annotations:$annotationsVersion"

// https://github.com/FasterXML/jackson-module-kotlin/releases
val moduleKotlin = "$moduleGroup:jackson-module-kotlin"

// https://github.com/FasterXML/jackson-modules-java8
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("Jackson.databind", "io.spine.dependency.lib.Jackson"),
level = DeprecationLevel.ERROR
)
val moduleParameterNames = "$moduleGroup:jackson-module-parameter-names"

override val modules = listOf(
core,
databind,
moduleKotlin,
moduleParameterNames
moduleKotlin
)

object DataFormat : Dependency() {
Expand All @@ -81,10 +107,13 @@ object Jackson : DependencyWithBom() {
// https://github.com/FasterXML/jackson-dataformats-text/releases
val yaml = "$group:$infix-yaml"

// https://github.com/FasterXML/jackson-dataformats-binary/tree/3.x/protobuf
val protobuf = "$group:$infix-protobuf"

val xmlArtifact = "$xml:$version"
val yamlArtifact = "$yaml:$version"

override val modules = listOf(xml, yaml)
override val modules = listOf(xml, yaml, protobuf)
}

object DataType : Dependency() {
Expand All @@ -93,38 +122,50 @@ object Jackson : DependencyWithBom() {

private const val infix = "jackson-datatype"

// https://github.com/FasterXML/jackson-modules-java8
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("Jackson.databind", "io.spine.dependency.lib.Jackson"),
level = DeprecationLevel.ERROR
)
val jdk8 = "$group:$infix-jdk8"

// https://github.com/FasterXML/jackson-modules-java8/tree/2.19/datetime
@Deprecated(
"The module was merged into `jackson-databind` in Jackson 3.0" +
" and is no longer published.",
ReplaceWith("Jackson.databind", "io.spine.dependency.lib.Jackson"),
level = DeprecationLevel.ERROR
)
val dateTime = "$group:$infix-jsr310"

// https://github.com/FasterXML/jackson-datatypes-collections/blob/2.19/guava
// https://github.com/FasterXML/jackson-datatypes-collections/tree/3.x/guava
val guava = "$group:$infix-guava"

// https://github.com/FasterXML/jackson-dataformats-binary/tree/2.19/protobuf
@Deprecated(
"Protobuf support is a data format, not a data type." +
" The `$infix-protobuf` artifact has never been published.",
ReplaceWith("Jackson.DataFormat.protobuf", "io.spine.dependency.lib.Jackson"),
level = DeprecationLevel.ERROR
)
val protobuf = "$group:$infix-protobuf"

// https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/javax-money
// https://github.com/FasterXML/jackson-datatypes-misc/tree/3.x/javax-money
val javaXMoney = "$group:$infix-javax-money"

// https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/moneta
val moneta = "$group:jackson-datatype-moneta"
// https://github.com/FasterXML/jackson-datatypes-misc/tree/3.x/moneta
val moneta = "$group:$infix-moneta"

override val modules = listOf(
jdk8,
dateTime,
guava,
protobuf,
javaXMoney,
moneta
)
}

// https://github.com/FasterXML/jackson-jr
// https://github.com/FasterXML/jackson-jr/tree/3.x
object Junior : Dependency() {
override val version = Jackson.version
override val group = "com.fasterxml.jackson.jr"
override val group = "$groupPrefix.jr"

val objects = "$group:jackson-jr-objects"

Expand Down
Loading
Loading