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' 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/ diff --git a/buildSrc/src/main/kotlin/DokkaExts.kt b/buildSrc/src/main/kotlin/DokkaExts.kt index 1214f4d6..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) } @@ -167,6 +168,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/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") 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() + } } 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..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.16.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.16.1" + private const val fallbackDfVersion = "0.20.7" /** * The artifact for the ProtoData Gradle plugin. @@ -90,8 +90,15 @@ 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" val gradleApi get() = "$group:protodata-gradle-api:$version" @@ -99,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 0f0122f1..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.183" + 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.192" + const val toolBase = "2.0.0-SNAPSHOT.208" /** * The version of [Spine.javadocTools]. 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" } 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 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