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
15 changes: 5 additions & 10 deletions codegen/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,6 @@

@file:Suppress("RemoveRedundantQualifierName")

import Build_gradle.Module
import io.spine.dependency.build.ErrorProne
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.Chords
Expand All @@ -38,6 +37,7 @@ import io.spine.gradle.publish.PublishingRepos
import io.spine.gradle.publish.spinePublishing
import io.spine.gradle.standardToSpineSdk
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
Expand All @@ -55,15 +55,10 @@ plugins {
id("net.ltgt.errorprone")
id("detekt-code-analysis")
id("com.google.protobuf")
id("io.spine.protodata") version "0.92.11"
id("io.spine.protodata") version "0.96.4"
idea
}

object BuildSettings {
private const val JAVA_VERSION = 11
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JAVA_VERSION)
}

allprojects {
apply(from = "$rootDir/../../version.gradle.kts")
version = extra["chordsVersion"]!!
Expand Down Expand Up @@ -136,8 +131,8 @@ fun Module.configureKotlin() {
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = BuildSettings.javaVersion.toString()
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(BuildSettings.javaVersion.toString()))
}
setFreeCompilerArgs()
}
Expand Down
41 changes: 21 additions & 20 deletions codegen/plugins/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
java
`kotlin-dsl`
Expand All @@ -41,60 +43,60 @@ repositories {
* Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`.
* It's not a requirement, but would be good in terms of consistency.
*/
val jacksonVersion = "2.13.4"
val jacksonVersion = "2.17.2"

/**
* The version of the Kotlin Gradle plugin.
*
* Please check that this value matches one defined in
* [i o.spine.internal.dependency.Kotlin.version].
*/
val kotlinVersion = "1.8.22"
val kotlinVersion = "2.3.20"

/**
* The version of Guava used in `buildSrc`.
*
* Always use the same version as the one specified in [io.spine.internal.dependency.Guava].
* Always use the same version as the one specified in [io.spine.dependency.lib.Guava].
* Otherwise, when testing Gradle plugins, clashes may occur.
*/
val guavaVersion = "32.1.2-jre"
val guavaVersion = "33.5.0-jre"

/**
* The version of ErrorProne Gradle plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.ErrorProne.GradlePlugin.version].
* Please keep in sync. with [io.spine.dependency.build.ErrorProne.GradlePlugin.version].
*
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
* Error Prone Gradle Plugin Releases</a>
*/
val errorPronePluginVersion = "3.1.0"
val errorPronePluginVersion = "4.2.0"

/**
* The version of Protobuf Gradle Plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.Protobuf.GradlePlugin.version].
* Please keep in sync. with [io.spine.dependency.lib.Protobuf.GradlePlugin.version].
*
* @see <a href="https://github.com/google/protobuf-gradle-plugin/releases">
* Protobuf Gradle Plugins Releases</a>
*/
val protobufPluginVersion = "0.9.4"
val protobufPluginVersion = "0.9.6"

/**
* The version of Detekt Gradle Plugin.
*
* @see <a href="https://github.com/detekt/detekt/releases">Detekt Releases</a>
*/
val detektVersion = "1.23.0"
val detektVersion = "2.0.0-alpha.1"

/**
* @see [io.spine.internal.dependency.Kotest]
* @see [io.spine.dependency.test.Kotest]
*/
val kotestJvmPluginVersion = "0.4.10"

/**
* @see [io.spine.internal.dependency.Kover]
* @see [io.spine.dependency.test.Kover]
*/
val koverVersion = "0.7.2"
val koverVersion = "0.9.1"

/**
* The version of Google Artifact Registry used by `buildSrc`.
Expand All @@ -119,15 +121,14 @@ configurations.all {
}
}

val jvmVersion = JavaLanguageVersion.of(11)

java {
toolchain.languageVersion.set(jvmVersion)
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = jvmVersion.toString()
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

Expand All @@ -144,7 +145,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")

implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion")
implementation("dev.detekt:detekt-gradle-plugin:$detektVersion")
implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion")

// https://github.com/srikanth-lingala/zip4j
Expand Down
22 changes: 2 additions & 20 deletions codegen/plugins/buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,15 +27,11 @@
@file:Suppress("UnusedReceiverParameter", "unused", "TopLevelPropertyNaming", "ObjectPropertyName")

import io.spine.dependency.build.ErrorProne
import io.spine.dependency.build.GradleDoctor
import io.spine.dependency.build.Ksp
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.McJava
import io.spine.dependency.local.ProtoData
import io.spine.dependency.local.ProtoTap
import io.spine.dependency.local.Spine
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.Kover
import io.spine.gradle.standardToSpineSdk
import org.gradle.api.Project
import org.gradle.api.Task
Expand Down Expand Up @@ -73,7 +69,7 @@ fun ScriptHandlerScope.standardSpineSdkRepositories() {
private const val ABOUT_DEPENDENCY_EXTENSIONS = ""

/**
* Shortcut to [Spine.McJava] dependency object.
* Shortcut to [McJava] dependency object.
*
* This plugin is not published to Gradle Portal and cannot be applied directly to a project.
* Firstly, it should be put to buildscript's classpath and then applied by ID only.
Expand Down Expand Up @@ -121,20 +117,11 @@ val PluginDependenciesSpec.errorprone: PluginDependencySpec
val PluginDependenciesSpec.protobuf: PluginDependencySpec
get() = id(Protobuf.GradlePlugin.id)

val PluginDependenciesSpec.prototap: PluginDependencySpec
get() = id(ProtoTap.gradlePluginId).version(ProtoTap.version)

val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec
get() = id(GradleDoctor.pluginId).version(GradleDoctor.version)

val PluginDependenciesSpec.kotest: PluginDependencySpec
get() = Kotest.MultiplatformGradlePlugin.let {
return id(it.id).version(it.version)
}

val PluginDependenciesSpec.kover: PluginDependencySpec
get() = id(Kover.id).version(Kover.version)

val PluginDependenciesSpec.ksp: PluginDependencySpec
get() = id(Ksp.id).version(Ksp.version)

Expand Down Expand Up @@ -179,11 +166,6 @@ fun Project.configureTaskDependencies() {
sourcesJar.dependOn(launchProtoData)
sourcesJar.dependOn(createVersionFile)
sourcesJar.dependOn("prepareProtocConfigVersions")
//val dokkaHtml = "dokkaHtml"
//dokkaHtml.dependOn(generateProto)
//dokkaHtml.dependOn(launchProtoData)
//"dokkaJavadoc".dependOn(launchProtoData)
//"publishPluginJar".dependOn(createVersionFile)
}
}

Expand Down
4 changes: 2 additions & 2 deletions codegen/plugins/buildSrc/src/main/kotlin/BuildSettings.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,6 +31,6 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion
* throughout the project.
*/
object BuildSettings {
private const val JVM_VERSION = 11
private const val JVM_VERSION = 17
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION)
}
18 changes: 13 additions & 5 deletions codegen/plugins/buildSrc/src/main/kotlin/DependencyResolution.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,12 +34,14 @@ import io.spine.dependency.lib.AutoValue
import io.spine.dependency.lib.CommonsCli
import io.spine.dependency.lib.CommonsCodec
import io.spine.dependency.lib.CommonsLogging
import io.spine.dependency.lib.Grpc
import io.spine.dependency.lib.Gson
import io.spine.dependency.lib.Guava
import io.spine.dependency.lib.J2ObjC
import io.spine.dependency.lib.Jackson
import io.spine.dependency.lib.JavaDiffUtils
import io.spine.dependency.lib.Kotlin
import io.spine.dependency.lib.KotlinPoet
import io.spine.dependency.lib.KotlinX
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.lib.Slf4J
Expand Down Expand Up @@ -68,7 +70,7 @@ fun doForceVersions(configurations: ConfigurationContainer) {
val reflect = io.spine.dependency.local.Reflect
val base = io.spine.dependency.local.Base
val toolBase = io.spine.dependency.local.ToolBase
val coreJava = io.spine.dependency.local.CoreJava
val coreJvm = io.spine.dependency.local.CoreJvm
val time = io.spine.dependency.local.Time

configurations {
Expand All @@ -77,17 +79,18 @@ fun doForceVersions(configurations: ConfigurationContainer) {

resolutionStrategy {
force(
io.spine.dependency.lib.Grpc.api,
reflect.lib,
base.lib,
base.annotations,
toolBase.lib,
coreJava.server,
coreJvm.server,
protoData.pluginLib,
protoData.lib,
logging.lib,
logging.middleware,
time.lib,
toolBase.oldLib,
validation.runtime,
validation.oldRuntime,
validation.javaBundle
)
}
Expand Down Expand Up @@ -121,6 +124,8 @@ private fun ResolutionStrategy.forceProductionDependencies() {
FindBugs.annotations,
Gson.lib,
Guava.lib,
KotlinPoet.lib,
Kotlin.bom,
Kotlin.reflect,
Kotlin.stdLib,
Kotlin.stdLibCommon,
Expand Down Expand Up @@ -160,6 +165,9 @@ private fun ResolutionStrategy.forceTransitiveDependencies() {
CommonsCli.lib,
CommonsCodec.lib,
CommonsLogging.lib,
Grpc.api,
Grpc.bom,
Grpc.stub,
Gson.lib,
Hamcrest.core,
J2ObjC.annotations,
Expand Down
31 changes: 0 additions & 31 deletions codegen/plugins/buildSrc/src/main/kotlin/StringExts.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.gitlab.arturbosch.detekt.Detekt
import dev.detekt.gradle.Detekt

/**
* This script-plugin sets up Kotlin code analyzing with Detekt.
Expand Down Expand Up @@ -64,22 +64,21 @@ import io.gitlab.arturbosch.detekt.Detekt
private val about = ""

plugins {
id("io.gitlab.arturbosch.detekt")
id("dev.detekt")
}

detekt {
buildUponDefaultConfig = true
config.from(files("${rootDir}/../../quality/detekt-config.yml"))
config.from(files("${rootDir}/quality/detekt-config.yml"))
}

tasks {
withType<Detekt>().configureEach {
reports {
html.required.set(true) // Only HTML report is generated.
xml.required.set(false)
txt.required.set(false)
checkstyle.required.set(false)
sarif.required.set(false)
md.required.set(false)
markdown.required.set(false)
}
}
}
Loading
Loading