From 41ff255a15a6584d5a20dadfb15eeaf695b1dda6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Mar 2024 10:28:16 +0000 Subject: [PATCH 01/10] Bring changes from `core-java` --- .github-workflows/build-on-ubuntu.yml | 2 +- .github-workflows/build-on-windows.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github-workflows/build-on-ubuntu.yml b/.github-workflows/build-on-ubuntu.yml index 788b8917..55bb482f 100644 --- a/.github-workflows/build-on-ubuntu.yml +++ b/.github-workflows/build-on-ubuntu.yml @@ -24,7 +24,7 @@ jobs: # See: https://github.com/marketplace/actions/junit-report-action - name: Publish Test Report - uses: mikepenz/action-junit-report@v3.7.6 + uses: mikepenz/action-junit-report@v4.0.3 if: always() # always run even if the previous step fails with: report_paths: '**/build/test-results/**/TEST-*.xml' diff --git a/.github-workflows/build-on-windows.yml b/.github-workflows/build-on-windows.yml index c910b200..ff947a64 100644 --- a/.github-workflows/build-on-windows.yml +++ b/.github-workflows/build-on-windows.yml @@ -18,8 +18,9 @@ jobs: distribution: zulu cache: gradle + # See: https://github.com/al-cheb/configure-pagefile-action - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.2 + uses: al-cheb/configure-pagefile-action@v1.3 - name: Build project and run tests shell: cmd @@ -28,7 +29,7 @@ jobs: # See: https://github.com/marketplace/actions/junit-report-action - name: Publish Test Report - uses: mikepenz/action-junit-report@v3.7.6 + uses: mikepenz/action-junit-report@v4.0.3 if: always() # always run even if the previous step fails with: report_paths: '**/build/test-results/**/TEST-*.xml' From df1327d8442efac799abd1523ca2b32cb1df9f58 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Mar 2024 10:44:07 +0000 Subject: [PATCH 02/10] Bump versions --- .../src/main/kotlin/io/spine/internal/dependency/Kotlin.kt | 2 +- .../main/kotlin/io/spine/internal/dependency/ProtoData.kt | 7 +++++-- .../src/main/kotlin/io/spine/internal/dependency/Spine.kt | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt index bcbf2864..ec7f338f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt @@ -35,7 +35,7 @@ object Kotlin { * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. */ @Suppress("MemberVisibilityCanBePrivate") // used directly from the outside. - const val version = "1.9.22" + const val version = "1.9.23" /** * The version of the JetBrains annotations library, which is a transitive diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt index 30b4aa41..37a3159c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt @@ -65,7 +65,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.16.1" + private const val fallbackVersion = "0.20.1" /** * The distinct version of ProtoData used by other build tools. @@ -74,7 +74,7 @@ object ProtoData { * transitional dependencies, this is the version used to build the project itself. */ val dogfoodingVersion: String - private const val fallbackDfVersion = "0.16.1" + private const val fallbackDfVersion = "0.19.1" /** * The artifact for the ProtoData Gradle plugin. @@ -93,6 +93,9 @@ object ProtoData { val compiler get() = "$group:protodata-compiler:$version" + val protocPlugin + get() = "$group:protodata-protoc:$version" + val gradleApi get() = "$group:protodata-gradle-api:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt index b5eb3179..8bf0260e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt @@ -45,7 +45,7 @@ object Spine { * * @see spine-base */ - const val base = "2.0.0-SNAPSHOT.195" + const val base = "2.0.0-SNAPSHOT.198" /** * The version of [Spine.reflect]. @@ -89,7 +89,7 @@ object Spine { * * @see spine-mc-java */ - const val mcJava = "2.0.0-SNAPSHOT.175" + const val mcJava = "2.0.0-SNAPSHOT.185" /** * The version of [Spine.baseTypes]. @@ -124,7 +124,7 @@ object Spine { * * @see spine-tool-base */ - const val toolBase = "2.0.0-SNAPSHOT.192" + const val toolBase = "2.0.0-SNAPSHOT.206" /** * The version of [Spine.javadocTools]. From 2a96b24cfc6089de8d471de59e735fdb5847dea0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Mar 2024 10:47:42 +0000 Subject: [PATCH 03/10] Remove `kotlin/Repositories.kt` ... which duplicates repositories declared under `io/spine/internal/gradle/Repositories.kt`. --- pull | 1 + 1 file changed, 1 insertion(+) diff --git a/pull b/pull index 7634b993..fc6cfb8f 100755 --- a/pull +++ b/pull @@ -120,6 +120,7 @@ rm -f ../buildSrc/src/main/kotlin/java-module.gradle.kts rm -f ../buildSrc/src/main/kotlin/kotlin-jvm-module.gradle.kts rm -f ../buildSrc/src/main/kotlin/jacoco-kmm-jvm.gradle.kts rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +rm -f ../buildSrc/src/main/kotlin/Repositories.kt # 2023-07-30, remove outdated files. rm -f ../.lift.toml From ae4f57c5b152ce3c9351e798f2e56386b7a0b2b0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Mar 2024 10:48:02 +0000 Subject: [PATCH 04/10] Remove `kotlin/Repositories.kt` ... which duplicates repositories declared under `io/spine/internal/gradle/Repositories.kt`. --- buildSrc/src/main/kotlin/Repositories.kt | 37 ------------------------ 1 file changed, 37 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/Repositories.kt diff --git a/buildSrc/src/main/kotlin/Repositories.kt b/buildSrc/src/main/kotlin/Repositories.kt deleted file mode 100644 index ee0974ba..00000000 --- a/buildSrc/src/main/kotlin/Repositories.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2024, 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. - */ - -@file:Suppress("unused") - -import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.gradle.kotlin.dsl.maven - -val RepositoryHandler.intellijReleases: MavenArtifactRepository - get() = maven("https://www.jetbrains.com/intellij-repository/releases") - -val RepositoryHandler.jetBrainsCacheRedirector: MavenArtifactRepository - get() = maven("https://cache-redirector.jetbrains.com/intellij-dependencies") From dad2156e66bd3fe042b85e7039edb772986db9ce Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Mar 2024 14:14:10 +0000 Subject: [PATCH 05/10] Ignore `.gradle-test-kit` directory --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6a33d4b1..2acc1afb 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,5 @@ pubspec.lock # Ignore the `tmp` directory used for building dependant repositories. /tmp + +.gradle-test-kit/ From f02aa34f59c1433eb09b849729a980d8f6a453e3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 19 Mar 2024 00:47:20 +0000 Subject: [PATCH 06/10] Bump Gradle -> `7.6.4` --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1624c47..c7d437bb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From d86ed1065f1198c3a929ed80691841b1eaac64a2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 19 Mar 2024 19:24:12 +0000 Subject: [PATCH 07/10] Bring doc task filtering from ProtoData --- buildSrc/src/main/kotlin/DokkaExts.kt | 13 +++++++++++++ buildSrc/src/main/kotlin/dokka-for-java.gradle.kts | 5 ++++- .../src/main/kotlin/dokka-for-kotlin.gradle.kts | 5 ++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/DokkaExts.kt b/buildSrc/src/main/kotlin/DokkaExts.kt index 1214f4d6..48c7762b 100644 --- a/buildSrc/src/main/kotlin/DokkaExts.kt +++ b/buildSrc/src/main/kotlin/DokkaExts.kt @@ -167,6 +167,19 @@ fun Project.dokkaKotlinJar(): TaskProvider = tasks.getOrCreate("dokkaKotlin } } +/** + * Tells if this task belongs to the execution graph which contains publishing tasks. + * + * The task `"publishToMavenLocal"` is excluded from the check because it is a part of + * the local testing workflow. + */ +fun DokkaTask.isInPublishingGraph(): Boolean = + project.gradle.taskGraph.allTasks.any { + with(it.name) { + startsWith("publish") && !startsWith("publishToMavenLocal") + } + } + /** * Locates or creates `dokkaJavaJar` task in this [Project]. * diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index 0e5087a1..49ac6d30 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023, TeamDev. All rights reserved. + * Copyright 2024, 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. @@ -37,4 +37,7 @@ dependencies { tasks.withType().configureEach { configureForJava() + onlyIf { + (it as DokkaTask).isInPublishingGraph() + } } diff --git a/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts index 0b12a0dd..9ed226e8 100644 --- a/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023, TeamDev. All rights reserved. + * Copyright 2024, 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. @@ -36,4 +36,7 @@ dependencies { tasks.withType().configureEach { configureForKotlin() + onlyIf { + (it as DokkaTask).isInPublishingGraph() + } } From f61f55fcb791229fc74ec13e4b28e1cae8c63ab6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 2 Apr 2024 20:24:32 +0100 Subject: [PATCH 08/10] Bring `Validation` dependency from McJava --- .../spine/internal/dependency/Validation.kt | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt index e3bb188b..ded15d83 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt @@ -33,11 +33,32 @@ package io.spine.internal.dependency */ @Suppress("unused", "ConstPropertyName") object Validation { - const val version = "2.0.0-SNAPSHOT.127" + /** + * The version of the Validation library artifacts. + */ + const val version = "2.0.0-SNAPSHOT.132" + + /** + * The distinct version of the Validation library used by build tools during + * the transition from a previous version when breaking API changes are introduced. + * + * When Validation is used both for building the project and as a part of the project's + * transitional dependencies, this is the version used to build the project itself to + * avoid errors caused by incompatible API changes. + */ + const val dogfoodingVersion = "2.0.0-SNAPSHOT.132" + const val group = "io.spine.validation" - const val runtime = "$group:spine-validation-java-runtime:$version" - const val java = "$group:spine-validation-java:$version" - const val javaBundle = "$group:spine-validation-java-bundle:$version" - const val model = "$group:spine-validation-model:$version" - const val config = "$group:spine-validation-configuration:$version" + private const val prefix = "spine-validation" + + const val runtime = "$group:$prefix-java-runtime:$version" + const val java = "$group:$prefix-java:$version" + + /** Obtains the artifact for the `java-bundle` artifact of the given version. */ + fun javaBundle(version: String) = "$group:$prefix-java-bundle:$version" + + val javaBundle = javaBundle(version) + + const val model = "$group:$prefix-model:$version" + const val config = "$group:$prefix-configuration:$version" } From 92ecdc4cd1cc16a758183c1a8e2b2f724088d040 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 2 Apr 2024 20:32:04 +0100 Subject: [PATCH 09/10] Bump internal dependencies --- .../io/spine/internal/dependency/ProtoData.kt | 22 ++++++++++++++----- .../io/spine/internal/dependency/Spine.kt | 8 +++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt index 37a3159c..b127c2fe 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt @@ -65,7 +65,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.20.1" + private const val fallbackVersion = "0.20.7" /** * The distinct version of ProtoData used by other build tools. @@ -74,7 +74,7 @@ object ProtoData { * transitional dependencies, this is the version used to build the project itself. */ val dogfoodingVersion: String - private const val fallbackDfVersion = "0.19.1" + private const val fallbackDfVersion = "0.20.7" /** * The artifact for the ProtoData Gradle plugin. @@ -90,8 +90,12 @@ object ProtoData { val api get() = api(version) + @Deprecated("Use `backend` instead", ReplaceWith("backend")) val compiler - get() = "$group:protodata-compiler:$version" + get() = backend + + val backend + get() = "$group:protodata-backend:$version" val protocPlugin get() = "$group:protodata-protoc:$version" @@ -102,11 +106,19 @@ object ProtoData { val cliApi get() = "$group:protodata-cli-api:$version" + @Deprecated("Use `java()` instead", ReplaceWith("java(version)")) fun codegenJava(version: String): String = - "$group:protodata-codegen-java:$version" + java(version) + + fun java(version: String): String = + "$group:protodata-java:$version" + @Deprecated("Use `java` instead.", ReplaceWith("java")) val codegenJava - get() = codegenJava(version) + get() = java(version) + + val java + get() = java(version) val fatCli get() = "$group:protodata-fat-cli:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt index 8bf0260e..8d03b449 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt @@ -45,7 +45,7 @@ object Spine { * * @see spine-base */ - const val base = "2.0.0-SNAPSHOT.198" + const val base = "2.0.0-SNAPSHOT.199" /** * The version of [Spine.reflect]. @@ -75,7 +75,7 @@ object Spine { * @see [Spine.CoreJava.server] * @see core-java */ - const val core = "2.0.0-SNAPSHOT.175" + const val core = "2.0.0-SNAPSHOT.176" /** * The version of [Spine.modelCompiler]. @@ -89,7 +89,7 @@ object Spine { * * @see spine-mc-java */ - const val mcJava = "2.0.0-SNAPSHOT.185" + const val mcJava = "2.0.0-SNAPSHOT.205" /** * The version of [Spine.baseTypes]. @@ -124,7 +124,7 @@ object Spine { * * @see spine-tool-base */ - const val toolBase = "2.0.0-SNAPSHOT.206" + const val toolBase = "2.0.0-SNAPSHOT.208" /** * The version of [Spine.javadocTools]. From 82d2e9572524e6c7f2eb67eab7e819bce3db80ff Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 2 Apr 2024 20:32:19 +0100 Subject: [PATCH 10/10] Suppress "unused" --- buildSrc/src/main/kotlin/DokkaExts.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/kotlin/DokkaExts.kt b/buildSrc/src/main/kotlin/DokkaExts.kt index 48c7762b..feb9eb08 100644 --- a/buildSrc/src/main/kotlin/DokkaExts.kt +++ b/buildSrc/src/main/kotlin/DokkaExts.kt @@ -143,6 +143,7 @@ fun TaskContainer.dokkaHtmlTask(): DokkaTask? = this.findByName("dokkaHtml") as * Dokka can properly generate documentation for either Kotlin or Java depending on * the configuration, but not both. */ +@Suppress("unused") internal fun GradleDokkaSourceSetBuilder.onlyJavaSources(): FileCollection { return sourceRoots.filter(File::isJavaSourceDirectory) }