From 5e16c685392b7827ca4c83f3e058481ed0617f98 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 12:26:29 +0300 Subject: [PATCH 01/17] Move deps out --- .../io/spine/internal/dependency => dependency}/AnimalSniffer.kt | 0 .../io/spine/internal/dependency => dependency}/ApacheHttp.kt | 0 .../io/spine/internal/dependency => dependency}/AppEngine.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/AssertK.kt | 0 .../io/spine/internal/dependency => dependency}/AutoCommon.kt | 0 .../io/spine/internal/dependency => dependency}/AutoService.kt | 0 .../io/spine/internal/dependency => dependency}/AutoValue.kt | 0 .../io/spine/internal/dependency => dependency}/BouncyCastle.kt | 0 .../io/spine/internal/dependency => dependency}/CheckStyle.kt | 0 .../spine/internal/dependency => dependency}/CheckerFramework.kt | 0 .../io/spine/internal/dependency => dependency}/CommonsCli.kt | 0 .../io/spine/internal/dependency => dependency}/CommonsCodec.kt | 0 .../io/spine/internal/dependency => dependency}/CommonsLogging.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Dokka.kt | 0 .../io/spine/internal/dependency => dependency}/ErrorProne.kt | 0 .../io/spine/internal/dependency => dependency}/FindBugs.kt | 0 .../io/spine/internal/dependency => dependency}/Firebase.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Flogger.kt | 0 .../io/spine/internal/dependency => dependency}/GoogleApis.kt | 0 .../io/spine/internal/dependency => dependency}/GoogleCloud.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Grpc.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Gson.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Guava.kt | 0 .../io/spine/internal/dependency => dependency}/HttpClient.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/J2ObjC.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/JUnit.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Jackson.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/JavaJwt.kt | 0 .../io/spine/internal/dependency => dependency}/JavaPoet.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/JavaX.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Klaxon.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Kotlin.kt | 0 .../io/spine/internal/dependency => dependency}/KotlinSemver.kt | 0 .../io/spine/internal/dependency => dependency}/LicenseReport.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Netty.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Okio.kt | 0 .../io/spine/internal/dependency => dependency}/OsDetector.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Plexus.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Pmd.kt | 0 .../io/spine/internal/dependency => dependency}/Protobuf.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Roaster.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Slf4J.kt | 0 .../io/spine/internal/dependency => dependency}/TestKitTruth.kt | 0 .../kotlin/io/spine/internal/dependency => dependency}/Truth.kt | 0 44 files changed, 0 insertions(+), 0 deletions(-) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AnimalSniffer.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/ApacheHttp.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AppEngine.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AssertK.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AutoCommon.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AutoService.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/AutoValue.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/BouncyCastle.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/CheckStyle.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/CheckerFramework.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/CommonsCli.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/CommonsCodec.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/CommonsLogging.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Dokka.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/ErrorProne.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/FindBugs.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Firebase.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Flogger.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/GoogleApis.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/GoogleCloud.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Grpc.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Gson.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Guava.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/HttpClient.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/J2ObjC.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/JUnit.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Jackson.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/JavaJwt.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/JavaPoet.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/JavaX.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Klaxon.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Kotlin.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/KotlinSemver.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/LicenseReport.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Netty.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Okio.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/OsDetector.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Plexus.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Pmd.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Protobuf.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Roaster.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Slf4J.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/TestKitTruth.kt (100%) rename {buildSrc/src/main/kotlin/io/spine/internal/dependency => dependency}/Truth.kt (100%) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt b/dependency/AnimalSniffer.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt rename to dependency/AnimalSniffer.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt b/dependency/ApacheHttp.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt rename to dependency/ApacheHttp.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt b/dependency/AppEngine.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt rename to dependency/AppEngine.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt b/dependency/AssertK.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt rename to dependency/AssertK.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt b/dependency/AutoCommon.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt rename to dependency/AutoCommon.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt b/dependency/AutoService.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt rename to dependency/AutoService.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt b/dependency/AutoValue.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt rename to dependency/AutoValue.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt b/dependency/BouncyCastle.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt rename to dependency/BouncyCastle.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/dependency/CheckStyle.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt rename to dependency/CheckStyle.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt b/dependency/CheckerFramework.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt rename to dependency/CheckerFramework.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt b/dependency/CommonsCli.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt rename to dependency/CommonsCli.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt b/dependency/CommonsCodec.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt rename to dependency/CommonsCodec.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt b/dependency/CommonsLogging.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt rename to dependency/CommonsLogging.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/dependency/Dokka.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt rename to dependency/Dokka.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt b/dependency/ErrorProne.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt rename to dependency/ErrorProne.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt b/dependency/FindBugs.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt rename to dependency/FindBugs.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt b/dependency/Firebase.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt rename to dependency/Firebase.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt b/dependency/Flogger.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt rename to dependency/Flogger.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt b/dependency/GoogleApis.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt rename to dependency/GoogleApis.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt b/dependency/GoogleCloud.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt rename to dependency/GoogleCloud.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt b/dependency/Grpc.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt rename to dependency/Grpc.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt b/dependency/Gson.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt rename to dependency/Gson.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt b/dependency/Guava.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt rename to dependency/Guava.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt b/dependency/HttpClient.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt rename to dependency/HttpClient.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt b/dependency/J2ObjC.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt rename to dependency/J2ObjC.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt b/dependency/JUnit.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt rename to dependency/JUnit.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/dependency/Jackson.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt rename to dependency/Jackson.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt b/dependency/JavaJwt.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt rename to dependency/JavaJwt.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt b/dependency/JavaPoet.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt rename to dependency/JavaPoet.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt b/dependency/JavaX.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt rename to dependency/JavaX.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt b/dependency/Klaxon.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt rename to dependency/Klaxon.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/dependency/Kotlin.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt rename to dependency/Kotlin.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt b/dependency/KotlinSemver.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt rename to dependency/KotlinSemver.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt b/dependency/LicenseReport.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt rename to dependency/LicenseReport.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt b/dependency/Netty.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt rename to dependency/Netty.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt b/dependency/Okio.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt rename to dependency/Okio.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt b/dependency/OsDetector.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt rename to dependency/OsDetector.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt b/dependency/Plexus.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt rename to dependency/Plexus.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt b/dependency/Pmd.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt rename to dependency/Pmd.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt b/dependency/Protobuf.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt rename to dependency/Protobuf.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt b/dependency/Roaster.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt rename to dependency/Roaster.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt b/dependency/Slf4J.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt rename to dependency/Slf4J.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt b/dependency/TestKitTruth.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt rename to dependency/TestKitTruth.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt b/dependency/Truth.kt similarity index 100% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt rename to dependency/Truth.kt From c75110a744f27a39a57d9b7797654467f7be3854 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 12:35:33 +0300 Subject: [PATCH 02/17] Inline `version.gradle.kts` --- build.gradle.kts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2c0b6c997..dc9fbdba9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,7 +98,17 @@ spinePublishing { } allprojects { - apply(from = "$rootDir/version.gradle.kts") + + // Due to a bug, we can't apply scripts. + // See: https://github.com/gradle/gradle/issues/20717 + + /** Versions of the Spine libraries that `time` depends on. */ + val mcJavaVersion: String by extra("2.0.0-SNAPSHOT.83") + val spineBaseVersion by extra("2.0.0-SNAPSHOT.91") + val javadocToolsVersion by extra("2.0.0-SNAPSHOT.75") + + /** The version of this library. */ + val versionToPublish by extra("2.0.0-SNAPSHOT.92") group = "io.spine" version = extra["versionToPublish"]!! From e62dbaf02736b16a6667ac49d710be271b1c0b39 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 16:42:44 +0300 Subject: [PATCH 03/17] Migrate first part of dependencies --- build.gradle.kts | 14 +++--- buildSrc/build.gradle.kts | 3 +- buildSrc/settings.gradle.kts | 33 +++++++++++++ .../src/main/kotlin/dokka-for-java.gradle.kts | 8 ++-- .../internal/gradle/DependencyResolution.kt | 46 ++++++++----------- .../gradle/checkstyle/CheckStyleConfig.kt | 7 ++- gradle/libs.versions.toml | 32 +++++++++++++ time/build.gradle.kts | 5 +- 8 files changed, 105 insertions(+), 43 deletions(-) create mode 100644 buildSrc/settings.gradle.kts create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index dc9fbdba9..01344a57f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,7 @@ buildscript { apply(from = "$rootDir/version.gradle.kts") io.spine.internal.gradle.doApplyStandard(repositories) - io.spine.internal.gradle.doForceVersions(configurations) + io.spine.internal.gradle.doForceVersions(configurations, libs) val mcJavaVersion: String by extra dependencies { @@ -91,7 +91,6 @@ spinePublishing { cloudArtifactRegistry ) } - dokkaJar { enabled = true } @@ -103,19 +102,18 @@ allprojects { // See: https://github.com/gradle/gradle/issues/20717 /** Versions of the Spine libraries that `time` depends on. */ - val mcJavaVersion: String by extra("2.0.0-SNAPSHOT.83") - val spineBaseVersion by extra("2.0.0-SNAPSHOT.91") - val javadocToolsVersion by extra("2.0.0-SNAPSHOT.75") + extra["mcJavaVersion"] = "2.0.0-SNAPSHOT.83" + extra["spineBaseVersion"] = "2.0.0-SNAPSHOT.91" + extra["javadocToolsVersion"] = "2.0.0-SNAPSHOT.75" /** The version of this library. */ val versionToPublish by extra("2.0.0-SNAPSHOT.92") group = "io.spine" - version = extra["versionToPublish"]!! + version = versionToPublish } subprojects { - apply { plugin("java-library") plugin("kotlin") @@ -148,7 +146,7 @@ subprojects { * [com.google.errorprone.bugpatterns.CheckReturnValue] was removed leading to breaking the API. */ configurations { - forceVersions() + forceVersions(rootProject.libs) all { resolutionStrategy { force( diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 79d04a938..2e5f6ed13 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -48,7 +48,7 @@ repositories { /** * The version of Jackson used by `buildSrc`. * - * Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`. + * Please keep this value in sync. with `Jackson.version`. * It's not a requirement, but would be good in terms of consistency. */ val jacksonVersion = "2.13.0" @@ -129,6 +129,7 @@ tasks.withType { } dependencies { + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") implementation("com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion") { diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 000000000..67609bba0 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,33 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index 54af9f8da..26c365886 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.Dokka import io.spine.internal.gradle.dokka.onlyJavaSources import io.spine.internal.gradle.dokka.onlyNonGeneratedSources @@ -32,6 +31,9 @@ import java.time.LocalDate import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.DokkaBaseConfiguration import org.jetbrains.dokka.gradle.DokkaTask +import org.gradle.accessors.dm.LibrariesForLibs + +val libs = rootProject.extensions.getByType() plugins { id("org.jetbrains.dokka") @@ -45,7 +47,7 @@ dependencies { * @see * Dokka output formats */ - dokkaPlugin(Dokka.KotlinAsJavaPlugin.lib) + dokkaPlugin(libs.dokka.kotlinAsJava) /** * To exclude pieces of code annotated with `@Internal` from the documentation a custom plugin @@ -54,7 +56,7 @@ dependencies { * @see * Custom Dokka Plugins */ - dokkaPlugin(Dokka.SpineExtensions.lib) + dokkaPlugin(libs.dokka.spineExtensions) } tasks.withType().configureEach { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index 168c07987..80e0298d3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,13 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.AnimalSniffer -import io.spine.internal.dependency.AutoCommon -import io.spine.internal.dependency.AutoService -import io.spine.internal.dependency.AutoValue -import io.spine.internal.dependency.CheckerFramework -import io.spine.internal.dependency.CommonsCli -import io.spine.internal.dependency.CommonsLogging import io.spine.internal.dependency.ErrorProne import io.spine.internal.dependency.FindBugs import io.spine.internal.dependency.Flogger @@ -45,6 +38,7 @@ import io.spine.internal.dependency.Okio import io.spine.internal.dependency.Plexus import io.spine.internal.dependency.Protobuf import io.spine.internal.dependency.Truth +import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.ConfigurationContainer @@ -55,32 +49,32 @@ import org.gradle.api.artifacts.dsl.RepositoryHandler * The function to be used in `buildscript` when a fully-qualified call must be made. */ @Suppress("unused") -fun doForceVersions(configurations: ConfigurationContainer) { - configurations.forceVersions() +fun doForceVersions(configurations: ConfigurationContainer, libs: LibrariesForLibs) { + configurations.forceVersions(libs) } /** * Forces dependencies used in the project. */ -fun NamedDomainObjectContainer.forceVersions() { +fun NamedDomainObjectContainer.forceVersions(libs: LibrariesForLibs) { all { resolutionStrategy { failOnVersionConflict() cacheChangingModulesFor(0, "seconds") - forceProductionDependencies() - forceTestDependencies() - forceTransitiveDependencies() + forceProductionDependencies(libs) + forceTestDependencies(libs) + forceTransitiveDependencies(libs) } } } -private fun ResolutionStrategy.forceProductionDependencies() { +private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLibs) { @Suppress("DEPRECATION") // Force SLF4J version. force( - AnimalSniffer.lib, - AutoCommon.lib, - AutoService.annotations, - CheckerFramework.annotations, + libs.animalSniffer, + libs.autoCommon, + libs.autoService.annotations, + libs.checkerFramework.annotations, ErrorProne.annotations, ErrorProne.core, Guava.lib, @@ -97,7 +91,7 @@ private fun ResolutionStrategy.forceProductionDependencies() { ) } -private fun ResolutionStrategy.forceTestDependencies() { +private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { force( Guava.testLib, JUnit.api, @@ -111,16 +105,16 @@ private fun ResolutionStrategy.forceTestDependencies() { /** * Forces transitive dependencies of 3rd party components that we don't use directly. */ -private fun ResolutionStrategy.forceTransitiveDependencies() { +private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLibs) { force( - AutoValue.annotations, + libs.autoValue.annotations, Gson.lib, J2ObjC.annotations, Plexus.utils, Okio.lib, - CommonsCli.lib, - CheckerFramework.compatQual, - CommonsLogging.lib + libs.commons.cli, + libs.commons.logging, + libs.checkerFramework.compatQual, ) } @@ -145,8 +139,8 @@ object DependencyResolution { "Please use `configurations.forceVersions()`.", ReplaceWith("configurations.forceVersions()") ) - fun forceConfiguration(configurations: ConfigurationContainer) { - configurations.forceVersions() + fun forceConfiguration(configurations: ConfigurationContainer, libs: LibrariesForLibs) { + configurations.forceVersions(libs) } @Deprecated( diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt index e3a0ef29a..08631f37d 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt @@ -26,7 +26,6 @@ package io.spine.internal.gradle.checkstyle -import io.spine.internal.dependency.CheckStyle import org.gradle.api.Project import org.gradle.api.plugins.quality.Checkstyle import org.gradle.api.plugins.quality.CheckstyleExtension @@ -49,6 +48,10 @@ import org.gradle.kotlin.dsl.the @Suppress("unused") object CheckStyleConfig { + // We can't migrate this to the plain TOML file. + // https://checkstyle.sourceforge.io/ + private const val version = "10.1" + /** * Applies the configuration to the passed [project]. */ @@ -60,7 +63,7 @@ object CheckStyleConfig { val configDir = project.rootDir.resolve("config/quality/") with(project.the()) { - toolVersion = CheckStyle.version + toolVersion = version configDirectory.set(configDir) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..f06eeed50 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,32 @@ +[versions] +animalSniffer = "1.21" #https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ +autoCommon = "1.2.1" #https://github.com/google/auto +autoService = "1.0.1" #https://github.com/google/auto +autoValue = "1.9" #https://github.com/google/auto +checkerFramework = "3.21.3" #https://checkerframework.org/ +commonsCli = "1.5.0" #https://commons.apache.org/proper/commons-cli/ +commonsLogging = "1.2" #https://commons.apache.org/proper/commons-logging/ +dokka = "1.6.20" #https://github.com/Kotlin/dokka + +[libraries] +animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } +autoCommon = { module = "com.google.auto:auto-common", version.ref = "autoCommon" } +autoService-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" } +autoService-processor = { module = "com.google.auto.service:auto-service", version.ref = "autoService" } +autoValue-annotations = { module = "com.google.auto.value:auto-value-annotations", version.ref = "autoValue" } +checkerFramework-annotations = { module = "org.checkerframework:checker-qual", version.ref = "checkerFramework" } +checkerFramework-dataflow = { module = "org.checkerframework:dataflow", version.ref = "checkerFramework" } +checkerFramework-javacUtil = { module = "org.checkerframework:javacutil", version.ref = "checkerFramework" } +checkerFramework-compatQual = { module = "org.checkerframework:checker-compat-qual", version = "2.5.5" } +commons-cli = { module = "commons-cli:commons-cli", version.ref = "commonsCli" } +commons-logging = { module = "commons-logging:commons-logging", version.ref = "commonsLogging" } +dokka-gradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } +dokka-basePlugin = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" } +dokka-kotlinAsJava = { module = "org.jetbrains.dokka:kotlin-as-java-plugin", version.ref = "dokka" } +dokka-spineExtensions = { module = "io.spine.tools:spine-dokka-extensions", version = "2.0.0-SNAPSHOT.3" } + +[bundles] +checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] + +[plugins] +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } diff --git a/time/build.gradle.kts b/time/build.gradle.kts index bb5f13ca4..a1c2c6d62 100644 --- a/time/build.gradle.kts +++ b/time/build.gradle.kts @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.AutoService import io.spine.internal.gradle.publish.IncrementGuard import io.spine.internal.gradle.excludeProtobufLite @@ -36,8 +35,8 @@ apply() val spineBaseVersion: String by extra dependencies { - annotationProcessor(AutoService.processor) - compileOnly(AutoService.annotations) + annotationProcessor(libs.autoService.processor) + compileOnly(libs.autoService.annotations) api("io.spine:spine-base:$spineBaseVersion") From b456ea7705d59664075e0c2f1ff72425f34c3bca Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 17:57:03 +0300 Subject: [PATCH 04/17] Migrate second bunch of dependencies --- build.gradle.kts | 5 +-- buildSrc/build.gradle.kts | 39 ++++--------------- .../internal/gradle/DependencyResolution.kt | 6 +-- gradle/libs.versions.toml | 24 ++++++++++++ 4 files changed, 36 insertions(+), 38 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 01344a57f..656a68601 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,6 @@ import com.google.protobuf.gradle.generateProtoTasks import com.google.protobuf.gradle.id import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.protoc -import io.spine.internal.dependency.ErrorProne import io.spine.internal.dependency.JUnit import io.spine.internal.dependency.Protobuf import io.spine.internal.gradle.publish.PublishingRepos @@ -76,7 +75,7 @@ plugins { `project-report` id(io.spine.internal.dependency.Protobuf.GradlePlugin.id) - id(io.spine.internal.dependency.ErrorProne.GradlePlugin.id) + id(libs.plugins.errorProne.get().pluginId) } spinePublishing { @@ -134,7 +133,7 @@ subprojects { val spineBaseVersion: String by extra dependencies { - errorprone(ErrorProne.core) + errorprone(rootProject.libs.errorProne.core) api(kotlin("stdlib-jdk8")) testImplementation("io.spine.tools:spine-testlib:$spineBaseVersion") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2e5f6ed13..ba77f603c 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -24,25 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** - * This script uses two declarations of the constant [licenseReportVersion] because - * currently there is no way to define a constant _before_ a build script of `buildSrc`. - * We cannot use imports or do something else before the `buildscript` or `plugin` clauses. - */ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { java groovy `kotlin-dsl` pmd - val licenseReportVersion = "2.1" - id("com.github.jk1.dependency-license-report").version(licenseReportVersion) } repositories { + mavenCentral() mavenLocal() gradlePluginPortal() - mavenCentral() } /** @@ -73,16 +67,6 @@ val kotlinVersion = "1.6.21" */ val guavaVersion = "31.1-jre" -/** - * The version of ErrorProne Gradle plugin. - * - * Please keep in sync. with [io.spine.internal.dependency.ErrorProne.GradlePlugin.version]. - * - * @see - * Error Prone Gradle Plugin Releases - */ -val errorProneVersion = "2.0.2" - /** * The version of Protobuf Gradle Plugin. * @@ -93,16 +77,6 @@ val errorProneVersion = "2.0.2" */ val protobufPluginVersion = "0.8.18" -/** - * The version of Dokka Gradle Plugins. - * - * Please keep in sync with [io.spine.internal.dependency.Dokka.version]. - * - * @see - * Dokka Releases - */ -val dokkaVersion = "1.6.20" - configurations.all { resolutionStrategy { // Force Kotlin lib versions avoiding using those bundled with Gradle. @@ -122,7 +96,7 @@ java { toolchain.languageVersion.set(jvmVersion) } -tasks.withType { +tasks.withType().configureEach { kotlinOptions { jvmTarget = jvmVersion.toString() } @@ -130,6 +104,7 @@ tasks.withType { dependencies { implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) + implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") implementation("com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion") { @@ -138,13 +113,13 @@ dependencies { implementation("com.google.guava:guava:$guavaVersion") api("com.github.jk1:gradle-license-report:$licenseReportVersion") implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}") - implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorProneVersion}") + implementation(libs.errorProne.gradlePlugin) // Add explicit dependency to avoid warning on different Kotlin runtime versions. implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") - implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") + implementation(libs.dokka.gradlePlugin) + implementation(libs.dokka.basePlugin) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index 80e0298d3..65cbaf353 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,7 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.ErrorProne import io.spine.internal.dependency.FindBugs import io.spine.internal.dependency.Flogger import io.spine.internal.dependency.Gson @@ -75,8 +74,9 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib libs.autoCommon, libs.autoService.annotations, libs.checkerFramework.annotations, - ErrorProne.annotations, - ErrorProne.core, + libs.errorProne.annotations, + libs.errorProne.typeAnnotations, + libs.errorProne.core, Guava.lib, FindBugs.annotations, Flogger.lib, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f06eeed50..d77c8a59a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,32 +1,56 @@ [versions] animalSniffer = "1.21" #https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ +apacheHttp = "4.4.14" #https://hc.apache.org/downloads.cgi +appEngine = "1.9.82" #https://cloud.google.com/java/docs/reference +appEngineGradlePlugin = "2.2.0" #https://cloud.google.com/java/docs/reference autoCommon = "1.2.1" #https://github.com/google/auto autoService = "1.0.1" #https://github.com/google/auto autoValue = "1.9" #https://github.com/google/auto +assertK = "0.25" #https://github.com/willowtreeapps/assertk +bouncyCastle = "1.68" #https://www.bouncycastle.org/java.html checkerFramework = "3.21.3" #https://checkerframework.org/ commonsCli = "1.5.0" #https://commons.apache.org/proper/commons-cli/ +commonsCodec = "1.15" #https://commons.apache.org/proper/commons-codec/changes-report.html commonsLogging = "1.2" #https://commons.apache.org/proper/commons-logging/ dokka = "1.6.20" #https://github.com/Kotlin/dokka +errorProne = "2.13.1" #https://github.com/google/error-prone +errorProneJavac = "9+181-r4173-1" #https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts +errorProneGradlePlugin = "2.0.2" #https://github.com/tbroyer/gradle-errorprone-plugin/releases [libraries] animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } +apacheHttp-core = { module = "org.apache.httpcomponents:httpcore", version.ref = "apacheHttp" } +appEngine-sdk = { module = "com.google.appengine:appengine-api-1.0-sdk", version.ref = "appEngine" } +appEngine-gradlePlugin = { module = "com.google.cloud.tools:appengine-gradle-plugin", version.ref = "appEngineGradlePlugin" } autoCommon = { module = "com.google.auto:auto-common", version.ref = "autoCommon" } autoService-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" } autoService-processor = { module = "com.google.auto.service:auto-service", version.ref = "autoService" } autoValue-annotations = { module = "com.google.auto.value:auto-value-annotations", version.ref = "autoValue" } +assertK-libJvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertK" } +bouncyCastle-libPkcsJdk15 = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bouncyCastle" } checkerFramework-annotations = { module = "org.checkerframework:checker-qual", version.ref = "checkerFramework" } checkerFramework-dataflow = { module = "org.checkerframework:dataflow", version.ref = "checkerFramework" } checkerFramework-javacUtil = { module = "org.checkerframework:javacutil", version.ref = "checkerFramework" } checkerFramework-compatQual = { module = "org.checkerframework:checker-compat-qual", version = "2.5.5" } commons-cli = { module = "commons-cli:commons-cli", version.ref = "commonsCli" } +commons-codec = { module = "commons-codec:commons-codec", version.ref = "commonsCodec" } commons-logging = { module = "commons-logging:commons-logging", version.ref = "commonsLogging" } dokka-gradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } dokka-basePlugin = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" } dokka-kotlinAsJava = { module = "org.jetbrains.dokka:kotlin-as-java-plugin", version.ref = "dokka" } dokka-spineExtensions = { module = "io.spine.tools:spine-dokka-extensions", version = "2.0.0-SNAPSHOT.3" } +errorProne-annotations = { module = "com.google.errorprone:error_prone_annotations", version.ref = "errorProne" } +errorProne-typeAnnotations = { module = "com.google.errorprone:error_prone_type_annotations", version.ref = "errorProne" } +errorProne-core = { module = "com.google.errorprone:error_prone_core", version.ref = "errorProne" } +errorProne-checkApi = { module = "com.google.errorprone:error_prone_check_api", version.ref = "errorProne" } +errorProne-testHelpers = { module = "com.google.errorprone:error_prone_test_helpers", version.ref = "errorProne" } +errorProne-javacPlugin = { module = "com.google.errorprone:javac", version.ref = "errorProneJavac" } +errorProne-gradlePlugin = { module = "net.ltgt.gradle:gradle-errorprone-plugin", version.ref = "errorProneGradlePlugin" } [bundles] checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] +errorProne-annotations = ["errorProne-annotations", "errorProne-typeAnnotations"] [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +errorProne = { id = "net.ltgt.errorprone" } From 63c56454f013d6b1678e97f39d8f712edce35323 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 19:13:05 +0300 Subject: [PATCH 05/17] Migrate third bunch of dependencies --- buildSrc/build.gradle.kts | 19 +--- .../internal/gradle/DependencyResolution.kt | 16 ++-- .../io/spine/internal/gradle/Runtime.kt | 6 -- gradle/libs.versions.toml | 93 +++++++++++++++---- 4 files changed, 86 insertions(+), 48 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ba77f603c..b06ed82c5 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -47,9 +47,7 @@ repositories { */ val jacksonVersion = "2.13.0" -val googleAuthToolVersion = "2.1.2" val licenseReportVersion = "2.1" -val grGitVersion = "3.1.1" /** * The version of the Kotlin Gradle plugin. @@ -59,14 +57,6 @@ val grGitVersion = "3.1.1" */ val kotlinVersion = "1.6.21" -/** - * The version of Guava used in `buildSrc`. - * - * Always use the same version as the one specified in [io.spine.internal.dependency.Guava]. - * Otherwise, when testing Gradle plugins, clashes may occur. - */ -val guavaVersion = "31.1-jre" - /** * The version of Protobuf Gradle Plugin. * @@ -107,12 +97,11 @@ dependencies { implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") - implementation("com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion") { - exclude(group = "com.google.guava") - } - implementation("com.google.guava:guava:$guavaVersion") + + implementation(libs.google.artifactRegistry.authCommon) + implementation(libs.guava) api("com.github.jk1:gradle-license-report:$licenseReportVersion") - implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}") + implementation(libs.grgit) implementation(libs.errorProne.gradlePlugin) // Add explicit dependency to avoid warning on different Kotlin runtime versions. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index 65cbaf353..957c01f96 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,10 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.FindBugs -import io.spine.internal.dependency.Flogger -import io.spine.internal.dependency.Gson -import io.spine.internal.dependency.Guava import io.spine.internal.dependency.J2ObjC import io.spine.internal.dependency.JUnit import io.spine.internal.dependency.Kotlin @@ -77,10 +73,10 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib libs.errorProne.annotations, libs.errorProne.typeAnnotations, libs.errorProne.core, - Guava.lib, - FindBugs.annotations, - Flogger.lib, - Flogger.Runtime.systemBackend, + libs.findBugs.annotations, + libs.flogger, + libs.flogger.runtime.systemBackend, + libs.guava, Kotlin.reflect, Kotlin.stdLib, Kotlin.stdLibCommon, @@ -93,7 +89,7 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { force( - Guava.testLib, + libs.guava.testLib, JUnit.api, JUnit.platformCommons, JUnit.platformLauncher, @@ -108,7 +104,7 @@ private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLibs) { force( libs.autoValue.annotations, - Gson.lib, + libs.gson, J2ObjC.annotations, Plexus.utils, Okio.lib, diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt index eced40e43..9fac53730 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt @@ -27,17 +27,11 @@ package io.spine.internal.gradle import com.google.common.base.Joiner -import io.spine.internal.dependency.Flogger import java.io.File import java.io.InputStream import java.io.StringWriter import java.util.* -object Runtime { - @Suppress("unused") - val flogger = Flogger.Runtime -} - /** * Executor of CLI commands. * diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d77c8a59a..fdae0bb2d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,21 +1,27 @@ [versions] -animalSniffer = "1.21" #https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ -apacheHttp = "4.4.14" #https://hc.apache.org/downloads.cgi -appEngine = "1.9.82" #https://cloud.google.com/java/docs/reference -appEngineGradlePlugin = "2.2.0" #https://cloud.google.com/java/docs/reference -autoCommon = "1.2.1" #https://github.com/google/auto -autoService = "1.0.1" #https://github.com/google/auto -autoValue = "1.9" #https://github.com/google/auto -assertK = "0.25" #https://github.com/willowtreeapps/assertk -bouncyCastle = "1.68" #https://www.bouncycastle.org/java.html -checkerFramework = "3.21.3" #https://checkerframework.org/ -commonsCli = "1.5.0" #https://commons.apache.org/proper/commons-cli/ -commonsCodec = "1.15" #https://commons.apache.org/proper/commons-codec/changes-report.html -commonsLogging = "1.2" #https://commons.apache.org/proper/commons-logging/ -dokka = "1.6.20" #https://github.com/Kotlin/dokka -errorProne = "2.13.1" #https://github.com/google/error-prone -errorProneJavac = "9+181-r4173-1" #https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts -errorProneGradlePlugin = "2.0.2" #https://github.com/tbroyer/gradle-errorprone-plugin/releases +animalSniffer = "1.21" # https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ +apacheHttp = "4.4.14" # https://hc.apache.org/downloads.cgi +appEngine = "1.9.82" # https://cloud.google.com/java/docs/reference +appEngineGradlePlugin = "2.2.0" # https://cloud.google.com/java/docs/reference +autoCommon = "1.2.1" # https://github.com/google/auto +autoService = "1.0.1" # https://github.com/google/auto +autoValue = "1.9" # https://github.com/google/auto +assertK = "0.25" # https://github.com/willowtreeapps/assertk +bouncyCastle = "1.68" # https://www.bouncycastle.org/java.html +checkerFramework = "3.21.3" # https://checkerframework.org/ +commonsCli = "1.5.0" # https://commons.apache.org/proper/commons-cli/ +commonsCodec = "1.15" # https://commons.apache.org/proper/commons-codec/changes-report.html +commonsLogging = "1.2" # https://commons.apache.org/proper/commons-logging/ +dokka = "1.6.20" # https://github.com/Kotlin/dokka +errorProne = "2.13.1" # https://github.com/google/error-prone +errorProneJavac = "9+181-r4173-1" # https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts +errorProneGradlePlugin = "2.0.2" # https://github.com/tbroyer/gradle-errorprone-plugin/releases +findBugs = "3.0.2" # https://github.com/SpineEventEngine/base/issues/108 +firebase = "8.1.0" # https://firebase.google.com/docs/admin/setup#java +flogger = "0.7.4" # https://github.com/google/flogger +googleAuthLib = "1.3.0" # https://github.com/googleapis/google-auth-library-java +grpc = "1.45.1" # https://github.com/grpc/grpc-java +guava = "31.1-jre" # https://github.com/google/guava [libraries] animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } @@ -46,6 +52,59 @@ errorProne-checkApi = { module = "com.google.errorprone:error_prone_check_api", errorProne-testHelpers = { module = "com.google.errorprone:error_prone_test_helpers", version.ref = "errorProne" } errorProne-javacPlugin = { module = "com.google.errorprone:javac", version.ref = "errorProneJavac" } errorProne-gradlePlugin = { module = "net.ltgt.gradle:gradle-errorprone-plugin", version.ref = "errorProneGradlePlugin" } +findBugs-annotations = { module = "com.google.code.findbugs:jsr305", version.ref = "findBugs" } +firebase-admin = { module = "com.google.firebase:firebase-admin", version.ref = "firebase" } +flogger = { module = "com.google.flogger:flogger", version.ref = "flogger" } +flogger-runtime-systemBackend = { module = "com.google.flogger:flogger-system-backend", version.ref = "flogger" } +flogger-runtime-log4J = { module = "com.google.flogger:flogger-log4j", version.ref = "flogger" } +flogger-runtime-slf4J = { module = "com.google.flogger:slf4j-backend-factory", version.ref = "flogger" } + +# https://github.com/googleapis/google-api-java-client +google-apis-client = "com.google.api-client:google-api-client:1.32.2" +# https://github.com/googleapis/api-common-java +google-apis-common = "com.google.api:api-common:2.1.1" +# https://github.com/googleapis/java-common-protos +google-apis-commonProtos = "com.google.api.grpc:proto-google-common-protos:2.7.0" +# https://github.com/googleapis/gax-java +google-apis-gax = "com.google.api:gax:2.7.1" +# https://github.com/googleapis/java-iam +google-apis-protoAim = "com.google.api.grpc:proto-google-iam-v1:1.2.0" +# https://github.com/googleapis/google-oauth-java-client +google-apis-oAuthClient = "com.google.oauth-client:google-oauth-client:1.32.1" +# https://github.com/googleapis/google-auth-library-java +google-apis-auth-credentials = { module = "com.google.auth:google-auth-library-credentials", version.ref = "googleAuthLib" } +#https://github.com/googleapis/google-auth-library-java +google-apis-auth-oAuth2Http = { module = "com.google.auth:google-auth-library-oauth2-http", version.ref = "googleAuthLib" } +# https://github.com/googleapis/java-core +google-cloud-core = "com.google.cloud:google-cloud-core:2.3.3" +# https://github.com/googleapis/java-pubsub/tree/main/proto-google-cloud-pubsub-v1 +google-cloud-pubSubGrpcApi = "com.google.api.grpc:proto-google-cloud-pubsub-v1:1.97.0" +# https://github.com/googleapis/java-trace +google-cloud-trace = "com.google.cloud:google-cloud-trace:2.1.0" +# https://github.com/googleapis/java-datastore +google-cloud-datastore = "com.google.cloud:google-cloud-datastore:2.2.1" +# https://mvnrepository.com/artifact/com.google.cloud.artifactregistry/artifactregistry-auth-common +google-artifactRegistry-authCommon = "com.google.cloud.artifactregistry:artifactregistry-auth-common:2.1.2" + +grpc-api = { module = "io.grpc:grpc-api", version.ref = "grpc" } +grpc-auth = { module = "io.grpc:grpc-auth", version.ref = "grpc" } +grpc-core = { module = "io.grpc:grpc-core", version.ref = "grpc" } +grpc-context = { module = "io.grpc:grpc-context", version.ref = "grpc" } +grpc-stub = { module = "io.grpc:grpc-stub", version.ref = "grpc" } +grpc-okHttp = { module = "io.grpc:grpc-okhttp", version.ref = "grpc" } +grpc-protobuf = { module = "io.grpc:grpc-protobuf", version.ref = "grpc" } +grpc-protobufLite = { module = "io.grpc:grpc-protobuf-lite", version.ref = "grpc" } +grpc-protobufPlugin = { module = "io.grpc:protoc-gen-grpc-java", version.ref = "grpc" } +grpc-netty = { module = "io.grpc:grpc-netty", version.ref = "grpc" } +grpc-nettyShaded = { module = "io.grpc:grpc-netty-shaded", version.ref = "grpc" } + +# https://github.com/google/gson +gson = "com.google.code.gson:gson:2.9.0" + +guava = { module = "com.google.guava:guava", version.ref = "guava" } +guava-testLib = { module = "com.google.guava:guava-testlib", version.ref = "guava" } +# https://github.com/ajoberstar/grgit +grgit = "org.ajoberstar.grgit:grgit-core:3.1.1" [bundles] checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] From a5ffec338af986b837acada1892cd04035076cb9 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Wed, 11 May 2022 19:15:32 +0300 Subject: [PATCH 06/17] Update list of already migrated deps --- .../spine/internal/dependency}/HttpClient.kt | 0 .../io/spine/internal/dependency/J2ObjC.kt | 16 ++-- .../io/spine/internal/dependency/JUnit.kt | 53 +++++++++++++ .../io/spine/internal/dependency/Jackson.kt | 43 +++++++++++ .../io/spine/internal/dependency/JavaJwt.kt | 10 +-- .../io/spine/internal/dependency/JavaPoet.kt | 7 +- .../io/spine/internal/dependency/JavaX.kt | 10 ++- .../io/spine/internal/dependency/Klaxon.kt | 12 ++- .../io/spine/internal/dependency/Kotlin.kt | 25 +++--- .../spine/internal/dependency/KotlinSemver.kt | 7 +- .../internal/dependency/LicenseReport.kt | 13 ++-- .../io/spine/internal/dependency/Netty.kt | 38 ++++++++++ .../io/spine/internal/dependency/Okio.kt | 11 ++- .../spine/internal/dependency/OsDetector.kt | 10 ++- .../io/spine/internal/dependency/Plexus.kt | 12 +-- .../io/spine/internal/dependency/Pmd.kt | 9 +-- .../io/spine/internal/dependency/Protobuf.kt | 36 ++++----- .../io/spine/internal/dependency/Roaster.kt | 23 +++--- .../io/spine/internal/dependency/Slf4J.kt | 18 ++--- .../spine/internal/dependency/TestKitTruth.kt | 42 ++++++++++ .../io/spine/internal/dependency/Truth.kt | 37 +++++++++ dependency/AutoService.kt | 35 --------- dependency/CommonsCodec.kt | 34 --------- dependency/Dokka.kt | 76 ------------------- dependency/FindBugs.kt | 39 ---------- dependency/Firebase.kt | 34 --------- dependency/Flogger.kt | 39 ---------- dependency/GoogleApis.kt | 59 -------------- dependency/Grpc.kt | 45 ----------- 29 files changed, 325 insertions(+), 468 deletions(-) rename {dependency => buildSrc/src/main/kotlin/io/spine/internal/dependency}/HttpClient.kt (100%) rename dependency/CommonsLogging.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt (68%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt rename dependency/AssertK.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt (85%) rename dependency/BouncyCastle.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt (89%) rename dependency/CheckStyle.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt (80%) rename dependency/AutoValue.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt (87%) rename dependency/CheckerFramework.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt (67%) rename dependency/AutoCommon.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt (89%) rename dependency/AppEngine.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt (79%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt rename dependency/CommonsCli.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt (84%) rename dependency/AnimalSniffer.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt (83%) rename dependency/Gson.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt (79%) rename dependency/ApacheHttp.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt (88%) rename dependency/ErrorProne.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt (57%) rename dependency/GoogleCloud.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt (69%) rename dependency/Guava.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt (69%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt delete mode 100644 dependency/AutoService.kt delete mode 100644 dependency/CommonsCodec.kt delete mode 100644 dependency/Dokka.kt delete mode 100644 dependency/FindBugs.kt delete mode 100644 dependency/Firebase.kt delete mode 100644 dependency/Flogger.kt delete mode 100644 dependency/GoogleApis.kt delete mode 100644 dependency/Grpc.kt diff --git a/dependency/HttpClient.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt similarity index 100% rename from dependency/HttpClient.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt diff --git a/dependency/CommonsLogging.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt similarity index 68% rename from dependency/CommonsLogging.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt index e9d148f14..9ed18f264 100644 --- a/dependency/CommonsLogging.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt @@ -27,11 +27,15 @@ package io.spine.internal.dependency /** - * [Commons Logging](https://commons.apache.org/proper/commons-logging/) is a transitive - * dependency which we don't use directly. This object is used for forcing the version. + * [J2ObjC](https://developers.google.com/j2objc) is a transitive dependency + * which we don't use directly. This object is used for forcing the version. */ -object CommonsLogging { - // https://commons.apache.org/proper/commons-logging/ - private const val version = "1.2" - const val lib = "commons-logging:commons-logging:${version}" +object J2ObjC { + // https://github.com/google/j2objc/releases + // `1.3.` is the latest version available from Maven Central. + // https://search.maven.org/artifact/com.google.j2objc/j2objc-annotations + private const val version = "1.3" + const val annotations = "com.google.j2objc:j2objc-annotations:${version}" + @Deprecated("Please use `annotations` instead.", ReplaceWith("annotations")) + const val lib = annotations } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt new file mode 100644 index 000000000..0c436ce4c --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt @@ -0,0 +1,53 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://junit.org/junit5/ +@Suppress("unused") +object JUnit { + const val version = "5.8.2" + private const val platformVersion = "1.8.2" + private const val legacyVersion = "4.13.1" + + // https://github.com/apiguardian-team/apiguardian + private const val apiGuardianVersion = "1.1.2" + // https://github.com/junit-pioneer/junit-pioneer + private const val pioneerVersion = "1.5.0" + + const val legacy = "junit:junit:${legacyVersion}" + val api = listOf( + "org.apiguardian:apiguardian-api:${apiGuardianVersion}", + "org.junit.jupiter:junit-jupiter-api:${version}", + "org.junit.jupiter:junit-jupiter-params:${version}" + ) + const val bom = "org.junit:junit-bom:${version}" + const val runner = "org.junit.jupiter:junit-jupiter-engine:${version}" + const val pioneer = "org.junit-pioneer:junit-pioneer:${pioneerVersion}" + const val platformCommons = "org.junit.platform:junit-platform-commons:${platformVersion}" + const val platformLauncher = "org.junit.platform:junit-platform-launcher:${platformVersion}" + const val params = "org.junit.jupiter:junit-jupiter-params:${version}" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt new file mode 100644 index 000000000..71f7e08c3 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +@Suppress("unused") +object Jackson { + private const val version = "2.13.2" + private const val databindVersion = "2.13.2.2" + // https://github.com/FasterXML/jackson-core + const val core = "com.fasterxml.jackson.core:jackson-core:${version}" + // https://github.com/FasterXML/jackson-databind + const val databind = "com.fasterxml.jackson.core:jackson-databind:${databindVersion}" + // https://github.com/FasterXML/jackson-dataformat-xml/releases + const val dataformatXml = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${version}" + // https://github.com/FasterXML/jackson-dataformats-text/releases + const val dataformatYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${version}" + // https://github.com/FasterXML/jackson-module-kotlin/releases + const val moduleKotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:${version}" +} diff --git a/dependency/AssertK.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt similarity index 85% rename from dependency/AssertK.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt index 8d42b6193..424c45fb8 100644 --- a/dependency/AssertK.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt @@ -27,12 +27,12 @@ package io.spine.internal.dependency /** - * Assertion library for tests in Kotlin + * A Java implementation of JSON Web Token (JWT) - RFC 7519. * - * [AssertK](https://github.com/willowtreeapps/assertk) + * [Java JWT](https://github.com/auth0/java-jwt) */ @Suppress("unused") -object AssertK { - private const val version = "0.25" - const val libJvm = "com.willowtreeapps.assertk:assertk-jvm:${version}" +object JavaJwt { + private const val version = "3.19.1" + const val lib = "com.auth0:java-jwt:${version}" } diff --git a/dependency/BouncyCastle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt similarity index 89% rename from dependency/BouncyCastle.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt index c0567edda..e9bdb9b37 100644 --- a/dependency/BouncyCastle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt @@ -26,8 +26,9 @@ package io.spine.internal.dependency -// https://www.bouncycastle.org/java.html +// https://github.com/square/javapoet @Suppress("unused") -object BouncyCastle { - const val libPkcsJdk15 = "org.bouncycastle:bcpkix-jdk15on:1.68" +object JavaPoet { + private const val version = "1.13.0" + const val lib = "com.squareup:javapoet:${version}" } diff --git a/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt similarity index 80% rename from dependency/CheckStyle.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt index 1e3effbae..9fb7bd594 100644 --- a/dependency/CheckStyle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt @@ -26,9 +26,11 @@ package io.spine.internal.dependency -// https://checkstyle.sourceforge.io/ -// See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. @Suppress("unused") -object CheckStyle { - const val version = "10.1" +object JavaX { + // This artifact which used to be a part of J2EE moved under Eclipse EE4J project. + // https://github.com/eclipse-ee4j/common-annotations-api + const val annotations = "javax.annotation:javax.annotation-api:1.3.2" + + const val servletApi = "javax.servlet:javax.servlet-api:3.1.0" } diff --git a/dependency/AutoValue.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt similarity index 87% rename from dependency/AutoValue.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt index 5b630bf19..160fdbfbe 100644 --- a/dependency/AutoValue.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt @@ -26,8 +26,12 @@ package io.spine.internal.dependency -// https://github.com/google/auto -object AutoValue { - private const val version = "1.9" - const val annotations = "com.google.auto.value:auto-value-annotations:${version}" +/** + * A JSON parser in Kotlin + * + * [Klaxon](https://github.com/cbeust/klaxon) + */ +object Klaxon { + private const val version = "5.6" + const val lib = "com.beust:klaxon:${version}" } diff --git a/dependency/CheckerFramework.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt similarity index 67% rename from dependency/CheckerFramework.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt index 75cc67f2e..ecee68630 100644 --- a/dependency/CheckerFramework.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt @@ -26,19 +26,16 @@ package io.spine.internal.dependency -// https://checkerframework.org/ -object CheckerFramework { - private const val version = "3.21.3" - const val annotations = "org.checkerframework:checker-qual:${version}" - @Suppress("unused") - val dataflow = listOf( - "org.checkerframework:dataflow:${version}", - "org.checkerframework:javacutil:${version}" - ) +// https://github.com/JetBrains/kotlin +// https://github.com/Kotlin +object Kotlin { /** - * This is discontinued artifact, which we do not use directly. - * This is a transitive dependency for us, which we force in - * [DependencyResolution.forceConfiguration] - */ - const val compatQual = "org.checkerframework:checker-compat-qual:2.5.5" + * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. + */ + @Suppress("MemberVisibilityCanBePrivate") // used directly from outside + const val version = "1.6.21" + const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${version}" + const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${version}" + const val stdLibCommon = "org.jetbrains.kotlin:kotlin-stdlib-common:${version}" + const val stdLibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${version}" } diff --git a/dependency/AutoCommon.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt similarity index 89% rename from dependency/AutoCommon.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt index 4053ef585..47fd7de41 100644 --- a/dependency/AutoCommon.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt @@ -26,8 +26,9 @@ package io.spine.internal.dependency -// https://github.com/google/auto -object AutoCommon { +// https://github.com/z4kn4fein/kotlin-semver +@Suppress("unused") +object KotlinSemver { private const val version = "1.2.1" - const val lib = "com.google.auto:auto-common:${version}" + const val lib = "io.github.z4kn4fein:semver:$version" } diff --git a/dependency/AppEngine.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt similarity index 79% rename from dependency/AppEngine.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt index 0d7fee394..8d0797631 100644 --- a/dependency/AppEngine.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/LicenseReport.kt @@ -26,14 +26,15 @@ package io.spine.internal.dependency -// https://cloud.google.com/java/docs/reference +// https://github.com/jk1/Gradle-License-Report @Suppress("unused") -object AppEngine { - private const val version = "1.9.82" - const val sdk = "com.google.appengine:appengine-api-1.0-sdk:${version}" +object LicenseReport { + private const val version = "1.16" + const val lib = "com.github.jk1:gradle-license-report:${version}" object GradlePlugin { - private const val version = "2.2.0" - const val lib = "com.google.cloud.tools:appengine-gradle-plugin:${version}" + const val version = LicenseReport.version + const val id = "com.github.jk1.dependency-license-report" + const val lib = LicenseReport.lib } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt new file mode 100644 index 000000000..dfcd80ef0 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +@Suppress("unused") +object Netty { + // https://github.com/netty/netty/releases + private const val version = "4.1.72.Final" + const val common = "io.netty:netty-common:${version}" + const val buffer = "io.netty:netty-buffer:${version}" + const val transport = "io.netty:netty-transport:${version}" + const val handler = "io.netty:netty-handler:${version}" + const val codecHttp = "io.netty:netty-codec-http:${version}" +} diff --git a/dependency/CommonsCli.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt similarity index 84% rename from dependency/CommonsCli.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt index 79a4036cd..4ad91c6fd 100644 --- a/dependency/CommonsCli.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt @@ -27,12 +27,11 @@ package io.spine.internal.dependency /** - * Commons CLI is a transitive dependency which we don't use directly. + * Okio is a transitive dependency which we don't use directly. * We `force` it in [DependencyResolution.forceConfiguration]. - * - * [Commons CLI](https://commons.apache.org/proper/commons-cli/) */ -object CommonsCli { - private const val version = "1.5.0" - const val lib = "commons-cli:commons-cli:${version}" +object Okio { + // This is the last version before next major. + private const val version = "1.17.5" + const val lib = "com.squareup.okio:okio:${version}" } diff --git a/dependency/AnimalSniffer.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt similarity index 83% rename from dependency/AnimalSniffer.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt index 068ae59ce..7f4bb16b8 100644 --- a/dependency/AnimalSniffer.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt @@ -26,8 +26,10 @@ package io.spine.internal.dependency -// https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ -object AnimalSniffer { - private const val version = "1.21" - const val lib = "org.codehaus.mojo:animal-sniffer-annotations:${version}" +object OsDetector { + // https://github.com/google/osdetector-gradle-plugin + const val version = "1.7.0" + const val id = "com.google.osdetector" + const val lib = "com.google.gradle:osdetector-gradle-plugin:${version}" + const val classpath = lib } diff --git a/dependency/Gson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt similarity index 79% rename from dependency/Gson.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt index e161ee1e8..27d27206a 100644 --- a/dependency/Gson.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt @@ -27,12 +27,12 @@ package io.spine.internal.dependency /** - * Gson is a transitive dependency which we don't use directly. - * We `force` it in [DependencyResolution.forceConfiguration()]. + * Plexus Utils is a transitive dependency which we don't use directly. + * We `force` it in [DependencyResolution.forceConfiguration]. * - * [Gson](https://github.com/google/gson) + * [Plexus Utils](https://codehaus-plexus.github.io/plexus-utils/) */ -object Gson { - private const val version = "2.9.0" - const val lib = "com.google.code.gson:gson:${version}" +object Plexus { + private const val version = "3.4.0" + const val utils = "org.codehaus.plexus:plexus-utils:${version}" } diff --git a/dependency/ApacheHttp.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt similarity index 88% rename from dependency/ApacheHttp.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt index dd518a0c0..badd77174 100644 --- a/dependency/ApacheHttp.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt @@ -26,9 +26,8 @@ package io.spine.internal.dependency -@Suppress("unused") -object ApacheHttp { - - // https://hc.apache.org/downloads.cgi - const val core = "org.apache.httpcomponents:httpcore:4.4.14" +// https://pmd.github.io/ +@Suppress("unused") // Will be used when `config/gradle/pmd.gradle` migrates to Kotlin. +object Pmd { + const val version = "6.44.0" } diff --git a/dependency/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt similarity index 57% rename from dependency/ErrorProne.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt index e62b4b416..437ee2cef 100644 --- a/dependency/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt @@ -26,34 +26,28 @@ package io.spine.internal.dependency -// https://errorprone.info/ -@Suppress("unused") -object ErrorProne { - // https://github.com/google/error-prone - private const val version = "2.13.1" - // https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts - private const val javacPluginVersion = "9+181-r4173-1" - - val annotations = listOf( - "com.google.errorprone:error_prone_annotations:${version}", - "com.google.errorprone:error_prone_type_annotations:${version}" +// https://github.com/protocolbuffers/protobuf +@Suppress("MemberVisibilityCanBePrivate") // used directly from outside +object Protobuf { + private const val group = "com.google.protobuf" + const val version = "3.20.1" + val libs = listOf( + "${group}:protobuf-java:${version}", + "${group}:protobuf-java-util:${version}", + "${group}:protobuf-kotlin:${version}" ) - const val core = "com.google.errorprone:error_prone_core:${version}" - const val checkApi = "com.google.errorprone:error_prone_check_api:${version}" - const val testHelpers = "com.google.errorprone:error_prone_test_helpers:${version}" - const val javacPlugin = "com.google.errorprone:javac:${javacPluginVersion}" + const val compiler = "${group}:protoc:${version}" - // https://github.com/tbroyer/gradle-errorprone-plugin/releases + // https://github.com/google/protobuf-gradle-plugin/releases object GradlePlugin { - const val id = "net.ltgt.errorprone" /** * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. * Thus, when applying the plugin in projects build files, only the [id] should be used. * - * When the plugin is used as a library (e.g. in tools), its version and the library - * artifacts are of importance. + * When changing the version, also change the version used in the `build.gradle.kts`. */ - const val version = "2.0.2" - const val lib = "net.ltgt.gradle:gradle-errorprone-plugin:${version}" + const val version = "0.8.18" + const val id = "com.google.protobuf" + const val lib = "${group}:protobuf-gradle-plugin:${version}" } } diff --git a/dependency/GoogleCloud.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt similarity index 69% rename from dependency/GoogleCloud.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt index a764af274..2d2370602 100644 --- a/dependency/GoogleCloud.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt @@ -26,18 +26,19 @@ package io.spine.internal.dependency +// https://github.com/forge/roaster @Suppress("unused") -object GoogleCloud { +object Roaster { - // https://github.com/googleapis/java-core - const val core = "com.google.cloud:google-cloud-core:2.3.3" + /** + * Do not advance this version further because it would break compatibility with Java 8 + * projects. Starting from the following version Roaster has a shaded version of Eclipse JFace + * built with Java 11. + * + * Please see [this issue][https://github.com/SpineEventEngine/config/issues/220] for details. + */ + private const val version = "2.24.0.Final" - // https://github.com/googleapis/java-pubsub/tree/main/proto-google-cloud-pubsub-v1 - const val pubSubGrpcApi = "com.google.api.grpc:proto-google-cloud-pubsub-v1:1.97.0" - - // https://github.com/googleapis/java-trace - const val trace = "com.google.cloud:google-cloud-trace:2.1.0" - - // https://github.com/googleapis/java-datastore - const val datastore = "com.google.cloud:google-cloud-datastore:2.2.1" + const val api = "org.jboss.forge.roaster:roaster-api:${version}" + const val jdt = "org.jboss.forge.roaster:roaster-jdt:${version}" } diff --git a/dependency/Guava.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt similarity index 69% rename from dependency/Guava.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt index faaf3b8ba..4cfa04946 100644 --- a/dependency/Guava.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt @@ -27,15 +27,15 @@ package io.spine.internal.dependency /** - * The dependencies for Guava. + * Spine used to log with SLF4J. Now we use Flogger. Whenever a choice comes up, we recommend to + * use the latter. * - * When changing the version, also change the version used in the `build.gradle.kts`. We need - * to synchronize the version used in `buildSrc` and in Spine modules. Otherwise, when testing - * Gradle plugins, errors may occur due to version clashes. + * Some third-party libraries may clash with different versions of the library. Thus, we specify + * this version and force it via [forceConfiguration(..)][DependencyResolution.forceConfiguration]. */ -// https://github.com/google/guava -object Guava { - private const val version = "31.1-jre" - const val lib = "com.google.guava:guava:${version}" - const val testLib = "com.google.guava:guava-testlib:${version}" +@Deprecated("Use Flogger over SLF4J.", replaceWith = ReplaceWith("flogger")) +object Slf4J { + private const val version = "1.7.30" + const val lib = "org.slf4j:slf4j-api:${version}" + const val jdk14 = "org.slf4j:slf4j-jdk14:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt new file mode 100644 index 000000000..8d572d9b2 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +/** + * Gradle TestKit extension for Google Truth. + * + * Source code: + * https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/tree/main/testkit-truth + * + * Usage description: + * https://dev.to/autonomousapps/gradle-all-the-way-down-testing-your-gradle-plugin-with-gradle-testkit-2hmc + */ +@Suppress("unused") +object TestKitTruth { + private const val version = "1.1" + const val lib = "com.autonomousapps:testkit-truth:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt new file mode 100644 index 000000000..48c1f2df5 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt @@ -0,0 +1,37 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://github.com/google/truth +object Truth { + private const val version = "1.1.3" + val libs = listOf( + "com.google.truth:truth:${version}", + "com.google.truth.extensions:truth-java8-extension:${version}", + "com.google.truth.extensions:truth-proto-extension:${version}" + ) +} diff --git a/dependency/AutoService.kt b/dependency/AutoService.kt deleted file mode 100644 index 80b79975a..000000000 --- a/dependency/AutoService.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/google/auto -object AutoService { - private const val version = "1.0.1" - const val annotations = "com.google.auto.service:auto-service-annotations:${version}" - @Suppress("unused") - const val processor = "com.google.auto.service:auto-service:${version}" -} diff --git a/dependency/CommonsCodec.kt b/dependency/CommonsCodec.kt deleted file mode 100644 index 97dbed873..000000000 --- a/dependency/CommonsCodec.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://commons.apache.org/proper/commons-codec/changes-report.html -@Suppress("unused") -object CommonsCodec { - private const val version = "1.15" - const val lib = "commons-codec:commons-codec:$version" -} diff --git a/dependency/Dokka.kt b/dependency/Dokka.kt deleted file mode 100644 index b9f811d04..000000000 --- a/dependency/Dokka.kt +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/Kotlin/dokka -@Suppress("unused") -object Dokka { - private const val group = "org.jetbrains.dokka" - - /** - * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. - */ - const val version = "1.6.20" - - object GradlePlugin { - const val id = "org.jetbrains.dokka" - - /** - * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. - * Thus, when applying the plugin in project's build files, only the [id] should be used. - */ - const val lib = "${group}:dokka-gradle-plugin:${version}" - } - - object BasePlugin { - const val lib = "${group}:dokka-base:${version}" - } - - /** - * To generate the documentation as seen from Java perspective use this plugin. - * - * @see - * Dokka output formats - */ - object KotlinAsJavaPlugin { - const val lib = "${group}:kotlin-as-java-plugin:${version}" - } - - /** - * Custom Dokka plugins developed for Spine-specific needs like excluding by `@Internal` - * annotation. - * - * @see - * Custom Dokka Plugins - */ - object SpineExtensions { - private const val group = "io.spine.tools" - - const val version = "2.0.0-SNAPSHOT.3" - const val lib = "${group}:spine-dokka-extensions:${version}" - } -} diff --git a/dependency/FindBugs.kt b/dependency/FindBugs.kt deleted file mode 100644 index 52b05f758..000000000 --- a/dependency/FindBugs.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -/** - * The FindBugs project is dead since 2017. It has a successor called SpotBugs, but we don't use it. - * We use ErrorProne for static analysis instead. The only reason for having this dependency is - * the annotations for null-checking introduced by JSR-305. These annotations are troublesome, - * but no alternatives are known for some of them so far. Please see - * [this issue](https://github.com/SpineEventEngine/base/issues/108) for more details. - */ -object FindBugs { - private const val version = "3.0.2" - const val annotations = "com.google.code.findbugs:jsr305:${version}" -} diff --git a/dependency/Firebase.kt b/dependency/Firebase.kt deleted file mode 100644 index 5e471caad..000000000 --- a/dependency/Firebase.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://firebase.google.com/docs/admin/setup#java -@Suppress("unused") -object Firebase { - private const val adminVersion = "8.1.0" - const val admin = "com.google.firebase:firebase-admin:${adminVersion}" -} diff --git a/dependency/Flogger.kt b/dependency/Flogger.kt deleted file mode 100644 index 4332178f9..000000000 --- a/dependency/Flogger.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/google/flogger -object Flogger { - internal const val version = "0.7.4" - const val lib = "com.google.flogger:flogger:${version}" - @Suppress("unused") - object Runtime { - const val systemBackend = "com.google.flogger:flogger-system-backend:${version}" - const val log4J = "com.google.flogger:flogger-log4j:${version}" - const val slf4J = "com.google.flogger:slf4j-backend-factory:${version}" - } -} diff --git a/dependency/GoogleApis.kt b/dependency/GoogleApis.kt deleted file mode 100644 index af663dc15..000000000 --- a/dependency/GoogleApis.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -/** - * Provides dependencies on [GoogleApis projects](https://github.com/googleapis/). - */ -@Suppress("unused") -object GoogleApis { - - // https://github.com/googleapis/google-api-java-client - const val client = "com.google.api-client:google-api-client:1.32.2" - - // https://github.com/googleapis/api-common-java - const val common = "com.google.api:api-common:2.1.1" - - // https://github.com/googleapis/java-common-protos - const val commonProtos = "com.google.api.grpc:proto-google-common-protos:2.7.0" - - // https://github.com/googleapis/gax-java - const val gax = "com.google.api:gax:2.7.1" - - // https://github.com/googleapis/java-iam - const val protoAim = "com.google.api.grpc:proto-google-iam-v1:1.2.0" - - // https://github.com/googleapis/google-oauth-java-client - const val oAuthClient = "com.google.oauth-client:google-oauth-client:1.32.1" - - // https://github.com/googleapis/google-auth-library-java - object AuthLibrary { - const val version = "1.3.0" - const val credentials = "com.google.auth:google-auth-library-credentials:${version}" - const val oAuth2Http = "com.google.auth:google-auth-library-oauth2-http:${version}" - } -} diff --git a/dependency/Grpc.kt b/dependency/Grpc.kt deleted file mode 100644 index c9d55667c..000000000 --- a/dependency/Grpc.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/grpc/grpc-java -@Suppress("unused") -object Grpc { - @Suppress("MemberVisibilityCanBePrivate") - const val version = "1.45.1" - const val api = "io.grpc:grpc-api:${version}" - const val auth = "io.grpc:grpc-auth:${version}" - const val core = "io.grpc:grpc-core:${version}" - const val context = "io.grpc:grpc-context:${version}" - const val stub = "io.grpc:grpc-stub:${version}" - const val okHttp = "io.grpc:grpc-okhttp:${version}" - const val protobuf = "io.grpc:grpc-protobuf:${version}" - const val protobufLite = "io.grpc:grpc-protobuf-lite:${version}" - const val protobufPlugin = "io.grpc:protoc-gen-grpc-java:${version}" - const val netty = "io.grpc:grpc-netty:${version}" - const val nettyShaded = "io.grpc:grpc-netty-shaded:${version}" -} From 76bd86164b4841bef657736859df0a78a28e4c19 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 11:53:00 +0300 Subject: [PATCH 07/17] Migrate fourth bunch of dependencies --- build.gradle.kts | 3 +- buildSrc/build.gradle.kts | 28 +++++-------- .../internal/gradle/DependencyResolution.kt | 12 +++--- gradle/libs.versions.toml | 40 +++++++++++++++++-- 4 files changed, 53 insertions(+), 30 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 656a68601..c42b4dc94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,6 @@ import com.google.protobuf.gradle.generateProtoTasks import com.google.protobuf.gradle.id import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.protoc -import io.spine.internal.dependency.JUnit import io.spine.internal.dependency.Protobuf import io.spine.internal.gradle.publish.PublishingRepos import io.spine.internal.gradle.applyGitHubPackages @@ -137,7 +136,7 @@ subprojects { api(kotlin("stdlib-jdk8")) testImplementation("io.spine.tools:spine-testlib:$spineBaseVersion") - testImplementation(JUnit.runner) + testImplementation(rootProject.libs.junit.runner) } /** diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index b06ed82c5..6a0418fef 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -39,14 +39,6 @@ repositories { gradlePluginPortal() } -/** - * The version of Jackson used by `buildSrc`. - * - * Please keep this value in sync. with `Jackson.version`. - * It's not a requirement, but would be good in terms of consistency. - */ -val jacksonVersion = "2.13.0" - val licenseReportVersion = "2.1" /** @@ -80,23 +72,25 @@ configurations.all { } } -val jvmVersion = JavaLanguageVersion.of(11) +kotlin { + val jvmVersion = JavaLanguageVersion.of(11) -java { - toolchain.languageVersion.set(jvmVersion) -} + jvmToolchain { + (this as JavaToolchainSpec).languageVersion.set(jvmVersion) + } -tasks.withType().configureEach { - kotlinOptions { - jvmTarget = jvmVersion.toString() + tasks.withType().configureEach { + kotlinOptions { + jvmTarget = jvmVersion.toString() + } } } dependencies { implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) - implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") - implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") + implementation(libs.jackson.databind) + implementation(libs.jackson.dataformatXml) implementation(libs.google.artifactRegistry.authCommon) implementation(libs.guava) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index 957c01f96..eabd5503a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,8 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.J2ObjC -import io.spine.internal.dependency.JUnit import io.spine.internal.dependency.Kotlin import io.spine.internal.dependency.Okio import io.spine.internal.dependency.Plexus @@ -90,10 +88,10 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { force( libs.guava.testLib, - JUnit.api, - JUnit.platformCommons, - JUnit.platformLauncher, - JUnit.legacy, + libs.junit.api, + libs.junit.platform.commons, + libs.junit.platform.launcher, + libs.junit.legacy, Truth.libs ) } @@ -105,7 +103,7 @@ private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLib force( libs.autoValue.annotations, libs.gson, - J2ObjC.annotations, + libs.j2objc.annotations, Plexus.utils, Okio.lib, libs.commons.cli, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fdae0bb2d..a70c5d689 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,6 +22,10 @@ flogger = "0.7.4" # https://github.com/google/flogger googleAuthLib = "1.3.0" # https://github.com/googleapis/google-auth-library-java grpc = "1.45.1" # https://github.com/grpc/grpc-java guava = "31.1-jre" # https://github.com/google/guava +httpClient = "1.41.5" # https://github.com/googleapis/google-http-java-client +jackson = "2.13.2" # https://github.com/FasterXML +junit = "5.8.2" # https://junit.org/junit5/ +junitPlatform = "1.8.2" # https://junit.org/junit5/ [libraries] animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } @@ -58,7 +62,6 @@ flogger = { module = "com.google.flogger:flogger", version.ref = "flogger" } flogger-runtime-systemBackend = { module = "com.google.flogger:flogger-system-backend", version.ref = "flogger" } flogger-runtime-log4J = { module = "com.google.flogger:flogger-log4j", version.ref = "flogger" } flogger-runtime-slf4J = { module = "com.google.flogger:slf4j-backend-factory", version.ref = "flogger" } - # https://github.com/googleapis/google-api-java-client google-apis-client = "com.google.api-client:google-api-client:1.32.2" # https://github.com/googleapis/api-common-java @@ -85,7 +88,6 @@ google-cloud-trace = "com.google.cloud:google-cloud-trace:2.1.0" google-cloud-datastore = "com.google.cloud:google-cloud-datastore:2.2.1" # https://mvnrepository.com/artifact/com.google.cloud.artifactregistry/artifactregistry-auth-common google-artifactRegistry-authCommon = "com.google.cloud.artifactregistry:artifactregistry-auth-common:2.1.2" - grpc-api = { module = "io.grpc:grpc-api", version.ref = "grpc" } grpc-auth = { module = "io.grpc:grpc-auth", version.ref = "grpc" } grpc-core = { module = "io.grpc:grpc-core", version.ref = "grpc" } @@ -97,18 +99,48 @@ grpc-protobufLite = { module = "io.grpc:grpc-protobuf-lite", version.ref = "grpc grpc-protobufPlugin = { module = "io.grpc:protoc-gen-grpc-java", version.ref = "grpc" } grpc-netty = { module = "io.grpc:grpc-netty", version.ref = "grpc" } grpc-nettyShaded = { module = "io.grpc:grpc-netty-shaded", version.ref = "grpc" } - # https://github.com/google/gson gson = "com.google.code.gson:gson:2.9.0" - guava = { module = "com.google.guava:guava", version.ref = "guava" } guava-testLib = { module = "com.google.guava:guava-testlib", version.ref = "guava" } # https://github.com/ajoberstar/grgit grgit = "org.ajoberstar.grgit:grgit-core:3.1.1" +httpClient-googe = { module = "com.google.http-client:google-http-client", version.ref = "httpClient" } +httpClient-jackson2 = { module = "com.google.http-client:google-http-client-jackson2", version.ref = "httpClient" } +httpClient-gson = { module = "com.google.http-client:google-http-client-gson", version.ref = "httpClient" } +httpClient-apache2 = { module = "com.google.http-client:google-http-client-apache-v2", version.ref = "httpClient" } +httpClient-apache = "com.google.http-client:google-http-client-apache:2.1.2" +# https://github.com/google/j2objc/releases +j2objc-annotations = "com.google.j2objc:j2objc-annotations:1.3" +jackson-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" } +jackson-dataformatXml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version.ref = "jackson" } +jackson-dataformatYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } +jackson-moduleKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } +# https://github.com/FasterXML/jackson-databind +jackson-databind = "com.fasterxml.jackson.core:jackson-databind:2.13.2.2" +# https://github.com/auth0/java-jwt +javaJwt = "com.auth0:java-jwt:3.19.1" +# https://github.com/square/javapoet +javaPoet = "com.squareup:javapoet:1.13.0" +# https://github.com/eclipse-ee4j/common-annotations-api +javaX-annotations = "javax.annotation:javax.annotation-api:1.3.2" +javaX-servletApi = "javax.servlet:javax.servlet-api:3.1.0" +junit-legacy = "junit:junit:4.13.1" +# https://github.com/apiguardian-team/apiguardian +junit-apiGuardian-api = "org.apiguardian:apiguardian-api:1.1.2" +junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" } +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } +junit-runner = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } +junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junitPlatform" } +junit-platform-commons = { module = "org.junit.platform:junit-platform-commons", version.ref = "junitPlatform" } +# https://github.com/junit-pioneer/junit-pioneer +junit-pioneer = "org.junit-pioneer:junit-pioneer:1.5.0" [bundles] checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] errorProne-annotations = ["errorProne-annotations", "errorProne-typeAnnotations"] +junit-api = ["junit-apiGuardian-api", "junit-api", "junit-params"] [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } From e472d3fa5a8031c78221a55c90de6f96cc94083b Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 13:05:08 +0300 Subject: [PATCH 08/17] Migrate fifth bunch of dependencies --- buildSrc/build.gradle.kts | 33 ++----------------- .../internal/gradle/DependencyResolution.kt | 12 +++---- gradle/libs.versions.toml | 26 ++++++++++++++- 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6a0418fef..c6ada2bc2 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -39,16 +39,6 @@ repositories { gradlePluginPortal() } -val licenseReportVersion = "2.1" - -/** - * The version of the Kotlin Gradle plugin. - * - * Please check that this value matches one defined in - * [io.spine.internal.dependency.Kotlin.version]. - */ -val kotlinVersion = "1.6.21" - /** * The version of Protobuf Gradle Plugin. * @@ -59,19 +49,6 @@ val kotlinVersion = "1.6.21" */ val protobufPluginVersion = "0.8.18" -configurations.all { - resolutionStrategy { - // Force Kotlin lib versions avoiding using those bundled with Gradle. - force( - "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" - ) - } -} - kotlin { val jvmVersion = JavaLanguageVersion.of(11) @@ -87,21 +64,15 @@ kotlin { } dependencies { + api(libs.licenseReport) implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) - implementation(libs.jackson.databind) implementation(libs.jackson.dataformatXml) - implementation(libs.google.artifactRegistry.authCommon) implementation(libs.guava) - api("com.github.jk1:gradle-license-report:$licenseReportVersion") implementation(libs.grgit) implementation(libs.errorProne.gradlePlugin) - - // Add explicit dependency to avoid warning on different Kotlin runtime versions. - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") - + implementation(libs.kotlin.gradlePlugin) implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") implementation(libs.dokka.gradlePlugin) implementation(libs.dokka.basePlugin) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index eabd5503a..d80b3b896 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,8 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.Kotlin -import io.spine.internal.dependency.Okio import io.spine.internal.dependency.Plexus import io.spine.internal.dependency.Protobuf import io.spine.internal.dependency.Truth @@ -75,10 +73,10 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib libs.flogger, libs.flogger.runtime.systemBackend, libs.guava, - Kotlin.reflect, - Kotlin.stdLib, - Kotlin.stdLibCommon, - Kotlin.stdLibJdk8, + libs.kotlin.reflect, + libs.kotlin.stdLib, + libs.kotlin.stdLib.common, + libs.kotlin.stdLib.jdk8, Protobuf.libs, Protobuf.GradlePlugin.lib, io.spine.internal.dependency.Slf4J.lib @@ -104,8 +102,8 @@ private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLib libs.autoValue.annotations, libs.gson, libs.j2objc.annotations, + libs.okio, Plexus.utils, - Okio.lib, libs.commons.cli, libs.commons.logging, libs.checkerFramework.compatQual, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a70c5d689..2f5e6a3e9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,10 @@ httpClient = "1.41.5" # https://github.com/googleapis/google-http-java-client jackson = "2.13.2" # https://github.com/FasterXML junit = "5.8.2" # https://junit.org/junit5/ junitPlatform = "1.8.2" # https://junit.org/junit5/ +kotlin = "1.6.21" # https://github.com/JetBrains/kotlin +licenseReport = "1.16" # https://github.com/jk1/Gradle-License-Report +netty = "4.1.72.Final" # https://github.com/netty/netty/releases +osDetector = "1.7.0" # https://github.com/google/osdetector-gradle-plugin [libraries] animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } @@ -136,6 +140,24 @@ junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher junit-platform-commons = { module = "org.junit.platform:junit-platform-commons", version.ref = "junitPlatform" } # https://github.com/junit-pioneer/junit-pioneer junit-pioneer = "org.junit-pioneer:junit-pioneer:1.5.0" +# https://github.com/cbeust/klaxon +klaxon = "com.beust:klaxon:5.6" +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } +kotlin-stdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlin-stdLib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" } +kotlin-stdLib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" } +kotlin-stdLib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } +kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +# https://github.com/z4kn4fein/kotlin-semver +kotlinSemver = "io.github.z4kn4fein:semver:1.2.1" +licenseReport = { module = "com.github.jk1:gradle-license-report", version.ref = "licenseReport" } +netty-common = { module = "io.netty:netty-common", version.ref = "netty" } +netty-buffer = { module = "io.netty:netty-buffer", version.ref = "netty" } +netty-transport = { module = "io.netty:netty-transport", version.ref = "netty" } +netty-handler = { module = "io.netty:netty-handler", version.ref = "netty" } +netty-codecHttp = { module = "io.netty:netty-codec-http", version.ref = "netty" } +okio = "com.squareup.okio:okio:1.17.5" +osDetector-gradlePlugin = { module = "com.google.gradle:osdetector-gradle-plugin", version.ref = "osDetector" } [bundles] checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] @@ -144,4 +166,6 @@ junit-api = ["junit-apiGuardian-api", "junit-api", "junit-params"] [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } -errorProne = { id = "net.ltgt.errorprone" } +errorProne = { id = "net.ltgt.errorprone", version.ref = "errorProneGradlePlugin" } +licenseReport = { id = "com.github.jk1.dependency-license-report", version.ref = "licenseReport" } +osDetector = { id = "com.google.osdetector", version.ref = "osDetector" } From f288830976d802002aa398fcfceceac574055a2e Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 13:33:20 +0300 Subject: [PATCH 09/17] Migrate the last bunch of dependencies --- build.gradle.kts | 8 +++---- buildSrc/build.gradle.kts | 12 +--------- .../internal/gradle/DependencyResolution.kt | 15 ++++++------ .../gradle/dart/plugin/DartPlugins.kt | 3 +++ .../internal/gradle/dart/plugin/Protobuf.kt | 3 +-- .../gradle/javascript/plugin/JsPlugins.kt | 3 +++ .../gradle/javascript/plugin/Protobuf.kt | 5 ++-- .../src/main/kotlin/pmd-settings.gradle.kts | 4 +--- gradle/libs.versions.toml | 23 +++++++++++++++++++ 9 files changed, 44 insertions(+), 32 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c42b4dc94..94a4214f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,6 @@ import com.google.protobuf.gradle.generateProtoTasks import com.google.protobuf.gradle.id import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.protoc -import io.spine.internal.dependency.Protobuf import io.spine.internal.gradle.publish.PublishingRepos import io.spine.internal.gradle.applyGitHubPackages import io.spine.internal.gradle.applyStandard @@ -73,7 +72,7 @@ plugins { idea `project-report` - id(io.spine.internal.dependency.Protobuf.GradlePlugin.id) + id(libs.plugins.protobuf.get().pluginId) id(libs.plugins.errorProne.get().pluginId) } @@ -117,7 +116,6 @@ subprojects { plugin("kotlin") plugin("com.google.protobuf") plugin("net.ltgt.errorprone") - plugin("pmd") plugin("checkstyle") plugin("idea") plugin("pmd-settings") @@ -133,7 +131,7 @@ subprojects { val spineBaseVersion: String by extra dependencies { errorprone(rootProject.libs.errorProne.core) - api(kotlin("stdlib-jdk8")) + api(rootProject.libs.kotlin.stdLib.jdk8) testImplementation("io.spine.tools:spine-testlib:$spineBaseVersion") testImplementation(rootProject.libs.junit.runner) @@ -205,7 +203,7 @@ subprojects { protobuf { generatedFilesBaseDir = generatedRootDir protoc { - artifact = Protobuf.compiler + artifact = rootProject.libs.protobuf.compiler.get().toString() } generateProtoTasks { all().forEach { task -> diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index c6ada2bc2..49d711725 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -39,16 +39,6 @@ repositories { gradlePluginPortal() } -/** - * The version of Protobuf Gradle Plugin. - * - * Please keep in sync. with [io.spine.internal.dependency.Protobuf.GradlePlugin.version]. - * - * @see - * Protobuf Gradle Plugins Releases - */ -val protobufPluginVersion = "0.8.18" - kotlin { val jvmVersion = JavaLanguageVersion.of(11) @@ -73,7 +63,7 @@ dependencies { implementation(libs.grgit) implementation(libs.errorProne.gradlePlugin) implementation(libs.kotlin.gradlePlugin) - implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") + implementation(libs.protobuf.gradlePlugin) implementation(libs.dokka.gradlePlugin) implementation(libs.dokka.basePlugin) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index d80b3b896..c2ed66476 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -26,9 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.dependency.Plexus -import io.spine.internal.dependency.Protobuf -import io.spine.internal.dependency.Truth import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.artifacts.Configuration @@ -77,9 +74,11 @@ private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLib libs.kotlin.stdLib, libs.kotlin.stdLib.common, libs.kotlin.stdLib.jdk8, - Protobuf.libs, - Protobuf.GradlePlugin.lib, - io.spine.internal.dependency.Slf4J.lib + libs.protobuf.java, + libs.protobuf.java.util, + libs.protobuf.kotlin, + libs.protobuf.gradlePlugin, + libs.slf4j.api ) } @@ -90,7 +89,7 @@ private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { libs.junit.platform.commons, libs.junit.platform.launcher, libs.junit.legacy, - Truth.libs + libs.truth ) } @@ -103,7 +102,7 @@ private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLib libs.gson, libs.j2objc.annotations, libs.okio, - Plexus.utils, + libs.plexus, libs.commons.cli, libs.commons.logging, libs.checkerFramework.compatQual, diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt index 061e2add2..3a9f61973 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt @@ -28,10 +28,12 @@ package io.spine.internal.gradle.dart.plugin import io.spine.internal.gradle.dart.DartContext import io.spine.internal.gradle.dart.DartEnvironment +import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.PluginContainer import org.gradle.api.tasks.TaskContainer +import org.gradle.kotlin.dsl.getByType /** * A scope for applying and configuring Dart-related plugins. @@ -79,6 +81,7 @@ class DartPlugins(dartEnv: DartEnvironment, project: Project) : DartContext(dart internal val plugins = project.plugins internal val extensions = project.extensions + internal val libs = extensions.getByType() internal val tasks = project.tasks internal fun plugins(configurations: PluginContainer.() -> Unit) = diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt index 350f0fbd3..454373b01 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt @@ -31,7 +31,6 @@ import com.google.protobuf.gradle.id import com.google.protobuf.gradle.plugins import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.remove -import io.spine.internal.dependency.Protobuf /** * Applies `protobuf` plugin and configures `GenerateProtoTask` to work with a Dart module. @@ -40,7 +39,7 @@ import io.spine.internal.dependency.Protobuf */ fun DartPlugins.protobuf() { - plugins.apply(Protobuf.GradlePlugin.id) + plugins.apply(libs.plugins.protobuf.get().pluginId) project.protobuf { generateProtoTasks.all().forEach { task -> diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt index 6a17820da..ffd414753 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt @@ -28,10 +28,12 @@ package io.spine.internal.gradle.javascript.plugin import io.spine.internal.gradle.javascript.JsContext import io.spine.internal.gradle.javascript.JsEnvironment +import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.PluginContainer import org.gradle.api.tasks.TaskContainer +import org.gradle.kotlin.dsl.getByType /** * A scope for applying and configuring JavaScript-related plugins. @@ -79,6 +81,7 @@ class JsPlugins(jsEnv: JsEnvironment, project: Project) : JsContext(jsEnv, proje internal val plugins = project.plugins internal val extensions = project.extensions + internal val libs = extensions.getByType() internal val tasks = project.tasks internal fun plugins(configurations: PluginContainer.() -> Unit) = diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt index d99d2a288..48e6b8c01 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt @@ -32,7 +32,6 @@ import com.google.protobuf.gradle.id import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.protoc import com.google.protobuf.gradle.remove -import io.spine.internal.dependency.Protobuf /** * Applies and configures `protobuf` plugin to work with a JavaScript module. @@ -47,7 +46,7 @@ import io.spine.internal.dependency.Protobuf fun JsPlugins.protobuf() { plugins { - apply(Protobuf.GradlePlugin.id) + apply(libs.plugins.protobuf.get().pluginId) } project.protobuf { @@ -55,7 +54,7 @@ fun JsPlugins.protobuf() { generatedFilesBaseDir = projectDir.path protoc { - artifact = Protobuf.compiler + artifact = libs.protobuf.compiler.get().toString() } generateProtoTasks { diff --git a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts index 03e69a67e..e9e101bbd 100644 --- a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts +++ b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts @@ -24,14 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.Pmd - plugins { pmd } pmd { - toolVersion = Pmd.version + toolVersion = "6.44.0" isConsoleOutput = true incrementalAnalysis.set(true) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2f5e6a3e9..3b08870e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -30,6 +30,11 @@ kotlin = "1.6.21" # https://github.com/JetBrains/kotlin licenseReport = "1.16" # https://github.com/jk1/Gradle-License-Report netty = "4.1.72.Final" # https://github.com/netty/netty/releases osDetector = "1.7.0" # https://github.com/google/osdetector-gradle-plugin +protobuf = "3.20.1" # https://github.com/protocolbuffers/protobuf +protobufGradlePlugin = "0.8.18" # https://github.com/google/protobuf-gradle-plugin/releases +roaster = "2.24.0.Final" # https://github.com/forge/roaster +slf4j = "1.7.30" # DEPRECATED, use Flogger instead +truth = "1.1.3" # https://github.com/google/truth [libraries] animalSniffer = { module = "org.codehaus.mojo:animal-sniffer-annotations", version.ref = "animalSniffer" } @@ -158,14 +163,32 @@ netty-handler = { module = "io.netty:netty-handler", version.ref = "netty" } netty-codecHttp = { module = "io.netty:netty-codec-http", version.ref = "netty" } okio = "com.squareup.okio:okio:1.17.5" osDetector-gradlePlugin = { module = "com.google.gradle:osdetector-gradle-plugin", version.ref = "osDetector" } +# https://codehaus-plexus.github.io/plexus-utils/ +plexus = "org.codehaus.plexus:plexus-utils:3.4.0" +protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" } +protobuf-java-util = { module = "com.google.protobuf:protobuf-java-util", version.ref = "protobuf" } +protobuf-kotlin = { module = "com.google.protobuf:protobuf-kotlin", version.ref = "protobuf" } +protobuf-compiler = { module = "com.google.protobuf:protoc", version.ref = "protobuf" } +protobuf-gradlePlugin = { module = "com.google.protobuf:protobuf-gradle-plugin", version.ref = "protobufGradlePlugin" } +roaster-api = { module = "org.jboss.forge.roaster:roaster-api", version.ref = "roaster" } +roaster-jdt = { module = "org.jboss.forge.roaster:roaster-jdt", version.ref = "roaster" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" } +testKitTruth = "com.autonomousapps:testkit-truth:1.1" +truth = { module = "com.google.truth:truth", version.ref = "truth" } +truth-java8 = { module = "com.google.truth.extensions:truth-java8-extension", version.ref = "truth" } +truth-proto = { module = "com.google.truth.extensions:truth-proto-extension", version.ref = "truth" } [bundles] checkerFramework-dataflow = ["checkerFramework-dataflow", "checkerFramework-javacUtil"] errorProne-annotations = ["errorProne-annotations", "errorProne-typeAnnotations"] junit-api = ["junit-apiGuardian-api", "junit-api", "junit-params"] +protobuf-libs = ["protobuf-java", "protobuf-java-util", "protobuf-kotlin"] +truth = ["truth", "truth-java8", "truth-proto"] [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } errorProne = { id = "net.ltgt.errorprone", version.ref = "errorProneGradlePlugin" } licenseReport = { id = "com.github.jk1.dependency-license-report", version.ref = "licenseReport" } osDetector = { id = "com.google.osdetector", version.ref = "osDetector" } +protobuf = { id = "com.google.protobuf", version.ref = "protobufGradlePlugin" } From 78d1a755cae0abe3def0f8dccb7544668b198337 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 13:36:15 +0300 Subject: [PATCH 10/17] Restore original Kotlin-based deps --- .../internal/dependency/AnimalSniffer.kt | 33 ++++++++ .../spine/internal/dependency/ApacheHttp.kt | 8 +- .../io/spine/internal/dependency/AppEngine.kt | 13 ++-- .../io/spine/internal/dependency/AssertK.kt | 10 +-- .../spine/internal/dependency/AutoCommon.kt | 7 +- .../spine/internal/dependency/AutoService.kt | 35 +++++++++ .../io/spine/internal/dependency/AutoValue.kt | 12 +-- .../spine/internal/dependency/BouncyCastle.kt | 8 +- .../spine/internal/dependency/CheckStyle.kt | 34 +++++++++ .../internal/dependency/CheckerFramework.kt | 26 +++---- .../spine/internal/dependency/CommonsCli.kt | 11 +-- .../spine/internal/dependency/CommonsCodec.kt | 34 +++++++++ .../internal/dependency/CommonsLogging.kt | 13 ++-- .../io/spine/internal/dependency/Dokka.kt | 76 +++++++++++++++++++ .../spine/internal/dependency/ErrorProne.kt | 36 +++++---- .../io/spine/internal/dependency/FindBugs.kt | 19 ++--- .../io/spine/internal/dependency/Firebase.kt | 34 +++++++++ .../io/spine/internal/dependency/Flogger.kt | 17 +++-- .../spine/internal/dependency/GoogleApis.kt | 52 +++++++------ .../spine/internal/dependency/GoogleCloud.kt | 43 +++++++++++ .../io/spine/internal/dependency/Grpc.kt | 45 +++++++++++ .../io/spine/internal/dependency/Gson.kt | 38 ++++++++++ .../io/spine/internal/dependency/Guava.kt | 19 +++-- dependency/J2ObjC.kt | 41 ---------- dependency/Jackson.kt | 43 ----------- dependency/Kotlin.kt | 41 ---------- dependency/OsDetector.kt | 35 --------- dependency/Slf4J.kt | 41 ---------- dependency/Truth.kt | 37 --------- 29 files changed, 502 insertions(+), 359 deletions(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt rename dependency/JavaPoet.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt (89%) rename dependency/LicenseReport.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt (79%) rename dependency/JavaJwt.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt (85%) rename dependency/KotlinSemver.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt (89%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt rename dependency/Klaxon.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt (87%) rename dependency/Pmd.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt (88%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt rename dependency/Roaster.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt (68%) rename dependency/Okio.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt (84%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt rename dependency/Plexus.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt (78%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt rename dependency/Protobuf.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt (57%) rename dependency/Netty.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt (71%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt rename dependency/JavaX.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt (73%) rename dependency/JUnit.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt (52%) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt rename dependency/TestKitTruth.kt => buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt (72%) delete mode 100644 dependency/J2ObjC.kt delete mode 100644 dependency/Jackson.kt delete mode 100644 dependency/Kotlin.kt delete mode 100644 dependency/OsDetector.kt delete mode 100644 dependency/Slf4J.kt delete mode 100644 dependency/Truth.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt new file mode 100644 index 000000000..068ae59ce --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ +object AnimalSniffer { + private const val version = "1.21" + const val lib = "org.codehaus.mojo:animal-sniffer-annotations:${version}" +} diff --git a/dependency/JavaPoet.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt similarity index 89% rename from dependency/JavaPoet.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt index e9bdb9b37..dd518a0c0 100644 --- a/dependency/JavaPoet.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt @@ -26,9 +26,9 @@ package io.spine.internal.dependency -// https://github.com/square/javapoet @Suppress("unused") -object JavaPoet { - private const val version = "1.13.0" - const val lib = "com.squareup:javapoet:${version}" +object ApacheHttp { + + // https://hc.apache.org/downloads.cgi + const val core = "org.apache.httpcomponents:httpcore:4.4.14" } diff --git a/dependency/LicenseReport.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt similarity index 79% rename from dependency/LicenseReport.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt index 8d0797631..0d7fee394 100644 --- a/dependency/LicenseReport.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt @@ -26,15 +26,14 @@ package io.spine.internal.dependency -// https://github.com/jk1/Gradle-License-Report +// https://cloud.google.com/java/docs/reference @Suppress("unused") -object LicenseReport { - private const val version = "1.16" - const val lib = "com.github.jk1:gradle-license-report:${version}" +object AppEngine { + private const val version = "1.9.82" + const val sdk = "com.google.appengine:appengine-api-1.0-sdk:${version}" object GradlePlugin { - const val version = LicenseReport.version - const val id = "com.github.jk1.dependency-license-report" - const val lib = LicenseReport.lib + private const val version = "2.2.0" + const val lib = "com.google.cloud.tools:appengine-gradle-plugin:${version}" } } diff --git a/dependency/JavaJwt.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt similarity index 85% rename from dependency/JavaJwt.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt index 424c45fb8..8d42b6193 100644 --- a/dependency/JavaJwt.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt @@ -27,12 +27,12 @@ package io.spine.internal.dependency /** - * A Java implementation of JSON Web Token (JWT) - RFC 7519. + * Assertion library for tests in Kotlin * - * [Java JWT](https://github.com/auth0/java-jwt) + * [AssertK](https://github.com/willowtreeapps/assertk) */ @Suppress("unused") -object JavaJwt { - private const val version = "3.19.1" - const val lib = "com.auth0:java-jwt:${version}" +object AssertK { + private const val version = "0.25" + const val libJvm = "com.willowtreeapps.assertk:assertk-jvm:${version}" } diff --git a/dependency/KotlinSemver.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt similarity index 89% rename from dependency/KotlinSemver.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt index 47fd7de41..4053ef585 100644 --- a/dependency/KotlinSemver.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt @@ -26,9 +26,8 @@ package io.spine.internal.dependency -// https://github.com/z4kn4fein/kotlin-semver -@Suppress("unused") -object KotlinSemver { +// https://github.com/google/auto +object AutoCommon { private const val version = "1.2.1" - const val lib = "io.github.z4kn4fein:semver:$version" + const val lib = "com.google.auto:auto-common:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt new file mode 100644 index 000000000..80b79975a --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://github.com/google/auto +object AutoService { + private const val version = "1.0.1" + const val annotations = "com.google.auto.service:auto-service-annotations:${version}" + @Suppress("unused") + const val processor = "com.google.auto.service:auto-service:${version}" +} diff --git a/dependency/Klaxon.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt similarity index 87% rename from dependency/Klaxon.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt index 160fdbfbe..5b630bf19 100644 --- a/dependency/Klaxon.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt @@ -26,12 +26,8 @@ package io.spine.internal.dependency -/** - * A JSON parser in Kotlin - * - * [Klaxon](https://github.com/cbeust/klaxon) - */ -object Klaxon { - private const val version = "5.6" - const val lib = "com.beust:klaxon:${version}" +// https://github.com/google/auto +object AutoValue { + private const val version = "1.9" + const val annotations = "com.google.auto.value:auto-value-annotations:${version}" } diff --git a/dependency/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt similarity index 88% rename from dependency/Pmd.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt index badd77174..c0567edda 100644 --- a/dependency/Pmd.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt @@ -26,8 +26,8 @@ package io.spine.internal.dependency -// https://pmd.github.io/ -@Suppress("unused") // Will be used when `config/gradle/pmd.gradle` migrates to Kotlin. -object Pmd { - const val version = "6.44.0" +// https://www.bouncycastle.org/java.html +@Suppress("unused") +object BouncyCastle { + const val libPkcsJdk15 = "org.bouncycastle:bcpkix-jdk15on:1.68" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt new file mode 100644 index 000000000..1e3effbae --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://checkstyle.sourceforge.io/ +// See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. +@Suppress("unused") +object CheckStyle { + const val version = "10.1" +} diff --git a/dependency/Roaster.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt similarity index 68% rename from dependency/Roaster.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt index 2d2370602..75cc67f2e 100644 --- a/dependency/Roaster.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt @@ -26,19 +26,19 @@ package io.spine.internal.dependency -// https://github.com/forge/roaster -@Suppress("unused") -object Roaster { - +// https://checkerframework.org/ +object CheckerFramework { + private const val version = "3.21.3" + const val annotations = "org.checkerframework:checker-qual:${version}" + @Suppress("unused") + val dataflow = listOf( + "org.checkerframework:dataflow:${version}", + "org.checkerframework:javacutil:${version}" + ) /** - * Do not advance this version further because it would break compatibility with Java 8 - * projects. Starting from the following version Roaster has a shaded version of Eclipse JFace - * built with Java 11. - * - * Please see [this issue][https://github.com/SpineEventEngine/config/issues/220] for details. + * This is discontinued artifact, which we do not use directly. + * This is a transitive dependency for us, which we force in + * [DependencyResolution.forceConfiguration] */ - private const val version = "2.24.0.Final" - - const val api = "org.jboss.forge.roaster:roaster-api:${version}" - const val jdt = "org.jboss.forge.roaster:roaster-jdt:${version}" + const val compatQual = "org.checkerframework:checker-compat-qual:2.5.5" } diff --git a/dependency/Okio.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt similarity index 84% rename from dependency/Okio.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt index 4ad91c6fd..79a4036cd 100644 --- a/dependency/Okio.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt @@ -27,11 +27,12 @@ package io.spine.internal.dependency /** - * Okio is a transitive dependency which we don't use directly. + * Commons CLI is a transitive dependency which we don't use directly. * We `force` it in [DependencyResolution.forceConfiguration]. + * + * [Commons CLI](https://commons.apache.org/proper/commons-cli/) */ -object Okio { - // This is the last version before next major. - private const val version = "1.17.5" - const val lib = "com.squareup.okio:okio:${version}" +object CommonsCli { + private const val version = "1.5.0" + const val lib = "commons-cli:commons-cli:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt new file mode 100644 index 000000000..97dbed873 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://commons.apache.org/proper/commons-codec/changes-report.html +@Suppress("unused") +object CommonsCodec { + private const val version = "1.15" + const val lib = "commons-codec:commons-codec:$version" +} diff --git a/dependency/Plexus.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt similarity index 78% rename from dependency/Plexus.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt index 27d27206a..e9d148f14 100644 --- a/dependency/Plexus.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt @@ -27,12 +27,11 @@ package io.spine.internal.dependency /** - * Plexus Utils is a transitive dependency which we don't use directly. - * We `force` it in [DependencyResolution.forceConfiguration]. - * - * [Plexus Utils](https://codehaus-plexus.github.io/plexus-utils/) + * [Commons Logging](https://commons.apache.org/proper/commons-logging/) is a transitive + * dependency which we don't use directly. This object is used for forcing the version. */ -object Plexus { - private const val version = "3.4.0" - const val utils = "org.codehaus.plexus:plexus-utils:${version}" +object CommonsLogging { + // https://commons.apache.org/proper/commons-logging/ + private const val version = "1.2" + const val lib = "commons-logging:commons-logging:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt new file mode 100644 index 000000000..b9f811d04 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt @@ -0,0 +1,76 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://github.com/Kotlin/dokka +@Suppress("unused") +object Dokka { + private const val group = "org.jetbrains.dokka" + + /** + * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. + */ + const val version = "1.6.20" + + object GradlePlugin { + const val id = "org.jetbrains.dokka" + + /** + * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. + * Thus, when applying the plugin in project's build files, only the [id] should be used. + */ + const val lib = "${group}:dokka-gradle-plugin:${version}" + } + + object BasePlugin { + const val lib = "${group}:dokka-base:${version}" + } + + /** + * To generate the documentation as seen from Java perspective use this plugin. + * + * @see + * Dokka output formats + */ + object KotlinAsJavaPlugin { + const val lib = "${group}:kotlin-as-java-plugin:${version}" + } + + /** + * Custom Dokka plugins developed for Spine-specific needs like excluding by `@Internal` + * annotation. + * + * @see + * Custom Dokka Plugins + */ + object SpineExtensions { + private const val group = "io.spine.tools" + + const val version = "2.0.0-SNAPSHOT.3" + const val lib = "${group}:spine-dokka-extensions:${version}" + } +} diff --git a/dependency/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt similarity index 57% rename from dependency/Protobuf.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt index 437ee2cef..e62b4b416 100644 --- a/dependency/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt @@ -26,28 +26,34 @@ package io.spine.internal.dependency -// https://github.com/protocolbuffers/protobuf -@Suppress("MemberVisibilityCanBePrivate") // used directly from outside -object Protobuf { - private const val group = "com.google.protobuf" - const val version = "3.20.1" - val libs = listOf( - "${group}:protobuf-java:${version}", - "${group}:protobuf-java-util:${version}", - "${group}:protobuf-kotlin:${version}" +// https://errorprone.info/ +@Suppress("unused") +object ErrorProne { + // https://github.com/google/error-prone + private const val version = "2.13.1" + // https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts + private const val javacPluginVersion = "9+181-r4173-1" + + val annotations = listOf( + "com.google.errorprone:error_prone_annotations:${version}", + "com.google.errorprone:error_prone_type_annotations:${version}" ) - const val compiler = "${group}:protoc:${version}" + const val core = "com.google.errorprone:error_prone_core:${version}" + const val checkApi = "com.google.errorprone:error_prone_check_api:${version}" + const val testHelpers = "com.google.errorprone:error_prone_test_helpers:${version}" + const val javacPlugin = "com.google.errorprone:javac:${javacPluginVersion}" - // https://github.com/google/protobuf-gradle-plugin/releases + // https://github.com/tbroyer/gradle-errorprone-plugin/releases object GradlePlugin { + const val id = "net.ltgt.errorprone" /** * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. * Thus, when applying the plugin in projects build files, only the [id] should be used. * - * When changing the version, also change the version used in the `build.gradle.kts`. + * When the plugin is used as a library (e.g. in tools), its version and the library + * artifacts are of importance. */ - const val version = "0.8.18" - const val id = "com.google.protobuf" - const val lib = "${group}:protobuf-gradle-plugin:${version}" + const val version = "2.0.2" + const val lib = "net.ltgt.gradle:gradle-errorprone-plugin:${version}" } } diff --git a/dependency/Netty.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt similarity index 71% rename from dependency/Netty.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt index dfcd80ef0..52b05f758 100644 --- a/dependency/Netty.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt @@ -26,13 +26,14 @@ package io.spine.internal.dependency -@Suppress("unused") -object Netty { - // https://github.com/netty/netty/releases - private const val version = "4.1.72.Final" - const val common = "io.netty:netty-common:${version}" - const val buffer = "io.netty:netty-buffer:${version}" - const val transport = "io.netty:netty-transport:${version}" - const val handler = "io.netty:netty-handler:${version}" - const val codecHttp = "io.netty:netty-codec-http:${version}" +/** + * The FindBugs project is dead since 2017. It has a successor called SpotBugs, but we don't use it. + * We use ErrorProne for static analysis instead. The only reason for having this dependency is + * the annotations for null-checking introduced by JSR-305. These annotations are troublesome, + * but no alternatives are known for some of them so far. Please see + * [this issue](https://github.com/SpineEventEngine/base/issues/108) for more details. + */ +object FindBugs { + private const val version = "3.0.2" + const val annotations = "com.google.code.findbugs:jsr305:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt new file mode 100644 index 000000000..5e471caad --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://firebase.google.com/docs/admin/setup#java +@Suppress("unused") +object Firebase { + private const val adminVersion = "8.1.0" + const val admin = "com.google.firebase:firebase-admin:${adminVersion}" +} diff --git a/dependency/JavaX.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt similarity index 73% rename from dependency/JavaX.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt index 9fb7bd594..4332178f9 100644 --- a/dependency/JavaX.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt @@ -26,11 +26,14 @@ package io.spine.internal.dependency -@Suppress("unused") -object JavaX { - // This artifact which used to be a part of J2EE moved under Eclipse EE4J project. - // https://github.com/eclipse-ee4j/common-annotations-api - const val annotations = "javax.annotation:javax.annotation-api:1.3.2" - - const val servletApi = "javax.servlet:javax.servlet-api:3.1.0" +// https://github.com/google/flogger +object Flogger { + internal const val version = "0.7.4" + const val lib = "com.google.flogger:flogger:${version}" + @Suppress("unused") + object Runtime { + const val systemBackend = "com.google.flogger:flogger-system-backend:${version}" + const val log4J = "com.google.flogger:flogger-log4j:${version}" + const val slf4J = "com.google.flogger:slf4j-backend-factory:${version}" + } } diff --git a/dependency/JUnit.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt similarity index 52% rename from dependency/JUnit.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt index 0c436ce4c..af663dc15 100644 --- a/dependency/JUnit.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt @@ -26,28 +26,34 @@ package io.spine.internal.dependency -// https://junit.org/junit5/ +/** + * Provides dependencies on [GoogleApis projects](https://github.com/googleapis/). + */ @Suppress("unused") -object JUnit { - const val version = "5.8.2" - private const val platformVersion = "1.8.2" - private const val legacyVersion = "4.13.1" - - // https://github.com/apiguardian-team/apiguardian - private const val apiGuardianVersion = "1.1.2" - // https://github.com/junit-pioneer/junit-pioneer - private const val pioneerVersion = "1.5.0" - - const val legacy = "junit:junit:${legacyVersion}" - val api = listOf( - "org.apiguardian:apiguardian-api:${apiGuardianVersion}", - "org.junit.jupiter:junit-jupiter-api:${version}", - "org.junit.jupiter:junit-jupiter-params:${version}" - ) - const val bom = "org.junit:junit-bom:${version}" - const val runner = "org.junit.jupiter:junit-jupiter-engine:${version}" - const val pioneer = "org.junit-pioneer:junit-pioneer:${pioneerVersion}" - const val platformCommons = "org.junit.platform:junit-platform-commons:${platformVersion}" - const val platformLauncher = "org.junit.platform:junit-platform-launcher:${platformVersion}" - const val params = "org.junit.jupiter:junit-jupiter-params:${version}" +object GoogleApis { + + // https://github.com/googleapis/google-api-java-client + const val client = "com.google.api-client:google-api-client:1.32.2" + + // https://github.com/googleapis/api-common-java + const val common = "com.google.api:api-common:2.1.1" + + // https://github.com/googleapis/java-common-protos + const val commonProtos = "com.google.api.grpc:proto-google-common-protos:2.7.0" + + // https://github.com/googleapis/gax-java + const val gax = "com.google.api:gax:2.7.1" + + // https://github.com/googleapis/java-iam + const val protoAim = "com.google.api.grpc:proto-google-iam-v1:1.2.0" + + // https://github.com/googleapis/google-oauth-java-client + const val oAuthClient = "com.google.oauth-client:google-oauth-client:1.32.1" + + // https://github.com/googleapis/google-auth-library-java + object AuthLibrary { + const val version = "1.3.0" + const val credentials = "com.google.auth:google-auth-library-credentials:${version}" + const val oAuth2Http = "com.google.auth:google-auth-library-oauth2-http:${version}" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt new file mode 100644 index 000000000..a764af274 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +@Suppress("unused") +object GoogleCloud { + + // https://github.com/googleapis/java-core + const val core = "com.google.cloud:google-cloud-core:2.3.3" + + // https://github.com/googleapis/java-pubsub/tree/main/proto-google-cloud-pubsub-v1 + const val pubSubGrpcApi = "com.google.api.grpc:proto-google-cloud-pubsub-v1:1.97.0" + + // https://github.com/googleapis/java-trace + const val trace = "com.google.cloud:google-cloud-trace:2.1.0" + + // https://github.com/googleapis/java-datastore + const val datastore = "com.google.cloud:google-cloud-datastore:2.2.1" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt new file mode 100644 index 000000000..c9d55667c --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://github.com/grpc/grpc-java +@Suppress("unused") +object Grpc { + @Suppress("MemberVisibilityCanBePrivate") + const val version = "1.45.1" + const val api = "io.grpc:grpc-api:${version}" + const val auth = "io.grpc:grpc-auth:${version}" + const val core = "io.grpc:grpc-core:${version}" + const val context = "io.grpc:grpc-context:${version}" + const val stub = "io.grpc:grpc-stub:${version}" + const val okHttp = "io.grpc:grpc-okhttp:${version}" + const val protobuf = "io.grpc:grpc-protobuf:${version}" + const val protobufLite = "io.grpc:grpc-protobuf-lite:${version}" + const val protobufPlugin = "io.grpc:protoc-gen-grpc-java:${version}" + const val netty = "io.grpc:grpc-netty:${version}" + const val nettyShaded = "io.grpc:grpc-netty-shaded:${version}" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt new file mode 100644 index 000000000..e161ee1e8 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2022, 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +/** + * Gson is a transitive dependency which we don't use directly. + * We `force` it in [DependencyResolution.forceConfiguration()]. + * + * [Gson](https://github.com/google/gson) + */ +object Gson { + private const val version = "2.9.0" + const val lib = "com.google.code.gson:gson:${version}" +} diff --git a/dependency/TestKitTruth.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt similarity index 72% rename from dependency/TestKitTruth.kt rename to buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt index 8d572d9b2..faaf3b8ba 100644 --- a/dependency/TestKitTruth.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt @@ -27,16 +27,15 @@ package io.spine.internal.dependency /** - * Gradle TestKit extension for Google Truth. + * The dependencies for Guava. * - * Source code: - * https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/tree/main/testkit-truth - * - * Usage description: - * https://dev.to/autonomousapps/gradle-all-the-way-down-testing-your-gradle-plugin-with-gradle-testkit-2hmc + * When changing the version, also change the version used in the `build.gradle.kts`. We need + * to synchronize the version used in `buildSrc` and in Spine modules. Otherwise, when testing + * Gradle plugins, errors may occur due to version clashes. */ -@Suppress("unused") -object TestKitTruth { - private const val version = "1.1" - const val lib = "com.autonomousapps:testkit-truth:$version" +// https://github.com/google/guava +object Guava { + private const val version = "31.1-jre" + const val lib = "com.google.guava:guava:${version}" + const val testLib = "com.google.guava:guava-testlib:${version}" } diff --git a/dependency/J2ObjC.kt b/dependency/J2ObjC.kt deleted file mode 100644 index 9ed18f264..000000000 --- a/dependency/J2ObjC.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -/** - * [J2ObjC](https://developers.google.com/j2objc) is a transitive dependency - * which we don't use directly. This object is used for forcing the version. - */ -object J2ObjC { - // https://github.com/google/j2objc/releases - // `1.3.` is the latest version available from Maven Central. - // https://search.maven.org/artifact/com.google.j2objc/j2objc-annotations - private const val version = "1.3" - const val annotations = "com.google.j2objc:j2objc-annotations:${version}" - @Deprecated("Please use `annotations` instead.", ReplaceWith("annotations")) - const val lib = annotations -} diff --git a/dependency/Jackson.kt b/dependency/Jackson.kt deleted file mode 100644 index 71f7e08c3..000000000 --- a/dependency/Jackson.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -@Suppress("unused") -object Jackson { - private const val version = "2.13.2" - private const val databindVersion = "2.13.2.2" - // https://github.com/FasterXML/jackson-core - const val core = "com.fasterxml.jackson.core:jackson-core:${version}" - // https://github.com/FasterXML/jackson-databind - const val databind = "com.fasterxml.jackson.core:jackson-databind:${databindVersion}" - // https://github.com/FasterXML/jackson-dataformat-xml/releases - const val dataformatXml = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${version}" - // https://github.com/FasterXML/jackson-dataformats-text/releases - const val dataformatYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${version}" - // https://github.com/FasterXML/jackson-module-kotlin/releases - const val moduleKotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:${version}" -} diff --git a/dependency/Kotlin.kt b/dependency/Kotlin.kt deleted file mode 100644 index ecee68630..000000000 --- a/dependency/Kotlin.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/JetBrains/kotlin -// https://github.com/Kotlin -object Kotlin { - /** - * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. - */ - @Suppress("MemberVisibilityCanBePrivate") // used directly from outside - const val version = "1.6.21" - const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${version}" - const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${version}" - const val stdLibCommon = "org.jetbrains.kotlin:kotlin-stdlib-common:${version}" - const val stdLibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${version}" -} diff --git a/dependency/OsDetector.kt b/dependency/OsDetector.kt deleted file mode 100644 index 7f4bb16b8..000000000 --- a/dependency/OsDetector.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -object OsDetector { - // https://github.com/google/osdetector-gradle-plugin - const val version = "1.7.0" - const val id = "com.google.osdetector" - const val lib = "com.google.gradle:osdetector-gradle-plugin:${version}" - const val classpath = lib -} diff --git a/dependency/Slf4J.kt b/dependency/Slf4J.kt deleted file mode 100644 index 4cfa04946..000000000 --- a/dependency/Slf4J.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -/** - * Spine used to log with SLF4J. Now we use Flogger. Whenever a choice comes up, we recommend to - * use the latter. - * - * Some third-party libraries may clash with different versions of the library. Thus, we specify - * this version and force it via [forceConfiguration(..)][DependencyResolution.forceConfiguration]. - */ -@Deprecated("Use Flogger over SLF4J.", replaceWith = ReplaceWith("flogger")) -object Slf4J { - private const val version = "1.7.30" - const val lib = "org.slf4j:slf4j-api:${version}" - const val jdk14 = "org.slf4j:slf4j-jdk14:${version}" -} diff --git a/dependency/Truth.kt b/dependency/Truth.kt deleted file mode 100644 index 48c1f2df5..000000000 --- a/dependency/Truth.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/google/truth -object Truth { - private const val version = "1.1.3" - val libs = listOf( - "com.google.truth:truth:${version}", - "com.google.truth.extensions:truth-java8-extension:${version}", - "com.google.truth.extensions:truth-proto-extension:${version}" - ) -} From b0c63181023f80db9a055150546ceca329d7daed Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 13:38:30 +0300 Subject: [PATCH 11/17] Bump the version --- license-report.md | 4 ++-- version.gradle.kts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index a06dc4bf1..978bc5321 100644 --- a/license-report.md +++ b/license-report.md @@ -512,7 +512,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue May 03 19:16:19 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 12 13:37:07 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1058,4 +1058,4 @@ This report was generated on **Tue May 03 19:16:19 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue May 03 19:16:20 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu May 12 13:37:08 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/version.gradle.kts b/version.gradle.kts index 832e03902..8bde299e6 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -30,4 +30,4 @@ val spineBaseVersion by extra("2.0.0-SNAPSHOT.91") val javadocToolsVersion by extra("2.0.0-SNAPSHOT.75") /** The version of this library. */ -val versionToPublish by extra("2.0.0-SNAPSHOT.92") +val versionToPublish by extra("2.0.0-SNAPSHOT.93") From f13d2a30a1b68e3dfe1ba44e3bb9007cf89dab23 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 13:41:57 +0300 Subject: [PATCH 12/17] Update reports --- build.gradle.kts | 2 +- license-report.md | 8 ++++---- pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 94a4214f8..325de4c36 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,7 +104,7 @@ allprojects { extra["javadocToolsVersion"] = "2.0.0-SNAPSHOT.75" /** The version of this library. */ - val versionToPublish by extra("2.0.0-SNAPSHOT.92") + val versionToPublish by extra("2.0.0-SNAPSHOT.93") group = "io.spine" version = versionToPublish diff --git a/license-report.md b/license-report.md index 978bc5321..0f567a274 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-testutil-time:2.0.0-SNAPSHOT.92` +# Dependencies of `io.spine.tools:spine-testutil-time:2.0.0-SNAPSHOT.93` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -512,12 +512,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 12 13:37:07 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 12 13:40:57 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-time:2.0.0-SNAPSHOT.92` +# Dependencies of `io.spine:spine-time:2.0.0-SNAPSHOT.93` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -1058,4 +1058,4 @@ This report was generated on **Thu May 12 13:37:07 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 12 13:37:08 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu May 12 13:40:58 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 26407f6bf..59b578d9e 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine spine-time -2.0.0-SNAPSHOT.92 +2.0.0-SNAPSHOT.93 2015 From b780b93890b957c540e65c8a9f75319fb1e4122f Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 14:28:10 +0300 Subject: [PATCH 13/17] Document certain points --- build.gradle.kts | 12 ++++++++++++ buildSrc/src/main/kotlin/dokka-for-java.gradle.kts | 5 +++-- .../io/spine/internal/dependency/CheckStyle.kt | 1 + .../main/kotlin/io/spine/internal/dependency/Pmd.kt | 1 + .../internal/gradle/checkstyle/CheckStyleConfig.kt | 8 +++----- .../spine/internal/gradle/dart/plugin/DartPlugins.kt | 3 ++- .../internal/gradle/javascript/plugin/JsPlugins.kt | 3 ++- buildSrc/src/main/kotlin/pmd-settings.gradle.kts | 2 ++ 8 files changed, 26 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 325de4c36..c9eb20930 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -72,6 +72,11 @@ plugins { idea `project-report` + // As for now, Gradle doesn't provide API for applying plugins without version. + // This is why we resolve a provider by `get()`. + // + // See a feature request: https://github.com/gradle/gradle/issues/17968 + id(libs.plugins.protobuf.get().pluginId) id(libs.plugins.errorProne.get().pluginId) } @@ -130,6 +135,13 @@ subprojects { val spineBaseVersion: String by extra dependencies { + + // Gradle discourages cross-configuration of projects. + // Thus, the direct access to `libs` in `allprojects` and `subprojects` + // blocks is unavailable. But we still can use it from `rootProject`. + // + // See the closed issue: https://github.com/gradle/gradle/issues/16634 + errorprone(rootProject.libs.errorProne.core) api(rootProject.libs.kotlin.stdLib.jdk8) diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index 26c365886..80d4cd7ab 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -33,13 +33,14 @@ import org.jetbrains.dokka.base.DokkaBaseConfiguration import org.jetbrains.dokka.gradle.DokkaTask import org.gradle.accessors.dm.LibrariesForLibs -val libs = rootProject.extensions.getByType() - plugins { id("org.jetbrains.dokka") } dependencies { + + val libs = rootProject.extensions.getByType() + /** * To generate the documentation as seen from Java perspective, the kotlin-as-java plugin was * added to the Dokka's classpath. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt index 1e3effbae..e0d781e65 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt @@ -30,5 +30,6 @@ package io.spine.internal.dependency // See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. @Suppress("unused") object CheckStyle { + // We can't migrate just a version to a TOML file. const val version = "10.1" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt index badd77174..cfc0de63b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt @@ -29,5 +29,6 @@ package io.spine.internal.dependency // https://pmd.github.io/ @Suppress("unused") // Will be used when `config/gradle/pmd.gradle` migrates to Kotlin. object Pmd { + // We can't migrate just a version to a TOML file. const val version = "6.44.0" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt index 08631f37d..98b9c118f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt @@ -48,10 +48,6 @@ import org.gradle.kotlin.dsl.the @Suppress("unused") object CheckStyleConfig { - // We can't migrate this to the plain TOML file. - // https://checkstyle.sourceforge.io/ - private const val version = "10.1" - /** * Applies the configuration to the passed [project]. */ @@ -63,7 +59,9 @@ object CheckStyleConfig { val configDir = project.rootDir.resolve("config/quality/") with(project.the()) { - toolVersion = version + // `CheckStyle.kt` is not migrated. + // A TOML file can't contain just a version. + toolVersion = "10.1" configDirectory.set(configDir) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt index 3a9f61973..5c8883d63 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt @@ -42,7 +42,8 @@ import org.gradle.kotlin.dsl.getByType * * 1. [plugins]. * 2. [extensions]. - * 3. [tasks]. + * 3. [libs]. + * 4. [tasks]. * * Let's imagine one wants to apply and configure `FooBar` plugin. To do that, several steps * should be completed: diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt index ffd414753..8fa52a6ec 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt @@ -42,7 +42,8 @@ import org.gradle.kotlin.dsl.getByType * * 1. [plugins]. * 2. [extensions]. - * 3. [tasks]. + * 3. [libs]. + * 4. [tasks]. * * Let's imagine one wants to apply and configure `FooBar` plugin. To do that, several steps * should be completed: diff --git a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts index e9e101bbd..3cc8b083f 100644 --- a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts +++ b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts @@ -29,6 +29,8 @@ plugins { } pmd { + // `Pmd.kt` is not migrated. + // A TOML file can't contain just a version. toolVersion = "6.44.0" isConsoleOutput = true incrementalAnalysis.set(true) From 68ab498cdc8ceab003f6a90e213581933c71f0d2 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Thu, 12 May 2022 15:51:48 +0300 Subject: [PATCH 14/17] Don't repeat yourself --- .../internal/gradle/DependencyResolution.kt | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index c2ed66476..9d284f9ab 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -56,56 +56,56 @@ fun NamedDomainObjectContainer.forceVersions(libs: LibrariesForLi } } -private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLibs) { +private fun ResolutionStrategy.forceProductionDependencies(libs: LibrariesForLibs) = with(libs) { @Suppress("DEPRECATION") // Force SLF4J version. force( - libs.animalSniffer, - libs.autoCommon, - libs.autoService.annotations, - libs.checkerFramework.annotations, - libs.errorProne.annotations, - libs.errorProne.typeAnnotations, - libs.errorProne.core, - libs.findBugs.annotations, - libs.flogger, - libs.flogger.runtime.systemBackend, - libs.guava, - libs.kotlin.reflect, - libs.kotlin.stdLib, - libs.kotlin.stdLib.common, - libs.kotlin.stdLib.jdk8, - libs.protobuf.java, - libs.protobuf.java.util, - libs.protobuf.kotlin, - libs.protobuf.gradlePlugin, - libs.slf4j.api + animalSniffer, + autoCommon, + autoService.annotations, + checkerFramework.annotations, + errorProne.annotations, + errorProne.typeAnnotations, + errorProne.core, + findBugs.annotations, + flogger, + flogger.runtime.systemBackend, + guava, + kotlin.reflect, + kotlin.stdLib, + kotlin.stdLib.common, + kotlin.stdLib.jdk8, + protobuf.java, + protobuf.java.util, + protobuf.kotlin, + protobuf.gradlePlugin, + slf4j.api ) } -private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) { +private fun ResolutionStrategy.forceTestDependencies(libs: LibrariesForLibs) = with(libs) { force( - libs.guava.testLib, - libs.junit.api, - libs.junit.platform.commons, - libs.junit.platform.launcher, - libs.junit.legacy, - libs.truth + guava.testLib, + junit.api, + junit.platform.commons, + junit.platform.launcher, + junit.legacy, + truth ) } /** * Forces transitive dependencies of 3rd party components that we don't use directly. */ -private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLibs) { +private fun ResolutionStrategy.forceTransitiveDependencies(libs: LibrariesForLibs) = with(libs) { force( - libs.autoValue.annotations, - libs.gson, - libs.j2objc.annotations, - libs.okio, - libs.plexus, - libs.commons.cli, - libs.commons.logging, - libs.checkerFramework.compatQual, + autoValue.annotations, + gson, + j2objc.annotations, + okio, + plexus, + commons.cli, + commons.logging, + checkerFramework.compatQual, ) } From 0b186f343e3fa20776ba414861a16c9152192e98 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Fri, 13 May 2022 11:38:08 +0300 Subject: [PATCH 15/17] Move version constants to TOML --- .../kotlin/io/spine/internal/dependency/CheckStyle.kt | 1 - .../src/main/kotlin/io/spine/internal/dependency/Pmd.kt | 1 - .../spine/internal/gradle/checkstyle/CheckStyleConfig.kt | 7 ++++--- buildSrc/src/main/kotlin/pmd-settings.gradle.kts | 8 +++++--- gradle/libs.versions.toml | 2 ++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt index e0d781e65..1e3effbae 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt @@ -30,6 +30,5 @@ package io.spine.internal.dependency // See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. @Suppress("unused") object CheckStyle { - // We can't migrate just a version to a TOML file. const val version = "10.1" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt index cfc0de63b..badd77174 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt @@ -29,6 +29,5 @@ package io.spine.internal.dependency // https://pmd.github.io/ @Suppress("unused") // Will be used when `config/gradle/pmd.gradle` migrates to Kotlin. object Pmd { - // We can't migrate just a version to a TOML file. const val version = "6.44.0" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt index 98b9c118f..fd5c112f2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt @@ -26,10 +26,12 @@ package io.spine.internal.gradle.checkstyle +import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project import org.gradle.api.plugins.quality.Checkstyle import org.gradle.api.plugins.quality.CheckstyleExtension import org.gradle.api.plugins.quality.CheckstylePlugin +import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.the /** @@ -57,11 +59,10 @@ object CheckStyleConfig { } val configDir = project.rootDir.resolve("config/quality/") + val libs = project.rootProject.extensions.getByType() with(project.the()) { - // `CheckStyle.kt` is not migrated. - // A TOML file can't contain just a version. - toolVersion = "10.1" + toolVersion = libs.versions.checkStyle.get() configDirectory.set(configDir) } diff --git a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts index 3cc8b083f..9d68767ed 100644 --- a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts +++ b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts @@ -1,3 +1,5 @@ +import org.gradle.accessors.dm.LibrariesForLibs + /* * Copyright 2022, TeamDev. All rights reserved. * @@ -29,9 +31,9 @@ plugins { } pmd { - // `Pmd.kt` is not migrated. - // A TOML file can't contain just a version. - toolVersion = "6.44.0" + val libs = rootProject.extensions.getByType() + + toolVersion = libs.versions.pmd.get() isConsoleOutput = true incrementalAnalysis.set(true) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3b08870e7..59392b4b3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,6 +9,7 @@ autoValue = "1.9" # https://github.com/google/auto assertK = "0.25" # https://github.com/willowtreeapps/assertk bouncyCastle = "1.68" # https://www.bouncycastle.org/java.html checkerFramework = "3.21.3" # https://checkerframework.org/ +checkStyle = "10.1" # https://checkstyle.sourceforge.io/ commonsCli = "1.5.0" # https://commons.apache.org/proper/commons-cli/ commonsCodec = "1.15" # https://commons.apache.org/proper/commons-codec/changes-report.html commonsLogging = "1.2" # https://commons.apache.org/proper/commons-logging/ @@ -30,6 +31,7 @@ kotlin = "1.6.21" # https://github.com/JetBrains/kotlin licenseReport = "1.16" # https://github.com/jk1/Gradle-License-Report netty = "4.1.72.Final" # https://github.com/netty/netty/releases osDetector = "1.7.0" # https://github.com/google/osdetector-gradle-plugin +pmd = "6.44.0" # https://pmd.github.io/ protobuf = "3.20.1" # https://github.com/protocolbuffers/protobuf protobufGradlePlugin = "0.8.18" # https://github.com/google/protobuf-gradle-plugin/releases roaster = "2.24.0.Final" # https://github.com/forge/roaster From df722d41f7884f6f101ac660eb762f5726c0cdaf Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Fri, 13 May 2022 11:38:25 +0300 Subject: [PATCH 16/17] Fix a typo --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 59392b4b3..053ab407a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -116,7 +116,7 @@ guava = { module = "com.google.guava:guava", version.ref = "guava" } guava-testLib = { module = "com.google.guava:guava-testlib", version.ref = "guava" } # https://github.com/ajoberstar/grgit grgit = "org.ajoberstar.grgit:grgit-core:3.1.1" -httpClient-googe = { module = "com.google.http-client:google-http-client", version.ref = "httpClient" } +httpClient-google = { module = "com.google.http-client:google-http-client", version.ref = "httpClient" } httpClient-jackson2 = { module = "com.google.http-client:google-http-client-jackson2", version.ref = "httpClient" } httpClient-gson = { module = "com.google.http-client:google-http-client-gson", version.ref = "httpClient" } httpClient-apache2 = { module = "com.google.http-client:google-http-client-apache-v2", version.ref = "httpClient" } From 52173b27e9806f4c30dd885375f68dba3f7133e3 Mon Sep 17 00:00:00 2001 From: "yevhenii.nadtochii" Date: Fri, 13 May 2022 15:51:49 +0300 Subject: [PATCH 17/17] Drop `settings.gradle.kts` --- build.gradle.kts | 5 +---- version.gradle.kts | 33 --------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 version.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index c9eb20930..477ef0612 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -49,12 +49,10 @@ import io.spine.internal.gradle.test.registerTestTasks import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { - apply(from = "$rootDir/version.gradle.kts") - io.spine.internal.gradle.doApplyStandard(repositories) io.spine.internal.gradle.doForceVersions(configurations, libs) - val mcJavaVersion: String by extra + val mcJavaVersion = "2.0.0-SNAPSHOT.83" dependencies { classpath("io.spine.tools:spine-mc-java:$mcJavaVersion") } @@ -104,7 +102,6 @@ allprojects { // See: https://github.com/gradle/gradle/issues/20717 /** Versions of the Spine libraries that `time` depends on. */ - extra["mcJavaVersion"] = "2.0.0-SNAPSHOT.83" extra["spineBaseVersion"] = "2.0.0-SNAPSHOT.91" extra["javadocToolsVersion"] = "2.0.0-SNAPSHOT.75" diff --git a/version.gradle.kts b/version.gradle.kts deleted file mode 100644 index 8bde299e6..000000000 --- a/version.gradle.kts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2022, 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** Versions of the Spine libraries that `time` depends on. */ -val mcJavaVersion: String by extra("2.0.0-SNAPSHOT.83") -val spineBaseVersion by extra("2.0.0-SNAPSHOT.91") -val javadocToolsVersion by extra("2.0.0-SNAPSHOT.75") - -/** The version of this library. */ -val versionToPublish by extra("2.0.0-SNAPSHOT.93")