From db5be57c88c02d8a8b07d9f6d2d1c0f2e8986f05 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 26 Oct 2024 19:28:49 +0100 Subject: [PATCH 1/6] Apply changes from ProtoData --- buildSrc/src/main/kotlin/BuildExtensions.kt | 6 +- .../src/main/kotlin/DependencyResolution.kt | 2 +- .../io/spine/internal/dependency/McJava.kt | 58 ------ .../io/spine/internal/dependency/ProtoData.kt | 174 ---------------- .../io/spine/internal/dependency/ProtoTap.kt | 46 ----- .../io/spine/internal/dependency/Spine.kt | 191 ------------------ .../spine/internal/dependency/Validation.kt | 54 ----- .../gradle/javadoc/ExcludeInternalDoclet.kt | 9 +- .../src/main/kotlin/jvm-module.gradle.kts | 18 +- 9 files changed, 12 insertions(+), 546 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt delete mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt delete mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt delete mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt delete mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt diff --git a/buildSrc/src/main/kotlin/BuildExtensions.kt b/buildSrc/src/main/kotlin/BuildExtensions.kt index 35faf3ef..5c50c992 100644 --- a/buildSrc/src/main/kotlin/BuildExtensions.kt +++ b/buildSrc/src/main/kotlin/BuildExtensions.kt @@ -31,10 +31,10 @@ import io.spine.internal.dependency.GradleDoctor import io.spine.internal.dependency.Kotest import io.spine.internal.dependency.Kover import io.spine.internal.dependency.Ksp -import io.spine.internal.dependency.McJava -import io.spine.internal.dependency.ProtoData -import io.spine.internal.dependency.ProtoTap import io.spine.internal.dependency.Protobuf +import io.spine.internal.dependency.spine.McJava +import io.spine.internal.dependency.spine.ProtoData +import io.spine.internal.dependency.spine.ProtoTap import io.spine.internal.gradle.standardToSpineSdk import org.gradle.api.Project import org.gradle.api.Task diff --git a/buildSrc/src/main/kotlin/DependencyResolution.kt b/buildSrc/src/main/kotlin/DependencyResolution.kt index fd41c25d..861852dd 100644 --- a/buildSrc/src/main/kotlin/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/DependencyResolution.kt @@ -50,8 +50,8 @@ import io.spine.internal.dependency.OpenTest4J import io.spine.internal.dependency.Plexus import io.spine.internal.dependency.Protobuf import io.spine.internal.dependency.Slf4J -import io.spine.internal.dependency.Spine import io.spine.internal.dependency.Truth +import io.spine.internal.dependency.spine.Spine import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.Project import org.gradle.api.artifacts.Configuration diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt deleted file mode 100644 index b1d0a052..00000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt +++ /dev/null @@ -1,58 +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 - * - * https://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 - -/** - * Dependencies on Spine Model Compiler for Java. - * - * See [mc-java](https://github.com/SpineEventEngine/mc-java). - */ -@Suppress( - "MemberVisibilityCanBePrivate" /* `pluginLib()` is used by subprojects. */, - "ConstPropertyName" -) -object McJava { - const val group = Spine.toolsGroup - - /** The version used to in the build classpath. */ - const val dogfoodingVersion = "2.0.0-SNAPSHOT.242" - - /** The version to be used for integration tests. */ - const val version = "2.0.0-SNAPSHOT.243" - - const val pluginId = "io.spine.mc-java" - - val pluginLib = pluginLib(dogfoodingVersion) - fun pluginLib(version: String): String = "$group:spine-mc-java-plugins:$version:all" - - /** The artifact reference for forcing in configurations. */ - @Suppress("unused") - const val pluginsArtifact: String = "$group:spine-mc-java-plugins:$version" - - val base = base(version) - fun base(version: String): String = "$group:spine-mc-java-base:$version" -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt deleted file mode 100644 index be14c890..00000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt +++ /dev/null @@ -1,174 +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 - * - * https://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 - -/** - * Dependencies on ProtoData modules. - * - * To use a locally published ProtoData version instead of the version from a public plugin - * registry, set the `PROTODATA_VERSION` and/or the `PROTODATA_DF_VERSION` environment variables - * and stop the Gradle daemons so that Gradle observes the env change: - * ``` - * export PROTODATA_VERSION=0.43.0-local - * export PROTODATA_DF_VERSION=0.41.0 - * - * ./gradle --stop - * ./gradle build # Conduct the intended checks. - * ``` - * - * Then, to reset the console to run the usual versions again, remove the values of - * the environment variables and stop the daemon: - * ``` - * export PROTODATA_VERSION="" - * export PROTODATA_DF_VERSION="" - * - * ./gradle --stop - * ``` - * - * See [`SpineEventEngine/ProtoData`](https://github.com/SpineEventEngine/ProtoData/). - */ -@Suppress( - "unused" /* Some subprojects do not use ProtoData directly. */, - "ConstPropertyName" /* We use custom convention for artifact properties. */, - "MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */, - "KDocUnresolvedReference" /* Referencing private properties in constructor KDoc. */ -) -object ProtoData { - const val pluginGroup = Spine.group - const val group = "io.spine.protodata" - const val pluginId = "io.spine.protodata" - - /** - * Identifies ProtoData as a `classpath` dependency under `buildScript` block. - * - * The dependency is obtained from https://plugins.gradle.org/m2/. - */ - const val module = "io.spine:protodata" - - /** - * The version of ProtoData dependencies. - */ - val version: String - private const val fallbackVersion = "0.61.4" - - /** - * The distinct version of ProtoData used by other build tools. - * - * When ProtoData 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. - */ - val dogfoodingVersion: String - private const val fallbackDfVersion = "0.61.4" - - /** - * The artifact for the ProtoData Gradle plugin. - */ - val pluginLib: String - - /** - * The artifact to be used during experiments when publishing locally. - * - * @see ProtoData - */ - private fun pluginLib(version: String): String = - "$group:gradle-plugin:$version" - - fun api(version: String): String = - "$group:protodata-api:$version" - - val api - get() = api(version) - - val backend - get() = "$group:protodata-backend:$version" - - val protocPlugin - get() = "$group:protodata-protoc:$version" - - val gradleApi - get() = "$group:protodata-gradle-api:$version" - - val cliApi - get() = "$group:protodata-cli-api:$version" - - fun java(version: String): String = - "$group:protodata-java:$version" - - val java - get() = java(version) - - val fatCli - get() = "$group:protodata-fat-cli:$version" - - val testlib - get() = "$group:protodata-testlib:$version" - - /** - * An env variable storing a custom [version]. - */ - private const val VERSION_ENV = "PROTODATA_VERSION" - - /** - * An env variable storing a custom [dogfoodingVersion]. - */ - private const val DF_VERSION_ENV = "PROTODATA_DF_VERSION" - - /** - * Sets up the versions and artifacts for the build to use. - * - * If either [VERSION_ENV] or [DF_VERSION_ENV] is set, those versions are used instead of - * the hardcoded ones. Also, in this mode, the [pluginLib] coordinates are changed so that - * it points at a locally published artifact. Otherwise, it points at an artifact that would be - * published to a public plugin registry. - */ - init { - val experimentVersion = System.getenv(VERSION_ENV) - val experimentDfVersion = System.getenv(DF_VERSION_ENV) - if (experimentVersion?.isNotBlank() == true || experimentDfVersion?.isNotBlank() == true) { - version = experimentVersion ?: fallbackVersion - dogfoodingVersion = experimentDfVersion ?: fallbackDfVersion - - pluginLib = pluginLib(version) - println(""" - - ❗ Running an experiment with ProtoData. ❗ - ----------------------------------------- - Regular version = v$version - Dogfooding version = v$dogfoodingVersion - - ProtoData Gradle plugin can now be loaded from Maven Local. - - To reset the versions, erase the `$$VERSION_ENV` and `$$DF_VERSION_ENV` environment variables. - - """.trimIndent()) - } else { - version = fallbackVersion - dogfoodingVersion = fallbackDfVersion - pluginLib = "$pluginGroup:protodata:$version" - } - } -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt deleted file mode 100644 index 470f550d..00000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt +++ /dev/null @@ -1,46 +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 - * - * https://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 - -/** - * Dependencies on ProtoTap plugins. - * - * See [`SpineEventEngine/ProtoTap`](https://github.com/SpineEventEngine/ProtoTap/). - */ -@Suppress( - "unused" /* Some subprojects do not use ProtoData directly. */, - "ConstPropertyName" /* We use custom convention for artifact properties. */, - "MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */, -) -object ProtoTap { - const val group = "io.spine.tools" - const val version = "0.8.7" - const val gradlePluginId = "io.spine.prototap" - const val api = "$group:prototap-api:$version" - const val gradlePlugin = "$group:prototap-gradle-plugin:$version" - const val protocPlugin = "$group:prototap-protoc-plugin:$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 deleted file mode 100644 index 08fab738..00000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +++ /dev/null @@ -1,191 +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 - * - * https://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 - -/** - * Dependencies on Spine modules. - */ -@Suppress("unused", "ConstPropertyName") -object Spine { - - const val group = "io.spine" - const val toolsGroup = "io.spine.tools" - - /** - * Versions for published Spine SDK artifacts. - */ - object ArtifactVersion { - - /** - * The version of [Spine.base]. - * - * @see spine-base - */ - const val base = "2.0.0-SNAPSHOT.212" - const val baseForBuildScript = "2.0.0-SNAPSHOT.212" - - /** - * The version of [Spine.reflect]. - * - * @see spine-reflect - */ - const val reflect = "2.0.0-SNAPSHOT.188" - - /** - * The version of [Spine.Logging]. - * - * @see spine-logging - */ - const val logging = "2.0.0-SNAPSHOT.233" - - /** - * The version of [Spine.testlib]. - * - * @see spine-testlib - */ - const val testlib = "2.0.0-SNAPSHOT.184" - - /** - * The version of `core-java`. - * - * @see [Spine.CoreJava.client] - * @see [Spine.CoreJava.server] - * @see core-java - */ - const val core = "2.0.0-SNAPSHOT.176" - - /** - * The version of [Spine.modelCompiler]. - * - * @see spine-model-compiler - */ - const val mc = "2.0.0-SNAPSHOT.133" - - /** - * The version of [Spine.baseTypes]. - * - * @see spine-base-types - */ - const val baseTypes = "2.0.0-SNAPSHOT.126" - - /** - * The version of [Spine.time]. - * - * @see spine-time - */ - const val time = "2.0.0-SNAPSHOT.135" - - /** - * The version of [Spine.change]. - * - * @see spine-change - */ - const val change = "2.0.0-SNAPSHOT.118" - - /** - * The version of [Spine.text]. - * - * @see spine-text - */ - const val text = "2.0.0-SNAPSHOT.6" - - /** - * The version of [Spine.toolBase]. - * - * @see spine-tool-base - */ - const val toolBase = "2.0.0-SNAPSHOT.226" - - /** - * The version of [Spine.javadocFilter]. - * - * @see spine-javadoc-tools - */ - const val javadocTools = "2.0.0-SNAPSHOT.75" - } - - const val base = "$group:spine-base:${ArtifactVersion.base}" - const val baseForBuildScript = "$group:spine-base:${ArtifactVersion.baseForBuildScript}" - - const val reflect = "$group:spine-reflect:${ArtifactVersion.reflect}" - const val baseTypes = "$group:spine-base-types:${ArtifactVersion.baseTypes}" - const val time = "$group:spine-time:${ArtifactVersion.time}" - const val change = "$group:spine-change:${ArtifactVersion.change}" - const val text = "$group:spine-text:${ArtifactVersion.text}" - - const val testlib = "$toolsGroup:spine-testlib:${ArtifactVersion.testlib}" - const val testUtilTime = "$toolsGroup:spine-testutil-time:${ArtifactVersion.time}" - const val psiJava = "$toolsGroup:spine-psi-java:${ArtifactVersion.toolBase}" - const val psiJavaBundle = "$toolsGroup:spine-psi-java-bundle:${ArtifactVersion.toolBase}" - const val toolBase = "$toolsGroup:spine-tool-base:${ArtifactVersion.toolBase}" - const val pluginBase = "$toolsGroup:spine-plugin-base:${ArtifactVersion.toolBase}" - const val pluginTestlib = "$toolsGroup:spine-plugin-testlib:${ArtifactVersion.toolBase}" - const val modelCompiler = "$toolsGroup:spine-model-compiler:${ArtifactVersion.mc}" - - @Deprecated(message = "Please use top level `McJava` object instead.") - val McJava = io.spine.internal.dependency.McJava - - /** - * Dependencies on the artifacts of the Spine Logging library. - * - * @see spine-logging - */ - object Logging { - const val version = ArtifactVersion.logging - const val lib = "$group:spine-logging:$version" - - const val log4j2Backend = "$group:spine-logging-log4j2-backend:$version" - const val stdContext = "$group:spine-logging-std-context:$version" - const val grpcContext = "$group:spine-logging-grpc-context:$version" - const val smokeTest = "$group:spine-logging-smoke-test:$version" - - // Transitive dependencies. - // Make `public` and use them to force a version in a particular repository, if needed. - internal const val julBackend = "$group:spine-logging-jul-backend:$version" - internal const val middleware = "$group:spine-logging-middleware:$version" - internal const val platformGenerator = "$group:spine-logging-platform-generator:$version" - internal const val jvmDefaultPlatform = "$group:spine-logging-jvm-default-platform:$version" - } - - const val javadocFilter = "$toolsGroup:spine-javadoc-filter:${ArtifactVersion.javadocTools}" - - const val client = CoreJava.client // Added for brevity. - const val server = CoreJava.server // Added for brevity. - - /** - * Dependencies on `core-java` modules. - * - * See [`SpineEventEngine/core-java`](https://github.com/SpineEventEngine/core-java/). - */ - object CoreJava { - const val version = ArtifactVersion.core - const val core = "$group:spine-core:$version" - const val client = "$group:spine-client:$version" - const val server = "$group:spine-server:$version" - const val testUtilServer = "$toolsGroup:spine-testutil-server:$version" - } -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt deleted file mode 100644 index 591d2c4e..00000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt +++ /dev/null @@ -1,54 +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 - * - * https://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 - -/** - * Dependencies on Spine Validation SDK. - * - * See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/). - */ -@Suppress("unused", "ConstPropertyName") -object Validation { - /** - * The version of the Validation library artifacts. - */ - const val version = "2.0.0-SNAPSHOT.160" - - const val group = "io.spine.validation" - 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/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt index 4d5702bf..ef689d1a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt @@ -1,11 +1,11 @@ /* - * 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. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://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 @@ -26,7 +26,8 @@ package io.spine.internal.gradle.javadoc -import io.spine.internal.dependency.Spine +import io.spine.internal.dependency.spine.ArtifactVersion +import io.spine.internal.dependency.spine.Spine import io.spine.internal.gradle.javadoc.ExcludeInternalDoclet.Companion.taskName import io.spine.internal.gradle.sourceSets import org.gradle.api.Project @@ -40,7 +41,7 @@ import org.gradle.external.javadoc.StandardJavadocDocletOptions @Suppress("ConstPropertyName") class ExcludeInternalDoclet( @Deprecated("`Spine.ArtifactVersion.javadocTools` is used instead.") - val version: String = Spine.ArtifactVersion.javadocTools + val version: String = ArtifactVersion.javadocTools ) { private val dependency = Spine.javadocFilter diff --git a/buildSrc/src/main/kotlin/jvm-module.gradle.kts b/buildSrc/src/main/kotlin/jvm-module.gradle.kts index 86290834..dd67d1cc 100644 --- a/buildSrc/src/main/kotlin/jvm-module.gradle.kts +++ b/buildSrc/src/main/kotlin/jvm-module.gradle.kts @@ -34,7 +34,8 @@ import io.spine.internal.dependency.Jacoco import io.spine.internal.dependency.JavaX import io.spine.internal.dependency.Kotest import io.spine.internal.dependency.Protobuf -import io.spine.internal.dependency.Spine +import io.spine.internal.dependency.spine.Logging +import io.spine.internal.dependency.spine.Spine import io.spine.internal.gradle.checkstyle.CheckStyleConfig import io.spine.internal.gradle.github.pages.updateGitHubPages import io.spine.internal.gradle.javac.configureErrorProne @@ -45,19 +46,6 @@ import io.spine.internal.gradle.kotlin.setFreeCompilerArgs import io.spine.internal.gradle.report.license.LicenseReporter import io.spine.internal.gradle.testing.configureLogging import io.spine.internal.gradle.testing.registerTestTasks -import org.gradle.api.Project -import org.gradle.api.tasks.Delete -import org.gradle.api.tasks.compile.JavaCompile -import org.gradle.jvm.toolchain.JavaLanguageVersion -import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.getValue -import org.gradle.kotlin.dsl.idea -import org.gradle.kotlin.dsl.invoke -import org.gradle.kotlin.dsl.`java-library` -import org.gradle.kotlin.dsl.kotlin -import org.gradle.kotlin.dsl.provideDelegate -import org.gradle.kotlin.dsl.registering -import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -149,7 +137,7 @@ fun Module.addDependencies() = dependencies { compileOnlyApi(JavaX.annotations) ErrorProne.annotations.forEach { compileOnlyApi(it) } - implementation(Spine.Logging.lib) + implementation(Logging.lib) testImplementation(Guava.testLib) testImplementation(JUnit.runner) From b2021db52c2d94dfca9bc983ab8bbb1262540331 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 26 Oct 2024 19:29:23 +0100 Subject: [PATCH 2/6] Make `pull` script remove older dependency objects --- pull | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/pull b/pull index fc6cfb8f..6d71d339 100755 --- a/pull +++ b/pull @@ -1,13 +1,13 @@ #!/usr/bin/env bash # -# 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. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://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 @@ -81,23 +81,21 @@ cp -a .github-workflows/. ../.github/workflows cp -a .github/workflows/. ../.github/workflows rm -f ../.github/workflows/detekt-code-analysis.yml # This one is `config`-only workflow. -echo "Cleaning up GitHub workflows" -# TODO:2022-11-15:yevhenii.nadtochii: Drop or update clean-up code below from time to time. -rm -f ../.github/workflows/ensure-reports.updated.yml - -echo "Cleaning up Gradle 'buildSrc' scripts" -# TODO:2022-11-02:yevhenii.nadtochii: Drop or update clean-up code below from time to time. -rm -f ../buildSrc/src/main/kotlin/force-jacoco.gradle.kts -rm -f ../buildSrc/src/main/kotlin/deps-between-tasks.kt -rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/Scripts.kt -rm -rf ../buildSrc/src/main/kotlin/io/spine/internal/gradle/test -rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependencies/AutoCommon.kt -rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependencies/AutoService.kt -rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependencies/AutoValue.kt -rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt -rm -f ../buildSrc/src/main/kotlin/TaskDependencies.kt -rm -f ../buildSrc/src/main/kotlin/Dependencies.kt -rm -f ../buildSrc/src/main/kotlin/PluginAccessors.kt +# echo "Cleaning up GitHub workflows" +#rm -f ../buildSrc/src/main/kotlin/force-jacoco.gradle.kts +#rm -f ../buildSrc/src/main/kotlin/deps-between-tasks.kt + +# echo "Cleaning up Gradle 'buildSrc' scripts" +#rm -f ../buildSrc/src/main/kotlin/force-jacoco.gradle.kts +#rm -f ../buildSrc/src/main/kotlin/deps-between-tasks.kt + +echo "Cleaning up outdated dependency objects in 'buildSrc'" +# 2024-10-26, remove outdated files. +rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt +rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt +rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt +rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt # 2023-04-13, remove outdated files. From 139ed67456d9e67408bf86dfde927867a64b3094 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 26 Oct 2024 19:41:20 +0100 Subject: [PATCH 3/6] Add new dependency objects --- .../dependency/spine/ArtifactVersion.kt | 117 ++++++++++++ .../internal/dependency/spine/CoreJava.kt | 42 +++++ .../internal/dependency/spine/Logging.kt | 52 ++++++ .../spine/internal/dependency/spine/McJava.kt | 79 ++++++++ .../internal/dependency/spine/ProtoData.kt | 174 ++++++++++++++++++ .../internal/dependency/spine/ProtoTap.kt | 46 +++++ .../spine/internal/dependency/spine/Spine.kt | 82 +++++++++ .../internal/dependency/spine/ToolBase.kt | 46 +++++ .../internal/dependency/spine/Validation.kt | 54 ++++++ 9 files changed, 692 insertions(+) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ArtifactVersion.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/CoreJava.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Logging.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/McJava.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoData.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoTap.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Spine.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ToolBase.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Validation.kt diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ArtifactVersion.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ArtifactVersion.kt new file mode 100644 index 00000000..0b2652b8 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ArtifactVersion.kt @@ -0,0 +1,117 @@ +/* + * 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 + * + * https://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 + +/** + * Versions for published Spine SDK artifacts. + */ +@Suppress("ConstPropertyName") +object ArtifactVersion { + + /** + * The version of [Spine.base]. + * + * @see spine-base + */ + const val base = "2.0.0-SNAPSHOT.215" + const val baseForBuildScript = "2.0.0-SNAPSHOT.215" + + /** + * The version of [Spine.reflect]. + * + * @see spine-reflect + */ + const val reflect = "2.0.0-SNAPSHOT.190" + + /** + * The version of [Logging]. + */ + @Deprecated(message = "Please use `Logging.version`.", ReplaceWith("Logging.version")) + const val logging = Logging.version + + /** + * The version of [Spine.testlib]. + * + * @see spine-testlib + */ + const val testlib = "2.0.0-SNAPSHOT.184" + + /** + * The version of `core-java`. + */ + @Deprecated(message = "Please use `CoreJava.version`.", ReplaceWith("CoreJava.version")) + const val core = CoreJava.version + + /** + * The version of [Spine.modelCompiler]. + * + * @see spine-model-compiler + */ + const val mc = "2.0.0-SNAPSHOT.133" + + /** + * The version of [Spine.baseTypes]. + * + * @see spine-base-types + */ + const val baseTypes = "2.0.0-SNAPSHOT.126" + + /** + * The version of [Spine.time]. + * + * @see spine-time + */ + const val time = "2.0.0-SNAPSHOT.135" + + /** + * The version of [Spine.change]. + * + * @see spine-change + */ + const val change = "2.0.0-SNAPSHOT.118" + + /** + * The version of [Spine.text]. + * + * @see spine-text + */ + const val text = "2.0.0-SNAPSHOT.6" + + /** + * The version of [Spine.toolBase]. + * + * @see spine-tool-base + */ + const val toolBase = ToolBase.version + + /** + * The version of [Spine.javadocFilter]. + * + * @see spine-javadoc-tools + */ + const val javadocTools = "2.0.0-SNAPSHOT.75" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/CoreJava.kt new file mode 100644 index 00000000..82f8c087 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/CoreJava.kt @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on `core-java` modules. + * + * See [`SpineEventEngine/core-java`](https://github.com/SpineEventEngine/core-java/). + */ +@Suppress("ConstPropertyName", "unused") +object CoreJava { + const val group = Spine.group + const val version = "2.0.0-SNAPSHOT.177" + const val core = "$group:spine-core:$version" + const val client = "$group:spine-client:$version" + const val server = "$group:spine-server:$version" + const val testUtilServer = "${Spine.toolsGroup}:spine-testutil-server:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Logging.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Logging.kt new file mode 100644 index 00000000..b5be98e4 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Logging.kt @@ -0,0 +1,52 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on the artifacts of the Spine Logging library. + * + * @see spine-logging + */ +@Suppress("ConstPropertyName", "unused") +object Logging { + const val version = "2.0.0-SNAPSHOT.240" + const val group = Spine.group + const val lib = "$group:spine-logging:$version" + const val libJvm = "$group:spine-logging-jvm:$version" + + const val log4j2Backend = "$group:spine-logging-log4j2-backend:$version" + const val stdContext = "$group:spine-logging-std-context:$version" + const val grpcContext = "$group:spine-logging-grpc-context:$version" + const val smokeTest = "$group:spine-logging-smoke-test:$version" + + // Transitive dependencies. + // Make `public` and use them to force a version in a particular repository, if needed. + internal const val julBackend = "$group:spine-logging-jul-backend:$version" + internal const val middleware = "$group:spine-logging-middleware:$version" + internal const val platformGenerator = "$group:spine-logging-platform-generator:$version" + internal const val jvmDefaultPlatform = "$group:spine-logging-jvm-default-platform:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/McJava.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/McJava.kt new file mode 100644 index 00000000..2eee68ee --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/McJava.kt @@ -0,0 +1,79 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on Spine Model Compiler for Java. + * + * See [mc-java](https://github.com/SpineEventEngine/mc-java). + */ +@Suppress( + "MemberVisibilityCanBePrivate" /* `pluginLib()` is used by subprojects. */, + "ConstPropertyName", + "unused" +) +object McJava { + const val group = Spine.toolsGroup + + /** + * The version used to in the build classpath. + */ + const val dogfoodingVersion = "2.0.0-SNAPSHOT.244" + + /** + * The version to be used for integration tests. + */ + const val version = "2.0.0-SNAPSHOT.244" + + /** + * The ID of the Gradle plugin. + */ + const val pluginId = "io.spine.mc-java" + + /** + * The library with the [dogfoodingVersion]. + */ + val pluginLib = pluginLib(dogfoodingVersion) + + /** + * The library with the given [version]. + */ + fun pluginLib(version: String): String = "$group:spine-mc-java-plugins:$version:all" + + /** The artifact reference for forcing in configurations. */ + const val pluginsArtifact: String = "$group:spine-mc-java-plugins:$version" + + /** + * The `mc-java-base` artifact with the [version]. + */ + val base = base(version) + + /** + * The `mc-java-base` artifact with the given [version]. + */ + fun base(version: String): String = "$group:spine-mc-java-base:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoData.kt new file mode 100644 index 00000000..9d03282b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoData.kt @@ -0,0 +1,174 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on ProtoData modules. + * + * To use a locally published ProtoData version instead of the version from a public plugin + * registry, set the `PROTODATA_VERSION` and/or the `PROTODATA_DF_VERSION` environment variables + * and stop the Gradle daemons so that Gradle observes the env change: + * ``` + * export PROTODATA_VERSION=0.43.0-local + * export PROTODATA_DF_VERSION=0.41.0 + * + * ./gradle --stop + * ./gradle build # Conduct the intended checks. + * ``` + * + * Then, to reset the console to run the usual versions again, remove the values of + * the environment variables and stop the daemon: + * ``` + * export PROTODATA_VERSION="" + * export PROTODATA_DF_VERSION="" + * + * ./gradle --stop + * ``` + * + * See [`SpineEventEngine/ProtoData`](https://github.com/SpineEventEngine/ProtoData/). + */ +@Suppress( + "unused" /* Some subprojects do not use ProtoData directly. */, + "ConstPropertyName" /* We use custom convention for artifact properties. */, + "MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */, + "KDocUnresolvedReference" /* Referencing private properties in constructor KDoc. */ +) +object ProtoData { + const val pluginGroup = Spine.group + const val group = "io.spine.protodata" + const val pluginId = "io.spine.protodata" + + /** + * Identifies ProtoData as a `classpath` dependency under `buildScript` block. + * + * The dependency is obtained from https://plugins.gradle.org/m2/. + */ + const val module = "io.spine:protodata" + + /** + * The version of ProtoData dependencies. + */ + val version: String + private const val fallbackVersion = "0.64.0" + + /** + * The distinct version of ProtoData used by other build tools. + * + * When ProtoData 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. + */ + val dogfoodingVersion: String + private const val fallbackDfVersion = "0.61.8" + + /** + * The artifact for the ProtoData Gradle plugin. + */ + val pluginLib: String + + /** + * The artifact to be used during experiments when publishing locally. + * + * @see ProtoData + */ + private fun pluginLib(version: String): String = + "$group:gradle-plugin:$version" + + fun api(version: String): String = + "$group:protodata-api:$version" + + val api + get() = api(version) + + val backend + get() = "$group:protodata-backend:$version" + + val protocPlugin + get() = "$group:protodata-protoc:$version" + + val gradleApi + get() = "$group:protodata-gradle-api:$version" + + val cliApi + get() = "$group:protodata-cli-api:$version" + + fun java(version: String): String = + "$group:protodata-java:$version" + + val java + get() = java(version) + + val fatCli + get() = "$group:protodata-fat-cli:$version" + + val testlib + get() = "$group:protodata-testlib:$version" + + /** + * An env variable storing a custom [version]. + */ + private const val VERSION_ENV = "PROTODATA_VERSION" + + /** + * An env variable storing a custom [dogfoodingVersion]. + */ + private const val DF_VERSION_ENV = "PROTODATA_DF_VERSION" + + /** + * Sets up the versions and artifacts for the build to use. + * + * If either [VERSION_ENV] or [DF_VERSION_ENV] is set, those versions are used instead of + * the hardcoded ones. Also, in this mode, the [pluginLib] coordinates are changed so that + * it points at a locally published artifact. Otherwise, it points at an artifact that would be + * published to a public plugin registry. + */ + init { + val experimentVersion = System.getenv(VERSION_ENV) + val experimentDfVersion = System.getenv(DF_VERSION_ENV) + if (experimentVersion?.isNotBlank() == true || experimentDfVersion?.isNotBlank() == true) { + version = experimentVersion ?: fallbackVersion + dogfoodingVersion = experimentDfVersion ?: fallbackDfVersion + + pluginLib = pluginLib(version) + println(""" + + ❗ Running an experiment with ProtoData. ❗ + ----------------------------------------- + Regular version = v$version + Dogfooding version = v$dogfoodingVersion + + ProtoData Gradle plugin can now be loaded from Maven Local. + + To reset the versions, erase the `$$VERSION_ENV` and `$$DF_VERSION_ENV` environment variables. + + """.trimIndent()) + } else { + version = fallbackVersion + dogfoodingVersion = fallbackDfVersion + pluginLib = "$pluginGroup:protodata:$version" + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoTap.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoTap.kt new file mode 100644 index 00000000..681d5d22 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ProtoTap.kt @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on ProtoTap plugins. + * + * See [`SpineEventEngine/ProtoTap`](https://github.com/SpineEventEngine/ProtoTap/). + */ +@Suppress( + "unused" /* Some subprojects do not use ProtoData directly. */, + "ConstPropertyName" /* We use custom convention for artifact properties. */, + "MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */, +) +object ProtoTap { + const val group = "io.spine.tools" + const val version = "0.8.7" + const val gradlePluginId = "io.spine.prototap" + const val api = "$group:prototap-api:$version" + const val gradlePlugin = "$group:prototap-gradle-plugin:$version" + const val protocPlugin = "$group:prototap-protoc-plugin:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Spine.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Spine.kt new file mode 100644 index 00000000..faf8179d --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Spine.kt @@ -0,0 +1,82 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on smaller Spine modules. + */ +@Suppress("unused", "ConstPropertyName") +object Spine { + + const val group = "io.spine" + const val toolsGroup = "io.spine.tools" + + const val base = "$group:spine-base:${ArtifactVersion.base}" + const val baseForBuildScript = "$group:spine-base:${ArtifactVersion.baseForBuildScript}" + + const val reflect = "$group:spine-reflect:${ArtifactVersion.reflect}" + const val baseTypes = "$group:spine-base-types:${ArtifactVersion.baseTypes}" + const val time = "$group:spine-time:${ArtifactVersion.time}" + const val change = "$group:spine-change:${ArtifactVersion.change}" + const val text = "$group:spine-text:${ArtifactVersion.text}" + + const val testlib = "$toolsGroup:spine-testlib:${ArtifactVersion.testlib}" + const val testUtilTime = "$toolsGroup:spine-testutil-time:${ArtifactVersion.time}" + + @Deprecated(message = "Please use `ToolBase.psiJava` instead`.") + const val psiJava = "$toolsGroup:spine-psi-java:${ArtifactVersion.toolBase}" + @Deprecated(message = "Please use `ToolBase.psiJava` instead`.") + const val psiJavaBundle = "$toolsGroup:spine-psi-java-bundle:${ArtifactVersion.toolBase}" + @Deprecated(message = "Please use `ToolBase.lib` instead`.") + const val toolBase = "$toolsGroup:spine-tool-base:${ArtifactVersion.toolBase}" + @Deprecated(message = "Please use `ToolBase.pluginBase` instead`.") + const val pluginBase = "$toolsGroup:spine-plugin-base:${ArtifactVersion.toolBase}" + @Deprecated(message = "Please use `ToolBase.pluginTestlib` instead`.") + const val pluginTestlib = "$toolsGroup:spine-plugin-testlib:${ArtifactVersion.toolBase}" + + const val modelCompiler = "$toolsGroup:spine-model-compiler:${ArtifactVersion.mc}" + + @Deprecated( + message = "Please use top level `McJava` object instead.", + ReplaceWith("McJava", "io.spine.internal.dependency.spine.McJava") + ) + val McJava = io.spine.internal.dependency.spine.McJava + + const val javadocFilter = "$toolsGroup:spine-javadoc-filter:${ArtifactVersion.javadocTools}" + + @Deprecated( + message = "Please use top level `CoreJava.client` object instead.", + ReplaceWith("CoreJava.client", "io.spine.internal.dependency.spine.CoreJava") + ) + const val client = CoreJava.client + + @Deprecated( + message = "Please use top level `CoreJava.server` object instead.", + ReplaceWith("CoreJava.server", "io.spine.internal.dependency.spine.CoreJava") + ) + const val server = CoreJava.server +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ToolBase.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ToolBase.kt new file mode 100644 index 00000000..29ed5605 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/ToolBase.kt @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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 + +/** + * Artifacts of the `tool-base` module. + * + * @see spine-tool-base + */ +@Suppress("ConstPropertyName", "unused") +object ToolBase { + const val group = Spine.toolsGroup + const val version = "2.0.0-SNAPSHOT.232" + + const val lib = "$group:spine-tool-base:$version" + const val pluginBase = "$group:spine-plugin-base:$version" + const val pluginTestlib = "$group:spine-plugin-testlib:$version" + + const val intellijPlatformJava = "$group:intellij-platform-java:$version" + + const val psiJava = "$group:spine-psi-java:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Validation.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Validation.kt new file mode 100644 index 00000000..be2d0c93 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/spine/Validation.kt @@ -0,0 +1,54 @@ +/* + * 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 + * + * https://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 + +/** + * Dependencies on Spine Validation SDK. + * + * See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/). + */ +@Suppress("unused", "ConstPropertyName") +object Validation { + /** + * The version of the Validation library artifacts. + */ + const val version = "2.0.0-SNAPSHOT.160" + + const val group = "io.spine.validation" + 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 b61cfa3f5687a7d9d7073e39fe3f8408355f29d0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 27 Oct 2024 12:09:39 +0000 Subject: [PATCH 4/6] Run Dokka tasks only when publishing --- buildSrc/src/main/kotlin/DokkaExts.kt | 8 +++++--- buildSrc/src/main/kotlin/dokka-for-java.gradle.kts | 6 +++--- buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/buildSrc/src/main/kotlin/DokkaExts.kt b/buildSrc/src/main/kotlin/DokkaExts.kt index c6d619c4..59520ab1 100644 --- a/buildSrc/src/main/kotlin/DokkaExts.kt +++ b/buildSrc/src/main/kotlin/DokkaExts.kt @@ -70,8 +70,10 @@ fun DependencyHandlerScope.useDokkaWithSpineExtensions() { private fun DependencyHandler.dokkaPlugin(dependencyNotation: Any): Dependency? = add("dokkaPlugin", dependencyNotation) -private fun Project.dokkaOutput(language: String): File = - buildDir.resolve("docs/dokka${language.capitalized()}") +private fun Project.dokkaOutput(language: String): File { + val lng = language.capitalized() + return layout.buildDirectory.dir("docs/dokka$lng").get().asFile +} fun Project.dokkaConfigFile(file: String): File { val dokkaConfDir = project.rootDir.resolve("buildSrc/src/main/resources/dokka") @@ -183,7 +185,7 @@ fun Project.dokkaKotlinJar(): TaskProvider = tasks.getOrCreate("dokkaKotlin * The task `"publishToMavenLocal"` is excluded from the check because it is a part of * the local testing workflow. */ -fun DokkaTask.isInPublishingGraph(): Boolean = +fun AbstractDokkaTask.isInPublishingGraph(): Boolean = project.gradle.taskGraph.allTasks.any { with(it.name) { startsWith("publish") && !startsWith("publishToMavenLocal") diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index 8dc4df46..2c10701c 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask plugins { id("org.jetbrains.dokka") // Cannot use `Dokka` dependency object here yet. @@ -35,9 +35,9 @@ dependencies { useDokkaWithSpineExtensions() } -tasks.withType().configureEach { +tasks.withType().configureEach { configureForJava() onlyIf { - (it as DokkaTask).isInPublishingGraph() + (it as AbstractDokkaLeafTask).isInPublishingGraph() } } diff --git a/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts index 5f20e007..73da35d8 100644 --- a/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask plugins { id("org.jetbrains.dokka") // Cannot use `Dokka` dependency object here yet. @@ -34,9 +34,9 @@ dependencies { useDokkaWithSpineExtensions() } -tasks.withType().configureEach { +tasks.withType().configureEach { configureForKotlin() onlyIf { - (it as DokkaTask).isInPublishingGraph() + (it as AbstractDokkaLeafTask).isInPublishingGraph() } } From 4341024f5d8bc6e6b74a3b50e825da4a7d2afdeb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 27 Oct 2024 12:09:54 +0000 Subject: [PATCH 5/6] Fix doc language grammar --- .../io/spine/internal/gradle/publish/Publications.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Publications.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Publications.kt index 0b4d24be..e89f5a9c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Publications.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Publications.kt @@ -5,7 +5,7 @@ * 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 + * https://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 @@ -174,14 +174,14 @@ internal class StandardJavaPublicationHandler( * * A typical Maven publication contains: * - * 1. Jar archives. For example: compilation output, sources, javadoc, etc. - * 2. Maven metadata file that has ".pom" extension. - * 3. Gradle's metadata file that has ".module" extension. + * 1. Jar archives. For example, compilation output, sources, javadoc, etc. + * 2. Maven metadata file that has the ".pom" extension. + * 3. Gradle's metadata file that has the ".module" extension. * - * Metadata files contain information about a publication itself, its artifacts and their + * Metadata files contain information about a publication itself, its artifacts, and their * dependencies. Presence of ".pom" file is mandatory for publication to be consumed by * `mvn` build tool itself or other build tools that understand Maven notation (Gradle, Ivy). - * Presence of ".module" is optional, but useful when a publication is consumed by Gradle. + * The presence of ".module" is optional, but useful when a publication is consumed by Gradle. * * @see Maven – POM Reference * @see From 58345d79798a219e18232ef6375a7d4b8d6762ea Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 27 Oct 2024 12:10:20 +0000 Subject: [PATCH 6/6] Improve code layout --- buildSrc/src/main/kotlin/DependencyResolution.kt | 1 + .../spine/internal/gradle/protobuf/ProtoTaskExtensions.kt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/DependencyResolution.kt b/buildSrc/src/main/kotlin/DependencyResolution.kt index 861852dd..a35d4a2a 100644 --- a/buildSrc/src/main/kotlin/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/DependencyResolution.kt @@ -195,6 +195,7 @@ fun Project.forceSpineBase() { * Forces configurations containing `"proto"` in their names (disregarding the case) to * use [Spine.baseForBuildScript]. */ +@Suppress("unused") fun Project.forceBaseInProtoTasks() { configurations.configureEach { if (name.toLowerCase().contains("proto")) { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt index de78a5ec..60e9953a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt @@ -5,7 +5,7 @@ * 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 + * https://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 @@ -262,7 +262,9 @@ private fun GenerateProtoTask.dependOnProcessResourcesTask() { * Obtains the name of the `processResource` task for the given source set name. */ private fun processResourceTaskName(sourceSetName: String): String { - val infix = if (sourceSetName == "main") "" else sourceSetName.capitalized() + val infix = + if (sourceSetName == "main") "" + else sourceSetName.capitalized() return "process${infix}Resources" }