diff --git a/.github/workflows/build-on-ubuntu.yml b/.github/workflows/build-on-ubuntu.yml index 4029252..f8c2493 100644 --- a/.github/workflows/build-on-ubuntu.yml +++ b/.github/workflows/build-on-ubuntu.yml @@ -4,16 +4,17 @@ on: push jobs: build: + name: Build under Ubuntu runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: zulu cache: gradle @@ -23,14 +24,15 @@ jobs: # See: https://github.com/marketplace/actions/junit-report-action - name: Publish Test Report - uses: mikepenz/action-junit-report@v3.5.2 + 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/TEST-*.xml' + report_paths: '**/build/test-results/**/TEST-*.xml' require_tests: true # will fail workflow if test reports not found - name: Upload code coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false verbose: true diff --git a/.github/workflows/build-on-windows.yml b/.github/workflows/build-on-windows.yml index 01b0f35..4e6b57f 100644 --- a/.github/workflows/build-on-windows.yml +++ b/.github/workflows/build-on-windows.yml @@ -4,19 +4,24 @@ on: pull_request jobs: build: + name: Build under Windows runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: zulu cache: gradle + # See: https://github.com/al-cheb/configure-pagefile-action + - name: Configure Pagefile + uses: al-cheb/configure-pagefile-action@v1.3 + - name: Build project and run tests shell: cmd # For the reason on `--no-daemon` see https://github.com/actions/cache/issues/454 @@ -24,8 +29,8 @@ jobs: # See: https://github.com/marketplace/actions/junit-report-action - name: Publish Test Report - uses: mikepenz/action-junit-report@v3.5.2 + 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/TEST-*.xml' + report_paths: '**/build/test-results/**/TEST-*.xml' require_tests: true # will fail workflow if test reports not found diff --git a/.github/workflows/ensure-reports-updated.yml b/.github/workflows/ensure-reports-updated.yml new file mode 100644 index 0000000..fdd8b8e --- /dev/null +++ b/.github/workflows/ensure-reports-updated.yml @@ -0,0 +1,25 @@ +# Ensures that the license report files were modified in this PR. + +name: Ensure license reports updated + +on: + pull_request: + branches: + - '**' + +jobs: + build: + name: Ensure license reports updated + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + # Configure the checkout of all branches, so that it is possible to run the comparison. + fetch-depth: 0 + # Check out the `config` submodule to fetch the required script file. + submodules: true + + - name: Check that both `pom.xml` and license report files are modified + shell: bash + run: chmod +x ./config/scripts/ensure-reports-updated.sh && ./config/scripts/ensure-reports-updated.sh diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 47e2938..858cebb 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -9,11 +9,11 @@ on: jobs: validation: - name: Validation + name: Gradle Wrapper Validation runs-on: ubuntu-latest steps: - name: Checkout latest code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v4 diff --git a/.github/workflows/increment-guard.yml b/.github/workflows/increment-guard.yml index ea2c48f..1993841 100644 --- a/.github/workflows/increment-guard.yml +++ b/.github/workflows/increment-guard.yml @@ -10,16 +10,17 @@ on: jobs: build: + name: Check version increment runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: zulu cache: gradle diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cadc62c..8b5b4d5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,13 +8,13 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: zulu cache: gradle diff --git a/.github/workflows/remove-obsolete-artifacts-from-packages.yaml b/.github/workflows/remove-obsolete-artifacts-from-packages.yaml new file mode 100644 index 0000000..fe8ad84 --- /dev/null +++ b/.github/workflows/remove-obsolete-artifacts-from-packages.yaml @@ -0,0 +1,73 @@ +# +# Periodically removes obsolete artifacts from GitHub Packages. +# +# Only non-release artifacts—those containing "SNAPSHOT" in their version name—are eligible +# for removal. The latest non-release artifacts will be retained, with the exact number determined +# by the `VERSION_COUNT_TO_KEEP` environment variable. +# +# Please note the following details: +# +# 1. An artifact cannot be deleted if it is public and has been downloaded more than 5,000 times. +# In this scenario, contact GitHub support for further assistance. +# +# 2. This workflow only applies to artifacts published from this repository. +# +# 3. A maximum of 100 artifacts can be removed per run from each package; +# if there are more than 100 obsolete artifacts, either manually restart the workflow +# or wait for the next scheduled removal. +# +# 4. When artifacts with version `x.x.x-SNAPSHOT` are published, GitHub automatically appends +# the current timestamp, resulting in versions like `x.x.x-SNAPSHOT.20241024.173759`. +# All such artifacts are grouped into one package and treated as a single package +# in GitHub Packages with the version `x.x.x-SNAPSHOT`. Consequently, it is not possible +# to remove obsolete versions within a package; only the entire package can be deleted. +# + +name: Remove obsolete Maven artifacts from GitHub Packages + +on: + schedule: + - cron: '0 0 * * *' # Run every day at midnight. + +env: + VERSION_COUNT_TO_KEEP: 5 # Number of most recent SNAPSHOT versions to retain. + +jobs: + retrieve-package-names: + name: Retrieve the package names published from this repository + runs-on: ubuntu-latest + outputs: + package-names: ${{ steps.request-package-names.outputs.package-names }} + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Retrieve the names of packages + id: request-package-names + shell: bash + run: | + repoName=$(echo ${{ github.repository }} | cut -d '/' -f2) + chmod +x ./config/scripts/request-package-names.sh + ./config/scripts/request-package-names.sh ${{ github.token }} \ + $repoName ${{ github.repository_owner }} ./package-names.json + echo "package-names=$(<./package-names.json)" >> $GITHUB_OUTPUT + + delete-obsolete-artifacts: + name: Remove obsolete artifacts published from this repository to GitHub Packages + needs: retrieve-package-names + runs-on: ubuntu-latest + strategy: + matrix: + package-name: ${{ fromJson(needs.retrieve-package-names.outputs.package-names) }} + steps: + - name: Remove obsolete artifacts from '${{ matrix.package-name }}' package + uses: actions/delete-package-versions@v5 + with: + owner: ${{ github.repository_owner }} + package-name: ${{ matrix.package-name }} + package-type: 'maven' + token: ${{ github.token }} + min-versions-to-keep: ${{ env.VERSION_COUNT_TO_KEEP }} + # Ignores artifacts that do not contain the word "SNAPSHOT". + ignore-versions: '^(?!.+SNAPSHOT).*$' diff --git a/.gitignore b/.gitignore index 29f034a..419020f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,6 @@ # # Copyright 2022, TeamDev. All rights reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# # Redistribution and use in source and/or binary forms, with or without # modification, must retain the above copyright notice and the following # disclaimer. @@ -31,6 +25,15 @@ # # Therefore, instructions below are superset of instructions required for all the projects. +# `jenv` local configuration. +.java-version + +# Internal tool directories. +.fleet/ + +# Kotlin temp directories. +**/.kotlin/** + # IntelliJ IDEA modules and interim config files. *.iml .idea/*.xml @@ -42,7 +45,6 @@ # Do not ignore the following IDEA settings !.idea/misc.xml -!.idea/kotlinc.xml !.idea/codeStyleSettings.xml !.idea/codeStyles/ !.idea/copyright/ @@ -55,6 +57,7 @@ # Gradle build files **/build/** +!**/src/**/build/** # Build files produced by the IDE **/out/** @@ -101,5 +104,17 @@ hs_err_pid* .packages pubspec.lock -# Ignore the `tmp` directory used for building dependant repositories. -/tmp + +# +# The gradle.properties file should contain settings specific to a developer's workstation. +# +# See sample file for a Mac OS X workstation below. +# ------- +# # Set Java home to point to JDK8. This is need to generate classes working with Java8 API. +# # Otherwise the following warning appears during the build: +# # warning: [options] bootstrap class path not set in conjunction with -source 1.8 +# # +# # suppress inspection "UnusedProperty" +# org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/ +# ------- +gradle.properties diff --git a/.idea/copyright/TeamDev_Open_Source.xml b/.idea/copyright/TeamDev_Open_Source.xml index 14d7385..cea7fed 100644 --- a/.idea/copyright/TeamDev_Open_Source.xml +++ b/.idea/copyright/TeamDev_Open_Source.xml @@ -1,6 +1,6 @@ - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 35bbdff..229f1d3 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -146,13 +146,11 @@ - - @@ -194,7 +192,6 @@ - @@ -258,6 +255,18 @@ + + + + + + - @@ -623,6 +631,9 @@ + + + @@ -690,7 +701,6 @@ - @@ -711,7 +721,6 @@ - - + diff --git a/.lift.toml b/.lift.toml deleted file mode 100644 index 178be58..0000000 --- a/.lift.toml +++ /dev/null @@ -1 +0,0 @@ -ignoreRules=["SpreadOperator"] diff --git a/build.gradle.kts b/build.gradle.kts index e2413f1..c2ab2da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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,53 +26,64 @@ @file:Suppress("RemoveRedundantQualifierName") -import com.google.protobuf.gradle.builtins -import com.google.protobuf.gradle.generateProtoTasks import com.google.protobuf.gradle.id -import com.google.protobuf.gradle.protobuf -import com.google.protobuf.gradle.protoc -import io.spine.internal.dependency.Dokka -import io.spine.internal.dependency.ErrorProne -import io.spine.internal.dependency.JUnit -import io.spine.internal.dependency.Jackson -import io.spine.internal.dependency.Spine -import io.spine.internal.gradle.applyGitHubPackages -import io.spine.internal.gradle.applyStandard -import io.spine.internal.gradle.checkstyle.CheckStyleConfig -import io.spine.internal.gradle.forceVersions -import io.spine.internal.gradle.github.pages.updateGitHubPages -import io.spine.internal.gradle.javac.configureErrorProne -import io.spine.internal.gradle.javac.configureJavac -import io.spine.internal.gradle.javadoc.JavadocConfig -import io.spine.internal.gradle.kotlin.setFreeCompilerArgs -import io.spine.internal.gradle.publish.PublishingRepos -import io.spine.internal.gradle.publish.spinePublishing -import io.spine.internal.gradle.report.coverage.JacocoConfig -import io.spine.internal.gradle.report.license.LicenseReporter -import io.spine.internal.gradle.report.pom.PomGenerator -import io.spine.internal.gradle.testing.configureLogging -import io.spine.internal.gradle.testing.registerTestTasks -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import io.spine.dependency.build.Dokka +import io.spine.dependency.build.ErrorProne +import io.spine.dependency.lib.Coroutines +import io.spine.dependency.lib.Jackson +import io.spine.dependency.lib.KotlinPoet +import io.spine.dependency.local.ArtifactVersion +import io.spine.dependency.local.Base +import io.spine.dependency.local.Logging +import io.spine.dependency.local.ProtoData +import io.spine.dependency.local.TestLib +import io.spine.dependency.local.ToolBase +import io.spine.dependency.local.Validation +import io.spine.dependency.test.JUnit +import io.spine.gradle.applyGitHubPackages +import io.spine.gradle.checkstyle.CheckStyleConfig +import io.spine.gradle.github.pages.updateGitHubPages +import io.spine.gradle.javac.configureErrorProne +import io.spine.gradle.javac.configureJavac +import io.spine.gradle.javadoc.JavadocConfig +import io.spine.gradle.kotlin.setFreeCompilerArgs +import io.spine.gradle.publish.PublishingRepos +import io.spine.gradle.publish.spinePublishing +import io.spine.gradle.report.coverage.JacocoConfig +import io.spine.gradle.report.license.LicenseReporter +import io.spine.gradle.report.pom.PomGenerator +import io.spine.gradle.standardToSpineSdk +import io.spine.gradle.testing.configureLogging +import io.spine.gradle.testing.registerTestTasks buildscript { - io.spine.internal.gradle.doApplyStandard(repositories) - io.spine.internal.gradle.doForceVersions(configurations) + standardSpineSdkRepositories() + doForceVersions(configurations) dependencies { - classpath(io.spine.internal.dependency.Spine.McJava.pluginLib) + classpath(io.spine.dependency.local.McJava.pluginLib) } - val spine = io.spine.internal.dependency.Spine(project) - val jackson = io.spine.internal.dependency.Jackson + val jackson = io.spine.dependency.lib.Jackson + val coroutiners = io.spine.dependency.lib.Coroutines + val validation = io.spine.dependency.local.Validation + val logging = io.spine.dependency.local.Logging + val base = io.spine.dependency.local.Base configurations { all { resolutionStrategy { force( - spine.base, jackson.annotations, jackson.bom, jackson.databind, - jackson.moduleKotlin + jackson.moduleKotlin, + base.lib, + validation.runtime, + logging.lib, + coroutiners.bom, + coroutiners.core, + coroutiners.coreJvm, + coroutiners.jdk8, ) } } @@ -81,16 +92,15 @@ buildscript { repositories { // Required to grab the dependencies for `JacocoConfig`. - applyStandard() + standardToSpineSdk() } plugins { `java-library` kotlin("jvm") + protobuf jacoco - idea `project-report` - protobuf errorprone } @@ -101,13 +111,13 @@ spinePublishing { destinations = with(PublishingRepos) { setOf( gitHub("change"), - cloudRepo, cloudArtifactRegistry ) } dokkaJar { - enabled = true + kotlin = true + java = true } } @@ -123,15 +133,22 @@ allprojects { group = "io.spine" version = extra["versionToPublish"]!! - val spine = Spine(project) configurations { forceVersions() all { exclude("io.spine:spine-validate") resolutionStrategy { force( - spine.base, - spine.validation.runtime, + KotlinPoet.lib, + ToolBase.lib, + Coroutines.bom, + Coroutines.core, + Coroutines.coreJvm, + Coroutines.jdk8, + Base.lib, + ProtoData.api, + Validation.runtime, + Logging.lib, Dokka.BasePlugin.lib, Jackson.databind, protocArtifact @@ -158,19 +175,17 @@ subprojects { repositories { applyGitHubPackages("base", project) - applyStandard() + standardToSpineSdk() } - val spine = Spine(project) dependencies { errorprone(ErrorProne.core) - api(kotlin("stdlib-jdk8")) - testImplementation(spine.testlib) + testImplementation(TestLib.lib) testImplementation(JUnit.runner) } - val javaVersion = JavaVersion.VERSION_11 + val javaVersion = JavaVersion.VERSION_17 java { sourceCompatibility = javaVersion @@ -189,12 +204,9 @@ subprojects { kotlin { explicitApi() - - tasks { - withType().configureEach { - kotlinOptions.jvmTarget = javaVersion.toString() - setFreeCompilerArgs() - } + compilerOptions { + jvmTarget.set(BuildSettings.jvmTarget) + setFreeCompilerArgs() } } @@ -232,29 +244,11 @@ subprojects { } } - updateGitHubPages(Spine.DefaultVersion.javadocTools) { + updateGitHubPages(ArtifactVersion.javadocTools) { allowInternalJavadoc.set(true) rootFolder.set(rootDir) } - // Apply the same IDEA module configuration for each of subprojects. - idea { - module { - with(generatedSourceDirs) { - add(file("$generatedDir/main/js")) - add(file("$generatedDir/main/java")) - add(file("$generatedDir/main/kotlin")) - add(file("$generatedDir/main/spine")) - } - testSources.from( - file("$generatedDir/test/java"), - file("$generatedDir/test/kotlin") - ) - isDownloadJavadoc = true - isDownloadSources = true - } - } - project.configureTaskDependencies() } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index fa1c5fc..050edc5 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + /** * This script uses two declarations of the constant [licenseReportVersion] because * currently there is no way to define a constant _before_ a build script of `buildSrc`. @@ -34,8 +36,9 @@ plugins { java groovy `kotlin-dsl` - val licenseReportVersion = "2.1" - id("com.github.jk1.dependency-license-report").version(licenseReportVersion) + + // https://github.com/jk1/Gradle-License-Report/releases + id("com.github.jk1.dependency-license-report").version("2.7") } repositories { @@ -47,113 +50,190 @@ repositories { /** * The version of Jackson used by `buildSrc`. * - * Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`. - * It's not a requirement, but would be good in terms of consistency. + * Please keep this value in sync with [io.spine.dependency.lib.Jackson.version]. + * It is not a requirement but would be good in terms of consistency. + */ +val jacksonVersion = "2.15.3" + +/** + * The version of Google Artifact Registry used by `buildSrc`. + * + * The version `2.1.5` is the latest before `2.2.0`, which introduces breaking changes. + * + * @see + * Google Artifact Registry at Maven */ -val jacksonVersion = "2.13.4" +val googleAuthToolVersion = "2.1.5" + +val licenseReportVersion = "2.7" -val googleAuthToolVersion = "2.1.2" -val licenseReportVersion = "2.1" -val grGitVersion = "3.1.1" +val grGitVersion = "4.1.1" /** - * The version of the Kotlin Gradle plugin. + * The version of the Kotlin Gradle plugin used by the build process. * - * Please check that this value matches one defined in - * [io.spine.internal.dependency.Kotlin.version]. + * This version may change from the [version of Kotlin][io.spine.dependency.lib.Kotlin.version] + * used by the project. */ -val kotlinVersion = "1.7.20" +val kotlinVersion = "2.1.20" /** * The version of Guava used in `buildSrc`. * - * Always use the same version as the one specified in [io.spine.internal.dependency.Guava]. + * Always use the same version as the one specified in [io.spine.dependency.lib.Guava]. * Otherwise, when testing Gradle plugins, clashes may occur. */ -val guavaVersion = "31.1-jre" +val guavaVersion = "32.1.3-jre" /** * The version of ErrorProne Gradle plugin. * - * Please keep in sync. with [io.spine.internal.dependency.ErrorProne.GradlePlugin.version]. + * Please keep in sync. with [io.spine.dependency.build.ErrorProne.GradlePlugin.version]. * * @see * Error Prone Gradle Plugin Releases */ -val errorProneVersion = "3.0.1" +val errorPronePluginVersion = "4.1.0" /** * The version of Protobuf Gradle Plugin. * - * Please keep in sync. with [io.spine.internal.dependency.Protobuf.GradlePlugin.version]. + * Please keep in sync. with [io.spine.dependency.lib.Protobuf.GradlePlugin.version]. * * @see * Protobuf Gradle Plugins Releases */ -val protobufPluginVersion = "0.8.19" +val protobufPluginVersion = "0.9.4" /** * The version of Dokka Gradle Plugins. * - * Please keep in sync with [io.spine.internal.dependency.Dokka.version]. + * Please keep in sync with [io.spine.dependency.build.Dokka.version]. * * @see * Dokka Releases */ -val dokkaVersion = "1.7.20" +val dokkaVersion = "1.9.20" /** * The version of Detekt Gradle Plugin. * * @see Detekt Releases */ -val detektVersion = "1.21.0" +val detektVersion = "1.23.8" + +/** + * @see [io.spine.dependency.test.Kotest] + */ +val kotestJvmPluginVersion = "0.4.10" + +/** + * @see [io.spine.dependency.test.Kover] + */ +val koverVersion = "0.7.2" + +/** + * The version of the Shadow Plugin. + * + * `7.1.2` is the last version compatible with Gradle 7.x. Newer versions require Gradle v8.x. + * + * @see Shadow Plugin releases + */ +val shadowVersion = "7.1.2" configurations.all { resolutionStrategy { force( + "com.google.guava:guava:${guavaVersion}", + "com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion", + // Force Kotlin lib versions avoiding using those bundled with Gradle. "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion", "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion", - "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion", "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" ) } } -val jvmVersion = JavaLanguageVersion.of(11) - java { - toolchain.languageVersion.set(jvmVersion) + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) } -tasks.withType { - kotlinOptions { - jvmTarget = jvmVersion.toString() +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) } } dependencies { - implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") - implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") - implementation("com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion") { - exclude(group = "com.google.guava") - } - implementation("com.google.guava:guava:$guavaVersion") api("com.github.jk1:gradle-license-report:$licenseReportVersion") - implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}") - implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorProneVersion}") + dependOnAuthCommon() + + listOf( + "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion", + "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion", + "com.github.jk1:gradle-license-report:$licenseReportVersion", + "com.google.guava:guava:$guavaVersion", + "com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion", + "gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}", + "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion", + "io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion", + // https://github.com/srikanth-lingala/zip4j + "net.lingala.zip4j:zip4j:2.10.0", + "net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}", + "org.ajoberstar.grgit:grgit-core:${grGitVersion}", + "org.jetbrains.dokka:dokka-base:${dokkaVersion}", + "org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}", + "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion", + "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion", + "org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion" + ).forEach { + implementation(it) + } +} - // Add explicit dependency to avoid warning on different Kotlin runtime versions. - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") +dependOnBuildSrcJar() - implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion") - implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") - implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") +/** + * Adds a dependency on a `buildSrc.jar`, iff: + * 1) the `src` folder is missing, and + * 2) `buildSrc.jar` is present in `buildSrc/` folder instead. + * + * This approach is used in the scope of integration testing. + */ +fun Project.dependOnBuildSrcJar() { + val srcFolder = this.rootDir.resolve("src") + val buildSrcJar = rootDir.resolve("buildSrc.jar") + if (!srcFolder.exists() && buildSrcJar.exists()) { + logger.info("Adding the pre-compiled 'buildSrc.jar' to 'implementation' dependencies.") + dependencies { + implementation(files("buildSrc.jar")) + } + } +} - // https://github.com/srikanth-lingala/zip4j - implementation("net.lingala.zip4j:zip4j:2.10.0") +/** + * Includes the `implementation` dependency on `artifactregistry-auth-common`, + * with the version defined in [googleAuthToolVersion]. + * + * `artifactregistry-auth-common` has transitive dependency on Gson and Apache `commons-codec`. + * Gson from version `2.8.6` until `2.8.9` is vulnerable to Deserialization of Untrusted Data + * (https://devhub.checkmarx.com/cve-details/CVE-2022-25647/). + * + * Apache `commons-codec` before 1.13 is vulnerable to information exposure + * (https://devhub.checkmarx.com/cve-details/Cxeb68d52e-5509/). + * + * We use Gson `2.10.1` and we force it in `forceProductionDependencies()`. + * We use `commons-code` with version `1.16.0`, forcing it in `forceProductionDependencies()`. + * + * So, we should be safe with the current version `artifactregistry-auth-common` until + * we migrate to a later version. + */ +fun DependencyHandlerScope.dependOnAuthCommon() { + @Suppress("VulnerableLibrariesLocal", "RedundantSuppression") + implementation( + "com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion" + ) { + exclude(group = "com.google.guava") + } } diff --git a/buildSrc/src/main/kotlin/BuildExtensions.kt b/buildSrc/src/main/kotlin/BuildExtensions.kt new file mode 100644 index 0000000..e5b4650 --- /dev/null +++ b/buildSrc/src/main/kotlin/BuildExtensions.kt @@ -0,0 +1,295 @@ +/* + * Copyright 2025, 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. + */ + +@file:Suppress("UnusedReceiverParameter", "unused", "TopLevelPropertyNaming", "ObjectPropertyName") + +import io.spine.dependency.build.ErrorProne +import io.spine.dependency.build.GradleDoctor +import io.spine.dependency.build.Ksp +import io.spine.dependency.lib.Protobuf +import io.spine.dependency.local.McJava +import io.spine.dependency.local.ProtoData +import io.spine.dependency.local.ProtoTap +import io.spine.dependency.test.Kotest +import io.spine.dependency.test.Kover +import io.spine.gradle.standardToSpineSdk +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.tasks.JavaExec +import org.gradle.kotlin.dsl.ScriptHandlerScope +import org.gradle.plugin.use.PluginDependenciesSpec +import org.gradle.plugin.use.PluginDependencySpec + +/** + * Provides shortcuts to reference our dependency objects. + * + * Dependency objects cannot be used under `plugins` section because `io` is a value + * declared in auto-generated `org.gradle.kotlin.dsl.PluginAccessors.kt` file. + * It conflicts with our own declarations. + * + * In such cases, a shortcut to apply a plugin can be created: + * + * ``` + * val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec + * get() = id(GradleDoctor.pluginId).version(GradleDoctor.version) + * ``` + * + * But for some plugins, it is impossible to apply them directly to a project. + * For example, when a plugin is not published to Gradle Portal, it can only be + * applied with the buildscript's classpath. Thus, it is necessary to leave some freedom + * upon how to apply them. In such cases, just a shortcut to a dependency object + * can be declared without applying the plugin in-place. + */ +private const val ABOUT_DEPENDENCY_EXTENSIONS = "" + +/** + * Applies [standard][standardToSpineSdk] repositories to this `buildscript`. + */ +fun ScriptHandlerScope.standardSpineSdkRepositories() { + repositories.standardToSpineSdk() +} + +/** + * Shortcut to [McJava] dependency object for using under `buildScript`. + */ +val ScriptHandlerScope.mcJava: McJava + get() = McJava + +/** + * Shortcut to [McJava] dependency object. + * + * This plugin is not published to Gradle Portal and cannot be applied directly to a project. + * Firstly, it should be put to buildscript's classpath and then applied by ID only. + */ +val PluginDependenciesSpec.mcJava: McJava + get() = McJava + +/** + * Shortcut to [ProtoData] dependency object for using under `buildscript`. + */ +val ScriptHandlerScope.protoData: ProtoData + get() = ProtoData + +/** + * Shortcut to [ProtoData] dependency object. + * + * This plugin is published at Gradle Plugin Portal. + * But when used in a pair with [mcJava], it cannot be applied directly to a project. + * It is so, because [mcJava] uses [protoData] as its dependency. + * And the buildscript's classpath ends up with both of them. + */ +val PluginDependenciesSpec.protoData: ProtoData + get() = ProtoData + +/** + * Provides shortcuts for applying plugins from our dependency objects. + * + * Dependency objects cannot be used under `plugins` section because `io` is a value + * declared in auto-generated `org.gradle.kotlin.dsl.PluginAccessors.kt` file. + * It conflicts with our own declarations. + * + * Declaring of top-level shortcuts eliminates the need to apply plugins + * using a fully qualified name of dependency objects. + * + * It is still possible to apply a plugin with a custom version, if needed. + * Just declare a version again on the returned [PluginDependencySpec]. + * + * For example: + * + * ``` + * plugins { + * protobuf version("0.8.19-custom") + * } + * ``` + */ +private const val ABOUT_PLUGIN_ACCESSORS = "" + +val PluginDependenciesSpec.errorprone: PluginDependencySpec + get() = id(ErrorProne.GradlePlugin.id) + +val PluginDependenciesSpec.protobuf: PluginDependencySpec + get() = id(Protobuf.GradlePlugin.id) + +val PluginDependenciesSpec.prototap: PluginDependencySpec + get() = id(ProtoTap.gradlePluginId).version(ProtoTap.version) + +val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec + get() = id(GradleDoctor.pluginId).version(GradleDoctor.version) + +val PluginDependenciesSpec.kotest: PluginDependencySpec + get() = Kotest.MultiplatformGradlePlugin.let { + return id(it.id).version(it.version) + } + +val PluginDependenciesSpec.kover: PluginDependencySpec + get() = id(Kover.id).version(Kover.version) + +val PluginDependenciesSpec.ksp: PluginDependencySpec + get() = id(Ksp.id).version(Ksp.version) + +/** + * Configures the dependencies between third-party Gradle tasks + * and those defined via ProtoData and Spine Model Compiler. + * + * It is required to avoid warnings in build logs, detecting the undeclared + * usage of Spine-specific task output by other tasks, + * e.g., the output of `launchProtoData` is used by `compileKotlin`. + */ +@Suppress("unused") +fun Project.configureTaskDependencies() { + + /** + * Creates a dependency between the Gradle task of *this* name + * onto the task with `taskName`. + * + * If either of tasks does not exist in the enclosing `Project`, + * this method does nothing. + * + * This extension is kept local to `configureTaskDependencies` extension + * to prevent its direct usage from outside. + */ + fun String.dependOn(taskName: String) { + val whoDepends = this + val dependOntoTask: Task? = tasks.findByName(taskName) + dependOntoTask?.let { + tasks.findByName(whoDepends)?.dependsOn(it) + } + } + + afterEvaluate { + val launchProtoData = "launchProtoData" + val launchTestProtoData = "launchTestProtoData" + val generateProto = "generateProto" + val createVersionFile = "createVersionFile" + val compileKotlin = "compileKotlin" + compileKotlin.run { + dependOn(generateProto) + dependOn(launchProtoData) + } + val compileTestKotlin = "compileTestKotlin" + compileTestKotlin.dependOn(launchTestProtoData) + val sourcesJar = "sourcesJar" + val kspKotlin = "kspKotlin" + sourcesJar.run { + dependOn(generateProto) + dependOn(launchProtoData) + dependOn(kspKotlin) + dependOn(createVersionFile) + dependOn("prepareProtocConfigVersions") + } + val dokkaHtml = "dokkaHtml" + dokkaHtml.run { + dependOn(generateProto) + dependOn(launchProtoData) + dependOn(kspKotlin) + } + val dokkaJavadoc = "dokkaJavadoc" + dokkaJavadoc.run { + dependOn(launchProtoData) + dependOn(kspKotlin) + } + "publishPluginJar".dependOn(createVersionFile) + compileKotlin.dependOn(kspKotlin) + compileTestKotlin.dependOn("kspTestKotlin") + "compileTestFixturesKotlin".dependOn("kspTestFixturesKotlin") + "javadocJar".dependOn(dokkaHtml) + "dokkaKotlinJar".dependOn(dokkaJavadoc) + } +} + +/** + * Obtains all modules names of which do not have `"-tests"` as the suffix. + * + * By convention, such modules are for integration tests and should be treated differently. + */ +val Project.productionModules: Iterable + get() = rootProject.subprojects.filter { !it.name.contains("-tests") } + +/** + * Sets the remote debug option for this [JavaExec] task. + * + * The port number is [5566][BuildSettings.REMOTE_DEBUG_PORT]. + * + * @param enabled If `true` the task will be suspended. + */ +fun JavaExec.remoteDebug(enabled: Boolean = true) { + debugOptions { + this@debugOptions.enabled.set(enabled) + port.set(BuildSettings.REMOTE_DEBUG_PORT) + server.set(true) + suspend.set(true) + } +} + +/** + * Sets the remote debug option for the task of [JavaExec] type with the given name. + * + * The port number is [5566][BuildSettings.REMOTE_DEBUG_PORT]. + * + * @param enabled If `true` the task will be suspended. + * @throws IllegalStateException if the task with the given name is not found, or, + * if the taks is not of [JavaExec] type. + */ +fun Project.setRemoteDebug(taskName: String, enabled: Boolean = true) { + val task = tasks.findByName(taskName) + check(task != null) { + "Could not find a task named `$taskName` in the project `$name`." + } + check(task is JavaExec) { + "The task `$taskName` is not of type `JavaExec`." + } + task.remoteDebug(enabled) +} + +/** + * Sets remote debug options for the `launchProtoData` task. + * + * @param enabled if `true` the task will be suspended. + * + * @see remoteDebug + */ +fun Project.protoDataRemoteDebug(enabled: Boolean = true) = + setRemoteDebug("launchProtoData", enabled) + +/** + * Sets remote debug options for the `launchTestProtoData` task. + * + * @param enabled if `true` the task will be suspended. + * + * @see remoteDebug + */ +fun Project.testProtoDataRemoteDebug(enabled: Boolean = true) = + setRemoteDebug("launchTestProtoData", enabled) + +/** + * Sets remote debug options for the `launchTestFixturesProtoData` task. + * + * @param enabled if `true` the task will be suspended. + * + * @see remoteDebug + */ +fun Project.testFixturesProtoDataRemoteDebug(enabled: Boolean = true) = + setRemoteDebug("launchTestFixturesProtoData", enabled) diff --git a/buildSrc/src/main/kotlin/BuildSettings.kt b/buildSrc/src/main/kotlin/BuildSettings.kt new file mode 100644 index 0000000..562eb83 --- /dev/null +++ b/buildSrc/src/main/kotlin/BuildSettings.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2025, 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. + */ + +import org.gradle.api.JavaVersion +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +/** + * This object provides high-level constants, like the version of JVM, to be used + * throughout the project. + */ +object BuildSettings { + private const val JVM_VERSION = 17 + val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION) + val javaVersionCompat = JavaVersion.toVersion(JVM_VERSION) + val jvmTarget = JvmTarget.JVM_17 + const val REMOTE_DEBUG_PORT = 5566 +} diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt deleted file mode 100644 index 2edb709..0000000 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -@file:Suppress("UnusedReceiverParameter", "unused") - -import io.spine.internal.dependency.ErrorProne -import io.spine.internal.dependency.GradleDoctor -import io.spine.internal.dependency.Protobuf -import io.spine.internal.dependency.Spine -import io.spine.internal.dependency.Spine.ProtoData -import org.gradle.plugin.use.PluginDependenciesSpec -import org.gradle.plugin.use.PluginDependencySpec - -/** - * Provides shortucts to reference our dependnecy objects. - * - * Dependency objects cannot be used under `plugins` section because `io` is a value - * declared in auto-generatated `org.gradle.kotlin.dsl.PluginAccessors.kt` file. - * It conflicts with our own declarations. - * - * In such cases, a shortctut to apply a plugin can be created: - * - * ``` - * val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec - * get() = id(GradleDoctor.pluginId).version(GradleDoctor.version) - * ``` - * - * But for some plugins, it's impossible to apply them directly to a project. - * For example, when a plugin is not published to Gradle Portal, it can only be - * applied with buildscript's classpath. Thus, it's needed to leave some freedom - * upon how to apply them. In such cases, just a shortcut to a dependency object - * can be declared, without applyin of the plugin in-place. - */ -private const val ABOUT = "" - -/** - * Shortcut to [Spine.McJava] dependency object. - * - * This plugin is not published to Gradle Portal and cannot be applied directly to a project. - * Firstly, it should be put to buildscript's classpath and then applied by ID only. - */ -val PluginDependenciesSpec.mcJava: Spine.McJava - get() = Spine.McJava - -/** - * Shortcut to [Spine.ProtoData] dependency object. - * - * This plugin is in Gradle Portal. But when used in pair with [mcJava], it cannot be applied - * directly to a project. It it so, because [mcJava] uses [protoData] as its dependency. - * And buildscript's classpath ends up with both of them. - */ -val PluginDependenciesSpec.protoData: ProtoData - get() = ProtoData diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/DependencyResolution.kt similarity index 54% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt rename to buildSrc/src/main/kotlin/DependencyResolution.kt index ad768c5..adf5eae 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/DependencyResolution.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,36 +24,45 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle - -import io.spine.internal.dependency.AnimalSniffer -import io.spine.internal.dependency.AutoCommon -import io.spine.internal.dependency.AutoService -import io.spine.internal.dependency.AutoValue -import io.spine.internal.dependency.CheckerFramework -import io.spine.internal.dependency.CommonsCli -import io.spine.internal.dependency.CommonsLogging -import io.spine.internal.dependency.ErrorProne -import io.spine.internal.dependency.FindBugs -import io.spine.internal.dependency.Flogger -import io.spine.internal.dependency.Gson -import io.spine.internal.dependency.Guava -import io.spine.internal.dependency.J2ObjC -import io.spine.internal.dependency.JUnit -import io.spine.internal.dependency.Jackson -import io.spine.internal.dependency.Kotlin -import io.spine.internal.dependency.Okio -import io.spine.internal.dependency.Plexus -import io.spine.internal.dependency.Protobuf -import io.spine.internal.dependency.Truth +import io.spine.dependency.build.AnimalSniffer +import io.spine.dependency.build.CheckerFramework +import io.spine.dependency.build.Dokka +import io.spine.dependency.build.ErrorProne +import io.spine.dependency.build.FindBugs +import io.spine.dependency.lib.Asm +import io.spine.dependency.lib.AutoCommon +import io.spine.dependency.lib.AutoService +import io.spine.dependency.lib.AutoValue +import io.spine.dependency.lib.CommonsCli +import io.spine.dependency.lib.CommonsCodec +import io.spine.dependency.lib.CommonsLogging +import io.spine.dependency.lib.Gson +import io.spine.dependency.lib.Guava +import io.spine.dependency.lib.J2ObjC +import io.spine.dependency.lib.Jackson +import io.spine.dependency.lib.JavaDiffUtils +import io.spine.dependency.lib.Kotlin +import io.spine.dependency.lib.Okio +import io.spine.dependency.lib.Plexus +import io.spine.dependency.lib.Protobuf +import io.spine.dependency.lib.Slf4J +import io.spine.dependency.local.Base +import io.spine.dependency.local.Spine +import io.spine.dependency.test.Hamcrest +import io.spine.dependency.test.JUnit +import io.spine.dependency.test.Kotest +import io.spine.dependency.test.OpenTest4J +import io.spine.dependency.test.Truth import org.gradle.api.NamedDomainObjectContainer +import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.ConfigurationContainer +import org.gradle.api.artifacts.ModuleDependency import org.gradle.api.artifacts.ResolutionStrategy -import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.kotlin.dsl.exclude /** - * The function to be used in `buildscript` when a fully-qualified call must be made. + * The function to be used in `buildscript` when a fully qualified call must be made. */ @Suppress("unused") fun doForceVersions(configurations: ConfigurationContainer) { @@ -76,25 +85,26 @@ fun NamedDomainObjectContainer.forceVersions() { } private fun ResolutionStrategy.forceProductionDependencies() { - @Suppress("DEPRECATION") // Force SLF4J version. + @Suppress("DEPRECATION") // Force versions of SLF4J and Kotlin libs. force( AnimalSniffer.lib, AutoCommon.lib, AutoService.annotations, CheckerFramework.annotations, + Dokka.BasePlugin.lib, ErrorProne.annotations, ErrorProne.core, - Guava.lib, FindBugs.annotations, - Flogger.lib, - Flogger.Runtime.systemBackend, + Gson.lib, + Guava.lib, Kotlin.reflect, Kotlin.stdLib, Kotlin.stdLibCommon, + Kotlin.stdLibJdk7, Kotlin.stdLibJdk8, - Protobuf.libs, Protobuf.GradlePlugin.lib, - io.spine.internal.dependency.Slf4J.lib + Protobuf.libs, + Slf4J.lib ) } @@ -102,10 +112,12 @@ private fun ResolutionStrategy.forceTestDependencies() { force( Guava.testLib, JUnit.api, - JUnit.platformCommons, - JUnit.platformLauncher, + JUnit.bom, + JUnit.Platform.commons, + JUnit.Platform.launcher, JUnit.legacy, - Truth.libs + Truth.libs, + Kotest.assertions, ) } @@ -114,24 +126,37 @@ private fun ResolutionStrategy.forceTestDependencies() { */ private fun ResolutionStrategy.forceTransitiveDependencies() { force( + Asm.lib, + Asm.tree, + Asm.analysis, + Asm.util, + Asm.commons, AutoValue.annotations, - Gson.lib, - J2ObjC.annotations, - Plexus.utils, - Okio.lib, CommonsCli.lib, - CheckerFramework.compatQual, + CommonsCodec.lib, CommonsLogging.lib, - Jackson.databind, + Gson.lib, + Hamcrest.core, + J2ObjC.annotations, + JUnit.Platform.engine, + JUnit.Platform.suiteApi, + JUnit.runner, + Jackson.annotations, + Jackson.bom, Jackson.core, + Jackson.databind, Jackson.dataformatXml, Jackson.dataformatYaml, Jackson.moduleKotlin, - Jackson.bom, - Jackson.annotations + JavaDiffUtils.lib, + Kotlin.jetbrainsAnnotations, + Okio.lib, + OpenTest4J.lib, + Plexus.utils, ) } +@Suppress("unused") fun NamedDomainObjectContainer.excludeProtobufLite() { fun excludeProtoLite(configurationName: String) { @@ -147,29 +172,37 @@ fun NamedDomainObjectContainer.excludeProtobufLite() { excludeProtoLite("testRuntimeOnly") } +/** + * Excludes `spine-base` from the dependencies. + */ @Suppress("unused") -object DependencyResolution { - @Deprecated( - "Please use `configurations.forceVersions()`.", - ReplaceWith("configurations.forceVersions()") - ) - fun forceConfiguration(configurations: ConfigurationContainer) { - configurations.forceVersions() - } +fun ModuleDependency.excludeSpineBase() { + exclude(group = Spine.group, module = "spine-base") +} - @Deprecated( - "Please use `configurations.excludeProtobufLite()`.", - ReplaceWith("configurations.excludeProtobufLite()") - ) - fun excludeProtobufLite(configurations: ConfigurationContainer) { - configurations.excludeProtobufLite() +/** + * Forces the version of [Spine.base] in the given project. + */ +@Suppress("unused") +fun Project.forceSpineBase() { + configurations.all { + resolutionStrategy { + force(Base.lib) + } } +} - @Deprecated( - "Please use `applyStandard(repositories)` instead.", - replaceWith = ReplaceWith("applyStandard(repositories)") - ) - fun defaultRepositories(repositories: RepositoryHandler) { - repositories.applyStandard() +/** + * Forces configurations containing `"proto"` in their names (disregarding the case) to + * use [Spine.baseForBuildScript]. + */ +@Suppress("unused") +fun Project.forceBaseInProtoTasks() { + configurations.configureEach { + if (name.lowercase().contains("proto")) { + resolutionStrategy { + force(Base.libForBuildScript) + } + } } } diff --git a/buildSrc/src/main/kotlin/DokkaExts.kt b/buildSrc/src/main/kotlin/DokkaExts.kt new file mode 100644 index 0000000..ff5de3f --- /dev/null +++ b/buildSrc/src/main/kotlin/DokkaExts.kt @@ -0,0 +1,224 @@ +/* + * Copyright 2025, 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. + */ + +import io.spine.dependency.build.Dokka +import io.spine.gradle.publish.getOrCreate +import java.io.File +import java.time.LocalDate +import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.api.file.FileCollection +import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.TaskProvider +import org.gradle.api.tasks.bundling.Jar +import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask +import org.jetbrains.dokka.gradle.AbstractDokkaTask +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder + +/** + * To generate the documentation as seen from Java perspective, the `kotlin-as-java` + * plugin was added to the Dokka classpath. + * + * @see + * Dokka output formats + */ +fun DependencyHandlerScope.useDokkaForKotlinAsJava() { + dokkaPlugin(Dokka.KotlinAsJavaPlugin.lib) +} + +/** + * To exclude pieces of code annotated with `@Internal` from the documentation + * a custom plugin is added to the Dokka classpath. + * + * @see + * Custom Dokka Plugins + */ +fun DependencyHandlerScope.useDokkaWithSpineExtensions() { + dokkaPlugin(Dokka.SpineExtensions.lib) +} + +private fun DependencyHandler.dokkaPlugin(dependencyNotation: Any): Dependency? = + add("dokkaPlugin", dependencyNotation) + +private fun Project.dokkaOutput(language: String): File { + val lng = language.titleCaseFirstChar() + 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") + return dokkaConfDir.resolve(file) +} + +/** + * Configures the presentation style, logo, and footer message. + * + * Dokka Base plugin allows setting a few properties to customize the output: + * - `customStyleSheets` property to which CSS files are passed overriding + * styles generated by Dokka; + * - `customAssets` property to provide resources. The image with the name + * "logo-icon.svg" is passed to override the default logo used by Dokka; + * - `separateInheritedMembers` when set to `true`, creates a separate tab in + * type-documentation for inherited members. + * + * @see + * Dokka modifying frontend assets + */ +fun AbstractDokkaTask.configureStyle() { + pluginConfiguration { + customStyleSheets = listOf(project.dokkaConfigFile("styles/custom-styles.css")) + customAssets = listOf(project.dokkaConfigFile("assets/logo-icon.svg")) + separateInheritedMembers = true + footerMessage = "Copyright ${LocalDate.now().year}, TeamDev" + } +} + +private fun AbstractDokkaLeafTask.configureFor(language: String) { + dokkaSourceSets.configureEach { + /** + * Configures links to the external Java documentation. + */ + jdkVersion.set(BuildSettings.javaVersion.asInt()) + + skipEmptyPackages.set(true) + + includeNonPublic.set(true) + + documentedVisibilities.set( + setOf( + DokkaConfiguration.Visibility.PUBLIC, + DokkaConfiguration.Visibility.PROTECTED + ) + ) + } + + outputDirectory.set(project.dokkaOutput(language)) + + configureStyle() +} + +/** + * Configures this [DokkaTask] to accept only Kotlin files. + */ +fun AbstractDokkaLeafTask.configureForKotlin() { + configureFor("kotlin") +} + +/** + * Configures this [DokkaTask] to accept only Java files. + */ +fun AbstractDokkaLeafTask.configureForJava() { + configureFor("java") +} + +/** + * Finds the `dokkaHtml` Gradle task. + */ +fun TaskContainer.dokkaHtmlTask(): DokkaTask? = this.findByName("dokkaHtml") as DokkaTask? + +/** + * Returns only Java source roots out of all present in the source set. + * + * It is a helper method for generating documentation by Dokka only for Java code. + * It is helpful when both Java and Kotlin source files are present in a source set. + * 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) +} + +private fun File.isJavaSourceDirectory(): Boolean { + return isDirectory && name == "java" +} + +/** + * Locates or creates `dokkaKotlinJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains the Dokka output, generated upon + * Kotlin sources from `main` source set. Requires Dokka to be configured in the target project by + * applying `dokka-for-kotlin` plugin. + */ +fun Project.dokkaKotlinJar(): TaskProvider = tasks.getOrCreate("dokkaKotlinJar") { + archiveClassifier.set("dokka") + from(files(dokkaOutput("kotlin"))) + + tasks.dokkaHtmlTask()?.let{ dokkaTask -> + this@getOrCreate.dependsOn(dokkaTask) + } +} + +/** + * 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 AbstractDokkaTask.isInPublishingGraph(): Boolean = + project.gradle.taskGraph.allTasks.any { + it.name == "publish" + } + +/** + * Locates or creates `dokkaJavaJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains the Dokka output, generated upon + * Kotlin sources from `main` source set. Requires Dokka to be configured in the target project by + * applying `dokka-for-java` and/or `dokka-for-kotlin` script plugin. + */ +fun Project.dokkaJavaJar(): TaskProvider = tasks.getOrCreate("dokkaJavaJar") { + archiveClassifier.set("dokka-java") + from(files(dokkaOutput("java"))) + + tasks.dokkaHtmlTask()?.let{ dokkaTask -> + this@getOrCreate.dependsOn(dokkaTask) + } +} + +/** + * Disables Dokka and Javadoc tasks in this `Project`. + * + * This function could be useful to improve build speed when building subprojects containing + * test environments or integration test projects. + */ +@Suppress("unused") +fun Project.disableDocumentationTasks() { + gradle.taskGraph.whenReady { + tasks.forEach { task -> + val lowercaseName = task.name.lowercase() + if (lowercaseName.contains("dokka") || lowercaseName.contains("javadoc")) { + task.enabled = false + } + } + } +} diff --git a/buildSrc/src/main/kotlin/PluginsAccessors.kt b/buildSrc/src/main/kotlin/PluginsAccessors.kt deleted file mode 100644 index f20c550..0000000 --- a/buildSrc/src/main/kotlin/PluginsAccessors.kt +++ /dev/null @@ -1,66 +0,0 @@ -/* -* Copyright 2022, TeamDev. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Redistribution and use in source and/or binary forms, with or without -* modification, must retain the above copyright notice and the following -* disclaimer. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// Those accessors should match Gradle's naming conventions. -@file:Suppress("TopLevelPropertyNaming", "unused") - -import io.spine.internal.dependency.ErrorProne -import io.spine.internal.dependency.GradleDoctor -import io.spine.internal.dependency.Protobuf -import org.gradle.plugin.use.PluginDependenciesSpec -import org.gradle.plugin.use.PluginDependencySpec - -/** - * Provides shortucts for applying plugins from our dependnecy objects. - * - * Dependency objects cannot be used under `plugins` section because `io` is a value - * declared in auto-generatated `org.gradle.kotlin.dsl.PluginAccessors.kt` file. - * It conflicts with our own declarations. - * - * Declaring of top-level shortucts eliminates need in applying plugins - * using fully-qualified name of dependency objects. - * - * It is still possible to apply a plugin with a custom version, if needed. - * Just delcate a version again on the returned [PluginDependencySpec]. - * - * For example: - * - * ``` - * plugins { - * protobuf version("0.8.19-custom") - * } - * ``` - */ -private const val ABOUT = "" - -val PluginDependenciesSpec.errorprone: PluginDependencySpec - get() = id(ErrorProne.GradlePlugin.id) - -val PluginDependenciesSpec.protobuf: PluginDependencySpec - get() = id(Protobuf.GradlePlugin.id) - -val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec - get() = id(GradleDoctor.pluginId).version(GradleDoctor.version) diff --git a/buildSrc/src/main/kotlin/Strings.kt b/buildSrc/src/main/kotlin/Strings.kt new file mode 100644 index 0000000..19e0c21 --- /dev/null +++ b/buildSrc/src/main/kotlin/Strings.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2025, 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. + */ + +/** + * This file provides extensions to `String` and `CharSequence` that wrap + * analogues from standard Kotlin runtime. + * + * It helps in switching between versions of Gradle which have different versions of + * the Kotlin runtime. Please see the bodies of the extension functions for details on + * switching the implementations depending on the Kotlin version at hand. + * + * Once we migrate to newer Gradle, these wrappers should be inlined with + * the subsequent removal of this source file. + */ +@Suppress("unused") +private const val ABOUT = "" + +/** + * Makes the first character come in the title case. + */ +fun String.titleCaseFirstChar(): String = replaceFirstChar { it.titlecase() } + +/** + * Converts this string to lowercase. + */ +@Deprecated(message = "Please use `lowercase()` instead.", replaceWith = ReplaceWith("lowercase")) +fun String.lowercased(): String = lowercase() diff --git a/buildSrc/src/main/kotlin/TaskDependencies.kt b/buildSrc/src/main/kotlin/TaskDependencies.kt deleted file mode 100644 index cfabc4d..0000000 --- a/buildSrc/src/main/kotlin/TaskDependencies.kt +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.gradle.api.Project -import org.gradle.api.Task - -/** - * Configures the dependencies between third-party Gradle tasks - * and those defined via ProtoData and Spine Model Compiler. - * - * It is required in order to avoid warnings in build logs, detecting the undeclared - * usage of Spine-specific task output by other tasks, - * e.g. the output of `launchProtoDataMain` is used by `compileKotlin`. - */ -@Suppress("unused") -fun Project.configureTaskDependencies() { - - /** - * Creates a dependency between the Gradle task of *this* name - * onto the task with `taskName`. - * - * If either of tasks does not exist in the enclosing `Project`, - * this method does nothing. - * - * This extension is kept local to `configureTaskDependencies` extension - * to prevent its direct usage from outside. - */ - fun String.dependOn(taskName: String) { - val whoDepends = this - val dependOntoTask: Task? = tasks.findByName(taskName) - dependOntoTask?.let { - tasks.findByName(whoDepends)?.dependsOn(it) - } - } - - afterEvaluate { - "compileKotlin".dependOn("launchProtoDataMain") - "compileTestKotlin".dependOn("launchProtoDataTest") - "sourcesJar".dependOn("generateProto") - "sourcesJar".dependOn("launchProtoDataMain") - "sourcesJar".dependOn("createVersionFile") - "sourcesJar".dependOn("prepareProtocConfigVersions") - "dokkaHtml".dependOn("generateProto") - "dokkaHtml".dependOn("launchProtoDataMain") - "dokkaJavadoc".dependOn("launchProtoDataMain") - "publishPluginJar".dependOn("createVersionFile") - } -} diff --git a/buildSrc/src/main/kotlin/compile-protobuf.gradle.kts b/buildSrc/src/main/kotlin/compile-protobuf.gradle.kts new file mode 100644 index 0000000..4acbb86 --- /dev/null +++ b/buildSrc/src/main/kotlin/compile-protobuf.gradle.kts @@ -0,0 +1,53 @@ +/* + * Copyright 2025, 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. + */ + +import io.spine.dependency.lib.Protobuf +import io.spine.gradle.protobuf.setup + +plugins { + id("java-library") + id("com.google.protobuf") +} + +// For generating test fixtures. See `src/test/proto`. +protobuf { + configurations.excludeProtobufLite() + protoc { + artifact = Protobuf.compiler + } + + afterEvaluate { + // Walk the collection of tasks to force the execution + // of the `configureEach` operations earlier. + // This hack allows to avoid `ConcurrentModificationException` on + // creating `kspKotlin` task. + generateProtoTasks.all().size + } + + generateProtoTasks.all().configureEach { + setup() + } +} diff --git a/buildSrc/src/main/kotlin/config-tester.gradle.kts b/buildSrc/src/main/kotlin/config-tester.gradle.kts index 8095691..21d31e3 100644 --- a/buildSrc/src/main/kotlin/config-tester.gradle.kts +++ b/buildSrc/src/main/kotlin/config-tester.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.gradle.ConfigTester -import io.spine.internal.gradle.SpineRepos -import io.spine.internal.gradle.cleanFolder +import io.spine.gradle.ConfigTester +import io.spine.gradle.SpineRepos +import io.spine.gradle.cleanFolder import java.nio.file.Path import java.nio.file.Paths diff --git a/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts b/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts index e38b8d6..7b0ffd1 100644 --- a/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts +++ b/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -60,6 +60,7 @@ import io.gitlab.arturbosch.detekt.Detekt * } * ``` */ +@Suppress("unused") private val about = "" plugins { @@ -68,7 +69,7 @@ plugins { detekt { buildUponDefaultConfig = true - config = files("${rootDir}/config/quality/detekt-config.yml") + config.from(files("${rootDir}/config/quality/detekt-config.yml")) } tasks { diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index d8f970f..ee22622 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,82 +24,20 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.Dokka -import io.spine.internal.gradle.dokka.onlyJavaSources - -import java.time.LocalDate -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.DokkaBaseConfiguration -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.dokka.DokkaConfiguration.Visibility +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask plugins { - id("org.jetbrains.dokka") + id("org.jetbrains.dokka") // Cannot use `Dokka` dependency object here yet. } dependencies { - /** - * To generate the documentation as seen from Java perspective, the `kotlin-as-java` - * plugin was added to the Dokka's classpath. - * - * @see - * Dokka output formats - */ - dokkaPlugin(Dokka.KotlinAsJavaPlugin.lib) - - /** - * To exclude pieces of code annotated with `@Internal` from the documentation a - * custom plugin is added to the Dokka's classpath. - * - * @see - * Custom Dokka Plugins - */ - dokkaPlugin(Dokka.SpineExtensions.lib) + useDokkaForKotlinAsJava() + useDokkaWithSpineExtensions() } -tasks.withType().configureEach { - dokkaSourceSets.configureEach { - /** - * Configures links to the external Java documentation. By default links are - * pointing to the Java 8 documentation. - */ - jdkVersion.set(11) - - sourceRoots.setFrom( - onlyJavaSources() - ) - - skipEmptyPackages.set(true) - - documentedVisibilities.set( - setOf( - Visibility.PUBLIC, - Visibility.PROTECTED - ) - ) - } - - outputDirectory.set(buildDir.resolve("docs/dokka")) - - val dokkaConfDir = rootDir.resolve("buildSrc/src/main/resources/dokka") - - /** - * Dokka Base plugin allows to set a few properties to customize the output: - * - * - `customStyleSheets` property to which css files are passed overriding - * styles generated by Dokka; - * - `customAssets` property to provide resources. The image with the name - * "logo-icon.svg" is passed to override the default logo used by Dokka; - * - `separateInheritedMembers` when set to `true`, creates a separate tab in - * type-documentation for inherited members. - * - * @see - * Dokka modifying frontend assets - */ - pluginConfiguration { - customStyleSheets = listOf(file("${dokkaConfDir.resolve("styles/custom-styles.css")}")) - customAssets = listOf(file("${dokkaConfDir.resolve("assets/logo-icon.svg")}")) - separateInheritedMembers = true - footerMessage = "Copyright ${LocalDate.now().year}, TeamDev" +tasks.withType().configureEach { + configureForJava() + onlyIf { + (it as AbstractDokkaLeafTask).isInPublishingGraph() } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts similarity index 71% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt rename to buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts index 80b7997..e50b10a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoService.kt +++ b/buildSrc/src/main/kotlin/dokka-for-kotlin.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask -// https://github.com/google/auto -object AutoService { - private const val version = "1.0.1" - const val annotations = "com.google.auto.service:auto-service-annotations:${version}" - @Suppress("unused") - const val processor = "com.google.auto.service:auto-service:${version}" +plugins { + id("org.jetbrains.dokka") // Cannot use `Dokka` dependency object here yet. +} + +dependencies { + useDokkaWithSpineExtensions() +} + +tasks.withType().configureEach { + configureForKotlin() + onlyIf { + (it as AbstractDokkaLeafTask).isInPublishingGraph() + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/AnimalSniffer.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/AnimalSniffer.kt index 068ae59..8258896 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/AnimalSniffer.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build // https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ +@Suppress("unused", "ConstPropertyName") object AnimalSniffer { private const val version = "1.21" - const val lib = "org.codehaus.mojo:animal-sniffer-annotations:${version}" + const val lib = "org.codehaus.mojo:animal-sniffer-annotations:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/CheckStyle.kt similarity index 63% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/CheckStyle.kt index 9723399..e1e3b28 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/CheckStyle.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,27 +24,23 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.dependency.build /** - * A DSL element of [SpinePublishing] extension which allows enabling publishing - * of [testJar] artifact. + * Dependencies on Checkstyle Java linter. * - * This artifact contains compilation output of `test` source set. By default, it is not published. - * - * Take a look on [SpinePublishing.testJar] for a usage example. - - * @see [registerArtifacts] + * @see Checkstyle + * @see [io.spine.gradle.checkstyle.CheckStyleConfig] */ -class TestJar { - - /** - * Set of modules, for which a test JAR will be published. - */ - var inclusions: Set = emptySet() - +@Suppress("unused", "ConstPropertyName") +object CheckStyle { /** - * Enables test JAR publishing for all published modules. + * The version to be used in the project. + * + * `10.12.1` is the last version in `10.12.0`, which does not introduce + * capability conflict over `google-collections` with Guava. + * + * @see Checkstyle */ - var enabled = false + const val version = "10.12.1" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/CheckerFramework.kt similarity index 70% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/CheckerFramework.kt index 75cc67f..5d2140a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/CheckerFramework.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,21 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build // https://checkerframework.org/ +@Suppress("unused", "ConstPropertyName") object CheckerFramework { - private const val version = "3.21.3" - const val annotations = "org.checkerframework:checker-qual:${version}" + private const val version = "3.40.0" + const val annotations = "org.checkerframework:checker-qual:$version" @Suppress("unused") val dataflow = listOf( - "org.checkerframework:dataflow:${version}", - "org.checkerframework:javacutil:${version}" + "org.checkerframework:dataflow:$version", + "org.checkerframework:javacutil:$version" ) - /** - * This is discontinued artifact, which we do not use directly. - * This is a transitive dependency for us, which we force in - * [DependencyResolution.forceConfiguration] - */ - const val compatQual = "org.checkerframework:checker-compat-qual:2.5.5" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt similarity index 73% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt index 063d0a8..41757db 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build // https://github.com/Kotlin/dokka -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object Dokka { private const val group = "org.jetbrains.dokka" @@ -35,37 +35,37 @@ object Dokka { * When changing the version, also change the version used in the * `buildSrc/build.gradle.kts`. */ - const val version = "1.7.20" + const val version = "1.9.20" object GradlePlugin { const val id = "org.jetbrains.dokka" /** * The version of this plugin is already specified in `buildSrc/build.gradle.kts` - * file. Thus, when applying the plugin in project's build files, only the [id] + * file. Thus, when applying the plugin to project's build files, only the [id] * should be used. */ - const val lib = "${group}:dokka-gradle-plugin:${version}" + const val lib = "$group:dokka-gradle-plugin:$version" } object BasePlugin { - const val lib = "${group}:dokka-base:${version}" + const val lib = "$group:dokka-base:$version" } - const val analysis = "org.jetbrains.dokka:dokka-analysis:${version}" + const val analysis = "org.jetbrains.dokka:dokka-analysis:$version" object CorePlugin { - const val lib = "${group}:dokka-core:${version}" + const val lib = "$group:dokka-core:$version" } /** - * To generate the documentation as seen from Java perspective use this plugin. + * To generate the documentation as seen from the Java perspective, please use this plugin. * * @see * Dokka output formats */ object KotlinAsJavaPlugin { - const val lib = "${group}:kotlin-as-java-plugin:${version}" + const val lib = "$group:kotlin-as-java-plugin:$version" } /** @@ -78,7 +78,7 @@ object Dokka { object SpineExtensions { private const val group = "io.spine.tools" - const val version = "2.0.0-SNAPSHOT.4" - const val lib = "${group}:spine-dokka-extensions:${version}" + const val version = "2.0.0-SNAPSHOT.6" + const val lib = "$group:spine-dokka-extensions:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt similarity index 66% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt index 5131c3e..5b47c1b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,36 +24,39 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build // https://errorprone.info/ -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object ErrorProne { // https://github.com/google/error-prone - private const val version = "2.16" + private const val version = "2.36.0" + + const val group = "com.google.errorprone" + // https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts private const val javacPluginVersion = "9+181-r4173-1" val annotations = listOf( - "com.google.errorprone:error_prone_annotations:${version}", - "com.google.errorprone:error_prone_type_annotations:${version}" + "$group:error_prone_annotations:$version", + "$group:error_prone_type_annotations:$version" ) - const val core = "com.google.errorprone:error_prone_core:${version}" - const val checkApi = "com.google.errorprone:error_prone_check_api:${version}" - const val testHelpers = "com.google.errorprone:error_prone_test_helpers:${version}" - const val javacPlugin = "com.google.errorprone:javac:${javacPluginVersion}" + const val core = "$group:error_prone_core:$version" + const val checkApi = "$group:error_prone_check_api:$version" + const val testHelpers = "$group:error_prone_test_helpers:$version" + const val javacPlugin = "$group:javac:$javacPluginVersion" // https://github.com/tbroyer/gradle-errorprone-plugin/releases object GradlePlugin { const val id = "net.ltgt.errorprone" /** * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. - * Thus, when applying the plugin in projects build files, only the [id] should be used. + * Thus, when applying the plugin to project build files, only the [id] should be used. * - * When the plugin is used as a library (e.g. in tools), its version and the library + * When the plugin is used as a library (e.g., in tools), its version and the library * artifacts are of importance. */ - const val version = "3.0.1" - const val lib = "net.ltgt.gradle:gradle-errorprone-plugin:${version}" + const val version = "4.1.0" + const val lib = "net.ltgt.gradle:gradle-errorprone-plugin:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/FindBugs.kt similarity index 63% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/FindBugs.kt index 52b05f7..98003b9 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/FindBugs.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/FindBugs.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build /** - * The FindBugs project is dead since 2017. It has a successor called SpotBugs, but we don't use it. - * We use ErrorProne for static analysis instead. The only reason for having this dependency is - * the annotations for null-checking introduced by JSR-305. These annotations are troublesome, - * but no alternatives are known for some of them so far. Please see - * [this issue](https://github.com/SpineEventEngine/base/issues/108) for more details. + * The FindBugs project has been dead since 2017. It has a successor called SpotBugs, + * but we don't use it. We use ErrorProne for static analysis instead. + * The only reason for having this dependency is the annotations for null-checking + * introduced by JSR-305. These annotations are troublesome, + * but no alternatives are known for some of them so far. + * Please see [this issue](https://github.com/SpineEventEngine/base/issues/108) for more details. */ +@Suppress("unused", "ConstPropertyName") object FindBugs { private const val version = "3.0.2" - const val annotations = "com.google.code.findbugs:jsr305:${version}" + const val annotations = "com.google.code.findbugs:jsr305:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/GradleDoctor.kt similarity index 87% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/GradleDoctor.kt index ecd685c..89cfb34 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/GradleDoctor.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build /** * Helps optimize Gradle Builds by ensuring recommendations at build time. * * See [plugin site](https://runningcode.github.io/gradle-doctor) for features and usage. */ +@Suppress("unused", "ConstPropertyName") object GradleDoctor { - const val version = "0.8.1" + const val version = "0.10.0" const val pluginId = "com.osacky.doctor" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt new file mode 100644 index 0000000..991c6c3 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2025, 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.dependency.build + +/** + * Kotlin Symbol Processing API. + * + * @see KSP GitHub repository + */ +@Suppress("ConstPropertyName", "unused") +object Ksp { + const val version = "2.1.20-1.0.31" + const val id = "com.google.devtools.ksp" + const val group = "com.google.devtools.ksp" + const val symbolProcessingApi = "$group:symbol-processing-api:$version" + const val symbolProcessing = "$group:symbol-processing:$version" + const val symbolProcessingAaEmb = "$group:symbol-processing-aa-embeddable:$version" + const val symbolProcessingCommonDeps = "$group:symbol-processing-common-deps:$version" + const val gradlePlugin = "$group:symbol-processing-gradle-plugin:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/LicenseReport.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/LicenseReport.kt new file mode 100644 index 0000000..a4eb754 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/LicenseReport.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.build + +// https://github.com/jk1/Gradle-License-Report +@Suppress("unused") +object LicenseReport { + private const val version = "1.16" + const val lib = "com.github.jk1:gradle-license-report:$version" + + object GradlePlugin { + const val version = LicenseReport.version + const val id = "com.github.jk1.dependency-license-report" + const val lib = LicenseReport.lib + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/OsDetector.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/build/OsDetector.kt index 7f4bb16..5b479bf 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/OsDetector.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/OsDetector.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.build +@Suppress("unused", "ConstPropertyName") object OsDetector { // https://github.com/google/osdetector-gradle-plugin - const val version = "1.7.0" + const val version = "1.7.3" const val id = "com.google.osdetector" - const val lib = "com.google.gradle:osdetector-gradle-plugin:${version}" + const val lib = "com.google.gradle:osdetector-gradle-plugin:$version" const val classpath = lib } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Pmd.kt new file mode 100644 index 0000000..e4f7fdd --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Pmd.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2025, 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. + */ + +@file:Suppress("MaxLineLength") + +package io.spine.dependency.build + +// https://github.com/pmd/pmd/releases +@Suppress("unused", "ConstPropertyName") +object Pmd { + /** + * This is the last version in the 6.x series. + * + * There's a major update to 7.x series. + * + * @see Aedile at GitHub */ @Suppress("unused") -object JavaJwt { - private const val version = "3.19.1" - const val lib = "com.auth0:java-jwt:${version}" +object Aedile { + private const val version = "1.3.1" + const val lib = "com.sksamuel.aedile:aedile-core:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/ApacheHttp.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/ApacheHttp.kt index dd518a0..f3eff5e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ApacheHttp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/ApacheHttp.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object ApacheHttp { // https://hc.apache.org/downloads.cgi diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/AppEngine.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/AppEngine.kt index 0d7fee3..b4e7336 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AppEngine.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/AppEngine.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://cloud.google.com/java/docs/reference -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object AppEngine { private const val version = "1.9.82" - const val sdk = "com.google.appengine:appengine-api-1.0-sdk:${version}" + const val sdk = "com.google.appengine:appengine-api-1.0-sdk:$version" object GradlePlugin { private const val version = "2.2.0" - const val lib = "com.google.cloud.tools:appengine-gradle-plugin:${version}" + const val lib = "com.google.cloud.tools:appengine-gradle-plugin:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Asm.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Asm.kt new file mode 100644 index 0000000..0a388c9 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Asm.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2025, 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.dependency.lib + +// https://asm.ow2.io/ +@Suppress("unused", "ConstPropertyName") +object Asm { + private const val version = "9.6" + const val group = "org.ow2.asm" + const val lib = "$group:asm:$version" + + // We use the following artifacts only to force the versions + // of the dependencies which are transitive for us. + // + const val tree = "$group:asm-tree:$version" + const val analysis = "$group:asm-analysis:$version" + const val util = "$group:asm-util:$version" + const val commons = "$group:asm-commons:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt new file mode 100644 index 0000000..6c222b9 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt @@ -0,0 +1,55 @@ +/* + * Copyright 2025, 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. + */ + +@file:Suppress("unused", "ConstPropertyName") + +package io.spine.dependency.lib + +// https://github.com/google/auto +object AutoCommon { + private const val version = "1.2.2" + const val lib = "com.google.auto:auto-common:$version" +} + +// https://github.com/google/auto +object AutoService { + private const val version = "1.1.1" + const val annotations = "com.google.auto.service:auto-service-annotations:$version" + @Suppress("unused") + const val processor = "com.google.auto.service:auto-service:$version" +} + +// https://github.com/google/auto +object AutoValue { + private const val version = "1.10.2" + const val annotations = "com.google.auto.value:auto-value-annotations:$version" +} + +// https://github.com/ZacSweers/auto-service-ksp +object AutoServiceKsp { + private const val version = "1.2.0" + const val processor = "dev.zacsweers.autoservice:auto-service-ksp:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/BouncyCastle.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/BouncyCastle.kt index c0567ed..5289d0c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/BouncyCastle.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://www.bouncycastle.org/java.html -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object BouncyCastle { const val libPkcsJdk15 = "org.bouncycastle:bcpkix-jdk15on:1.68" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Caffeine.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Caffeine.kt new file mode 100644 index 0000000..9b0c7c1 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Caffeine.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * A [high performance](https://github.com/ben-manes/caffeine/wiki/Benchmarks), + * [near optimal](https://github.com/ben-manes/caffeine/wiki/Efficiency) caching library. + * + * This library is a transitive dependency for us via ErrorProne. + * + * @see Caffeine at GitHub + */ +@Suppress("unused") +object Caffeine { + private const val version = "3.0.5" + const val lib = "com.github.ben-manes.caffeine:caffeine:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Clikt.kt similarity index 80% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Clikt.kt index c05d2fb..3da42ce 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Clikt.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -// https://checkstyle.sourceforge.io/ -// See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. +// https://ajalt.github.io/clikt/ @Suppress("unused") -object CheckStyle { - const val version = "10.3.4" +object Clikt { + private const val version = "3.5.2" + const val lib = "com.github.ajalt.clikt:clikt:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCli.kt similarity index 83% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCli.kt index 79a4036..6063278 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCli.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * Commons CLI is a transitive dependency which we don't use directly. - * We `force` it in [DependencyResolution.forceConfiguration]. + * We `force` it in [forceVersions]. * * [Commons CLI](https://commons.apache.org/proper/commons-cli/) */ +@Suppress("unused", "ConstPropertyName") object CommonsCli { private const val version = "1.5.0" - const val lib = "commons-cli:commons-cli:${version}" + const val lib = "commons-cli:commons-cli:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCodec.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCodec.kt index 97dbed8..270b704 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCodec.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCodec.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://commons.apache.org/proper/commons-codec/changes-report.html -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object CommonsCodec { - private const val version = "1.15" + private const val version = "1.16.0" const val lib = "commons-codec:commons-codec:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsLogging.kt similarity index 80% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsLogging.kt index e9d148f..9f1139c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsLogging.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsLogging.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * [Commons Logging](https://commons.apache.org/proper/commons-logging/) is a transitive - * dependency which we don't use directly. This object is used for forcing the version. + * dependency, which we don't use directly. This object is used for forcing the version. */ +@Suppress("unused", "ConstPropertyName") object CommonsLogging { // https://commons.apache.org/proper/commons-logging/ private const val version = "1.2" - const val lib = "commons-logging:commons-logging:${version}" + const val lib = "commons-logging:commons-logging:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Coroutines.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Coroutines.kt new file mode 100644 index 0000000..07c43f0 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Coroutines.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * Kotlin Coroutines. + * + * @see GitHub projecet + */ +@Suppress("unused") +object Coroutines { + const val group = "org.jetbrains.kotlinx" + const val version = "1.10.1" + const val bom = "$group:kotlinx-coroutines-bom:$version" + const val core = "$group:kotlinx-coroutines-core:$version" + const val coreJvm = "$group:kotlinx-coroutines-core-jvm:$version" + const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version" + const val debug = "$group:kotlinx-coroutines-debug:$version" + const val test = "$group:kotlinx-coroutines-test:$version" + const val testJvm = "$group:kotlinx-coroutines-test-jvm:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Firebase.kt similarity index 83% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Firebase.kt index 5e471ca..1d798ee 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Firebase.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Firebase.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://firebase.google.com/docs/admin/setup#java -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object Firebase { private const val adminVersion = "8.1.0" - const val admin = "com.google.firebase:firebase-admin:${adminVersion}" + const val admin = "com.google.firebase:firebase-admin:$adminVersion" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Flogger.kt similarity index 70% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Flogger.kt index 4332178..769c905 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Flogger.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Flogger.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/google/flogger +@Deprecated("Please use Spine Logging library instead.") +@Suppress("unused", "ConstPropertyName") object Flogger { internal const val version = "0.7.4" - const val lib = "com.google.flogger:flogger:${version}" - @Suppress("unused") + const val lib = "com.google.flogger:flogger:$version" + object Runtime { - const val systemBackend = "com.google.flogger:flogger-system-backend:${version}" - const val log4J = "com.google.flogger:flogger-log4j:${version}" - const val slf4J = "com.google.flogger:slf4j-backend-factory:${version}" + const val systemBackend = "com.google.flogger:flogger-system-backend:$version" + const val log4j2Backend = "com.google.flogger:flogger-log4j2-backend:$version" + const val slf4JBackend = "com.google.flogger:flogger-slf4j-backend:$version" + const val grpcContext = "com.google.flogger:flogger-grpc-context:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleApis.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleApis.kt index af663dc..7fd3340 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleApis.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleApis.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * Provides dependencies on [GoogleApis projects](https://github.com/googleapis/). */ -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object GoogleApis { // https://github.com/googleapis/google-api-java-client @@ -53,7 +53,7 @@ object GoogleApis { // https://github.com/googleapis/google-auth-library-java object AuthLibrary { const val version = "1.3.0" - const val credentials = "com.google.auth:google-auth-library-credentials:${version}" - const val oAuth2Http = "com.google.auth:google-auth-library-oauth2-http:${version}" + const val credentials = "com.google.auth:google-auth-library-credentials:$version" + const val oAuth2Http = "com.google.auth:google-auth-library-oauth2-http:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleCloud.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleCloud.kt index a764af2..b755168 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GoogleCloud.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GoogleCloud.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object GoogleCloud { // https://github.com/googleapis/java-core diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Grpc.kt similarity index 54% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Grpc.kt index 9544d45..011b4d2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Grpc.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,22 +24,28 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/grpc/grpc-java -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object Grpc { @Suppress("MemberVisibilityCanBePrivate") - const val version = "1.46.0" - const val api = "io.grpc:grpc-api:${version}" - const val auth = "io.grpc:grpc-auth:${version}" - const val core = "io.grpc:grpc-core:${version}" - const val context = "io.grpc:grpc-context:${version}" - const val stub = "io.grpc:grpc-stub:${version}" - const val okHttp = "io.grpc:grpc-okhttp:${version}" - const val protobuf = "io.grpc:grpc-protobuf:${version}" - const val protobufLite = "io.grpc:grpc-protobuf-lite:${version}" - const val protobufPlugin = "io.grpc:protoc-gen-grpc-java:${version}" - const val netty = "io.grpc:grpc-netty:${version}" - const val nettyShaded = "io.grpc:grpc-netty-shaded:${version}" + const val version = "1.59.0" + const val group = "io.grpc" + const val api = "$group:grpc-api:$version" + const val auth = "$group:grpc-auth:$version" + const val core = "$group:grpc-core:$version" + const val context = "$group:grpc-context:$version" + const val inProcess = "$group:grpc-inprocess:$version" + const val stub = "$group:grpc-stub:$version" + const val okHttp = "$group:grpc-okhttp:$version" + const val protobuf = "$group:grpc-protobuf:$version" + const val protobufLite = "$group:grpc-protobuf-lite:$version" + const val netty = "$group:grpc-netty:$version" + const val nettyShaded = "$group:grpc-netty-shaded:$version" + + object ProtocPlugin { + const val id = "grpc" + const val artifact = "$group:protoc-gen-grpc-java:$version" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/GrpcKotlin.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GrpcKotlin.kt new file mode 100644 index 0000000..e695f6f --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/GrpcKotlin.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * gRPC-Kotlin/JVM. + * + * @see GitHub project + */ +@Suppress("unused") +object GrpcKotlin { + const val version = "1.3.0" + const val stub = "io.grpc:grpc-kotlin-stub:$version" + + object ProtocPlugin { + const val id = "grpckt" + const val artifact = "io.grpc:protoc-gen-grpc-kotlin:$version:jdk8@jar" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Gson.kt similarity index 79% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Gson.kt index e161ee1..229c434 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Gson.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** - * Gson is a transitive dependency which we don't use directly. + * Gson is a transitive dependency, which we don't use directly. * We `force` it in [DependencyResolution.forceConfiguration()]. * * [Gson](https://github.com/google/gson) */ +@Suppress("unused", "ConstPropertyName") object Gson { - private const val version = "2.9.0" - const val lib = "com.google.code.gson:gson:${version}" + private const val version = "2.10.1" + const val lib = "com.google.code.gson:gson:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Guava.kt similarity index 77% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Guava.kt index faaf3b8..5ea5fcc 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Guava.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * The dependencies for Guava. @@ -32,10 +32,13 @@ package io.spine.internal.dependency * When changing the version, also change the version used in the `build.gradle.kts`. We need * to synchronize the version used in `buildSrc` and in Spine modules. Otherwise, when testing * Gradle plugins, errors may occur due to version clashes. + * + * @see Guava at GitHub. */ -// https://github.com/google/guava +@Suppress("unused", "ConstPropertyName") object Guava { - private const val version = "31.1-jre" - const val lib = "com.google.guava:guava:${version}" - const val testLib = "com.google.guava:guava-testlib:${version}" + private const val version = "32.1.3-jre" + const val group = "com.google.guava" + const val lib = "$group:guava:$version" + const val testLib = "$group:guava-testlib:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/HttpClient.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/HttpClient.kt index 849f1f4..526f05f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/HttpClient.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,19 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * Google implementations of [HTTP client](https://github.com/googleapis/google-http-java-client). */ -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object HttpClient { // https://github.com/googleapis/google-http-java-client - const val version = "1.41.5" - const val google = "com.google.http-client:google-http-client:${version}" - const val jackson2 = "com.google.http-client:google-http-client-jackson2:${version}" - const val gson = "com.google.http-client:google-http-client-gson:${version}" - const val apache2 = "com.google.http-client:google-http-client-apache-v2:${version}" + const val version = "1.43.3" + const val google = "com.google.http-client:google-http-client:$version" + const val jackson2 = "com.google.http-client:google-http-client-jackson2:$version" + const val gson = "com.google.http-client:google-http-client-gson:$version" + const val apache2 = "com.google.http-client:google-http-client-apache-v2:$version" const val apache = "com.google.http-client:google-http-client-apache:2.1.2" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/IntelliJ.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/IntelliJ.kt new file mode 100644 index 0000000..7f9232b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/IntelliJ.kt @@ -0,0 +1,89 @@ +/* + * Copyright 2025, 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. + */ + +@file:Suppress("ConstPropertyName") + +package io.spine.dependency.lib + +/** + * The components of the IntelliJ Platform. + * + * Make sure to add the `intellijReleases` and `jetBrainsCacheRedirector` + * repositories to your project. See `kotlin/Repositories.kt` for details. + */ +@Suppress("unused") +object IntelliJ { + + /** + * The version of the IntelliJ platform. + * + * This is the version used by Kotlin compiler `1.9.21`. + * Advance this version with caution because it may break the setup of + * IntelliJ platform standalone execution. + */ + const val version = "213.7172.53" + + object Platform { + private const val group = "com.jetbrains.intellij.platform" + const val core = "$group:core:$version" + const val util = "$group:util:$version" + const val coreImpl = "$group:core-impl:$version" + const val codeStyle = "$group:code-style:$version" + const val codeStyleImpl = "$group:code-style-impl:$version" + const val projectModel = "$group:project-model:$version" + const val projectModelImpl = "$group:project-model-impl:$version" + const val lang = "$group:lang:$version" + const val langImpl = "$group:lang-impl:$version" + const val ideImpl = "$group:ide-impl:$version" + const val ideCoreImpl = "$group:ide-core-impl:$version" + const val analysisImpl = "$group:analysis-impl:$version" + const val indexingImpl = "$group:indexing-impl:$version" + } + + object Jsp { + private const val group = "com.jetbrains.intellij.jsp" + @Suppress("MemberNameEqualsClassName") + const val jsp = "$group:jsp:$version" + } + + object Xml { + private const val group = "com.jetbrains.intellij.xml" + const val xmlPsiImpl = "$group:xml-psi-impl:$version" + } + + object JavaPsi { + private const val group = "com.jetbrains.intellij.java" + const val api = "$group:java-psi:$version" + const val impl = "$group:java-psi-impl:$version" + } + + object Java { + private const val group = "com.jetbrains.intellij.java" + @Suppress("MemberNameEqualsClassName") + const val java = "$group:java:$version" + const val impl = "$group:java-impl:$version" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/J2ObjC.kt similarity index 66% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/J2ObjC.kt index 9ed18f2..3098466 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/J2ObjC.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/J2ObjC.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,18 +24,28 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** - * [J2ObjC](https://developers.google.com/j2objc) is a transitive dependency + * [J2ObjC](https://developers.google.com/j2objc) is a transitive dependency, * which we don't use directly. This object is used for forcing the version. */ +@Suppress("unused", "ConstPropertyName") object J2ObjC { - // https://github.com/google/j2objc/releases - // `1.3.` is the latest version available from Maven Central. - // https://search.maven.org/artifact/com.google.j2objc/j2objc-annotations - private const val version = "1.3" - const val annotations = "com.google.j2objc:j2objc-annotations:${version}" + /** + * See [J2ObjC releases](https://github.com/google/j2objc/releases). + * + * `1.3` was the latest version available from Maven Central. + * Now `2.8` is the latest version available. + * As [HttpClient] + * [migrated](https://github.com/googleapis/google-http-java-client/releases/tag/v1.43.3) to v2, + * we set the latest v2 version as well. + * + * @see + * J2ObjC on Maven Central + */ + private const val version = "2.8" + const val annotations = "com.google.j2objc:j2objc-annotations:$version" @Deprecated("Please use `annotations` instead.", ReplaceWith("annotations")) const val lib = annotations } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt similarity index 69% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt index 2ed3df8..4b78c8f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,32 +24,40 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -@Suppress("unused") +// https://github.com/FasterXML/jackson/wiki/Jackson-Releases +@Suppress("unused", "ConstPropertyName") object Jackson { - const val version = "2.13.4" - private const val databindVersion = "2.13.4.2" + const val version = "2.15.3" + private const val databindVersion = "2.15.3" private const val coreGroup = "com.fasterxml.jackson.core" private const val dataformatGroup = "com.fasterxml.jackson.dataformat" private const val moduleGroup = "com.fasterxml.jackson.module" // https://github.com/FasterXML/jackson-core - const val core = "$coreGroup:jackson-core:${version}" + const val core = "$coreGroup:jackson-core:$version" // https://github.com/FasterXML/jackson-databind - const val databind = "$coreGroup:jackson-databind:${databindVersion}" + const val databind = "$coreGroup:jackson-databind:$databindVersion" // https://github.com/FasterXML/jackson-annotations - const val annotations = "$coreGroup:jackson-annotations:${version}" + const val annotations = "$coreGroup:jackson-annotations:$version" // https://github.com/FasterXML/jackson-dataformat-xml/releases - const val dataformatXml = "$dataformatGroup:jackson-dataformat-xml:${version}" + const val dataformatXml = "$dataformatGroup:jackson-dataformat-xml:$version" // https://github.com/FasterXML/jackson-dataformats-text/releases - const val dataformatYaml = "$dataformatGroup:jackson-dataformat-yaml:${version}" + const val dataformatYaml = "$dataformatGroup:jackson-dataformat-yaml:$version" // https://github.com/FasterXML/jackson-module-kotlin/releases - const val moduleKotlin = "$moduleGroup:jackson-module-kotlin:${version}" + const val moduleKotlin = "$moduleGroup:jackson-module-kotlin:$version" // https://github.com/FasterXML/jackson-bom - const val bom = "com.fasterxml.jackson:jackson-bom:${version}" + const val bom = "com.fasterxml.jackson:jackson-bom:$version" + + // https://github.com/FasterXML/jackson-jr + object Junior { + const val version = Jackson.version + const val group = "com.fasterxml.jackson.jr" + const val objects = "$group:jackson-jr-objects:$version" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaDiffUtils.kt similarity index 66% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaDiffUtils.kt index 1ddd1fb..7cc2e59 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaDiffUtils.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,20 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.dependency.lib /** - * A DSL element of [SpinePublishing] extension which configures publishing of [dokkaJar] artifact. + * The dependency on the `java-diff-utils` library, which is transitive for us at the time + * of writing. * - * This artifact contains Dokka-generated documentation. By default, it is not published. - * - * Take a look at the [SpinePublishing.dokkaJar] for a usage example. - * - * @see [registerArtifacts] + * It might become our dependency as a part of + * the [Spine Text](https://github.com/SpineEventEngine/text) library. */ -class DokkaJar { - /** - * Enables publishing `JAR`s with Dokka-generated documentation for all published modules. - */ - var enabled = false +@Suppress("unused", "ConstPropertyName") +object JavaDiffUtils { + + // https://github.com/java-diff-utils/java-diff-utils/releases + private const val version = "4.12" + const val lib = "io.github.java-diff-utils:java-diff-utils:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaJwt.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaJwt.kt new file mode 100644 index 0000000..4d9b1df --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaJwt.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * A Java implementation of JSON Web Token (JWT) - RFC 7519. + * + * [Java JWT](https://github.com/auth0/java-jwt) + */ +@Suppress("unused", "ConstPropertyName") +object JavaJwt { + + /** + * The last version in the v3.x.x series. + * + * There's a v4.x.x series (e.g., https://github.com/auth0/java-jwt/releases/tag/4.4.0), but + * it introduces breaking changes. Consider upgrading to it when we're ready to migrate. + */ + private const val version = "3.19.4" + + const val lib = "com.auth0:java-jwt:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaPoet.kt similarity index 79% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaPoet.kt index e9bdb9b..b99e503 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaPoet.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/square/javapoet -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object JavaPoet { private const val version = "1.13.0" - const val lib = "com.squareup:javapoet:${version}" + const val group = "com.squareup" + const val artifact = "javapoet" + const val module = "$group:$artifact" + const val lib = "$module:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaX.kt similarity index 77% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaX.kt index 9fb7bd5..7ea8cdf 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaX.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaX.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,13 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object JavaX { - // This artifact which used to be a part of J2EE moved under Eclipse EE4J project. + // This artifact, which used to be a part of J2EE, moved under the Eclipse EE4J project. // https://github.com/eclipse-ee4j/common-annotations-api - const val annotations = "javax.annotation:javax.annotation-api:1.3.2" + const val annotationGroup = "javax.annotation" + const val annotations = "$annotationGroup:javax.annotation-api:1.3.2" const val servletApi = "javax.servlet:javax.servlet-api:3.1.0" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Klaxon.kt similarity index 83% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Klaxon.kt index 160fdbf..69089c6 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Klaxon.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** - * A JSON parser in Kotlin + * A JSON parser in Kotlin. * * [Klaxon](https://github.com/cbeust/klaxon) */ +@Suppress("unused", "ConstPropertyName") object Klaxon { private const val version = "5.6" - const val lib = "com.beust:klaxon:${version}" + const val lib = "com.beust:klaxon:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt new file mode 100644 index 0000000..ba24aaa --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt @@ -0,0 +1,90 @@ +/* + * Copyright 2025, 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.dependency.lib + +// https://github.com/JetBrains/kotlin +// https://github.com/Kotlin +@Suppress("unused", "ConstPropertyName") +object Kotlin { + + /** + * This is the version of Kotlin we use for writing code which does not + * depend on Gradle and the version of embedded Kotlin. + */ + @Suppress("MemberVisibilityCanBePrivate") // used directly from the outside. + const val runtimeVersion = "2.1.20" + + /** + * This is the version of + * [Kotlin embedded into Gradle](https://docs.gradle.org/current/userguide/compatibility.html#kotlin). + */ + const val embeddedVersion = "2.0.21" + + /** + * The version of the JetBrains annotations library, which is a transitive + * dependency for us via Kotlin libraries. + * + * @see Java Annotations + */ + private const val annotationsVersion = "26.0.2" + + private const val group = "org.jetbrains.kotlin" + + const val scriptRuntime = "$group:kotlin-script-runtime:$runtimeVersion" + const val stdLib = "$group:kotlin-stdlib:$runtimeVersion" + const val stdLibCommon = "$group:kotlin-stdlib-common:$runtimeVersion" + + const val toolingCore = "$group:kotlin-tooling-core:$runtimeVersion" + + @Deprecated("Please use `stdLib` instead.") + const val stdLibJdk7 = "$group:kotlin-stdlib-jdk7:$runtimeVersion" + + @Deprecated("Please use `stdLib` instead.") + const val stdLibJdk8 = "$group:kotlin-stdlib-jdk8:$runtimeVersion" + + const val reflect = "$group:kotlin-reflect:$runtimeVersion" + const val testJUnit5 = "$group:kotlin-test-junit5:$runtimeVersion" + + @Deprecated(message = "Please use `GradlePlugin.api` instead.", ReplaceWith("GradlePlugin.api")) + const val gradlePluginApi = "$group:kotlin-gradle-plugin-api:$runtimeVersion" + + @Deprecated(message = "Please use `GradlePlugin.lib` instead.", ReplaceWith("GradlePlugin.lib")) + const val gradlePluginLib = "$group:kotlin-gradle-plugin:$runtimeVersion" + + const val jetbrainsAnnotations = "org.jetbrains:annotations:$annotationsVersion" + + object Compiler { + const val embeddable = "$group:kotlin-compiler-embeddable:$runtimeVersion" + } + + object GradlePlugin { + const val version = runtimeVersion + const val api = "$group:kotlin-gradle-plugin-api:$version" + const val lib = "$group:kotlin-gradle-plugin:$version" + const val model = "$group:kotlin-gradle-model:$version" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt similarity index 75% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt index 5b630bf..346c5d8 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoValue.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -// https://github.com/google/auto -object AutoValue { - private const val version = "1.9" - const val annotations = "com.google.auto.value:auto-value-annotations:${version}" +// https://github.com/square/kotlinpoet +@Suppress("unused", "ConstPropertyName") +object KotlinPoet { + private const val version = "2.0.0" + const val lib = "com.squareup:kotlinpoet:$version" + const val ksp = "com.squareup:kotlinpoet-ksp:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinSemver.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinSemver.kt index 47fd7de..1525360 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinSemver.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/z4kn4fein/kotlin-semver -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object KotlinSemver { - private const val version = "1.2.1" + private const val version = "1.4.2" const val lib = "io.github.z4kn4fein:semver:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt new file mode 100644 index 0000000..fc909af --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2025, 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.dependency.lib + +@Suppress("unused", "ConstPropertyName") +object KotlinX { + + const val group = "org.jetbrains.kotlinx" + + @Deprecated( + message = "Pleaser use top level object `Coroutines` instead.", + ReplaceWith("Coroutines") + ) + object Coroutines { + + // https://github.com/Kotlin/kotlinx.coroutines + const val version = "1.10.1" + const val bom = "$group:kotlinx-coroutines-bom:$version" + const val core = "$group:kotlinx-coroutines-core:$version" + const val coreJvm = "$group:kotlinx-coroutines-core-jvm:$version" + const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version" + const val test = "$group:kotlinx-coroutines-test:$version" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt new file mode 100644 index 0000000..d4f2bd2 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * An open-source logging framework. + * + * Spine uses its own [logging library][io.spine.dependency.local.Logging], but also + * provides a backend implementation for [Log4j2]. This is why + * this dependency is needed. + * + * @see Log4j2 releases at GitHub + */ +@Suppress("unused", "ConstPropertyName") +object Log4j2 { + private const val version = "2.20.0" + const val core = "org.apache.logging.log4j:log4j-core:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Netty.kt similarity index 67% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Netty.kt index dfcd80e..c317bb3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Netty.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Netty.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object Netty { - // https://github.com/netty/netty/releases - private const val version = "4.1.72.Final" - const val common = "io.netty:netty-common:${version}" - const val buffer = "io.netty:netty-buffer:${version}" - const val transport = "io.netty:netty-transport:${version}" - const val handler = "io.netty:netty-handler:${version}" - const val codecHttp = "io.netty:netty-codec-http:${version}" + // https://github.com/netty/netty/tags + private const val version = "4.1.100.Final" + const val common = "io.netty:netty-common:$version" + const val buffer = "io.netty:netty-buffer:$version" + const val transport = "io.netty:netty-transport:$version" + const val handler = "io.netty:netty-handler:$version" + const val codecHttp = "io.netty:netty-codec-http:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Okio.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Okio.kt new file mode 100644 index 0000000..3107d76 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Okio.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2025, 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.dependency.lib + +/** + * Okio is a transitive dependency, which we don't use directly. + * + * https://github.com/square/okio/tags + */ +@Suppress("unused", "ConstPropertyName") +object Okio { + private const val version = "3.6.0" + const val lib = "com.squareup.okio:okio:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Plexus.kt similarity index 62% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Plexus.kt index b9ffb59..e393906 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Plexus.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,28 +24,25 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +@file:Suppress("MaxLineLength") + +package io.spine.dependency.lib /** - * A DSL element of [SpinePublishing] extension which allows disabling publishing - * of [protoJar] artifact. - * - * This artifact contains all the `.proto` definitions from `sourceSets.main.proto`. By default, - * it is published. - * - * Take a look on [SpinePublishing.protoJar] for a usage example. + * Plexus Utils is a transitive dependency, which we don't use directly. * - * @see [registerArtifacts] + * [Plexus Utils](https://github.com/codehaus-plexus/plexus-utils) */ -class ProtoJar { - - /** - * Set of modules, for which a proto JAR will not be published. - */ - var exclusions: Set = emptySet() +@Suppress("unused", "ConstPropertyName") +object Plexus { /** - * Disables proto JAR publishing for all published modules. + * This is the last version in the 3.x series. + * + * There's a major update to 4.x. + * + * @see plexus-utils-4.0.0 */ - var disabled = false + private const val version = "4.0.0" + const val utils = "org.codehaus.plexus:plexus-utils:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt similarity index 61% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt index bac3dc9..98ce188 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,30 +24,48 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/protocolbuffers/protobuf -@Suppress("MemberVisibilityCanBePrivate") // used directly from outside +@Suppress( + "MemberVisibilityCanBePrivate" /* used directly from the outside */, + "ConstPropertyName" /* https://bit.ly/kotlin-prop-names */ +) object Protobuf { - private const val group = "com.google.protobuf" - const val version = "3.19.6" + const val group = "com.google.protobuf" + const val version = "3.25.1" + + /** + * The Java library with Protobuf data types. + */ + const val javaLib = "$group:protobuf-java:$version" + + /** + * The Java library containing proto definitions of Google Protobuf types. + */ + @Suppress("unused") + const val protoSrcLib = javaLib + + /** + * All Java and Kotlin libraries we depend on. + */ val libs = listOf( - "${group}:protobuf-java:${version}", - "${group}:protobuf-java-util:${version}", - "${group}:protobuf-kotlin:${version}" + javaLib, + "$group:protobuf-java-util:$version", + "$group:protobuf-kotlin:$version" ) - const val compiler = "${group}:protoc:${version}" + const val compiler = "$group:protoc:$version" // https://github.com/google/protobuf-gradle-plugin/releases object GradlePlugin { /** * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. - * Thus, when applying the plugin in projects build files, only the [id] should be used. + * Thus, when applying the plugin to projects build files, only the [id] should be used. * * When changing the version, also change the version used in the `build.gradle.kts`. */ - const val version = "0.8.19" + const val version = "0.9.4" const val id = "com.google.protobuf" - const val lib = "${group}:protobuf-gradle-plugin:${version}" + const val lib = "$group:protobuf-gradle-plugin:$version" } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Roaster.kt similarity index 65% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Roaster.kt index 2d23706..e55420e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Roaster.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,21 +24,22 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib // https://github.com/forge/roaster -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object Roaster { /** - * Do not advance this version further because it would break compatibility with Java 8 - * projects. Starting from the following version Roaster has a shaded version of Eclipse JFace - * built with Java 11. + * This is the last version build with Java 11. * - * Please see [this issue][https://github.com/SpineEventEngine/config/issues/220] for details. + * Starting from the version + * [2.29.0.Final](https://github.com/forge/roaster/releases/tag/2.29.0.Final), + * Roaster requires Java 17. */ - private const val version = "2.24.0.Final" + private const val version = "2.28.0.Final" - const val api = "org.jboss.forge.roaster:roaster-api:${version}" - const val jdt = "org.jboss.forge.roaster:roaster-jdt:${version}" + const val group = "org.jboss.forge.roaster" + const val api = "$group:roaster-api:$version" + const val jdt = "$group:roaster-jdt:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Slf4J.kt similarity index 66% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/lib/Slf4J.kt index 4cfa049..bd5b9df 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Slf4J.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Slf4J.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,18 +24,24 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.lib /** * Spine used to log with SLF4J. Now we use Flogger. Whenever a choice comes up, we recommend to * use the latter. * - * Some third-party libraries may clash with different versions of the library. Thus, we specify - * this version and force it via [forceConfiguration(..)][DependencyResolution.forceConfiguration]. + * The primary purpose of having this dependency object is working in combination with + * [Flogger.Runtime.slf4JBackend]. + * + * Some third-party libraries may clash with different versions of the library. + * Thus, we specify this version and force it via [forceVersions]. + * Please see `DependencyResolution.kt` for details. */ -@Deprecated("Use Flogger over SLF4J.", replaceWith = ReplaceWith("flogger")) +@Suppress("unused", "ConstPropertyName") object Slf4J { - private const val version = "1.7.30" - const val lib = "org.slf4j:slf4j-api:${version}" - const val jdk14 = "org.slf4j:slf4j-jdk14:${version}" + private const val version = "2.0.7" + const val lib = "org.slf4j:slf4j-api:$version" + const val jdk14 = "org.slf4j:slf4j-jdk14:$version" + const val reload4j = "org.slf4j:slf4j-reload4j:$version" + const val simple = "org.slf4j:slf4j-simple:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt new file mode 100644 index 0000000..77497b2 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt @@ -0,0 +1,137 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Versions for published Spine SDK artifacts. + */ +@Suppress("ConstPropertyName") +object ArtifactVersion { + + /** + * The version of [Spine.base]. + * + * @see spine-base + */ + @Deprecated(message = "Please use `Base.version`.", ReplaceWith("Base.version")) + const val base = Base.version + + @Suppress("unused") + @Deprecated( + message = "Please use `Base.versionForBuildScript`.", + ReplaceWith("Base.versionForBuildScript") + ) + const val baseForBuildScript = Base.versionForBuildScript + + /** + * The version of [Spine.reflect]. + * + * @see spine-reflect + */ + @Deprecated(message = "Please use `Reflect.version`.", ReplaceWith("Reflect.version")) + const val reflect = Reflect.version + + /** + * 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 + */ + @Deprecated(message = "Please use `TestLib.version`.", ReplaceWith("TestLib.version")) + const val testlib = TestLib.version + + /** + * 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 + */ + @Suppress("unused") + @Deprecated( + message = "Please use `ModelCompiler.version` instead.", + ReplaceWith("ModelCompiler.version") + ) + const val mc = ModelCompiler.version + + /** + * The version of [Spine.baseTypes]. + * + * @see spine-base-types + */ + @Deprecated(message = "Please use `BaseTypes.version`.", ReplaceWith("BaseTypes.version")) + const val baseTypes = BaseTypes.version + + /** + * The version of [Spine.time]. + * + * @see spine-time + */ + @Deprecated(message = "Please use `Time.version`.", ReplaceWith("Time.version")) + const val time = Time.version + + /** + * The version of [Spine.change]. + * + * @see spine-change + */ + @Deprecated(message = "Please use `Change.version`.", ReplaceWith("Change.version")) + const val change = Change.version + + /** + * The version of [Spine.text]. + * + * @see spine-text + */ + @Deprecated(message = "Please use `Text.version`.", ReplaceWith("Text.version")) + const val text = Text.version + + /** + * The version of [Spine.toolBase]. + * + * @see spine-tool-base + */ + @Suppress("unused") + @Deprecated(message = "Please use `ToolBase.version`.", ReplaceWith("ToolBase.version")) + 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/dependency/local/Base.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt new file mode 100644 index 0000000..8a8e0fb --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Base module. + * + * @see spine-base + */ +@Suppress("ConstPropertyName") +object Base { + const val version = "2.0.0-SNAPSHOT.307" + const val versionForBuildScript = "2.0.0-SNAPSHOT.307" + const val group = Spine.group + const val artifact = "spine-base" + const val lib = "$group:$artifact:$version" + const val libForBuildScript = "$group:$artifact:$versionForBuildScript" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt new file mode 100644 index 0000000..988cab3 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Base module. + * + * @see spine-base-types + */ +@Suppress("ConstPropertyName") +object BaseTypes { + const val version = "2.0.0-SNAPSHOT.126" + const val group = Spine.group + const val artifact = "spine-base-types" + const val lib = "$group:$artifact:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Change.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Change.kt new file mode 100644 index 0000000..a5728f7 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Change.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Reflect library. + * + * @see spine-change + */ +@Suppress("ConstPropertyName") +object Change { + const val version = "2.0.0-SNAPSHOT.118" + const val group = Spine.group + const val artifact = "spine-change" + const val lib = "$group:$artifact:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt new file mode 100644 index 0000000..af124e6 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * 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.206" + + const val coreArtifact = "spine-core" + const val clientArtifact = "spine-client" + const val serverArtifact = "spine-server" + + const val core = "$group:$coreArtifact:$version" + const val client = "$group:$clientArtifact:$version" + const val server = "$group:$serverArtifact:$version" + + const val testUtilServer = "${Spine.toolsGroup}:spine-testutil-server:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt new file mode 100644 index 0000000..b1a00ab --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt @@ -0,0 +1,57 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Dependencies on the artifacts of the Spine Logging library. + * + * @see spine-logging + */ +@Suppress("ConstPropertyName", "unused") +object Logging { + const val version = "2.0.0-SNAPSHOT.242" + const val group = Spine.group + + const val loggingArtifact = "spine-logging" + + const val lib = "$group:$loggingArtifact:$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" + + const val testLib = "${Spine.toolsGroup}:spine-logging-testlib:$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" + 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/dependency/local/McJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt new file mode 100644 index 0000000..30fabf8 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt @@ -0,0 +1,79 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * 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.306" + + /** + * The version to be used for integration tests. + */ + const val version = "2.0.0-SNAPSHOT.306" + + /** + * 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/dependency/local/ModelCompiler.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ModelCompiler.kt new file mode 100644 index 0000000..5f9e541 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ModelCompiler.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Model Compiler Gradle API. + * + * @see spine-model-compiler + */ +@Suppress("ConstPropertyName") +object ModelCompiler { + const val version = "2.0.0-SNAPSHOT.133" + const val group = Spine.toolsGroup + const val artifact = "spine-model-compiler" + const val lib = "$group:$artifact:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt new file mode 100644 index 0000000..6d106f2 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -0,0 +1,179 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * 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.93.5" + + /** + * 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.93.5" + + /** + * 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 params + get() = "$group:protodata-params:$version" + + val protocPlugin + get() = "$group:protodata-protoc:$version" + + val gradleApi + get() = "$group:protodata-gradle-api:$version" + + val cliApi + get() = "$group:protodata-cli-api:$version" + + val javaModule = "$group:protodata-java" + + fun java(version: String): String = + "$javaModule:$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/dependency/local/ProtoTap.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt new file mode 100644 index 0000000..c811e58 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * 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.9.1" + 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/Plexus.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Reflect.kt similarity index 71% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/local/Reflect.kt index 27d2720..fbf37f1 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Plexus.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Reflect.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.local /** - * Plexus Utils is a transitive dependency which we don't use directly. - * We `force` it in [DependencyResolution.forceConfiguration]. + * Spine Reflect library. * - * [Plexus Utils](https://codehaus-plexus.github.io/plexus-utils/) + * @see spine-reflect */ -object Plexus { - private const val version = "3.4.0" - const val utils = "org.codehaus.plexus:plexus-utils:${version}" +@Suppress("ConstPropertyName") +object Reflect { + const val version = "2.0.0-SNAPSHOT.191" + const val group = Spine.group + const val artifact = "spine-reflect" + const val lib = "$group:$artifact:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt new file mode 100644 index 0000000..d7b6d0c --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt @@ -0,0 +1,117 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Dependencies on smaller Spine modules. + */ +@Suppress("unused", "ConstPropertyName") +object Spine { + + const val group = "io.spine" + const val toolsGroup = "io.spine.tools" + + @Deprecated(message = "Please use `Base.lib`.", ReplaceWith("Base.lib")) + const val base = Base.lib + + @Deprecated( + message = "Please use `Base.libForBuildScript`.", + ReplaceWith("Base.libForBuildScript") + ) + const val baseForBuildScript = Base.libForBuildScript + + @Deprecated(message = "Please use `Reflect.lib`.", ReplaceWith("Reflect.lib")) + const val reflect = Reflect.lib + + @Deprecated(message = "Please use `BaseTypes.lib`.", ReplaceWith("BaseTypes.lib")) + const val baseTypes = BaseTypes.lib + + @Deprecated(message = "Please use `Time.lib`.", ReplaceWith("Time.lib")) + const val time = Time.lib + + @Deprecated(message = "Please use `Change.lib`.", ReplaceWith("Change.lib")) + const val change = Change.lib + + @Deprecated(message = "Please use `Text.lib`.", ReplaceWith("Text.lib")) + const val text = Text.lib + + @Deprecated(message = "Please use `TestLib.lib`.", ReplaceWith("TestLib.lib")) + const val testlib = TestLib.lib + + @Deprecated(message = "Please use `Time.testLib`.", ReplaceWith("Time.testLib")) + const val testUtilTime = Time.testLib + + @Deprecated(message = "Please use `ToolBase.psiJava` instead`.") + const val psiJava = "$toolsGroup:spine-psi-java:${ToolBase.version}" + + @Deprecated( + message = "Please use `ToolBase.psiJava` instead`.", + ReplaceWith("ToolBase.psiJava") + ) + const val psiJavaBundle = "$toolsGroup:spine-psi-java-bundle:${ToolBase.version}" + + @Deprecated(message = "Please use `ToolBase.lib` instead`.", ReplaceWith("ToolBase.lib")) + const val toolBase = "$toolsGroup:spine-tool-base:${ToolBase.version}" + + @Deprecated( + message = "Please use `ToolBase.pluginBase` instead`.", + ReplaceWith("ToolBase.pluginBase") + ) + const val pluginBase = "$toolsGroup:spine-plugin-base:${ToolBase.version}" + + @Deprecated( + message = "Please use `ToolBase.pluginTestlib` instead`.", + ReplaceWith("ToolBase.pluginTestlib") + ) + const val pluginTestlib = ToolBase.pluginTestlib + + @Deprecated( + message = "Please use `ModelCompiler.lib` instead.", + ReplaceWith("ModelCompiler.lib") + ) + const val modelCompiler = ModelCompiler.lib + + @Deprecated( + message = "Please use top level `McJava` object instead.", + ReplaceWith("McJava", "io.spine.dependency.local.McJava") + ) + val McJava = io.spine.dependency.local.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.dependency.local.CoreJava") + ) + const val client = CoreJava.client + + @Deprecated( + message = "Please use top level `CoreJava.server` object instead.", + ReplaceWith("CoreJava.server", "io.spine.dependency.local.CoreJava") + ) + const val server = CoreJava.server +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt new file mode 100644 index 0000000..e7e6534 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine TestLib library. + * + * @see spine-testlib + */ +@Suppress("ConstPropertyName") +object TestLib { + const val version = "2.0.0-SNAPSHOT.185" + const val group = Spine.toolsGroup + const val artifact = "spine-testlib" + const val lib = "$group:$artifact:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Text.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Text.kt new file mode 100644 index 0000000..216ec13 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Text.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Reflect library. + * + * @see spine-text + */ +@Suppress("ConstPropertyName") +object Text { + const val version = "2.0.0-SNAPSHOT.6" + const val group = Spine.group + const val artifact = "spine-text" + const val lib = "$group:$artifact:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt new file mode 100644 index 0000000..1f7e2a6 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * Spine Time library. + * + * @see spine-time + */ +@Suppress("ConstPropertyName") +object Time { + const val version = "2.0.0-SNAPSHOT.200" + const val group = Spine.group + const val artifact = "spine-time" + const val lib = "$group:$artifact:$version" + + const val testLib = "${Spine.toolsGroup}:spine-time-testlib:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt new file mode 100644 index 0000000..b402a3d --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, 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.dependency.local + +/** + * 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.302" + + 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/gradle/publish/PublishingRepos.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt similarity index 52% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingRepos.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt index 5abdc10..4df0bcc 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingRepos.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,29 +24,34 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish - -import io.spine.internal.gradle.Repository +package io.spine.dependency.local /** - * Repositories to which we may publish. + * Dependencies on Spine Validation SDK. + * + * See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/). */ -object PublishingRepos { +@Suppress("ConstPropertyName", "unused") +object Validation { + /** + * The version of the Validation library artifacts. + */ + const val version = "2.0.0-SNAPSHOT.305" - @Suppress("HttpUrlsUsage") // HTTPS is not supported by this repository. - val mavenTeamDev = Repository( - name = "maven.teamdev.com", - releases = "http://maven.teamdev.com/repository/spine", - snapshots = "http://maven.teamdev.com/repository/spine-snapshots", - credentialsFile = "credentials.properties" - ) + const val group = "io.spine.validation" + private const val prefix = "spine-validation" - val cloudRepo = CloudRepo.destination + const val runtimeModule = "$group:$prefix-java-runtime" + const val runtime = "$runtimeModule:$version" + const val java = "$group:$prefix-java:$version" - val cloudArtifactRegistry = CloudArtifactRegistry.repository + const val javaBundleModule = "$group:$prefix-java-bundle" - /** - * Obtains a GitHub repository by the given name. - */ - fun gitHub(repoName: String): Repository = GitHubPackages.repository(repoName) + /** Obtains the artifact for the `java-bundle` artifact of the given version. */ + fun javaBundle(version: String) = "$javaBundleModule:$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/dependency/AssertK.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/AssertK.kt similarity index 83% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/AssertK.kt index 8d42b61..b9a554b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/AssertK.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test /** * Assertion library for tests in Kotlin * * [AssertK](https://github.com/willowtreeapps/assertk) */ -@Suppress("unused") +@Deprecated("Please use Kotest assertions instead.") +@Suppress("unused", "ConstPropertyName") object AssertK { - private const val version = "0.25" - const val libJvm = "com.willowtreeapps.assertk:assertk-jvm:${version}" + private const val version = "0.26.1" + const val libJvm = "com.willowtreeapps.assertk:assertk-jvm:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/Hamcrest.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/Hamcrest.kt new file mode 100644 index 0000000..c2dcfe2 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/Hamcrest.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.test + +/** + * The dependency on the Hamcrest, which is transitive for us. + * + * If you need assertions in Java, please use Google [Truth] instead. + * For Kotlin, please use [Kotest]. + */ +@Suppress("unused", "ConstPropertyName") +object Hamcrest { + // https://github.com/hamcrest/JavaHamcrest/releases + private const val version = "2.2" + const val core = "org.hamcrest:hamcrest-core:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt similarity index 55% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt index 3402460..c410b42 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JUnit.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,30 +24,41 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test // https://junit.org/junit5/ -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object JUnit { - const val version = "5.9.1" - private const val platformVersion = "1.9.1" - private const val legacyVersion = "4.13.1" + const val version = "5.10.0" + private const val legacyVersion = "4.13.1" // https://github.com/apiguardian-team/apiguardian private const val apiGuardianVersion = "1.1.2" + // https://github.com/junit-pioneer/junit-pioneer - private const val pioneerVersion = "1.7.1" + private const val pioneerVersion = "2.0.1" + + const val legacy = "junit:junit:$legacyVersion" - const val legacy = "junit:junit:${legacyVersion}" val api = listOf( - "org.apiguardian:apiguardian-api:${apiGuardianVersion}", - "org.junit.jupiter:junit-jupiter-api:${version}", - "org.junit.jupiter:junit-jupiter-params:${version}" + "org.apiguardian:apiguardian-api:$apiGuardianVersion", + "org.junit.jupiter:junit-jupiter-api:$version", + "org.junit.jupiter:junit-jupiter-params:$version" ) - const val bom = "org.junit:junit-bom:${version}" - const val runner = "org.junit.jupiter:junit-jupiter-engine:${version}" - const val pioneer = "org.junit-pioneer:junit-pioneer:${pioneerVersion}" - const val platformCommons = "org.junit.platform:junit-platform-commons:${platformVersion}" - const val platformLauncher = "org.junit.platform:junit-platform-launcher:${platformVersion}" - const val params = "org.junit.jupiter:junit-jupiter-params:${version}" + const val bom = "org.junit:junit-bom:$version" + + const val runner = "org.junit.jupiter:junit-jupiter-engine:$version" + const val params = "org.junit.jupiter:junit-jupiter-params:$version" + + const val pioneer = "org.junit-pioneer:junit-pioneer:$pioneerVersion" + + object Platform { + // https://junit.org/junit5/ + const val version = "1.10.0" + internal const val group = "org.junit.platform" + const val commons = "$group:junit-platform-commons:$version" + const val launcher = "$group:junit-platform-launcher:$version" + const val engine = "$group:junit-platform-engine:$version" + const val suiteApi = "$group:junit-platform-suite-api:$version" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt similarity index 78% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt index 4053ef5..b883928 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AutoCommon.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test -// https://github.com/google/auto -object AutoCommon { - private const val version = "1.2.1" - const val lib = "com.google.auto:auto-common:${version}" +/** + * Code coverage library for Java. + * + * @see Releases + */ +@Suppress("ConstPropertyName") +object Jacoco { + const val version = "0.8.12" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/Kotest.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/Kotest.kt new file mode 100644 index 0000000..8de10ff --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/Kotest.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2025, 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. + */ + +@file:Suppress("unused") + +package io.spine.dependency.test + +/** + * Testing framework for Kotlin. + * + * @see Kotest site + */ +@Suppress("unused", "ConstPropertyName") +object Kotest { + const val version = "5.9.1" + const val group = "io.kotest" + const val assertions = "$group:kotest-assertions-core:$version" + const val runnerJUnit5 = "$group:kotest-runner-junit5:$version" + const val runnerJUnit5Jvm = "$group:kotest-runner-junit5-jvm:$version" + const val frameworkApi = "$group:kotest-framework-api:$version" + const val datatest = "$group:kotest-framework-datatest:$version" + const val frameworkEngine = "$group:kotest-framework-engine:$version" + + // https://plugins.gradle.org/plugin/io.kotest.multiplatform + object MultiplatformGradlePlugin { + const val version = Kotest.version + const val id = "io.kotest.multiplatform" + const val classpath = "$group:kotest-framework-multiplatform-plugin-gradle:$version" + } + + // https://github.com/kotest/kotest-gradle-plugin + object JvmGradlePlugin { + const val version = "0.4.10" + const val id = "io.kotest" + const val classpath = "$group:kotest-gradle-plugin:$version" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt new file mode 100644 index 0000000..0e9110b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, 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.dependency.test + +/** + * A library for in-process compilation of Kotlin and Java code compilation. + * + * @see GitHub repo + */ +@Suppress("unused", "ConstPropertyName") +object KotlinCompileTesting { + private const val version = "0.7.0" + private const val group = "dev.zacsweers.kctfork" + const val libCore = "$group:core:$version" + const val libKsp = "$group:ksp:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/Kover.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/Kover.kt new file mode 100644 index 0000000..759e21a --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/Kover.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2025, 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.dependency.test + +// https://github.com/Kotlin/kotlinx-kover +@Suppress("unused", "ConstPropertyName") +object Kover { + const val version = "0.7.6" + const val id = "org.jetbrains.kotlinx.kover" + const val classpath = "org.jetbrains.kotlinx:kover-gradle-plugin:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/OpenTest4J.kt similarity index 73% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/OpenTest4J.kt index 4ad91c6..1e22fb3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Okio.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/OpenTest4J.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test /** - * Okio is a transitive dependency which we don't use directly. - * We `force` it in [DependencyResolution.forceConfiguration]. + * The dependency on the OpenTest4j library, which is transitive for us. */ -object Okio { - // This is the last version before next major. - private const val version = "1.17.5" - const val lib = "com.squareup.okio:okio:${version}" +@Suppress("unused", "ConstPropertyName") +object OpenTest4J { + + // https://github.com/ota4j-team/opentest4j/releases + private const val version = "1.3.0" + const val lib = "org.opentest4j:opentest4j:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/SystemLambda.kt similarity index 75% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/SystemLambda.kt index edb0790..5f0eef8 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/SystemLambda.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test -// https://pmd.github.io/ -object Pmd { - const val version = "6.50.0" +// https://github.com/stefanbirkner/system-lambda +@Suppress("unused", "ConstPropertyName") +object SystemLambda { + const val version = "1.2.1" + const val group = "com.github.stefanbirkner" + const val lib = "$group:system-lambda:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/TestKitTruth.kt similarity index 70% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/TestKitTruth.kt index 8d572d9..bfec211 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/TestKitTruth.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,19 +24,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +@file:Suppress("MaxLineLength") + +package io.spine.dependency.test /** * Gradle TestKit extension for Google Truth. * - * Source code: - * https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/tree/main/testkit-truth - * - * Usage description: - * https://dev.to/autonomousapps/gradle-all-the-way-down-testing-your-gradle-plugin-with-gradle-testkit-2hmc + * @see TestKit source code + * @see Usage description */ -@Suppress("unused") +@Suppress("unused", "ConstPropertyName") object TestKitTruth { - private const val version = "1.1" + private const val version = "1.20.0" const val lib = "com.autonomousapps:testkit-truth:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/Truth.kt similarity index 75% rename from buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt rename to buildSrc/src/main/kotlin/io/spine/dependency/test/Truth.kt index 48c1f2d..f9af032 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Truth.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/Truth.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.dependency +package io.spine.dependency.test // https://github.com/google/truth +@Suppress("unused", "ConstPropertyName") object Truth { - private const val version = "1.1.3" + private const val version = "1.1.5" val libs = listOf( - "com.google.truth:truth:${version}", - "com.google.truth.extensions:truth-java8-extension:${version}", - "com.google.truth.extensions:truth-proto-extension:${version}" + "com.google.truth:truth:$version", + "com.google.truth.extensions:truth-java8-extension:$version", + "com.google.truth.extensions:truth-proto-extension:$version" ) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/markup/MarkdownDocument.kt b/buildSrc/src/main/kotlin/io/spine/docs/MarkdownDocument.kt similarity index 96% rename from buildSrc/src/main/kotlin/io/spine/internal/markup/MarkdownDocument.kt rename to buildSrc/src/main/kotlin/io/spine/docs/MarkdownDocument.kt index a73076b..23937bd 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/markup/MarkdownDocument.kt +++ b/buildSrc/src/main/kotlin/io/spine/docs/MarkdownDocument.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.markup +package io.spine.docs import java.io.File diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Build.kt b/buildSrc/src/main/kotlin/io/spine/gradle/Build.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/Build.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/Build.kt index c42a3c0..327031e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Build.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/Build.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle @Suppress("unused") object Build { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Clean.kt b/buildSrc/src/main/kotlin/io/spine/gradle/Clean.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/Clean.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/Clean.kt index ad5c1c5..380e835 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Clean.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/Clean.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle import java.io.File import java.nio.file.Files diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ConfigTester.kt b/buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt similarity index 98% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/ConfigTester.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt index 2178a23..3de99c4 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ConfigTester.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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,7 @@ @file:Suppress("unused") /* Some constants may be used throughout the Spine repos. */ -package io.spine.internal.gradle +package io.spine.gradle import java.io.File import java.net.URI diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt similarity index 87% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt index a2e34b3..3b43246 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle -import io.spine.internal.gradle.publish.SpinePublishing +import io.spine.gradle.publish.SpinePublishing +import java.io.File import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task @@ -69,7 +70,8 @@ fun Project.applyPlugin(cls: Class>) { @Suppress("UNCHECKED_CAST") /* See the method docs. */ fun Project.findTask(name: String): T { val task = this.tasks.findByName(name) - return task!! as T + ?: error("Unable to find a task named `$name` in the project `${this.name}`.") + return task as T } /** @@ -90,3 +92,9 @@ val Project.artifactId: String val artifactId = spinePublishing?.artifactId(this) return artifactId ?: name } + +/** + * Returns project's build directory as [File]. + */ +val Project.buildDirectory: File + get() = layout.buildDirectory.get().asFile diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RepoSlug.kt b/buildSrc/src/main/kotlin/io/spine/gradle/RepoSlug.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/RepoSlug.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/RepoSlug.kt index 48a4938..71fbac3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RepoSlug.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/RepoSlug.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle import org.gradle.api.GradleException diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt b/buildSrc/src/main/kotlin/io/spine/gradle/Repositories.kt similarity index 74% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/Repositories.kt index 6a35ab1..8ec449e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/Repositories.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +@file:Suppress("TooManyFunctions") // Deprecated functions will be kept for a while. -import io.spine.internal.gradle.publish.CloudRepo -import io.spine.internal.gradle.publish.PublishingRepos -import io.spine.internal.gradle.publish.PublishingRepos.gitHub +package io.spine.gradle + +import io.spine.gradle.publish.CloudRepo +import io.spine.gradle.publish.PublishingRepos +import io.spine.gradle.publish.PublishingRepos.gitHub import java.io.File import java.net.URI import java.util.* @@ -36,6 +38,7 @@ import org.gradle.api.Project import org.gradle.api.artifacts.dsl.RepositoryHandler import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.kotlin.dsl.ScriptHandlerScope +import org.gradle.kotlin.dsl.maven /** * Applies [standard][doApplyStandard] repositories to this [ScriptHandlerScope] @@ -51,6 +54,10 @@ import org.gradle.kotlin.dsl.ScriptHandlerScope * [standard repositories][doApplyStandard] are required. */ @Suppress("unused") +@Deprecated( + message = "Please use `standardSpineSdkRepositories()`.", + replaceWith = ReplaceWith("standardSpineSdkRepositories()") +) fun applyWithStandard( buildscript: ScriptHandlerScope, rootProject: Project, @@ -60,7 +67,7 @@ fun applyWithStandard( gitHubRepo.iterator().forEachRemaining { repo -> repositories.applyGitHubPackages(repo, rootProject) } - repositories.applyStandard() + repositories.standardToSpineSdk() } /** @@ -77,6 +84,10 @@ fun applyWithStandard( * @see applyGitHubPackages */ @Suppress("unused") +@Deprecated( + message = "Please use `standardSpineSdkRepositories()`.", + replaceWith = ReplaceWith("standardSpineSdkRepositories()") +) fun doApplyGitHubPackages( repositories: RepositoryHandler, shortRepositoryName: String, @@ -89,7 +100,11 @@ fun doApplyGitHubPackages( * To be used in `buildscript` clauses when a fully-qualified call must be made. */ @Suppress("unused") -fun doApplyStandard(repositories: RepositoryHandler) = repositories.applyStandard() +@Deprecated( + message = "Please use `standardSpineSdkRepositories()`.", + replaceWith = ReplaceWith("standardSpineSdkRepositories()") +) +fun doApplyStandard(repositories: RepositoryHandler) = repositories.standardToSpineSdk() /** * Applies the repository hosted at GitHub Packages, to which Spine artifacts were published. @@ -142,21 +157,75 @@ fun RepositoryHandler.applyGitHubPackages(project: Project, vararg shortReposito * [standard repositories][applyStandard] are required. */ @Suppress("unused") +@Deprecated( + message = "Please use `standardToSpineSdk()`.", + replaceWith = ReplaceWith("standardToSpineSdk()") +) fun RepositoryHandler.applyStandardWithGitHub(project: Project, vararg gitHubRepo: String) { gitHubRepo.iterator().forEachRemaining { repo -> applyGitHubPackages(repo, project) } - applyStandard() + standardToSpineSdk() } /** - * Applies repositories commonly used by Spine Event Engine projects. + * A scrambled version of PAT generated with the only "read:packages" scope. * - * Does not include the repositories hosted at GitHub Packages. + * The scrambling around PAT is necessary because GitHub analyzes commits for the presence + * of tokens and invalidates them. * - * @see applyGitHubPackages + * @see + * How to make GitHub packages to the public */ -fun RepositoryHandler.applyStandard() { +object Pat { + private const val shade = "_phg->8YlN->MFRA->gxIk->HVkm->eO6g->FqHJ->z8MS->H4zC->ZEPq" + private const val separator = "->" + private val chunks: Int = shade.split(separator).size - 1 + + fun credentials(): Credentials { + val pass = shade.replace(separator, "").splitAndReverse(chunks, "") + return Credentials("public", pass) + } + + /** + * Splits this string to the chunks, reverses each chunk, and joins them + * back to a string using the [separator]. + */ + private fun String.splitAndReverse(numChunks: Int, separator: String): String { + check(length / numChunks >= 2) { + "The number of chunks is too big. Must be <= ${length / 2}." + } + val chunks = chunked(length / numChunks) + val reversedChunks = chunks.map { chunk -> chunk.reversed() } + return reversedChunks.joinToString(separator) + } +} + +/** + * Adds a read-only view to all artifacts of the SpineEventEngine + * GitHub organization. + */ +fun RepositoryHandler.spineArtifacts(): MavenArtifactRepository = maven { + url = URI("https://maven.pkg.github.com/SpineEventEngine/*") + includeSpineOnly() + val pat = Pat.credentials() + credentials { + username = pat.username + password = pat.password + } +} + +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") + +/** + * Applies repositories commonly used by Spine Event Engine projects. + */ +fun RepositoryHandler.standardToSpineSdk() { + spineArtifacts() val spineRepos = listOf( Repos.spine, @@ -174,6 +243,9 @@ fun RepositoryHandler.applyStandard() { } } + intellijReleases + jetBrainsCacheRedirector + maven { url = URI(Repos.sonatypeSnapshots) } @@ -183,6 +255,12 @@ fun RepositoryHandler.applyStandard() { mavenLocal().includeSpineOnly() } +@Deprecated( + message = "Please use `standardToSpineSdk() instead.", + replaceWith = ReplaceWith("standardToSpineSdk()") +) +fun RepositoryHandler.applyStandard() = this.standardToSpineSdk() + /** * A Maven repository. */ diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RunBuild.kt b/buildSrc/src/main/kotlin/io/spine/gradle/RunBuild.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/RunBuild.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/RunBuild.kt index 03cef70..aa2759d 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RunBuild.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/RunBuild.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle /** * Runs the `build` task via Gradle Wrapper. @@ -32,6 +32,6 @@ package io.spine.internal.gradle open class RunBuild : RunGradle() { init { - task("build") + task("clean", "build") } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RunGradle.kt b/buildSrc/src/main/kotlin/io/spine/gradle/RunGradle.kt similarity index 97% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/RunGradle.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/RunGradle.kt index 857d170..8942630 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/RunGradle.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/RunGradle.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle import java.io.File import java.io.FileOutputStream @@ -55,7 +55,6 @@ open class RunGradle : DefaultTask() { private const val BUILD_TIMEOUT_MINUTES: Long = 10 } - /** * Path to the directory which contains a Gradle wrapper script. */ @@ -101,7 +100,7 @@ open class RunGradle : DefaultTask() { } @TaskAction - private fun execute() { + public fun execute() { // Ensure build error output log. // Since we're executing this task in another process, we redirect error output to // the file under the `_out` directory. Using the `build` directory for this purpose diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt b/buildSrc/src/main/kotlin/io/spine/gradle/Runtime.kt similarity index 73% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/Runtime.kt index eced40e..c5b5f54 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Runtime.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/Runtime.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,19 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle -import com.google.common.base.Joiner -import io.spine.internal.dependency.Flogger import java.io.File import java.io.InputStream import java.io.StringWriter +import java.lang.ProcessBuilder.Redirect.PIPE import java.util.* -object Runtime { - @Suppress("unused") - val flogger = Flogger.Runtime -} +/** + * Utilities for working with processes from Gradle code. + */ +@Suppress("unused") +private const val ABOUT = "" /** * Executor of CLI commands. @@ -60,23 +60,26 @@ class Cli(private val workingFolder: File) { val outWriter = StringWriter() val errWriter = StringWriter() - val process = ProcessBuilder(*command) - .directory(workingFolder) - .redirectOutput(ProcessBuilder.Redirect.PIPE) - .redirectError(ProcessBuilder.Redirect.PIPE) - .start() + val process = ProcessBuilder(*command).apply { + directory(workingFolder) + redirectOutput(PIPE) + redirectError(PIPE) + }.start() - process.inputStream!!.pourTo(outWriter) - process.errorStream!!.pourTo(errWriter) - val exitCode = process.waitFor() + val exitCode = process.run { + inputStream!!.pourTo(outWriter) + errorStream!!.pourTo(errWriter) + waitFor() + } if (exitCode == 0) { return outWriter.toString() } else { - val cmdAsString = Joiner.on(" ").join(command.iterator()) - val errorMsg = "Command `$cmdAsString` finished with exit code $exitCode:" + - " ${System.lineSeparator()}$errWriter" + - " ${System.lineSeparator()}$outWriter." + val commandLine = command.joinToString(" ") + val nl = System.lineSeparator() + val errorMsg = "Command `$commandLine` finished with exit code $exitCode:" + + "$nl$errWriter" + + "$nl$outWriter." throw IllegalStateException(errorMsg) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/StringExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/StringExtensions.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/StringExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/StringExtensions.kt index ae19007..a185892 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/StringExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/StringExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle /** * Returns `true` if the version of a project contains `snapshot` (in any case), diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/TaskName.kt b/buildSrc/src/main/kotlin/io/spine/gradle/TaskName.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/TaskName.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/TaskName.kt index e6967b4..7c7abd1 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/TaskName.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/TaskName.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle import kotlin.reflect.KClass import org.gradle.api.Task diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/VersionWriter.kt similarity index 97% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/VersionWriter.kt index 79ae732..d3d4323 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/VersionWriter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle +package io.spine.gradle import java.util.* import org.gradle.api.DefaultTask diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/base/Tasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/base/Tasks.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/base/Tasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/base/Tasks.kt index 1029071..c77b795 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/base/Tasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/base/Tasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.base +package io.spine.gradle.base import org.gradle.api.Task import org.gradle.api.tasks.Delete @@ -77,8 +77,8 @@ val TaskContainer.assemble: TaskProvider * * Intended to build everything, including running all tests, producing the production artifacts * and generating documentation. One will probably rarely attach concrete tasks directly - * to `build` as [assemble][io.spine.internal.gradle.base.assemble] and - * [check][io.spine.internal.gradle.base.check] are typically more appropriate. + * to `build` as [assemble][io.spine.gradle.base.assemble] and + * [check][io.spine.gradle.base.check] are typically more appropriate. * * @see * Tasks | The Base Plugin diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt b/buildSrc/src/main/kotlin/io/spine/gradle/checkstyle/CheckStyleConfig.kt similarity index 82% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/checkstyle/CheckStyleConfig.kt index e3a0ef2..122a604 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/checkstyle/CheckStyleConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/checkstyle/CheckStyleConfig.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.checkstyle +package io.spine.gradle.checkstyle -import io.spine.internal.dependency.CheckStyle +import io.spine.dependency.build.CheckStyle import org.gradle.api.Project -import org.gradle.api.plugins.quality.Checkstyle import org.gradle.api.plugins.quality.CheckstyleExtension import org.gradle.api.plugins.quality.CheckstylePlugin import org.gradle.kotlin.dsl.the @@ -65,9 +64,13 @@ object CheckStyleConfig { } project.afterEvaluate { - // Disables checking the test sources. - val checkstyleTest = project.tasks.findByName("checkstyleTest") as Checkstyle - checkstyleTest.enabled = false + // Disables checking the test sources and test fixtures. + arrayOf( + "checkstyleTest", + "checkstyleTestFixtures" + ).forEach { + task -> tasks.findByName(task)?.enabled = false + } } } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartContext.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartContext.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartContext.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/DartContext.kt index 2f33b28..c32c10f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartContext.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartContext.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart +package io.spine.gradle.dart import org.gradle.api.Project import org.gradle.api.tasks.Exec diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartEnvironment.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartEnvironment.kt similarity index 97% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartEnvironment.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/DartEnvironment.kt index 7b10f64..4e4ae83 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartEnvironment.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartEnvironment.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart +package io.spine.gradle.dart import java.io.File import org.apache.tools.ant.taskdefs.condition.Os diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartExtension.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartExtension.kt similarity index 96% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartExtension.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/DartExtension.kt index cf585a9..57a2bcf 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/DartExtension.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/DartExtension.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart +package io.spine.gradle.dart -import io.spine.internal.gradle.dart.task.DartTasks -import io.spine.internal.gradle.dart.plugin.DartPlugins +import io.spine.gradle.dart.plugin.DartPlugins +import io.spine.gradle.dart.task.DartTasks import org.gradle.api.Project import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.findByType diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/DartPlugins.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/DartPlugins.kt index 061e2ad..9d76a77 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/DartPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/DartPlugins.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.plugin +package io.spine.gradle.dart.plugin -import io.spine.internal.gradle.dart.DartContext -import io.spine.internal.gradle.dart.DartEnvironment +import io.spine.gradle.dart.DartContext +import io.spine.gradle.dart.DartEnvironment import org.gradle.api.Project import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.PluginContainer @@ -63,8 +63,8 @@ import org.gradle.api.tasks.TaskContainer * And here's how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.dart.dart - * import io.spine.internal.gradle.dart.plugins.fooBar + * import io.spine.gradle.dart.dart + * import io.spine.gradle.dart.plugins.fooBar * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/Protobuf.kt similarity index 78% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/Protobuf.kt index 350f0fb..bfd503f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/plugin/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/plugin/Protobuf.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.plugin +package io.spine.gradle.dart.plugin -import com.google.protobuf.gradle.builtins +import com.google.protobuf.gradle.ProtobufExtension import com.google.protobuf.gradle.id -import com.google.protobuf.gradle.plugins -import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.remove -import io.spine.internal.dependency.Protobuf +import io.spine.dependency.lib.Protobuf /** * Applies `protobuf` plugin and configures `GenerateProtoTask` to work with a Dart module. @@ -42,9 +40,10 @@ fun DartPlugins.protobuf() { plugins.apply(Protobuf.GradlePlugin.id) - project.protobuf { - generateProtoTasks.all().forEach { task -> - task.apply { + val protobufExtension = project.extensions.getByType(ProtobufExtension::class.java) + protobufExtension.apply { + generateProtoTasks.all().configureEach { + apply { plugins { id("dart") } builtins { remove("java") } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Build.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Build.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Build.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Build.kt index 79c387c..163747e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Build.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Build.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.task +package io.spine.gradle.dart.task -import io.spine.internal.gradle.TaskName -import io.spine.internal.gradle.base.assemble -import io.spine.internal.gradle.base.check -import io.spine.internal.gradle.base.clean -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register +import io.spine.gradle.TaskName +import io.spine.gradle.base.assemble +import io.spine.gradle.base.check +import io.spine.gradle.base.clean +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.tasks.Delete import org.gradle.api.tasks.Exec import org.gradle.api.tasks.TaskContainer @@ -49,8 +49,8 @@ import org.gradle.api.tasks.TaskProvider * An example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.dart.dart - * import io.spine.internal.gradle.dart.task.build + * import io.spine.gradle.dart.dart + * import io.spine.gradle.dart.task.build * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/DartTasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/DartTasks.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/DartTasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/task/DartTasks.kt index 5ebe927..bc5e1e9 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/DartTasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/DartTasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.task +package io.spine.gradle.dart.task -import io.spine.internal.gradle.dart.DartContext -import io.spine.internal.gradle.dart.DartEnvironment +import io.spine.gradle.dart.DartContext +import io.spine.gradle.dart.DartEnvironment import org.gradle.api.Project import org.gradle.api.tasks.TaskContainer @@ -43,7 +43,7 @@ import org.gradle.api.tasks.TaskContainer * Supposing, one needs to create a new task that would participate in building. Let the task name * be `testDart`. To do that, several steps should be completed: * - * 1. Define the task name and type using [TaskName][io.spine.internal.gradle.TaskName]. + * 1. Define the task name and type using [TaskName][io.spine.gradle.TaskName]. * 2. Create a public typed reference for the task upon [TaskContainer]. It would facilitate * referencing to the new task, so that external tasks could depend on it. This reference * should be documented. @@ -53,9 +53,9 @@ import org.gradle.api.tasks.TaskContainer * Here's an example of `testDart()` extension: * * ``` - * import io.spine.internal.gradle.named - * import io.spine.internal.gradle.register - * import io.spine.internal.gradle.TaskName + * import io.spine.gradle.named + * import io.spine.gradle.register + * import io.spine.gradle.TaskName * import org.gradle.api.Task * import org.gradle.api.tasks.TaskContainer * import org.gradle.api.tasks.Exec @@ -85,8 +85,8 @@ import org.gradle.api.tasks.TaskContainer * And here's how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.dart.dart - * import io.spine.internal.gradle.dart.task.testDart + * import io.spine.gradle.dart.dart + * import io.spine.gradle.dart.task.testDart * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/IntegrationTest.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/IntegrationTest.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/IntegrationTest.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/task/IntegrationTest.kt index f12b96f..19f1f14 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/IntegrationTest.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/IntegrationTest.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.task +package io.spine.gradle.dart.task -import io.spine.internal.gradle.TaskName -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register +import io.spine.gradle.TaskName +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.tasks.Exec import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -57,9 +57,9 @@ val TaskContainer.integrationTest: TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.dart.dart - * import io.spine.internal.gradle.task.build - * import io.spine.internal.gradle.task.integrationTest + * import io.spine.gradle.dart.dart + * import io.spine.gradle.task.build + * import io.spine.gradle.task.integrationTest * * // ... * @@ -71,6 +71,7 @@ val TaskContainer.integrationTest: TaskProvider * } * ``` */ +@Suppress("unused") fun DartTasks.integrationTest() = register(integrationTestName) { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Publish.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Publish.kt index 92eb290..2f8df6b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dart/task/Publish.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,13 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dart.task +package io.spine.gradle.dart.task -import io.spine.internal.gradle.TaskName -import io.spine.internal.gradle.base.assemble -import io.spine.internal.gradle.publish.publish -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register +import io.spine.gradle.TaskName +import io.spine.gradle.base.assemble +import io.spine.gradle.named +import io.spine.gradle.publish.publish +import io.spine.gradle.register import org.gradle.api.tasks.Copy import org.gradle.api.tasks.Exec import org.gradle.api.tasks.TaskContainer @@ -51,9 +51,9 @@ import org.gradle.api.tasks.TaskProvider * Usage example: * * ``` - * import io.spine.internal.gradle.dart.dart - * import io.spine.internal.gradle.dart.task.build - * import io.spine.internal.gradle.dart.task.publish + * import io.spine.gradle.dart.dart + * import io.spine.gradle.dart.task.build + * import io.spine.gradle.dart.task.publish * * // ... * @@ -83,7 +83,7 @@ private val stagePubPublicationName = TaskName.of("stagePubPublication", Copy::c * Locates `stagePubPublication` in this [TaskContainer]. * * The task prepares the Dart package for Pub publication in the - * [publication directory][io.spine.internal.gradle.dart.DartEnvironment.publicationDir]. + * [publication directory][io.spine.gradle.dart.DartEnvironment.publicationDir]. */ val TaskContainer.stagePubPublication: TaskProvider get() = named(stagePubPublicationName) @@ -110,7 +110,7 @@ private fun DartTasks.stagePubPublication(): TaskProvider = into(publicationDir) doLast { - logger.debug("Pub publication is prepared in directory `$publicationDir`.") + logger.debug("Pub publication is prepared in directory `{}`.", publicationDir) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dokka/DokkaExtensions.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dokka/DokkaExtensions.kt index a912d50..727a079 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dokka/DokkaExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dokka +package io.spine.gradle.dokka import java.io.File import org.gradle.api.file.FileCollection @@ -38,6 +38,7 @@ import org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder * 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) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/TaskContainerExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/dokka/TaskContainerExtensions.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/TaskContainerExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/dokka/TaskContainerExtensions.kt index 058eb99..02deead 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/TaskContainerExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/dokka/TaskContainerExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.dokka +package io.spine.gradle.dokka import org.gradle.api.tasks.TaskContainer import org.jetbrains.dokka.gradle.DokkaTask @@ -32,4 +32,5 @@ import org.jetbrains.dokka.gradle.DokkaTask /** * Finds the `dokkaHtml` Gradle task. */ +@Suppress("unused") fun TaskContainer.dokkaHtmlTask() = this.getByName("dokkaHtml") as DokkaTask diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/fs/LazyTempPath.kt b/buildSrc/src/main/kotlin/io/spine/gradle/fs/LazyTempPath.kt similarity index 96% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/fs/LazyTempPath.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/fs/LazyTempPath.kt index 9f48371..f6e1777 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/fs/LazyTempPath.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/fs/LazyTempPath.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.fs +package io.spine.gradle.fs import java.io.File import java.net.URI diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Branch.kt b/buildSrc/src/main/kotlin/io/spine/gradle/git/Branch.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Branch.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/git/Branch.kt index 47ddd30..a10a65f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Branch.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/git/Branch.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.git +package io.spine.gradle.git /** * Branch names. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Repository.kt b/buildSrc/src/main/kotlin/io/spine/gradle/git/Repository.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Repository.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/git/Repository.kt index 824003c..55ce67f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/Repository.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/git/Repository.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.git +package io.spine.gradle.git -import io.spine.internal.gradle.Cli -import io.spine.internal.gradle.fs.LazyTempPath +import io.spine.gradle.Cli +import io.spine.gradle.fs.LazyTempPath /** * Interacts with a real Git repository. @@ -44,43 +44,31 @@ import io.spine.internal.gradle.fs.LazyTempPath * release of resources please use the provided functionality inside a `use` block or * call the `close` method manually. */ -class Repository : AutoCloseable { - /** - * The GitHub SSH URL to the underlying repository. - */ - val sshUrl: String +class Repository private constructor( /** - * Path to the temporal folder for a clone of the underlying repository. + * The GitHub SSH URL to the underlying repository. */ - val location = LazyTempPath("repoTemp") + private val sshUrl: String, /** * Current user configuration. * - * This configuration determines what ends up in author and commiter fields of a commit. + * This configuration determines what ends up in author and committer fields of a commit. */ - var user: UserInfo - get() = field - private set(value) { - field = value - } + private var user: UserInfo, /** * Currently checked out branch. */ - var currentBranch: String - get() = field - private set(value) { - field = value - } + private var currentBranch: String +) : AutoCloseable { - private constructor(sshUrl: String, user: UserInfo, branch: String) { - this.sshUrl = sshUrl - this.user = user - this.currentBranch = branch - } + /** + * Path to the temporal folder for a clone of the underlying repository. + */ + val location = LazyTempPath("repoTemp") /** * Clones the repository with [the SSH url][sshUrl] into the [temporal folder][location]. @@ -101,7 +89,7 @@ class Repository : AutoCloseable { fun checkout(branch: String) { repoExecute("git", "checkout", branch) - this.currentBranch = branch + currentBranch = branch } /** @@ -109,7 +97,7 @@ class Repository : AutoCloseable { * * Overwrites `user.name` and `user.email` settings locally in [location] with * values from [user]. These settings determine what ends up in author and - * commiter fields of a commit. + * committer fields of a commit. */ fun configureUser(user: UserInfo) { repoExecute("git", "config", "user.name", user.name) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/UserInfo.kt b/buildSrc/src/main/kotlin/io/spine/gradle/git/UserInfo.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/git/UserInfo.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/git/UserInfo.kt index 310e721..bc9f08d 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/git/UserInfo.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/git/UserInfo.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.git +package io.spine.gradle.git /** * Contains information about a Git user. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/AuthorEmail.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/AuthorEmail.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/AuthorEmail.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/AuthorEmail.kt index 7eb4f9c..f0d839f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/AuthorEmail.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/AuthorEmail.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages /** * An author of updates to GitHub pages. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/RepositoryExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/RepositoryExtensions.kt similarity index 87% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/RepositoryExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/RepositoryExtensions.kt index 617ee94..94ab6ac 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/RepositoryExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/RepositoryExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages -import io.spine.internal.gradle.RepoSlug -import io.spine.internal.gradle.git.Branch -import io.spine.internal.gradle.git.Repository -import io.spine.internal.gradle.git.UserInfo +import io.spine.gradle.RepoSlug +import io.spine.gradle.git.Branch +import io.spine.gradle.git.Repository +import io.spine.gradle.git.UserInfo /** * Clones the current project repository with the branch dedicated to publishing diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/SshKey.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/SshKey.kt similarity index 95% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/SshKey.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/SshKey.kt index 4bda3f7..186c474 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/SshKey.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/SshKey.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages -import io.spine.internal.gradle.Cli +import io.spine.gradle.Cli import java.io.File import org.gradle.api.GradleException diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/TaskName.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/TaskName.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/TaskName.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/TaskName.kt index 82f9a6e..f5e3bfc 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/TaskName.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/TaskName.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages object TaskName { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/Update.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/Update.kt similarity index 83% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/Update.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/Update.kt index f237156..0f9a0f5 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/Update.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/Update.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,8 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages +import io.spine.gradle.git.Repository import java.io.File import java.nio.file.Path import org.gradle.api.Project @@ -33,7 +34,6 @@ import org.gradle.api.Task import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileCollection import org.gradle.api.logging.Logger -import io.spine.internal.gradle.git.Repository /** * Performs the update of GitHub pages. @@ -90,25 +90,33 @@ private abstract class UpdateDocumentation( File("${repository.location}/${docsDestinationFolder}/${project.name}") } + private fun logDebug(message: () -> String) { + if (logger.isDebugEnabled) { + logger.debug(message()) + } + } + fun run() { val module = project.name - logger.debug("Update of the $toolName documentation for module `$module` started.") + logDebug {"Update of the $toolName documentation for module `$module` started." } val documentation = replaceMostRecentDocs() copyIntoVersionDir(documentation) val version = project.version - val updateMessage = "Update $toolName documentation for module `$module` as for " + - "version $version" + val updateMessage = + "Update `$toolName` documentation for module `$module` as for version $version" repository.commitAllChanges(updateMessage) - logger.debug("Update of the $toolName documentation for `$module` successfully finished.") + logDebug { "Update of the `$toolName` documentation for `$module` successfully finished." } } private fun replaceMostRecentDocs(): ConfigurableFileCollection { val generatedDocs = project.files(docsSourceFolder) - logger.debug("Replacing the most recent $toolName documentation in ${mostRecentFolder}.") + logDebug { + "Replacing the most recent `$toolName` documentation in `${mostRecentFolder}`." + } copyDocs(generatedDocs, mostRecentFolder) return generatedDocs @@ -125,7 +133,9 @@ private abstract class UpdateDocumentation( private fun copyIntoVersionDir(generatedDocs: ConfigurableFileCollection) { val versionedDocDir = File("$mostRecentFolder/v/${project.version}") - logger.debug("Storing the new version of $toolName documentation in `${versionedDocDir}.") + logDebug { + "Storing the new version of `$toolName` documentation in `${versionedDocDir}`." + } copyDocs(generatedDocs, versionedDocDir) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPages.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPages.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPages.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPages.kt index 87d160a..e46a565 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPages.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPages.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages -import io.spine.internal.gradle.dokka.dokkaHtmlTask -import io.spine.internal.gradle.fs.LazyTempPath -import io.spine.internal.gradle.github.pages.TaskName.copyDokka -import io.spine.internal.gradle.github.pages.TaskName.copyJavadoc -import io.spine.internal.gradle.github.pages.TaskName.updateGitHubPages -import io.spine.internal.gradle.isSnapshot -import io.spine.internal.gradle.javadoc.ExcludeInternalDoclet -import io.spine.internal.gradle.javadoc.javadocTask +import dokkaHtmlTask +import io.spine.gradle.fs.LazyTempPath +import io.spine.gradle.github.pages.TaskName.copyDokka +import io.spine.gradle.github.pages.TaskName.copyJavadoc +import io.spine.gradle.github.pages.TaskName.updateGitHubPages +import io.spine.gradle.isSnapshot +import io.spine.gradle.javadoc.ExcludeInternalDoclet +import io.spine.gradle.javadoc.javadocTask import java.io.File import org.gradle.api.Plugin import org.gradle.api.Project @@ -205,7 +205,9 @@ class UpdateGitHubPages : Plugin { private fun TaskContainer.composeDokkaInputs(): List { val inputs = mutableListOf() - inputs.add(dokkaHtmlTask()) + dokkaHtmlTask()?.let { + inputs.add(it) + } inputs.addAll(includedInputs) return inputs diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPagesExtension.kt b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPagesExtension.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPagesExtension.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPagesExtension.kt index 778d841..90eebc2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/github/pages/UpdateGitHubPagesExtension.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPagesExtension.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.github.pages +package io.spine.gradle.github.pages import java.io.File import org.gradle.api.Project @@ -78,7 +78,7 @@ private constructor( /** * The version of the - * [ExcludeInternalDoclet][io.spine.internal.gradle.javadoc.ExcludeInternalDoclet] + * [ExcludeInternalDoclet][io.spine.gradle.javadoc.ExcludeInternalDoclet] * used when updating documentation at GitHub Pages. * * This value is used when adding dependency on the doclet when the plugin tasks diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/java/Tasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/java/Tasks.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/java/Tasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/java/Tasks.kt index 8f2344f..12d4d56 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/java/Tasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/java/Tasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.java +package io.spine.gradle.java import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javac/ErrorProne.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javac/ErrorProne.kt index 7a97cab..84c6bcb 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javac/ErrorProne.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javac +package io.spine.gradle.javac import net.ltgt.gradle.errorprone.errorprone import org.gradle.api.tasks.compile.JavaCompile @@ -51,6 +51,7 @@ import org.gradle.process.CommandLineArgumentProvider */ @Suppress("unused") fun JavaCompile.configureErrorProne() { + options.compilerArgs.add("--should-stop=ifError=FLOW") options.errorprone .errorproneArgumentProviders .add(ErrorProneConfig.ARGUMENTS) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/Javac.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javac/Javac.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/Javac.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javac/Javac.kt index 839252d..44223cb 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/Javac.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javac/Javac.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javac +package io.spine.gradle.javac import org.gradle.api.tasks.compile.JavaCompile import org.gradle.process.CommandLineArgumentProvider diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/Encoding.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/Encoding.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/Encoding.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javadoc/Encoding.kt index f712968..052a1aa 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/Encoding.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/Encoding.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javadoc +package io.spine.gradle.javadoc /** * The encoding to use in Javadoc processing. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/ExcludeInternalDoclet.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javadoc/ExcludeInternalDoclet.kt index 72d7f6a..541504c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/ExcludeInternalDoclet.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javadoc +package io.spine.gradle.javadoc -import io.spine.internal.gradle.javadoc.ExcludeInternalDoclet.Companion.taskName -import io.spine.internal.gradle.sourceSets +import io.spine.dependency.local.ArtifactVersion +import io.spine.dependency.local.Spine +import io.spine.gradle.javadoc.ExcludeInternalDoclet.Companion.taskName +import io.spine.gradle.sourceSets import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.tasks.javadoc.Javadoc @@ -36,9 +38,13 @@ import org.gradle.external.javadoc.StandardJavadocDocletOptions /** * The doclet which removes Javadoc for `@Internal` things in the Java code. */ -class ExcludeInternalDoclet(val version: String) { +@Suppress("ConstPropertyName") +class ExcludeInternalDoclet( + @Deprecated("`Spine.ArtifactVersion.javadocTools` is used instead.") + val version: String = ArtifactVersion.javadocTools +) { - private val dependency = "io.spine.tools:spine-javadoc-filter:${version}" + private val dependency = Spine.javadocFilter companion object { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocConfig.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocConfig.kt index f6002ca..d2e4c90 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocConfig.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javadoc +package io.spine.gradle.javadoc import java.io.File import org.gradle.api.JavaVersion @@ -43,9 +43,9 @@ object JavadocConfig { /** * Link to the documentation for Java 11 Standard Library API. * - * OpenJDK SE 11 is used for the reference. + * Oracle JDK SE 11 is used for the reference. */ - private const val standardLibraryAPI = "https://cr.openjdk.java.net/~iris/se/11/latestSpec/api/" + private const val standardLibraryAPI = "https://docs.oracle.com/en/java/javase/11/docs/api/" @Suppress("MemberVisibilityCanBePrivate") // opened to be visible from docs. val tags = listOf( diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocTag.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocTag.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocTag.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocTag.kt index 2a278bd..a6224a5 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocTag.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/JavadocTag.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javadoc +package io.spine.gradle.javadoc /** * The Javadoc tag. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/TaskContainerExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/TaskContainerExtensions.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/TaskContainerExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javadoc/TaskContainerExtensions.kt index f80d53e..7e5b517 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/TaskContainerExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javadoc/TaskContainerExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javadoc +package io.spine.gradle.javadoc import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.javadoc.Javadoc diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsContext.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsContext.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsContext.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsContext.kt index 8754173..ec5d872 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsContext.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsContext.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript +package io.spine.gradle.javascript import java.io.File import org.gradle.api.Project +import org.gradle.kotlin.dsl.support.serviceOf +import org.gradle.process.ExecOperations /** * Provides access to the current [JsEnvironment] and shortcuts for running `npm` tool. @@ -47,8 +49,7 @@ open class JsContext(jsEnv: JsEnvironment, internal val project: Project) * * This [File] is used as a working directory. */ - fun File.npm(vararg args: String) = project.exec { - + fun File.npm(vararg args: String) = project.serviceOf().exec { workingDir(this@npm) commandLine(npmExecutable) args(*args) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsEnvironment.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsEnvironment.kt similarity index 98% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsEnvironment.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsEnvironment.kt index f2d10ac..c2dc68e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsEnvironment.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsEnvironment.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript +package io.spine.gradle.javascript import java.io.File import org.apache.tools.ant.taskdefs.condition.Os diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsExtension.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsExtension.kt similarity index 95% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsExtension.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsExtension.kt index 4fe1d3f..69c3e26 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/JsExtension.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsExtension.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript +package io.spine.gradle.javascript -import io.spine.internal.gradle.javascript.task.JsTasks -import io.spine.internal.gradle.javascript.plugin.JsPlugins +import io.spine.gradle.javascript.plugin.JsPlugins +import io.spine.gradle.javascript.task.JsTasks import org.gradle.api.Project import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.extra diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Idea.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Idea.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Idea.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Idea.kt index f409016..087dd25 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Idea.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Idea.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.plugin +package io.spine.gradle.javascript.plugin import org.gradle.kotlin.dsl.configure import org.gradle.plugins.ide.idea.model.IdeaModel diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/JsPlugins.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/JsPlugins.kt index 6a17820..b478f64 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/JsPlugins.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/JsPlugins.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.plugin +package io.spine.gradle.javascript.plugin -import io.spine.internal.gradle.javascript.JsContext -import io.spine.internal.gradle.javascript.JsEnvironment +import io.spine.gradle.javascript.JsContext +import io.spine.gradle.javascript.JsEnvironment import org.gradle.api.Project import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.PluginContainer @@ -63,8 +63,8 @@ import org.gradle.api.tasks.TaskContainer * And here's how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.plugins.fooBar + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.plugins.fooBar * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/McJs.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/McJs.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/McJs.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/McJs.kt index 56b1263..2efa4a4 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/McJs.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/McJs.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.plugin +package io.spine.gradle.javascript.plugin import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Protobuf.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Protobuf.kt index d99d2a2..c1c2d64 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/plugin/Protobuf.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.plugin +package io.spine.gradle.javascript.plugin -import com.google.protobuf.gradle.builtins -import com.google.protobuf.gradle.generateProtoTasks +import com.google.protobuf.gradle.ProtobufExtension import com.google.protobuf.gradle.id -import com.google.protobuf.gradle.protobuf -import com.google.protobuf.gradle.protoc import com.google.protobuf.gradle.remove -import io.spine.internal.dependency.Protobuf +import io.spine.dependency.lib.Protobuf /** * Applies and configures `protobuf` plugin to work with a JavaScript module. @@ -50,9 +47,8 @@ fun JsPlugins.protobuf() { apply(Protobuf.GradlePlugin.id) } - project.protobuf { - - generatedFilesBaseDir = projectDir.path + val protobufExt = project.extensions.getByType(ProtobufExtension::class.java) + protobufExt.apply { protoc { artifact = Protobuf.compiler diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Assemble.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Assemble.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Assemble.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Assemble.kt index dbc770d..4b57a4e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Assemble.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Assemble.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.ObjectNode import com.google.protobuf.gradle.GenerateProtoTask -import io.spine.internal.gradle.base.assemble -import io.spine.internal.gradle.javascript.plugin.generateJsonParsers -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.base.assemble +import io.spine.gradle.javascript.plugin.generateJsonParsers +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -42,8 +42,8 @@ import org.gradle.kotlin.dsl.withType /** * Registers tasks for assembling JavaScript artifacts. * - * Please note, this task group depends on [mc-js][io.spine.internal.gradle.javascript.plugin.mcJs] - * and [protobuf][io.spine.internal.gradle.javascript.plugin.protobuf]` plugins. Therefore, + * Please note, this task group depends on [mc-js][io.spine.gradle.javascript.plugin.mcJs] + * and [protobuf][io.spine.gradle.javascript.plugin.protobuf]` plugins. Therefore, * these plugins should be applied in the first place. * * List of tasks to be created: @@ -56,8 +56,8 @@ import org.gradle.kotlin.dsl.withType * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.assemble + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.assemble * * // ... * @@ -175,7 +175,7 @@ private val updatePackageVersionName = TaskName.of("updatePackageVersion") * Locates `updatePackageVersion` task in this [TaskContainer]. * * The task sets the module's version in `package.json` to the value of - * [moduleVersion][io.spine.internal.gradle.javascript.JsEnvironment.moduleVersion] + * [moduleVersion][io.spine.gradle.javascript.JsEnvironment.moduleVersion] * specified in the current `JsEnvironment`. */ val TaskContainer.updatePackageVersion: TaskProvider diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Check.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Check.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Check.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Check.kt index 4fdd69f..d25c3c2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Check.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Check.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.base.check -import io.spine.internal.gradle.java.test -import io.spine.internal.gradle.javascript.isWindows -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.base.check +import io.spine.gradle.java.test +import io.spine.gradle.javascript.isWindows +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -52,9 +52,9 @@ import org.gradle.api.tasks.TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.assemble - * import io.spine.internal.gradle.javascript.task.check + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.assemble + * import io.spine.gradle.javascript.task.check * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Clean.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Clean.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Clean.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Clean.kt index 6658b83..c5ff835 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Clean.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Clean.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.base.clean -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.base.clean +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.tasks.Delete import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -48,9 +48,9 @@ import org.gradle.api.tasks.TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.assemble - * import io.spine.internal.gradle.javascript.task.clean + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.assemble + * import io.spine.gradle.javascript.task.clean * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/IntegrationTest.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/IntegrationTest.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/IntegrationTest.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/IntegrationTest.kt index fadcc09..227e33e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/IntegrationTest.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/IntegrationTest.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.base.build -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.base.build +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -61,8 +61,8 @@ val TaskContainer.integrationTest: TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.integrationTest + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.integrationTest * * // ... * @@ -74,6 +74,7 @@ val TaskContainer.integrationTest: TaskProvider * } * ``` */ +@Suppress("unused") fun JsTasks.integrationTest() { linkSpineWebModule() diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/JsTasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/JsTasks.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/JsTasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/JsTasks.kt index b384fd3..3cf6335 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/JsTasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/JsTasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.javascript.JsEnvironment -import io.spine.internal.gradle.javascript.JsContext +import io.spine.gradle.javascript.JsContext +import io.spine.gradle.javascript.JsEnvironment import org.gradle.api.Project import org.gradle.api.tasks.TaskContainer @@ -43,7 +43,7 @@ import org.gradle.api.tasks.TaskContainer * Supposing, one needs to create a new task that would participate in building. Let the task name * be `bundleJs`. To do that, several steps should be completed: * - * 1. Define the task name and type using [TaskName][io.spine.internal.gradle.TaskName]. + * 1. Define the task name and type using [TaskName][io.spine.gradle.TaskName]. * 2. Create a public typed reference for the task upon [TaskContainer]. It would facilitate * referencing to the new task, so that external tasks could depend on it. This reference * should be documented. @@ -53,9 +53,9 @@ import org.gradle.api.tasks.TaskContainer * Here's an example of `bundleJs()` extension: * * ``` - * import io.spine.internal.gradle.named - * import io.spine.internal.gradle.register - * import io.spine.internal.gradle.TaskName + * import io.spine.gradle.named + * import io.spine.gradle.register + * import io.spine.gradle.TaskName * import org.gradle.api.Task * import org.gradle.api.tasks.TaskContainer * import org.gradle.api.tasks.Exec @@ -85,8 +85,8 @@ import org.gradle.api.tasks.TaskContainer * And here's how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.bundleJs + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.bundleJs * * // ... * diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/LicenseReport.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/LicenseReport.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/LicenseReport.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/LicenseReport.kt index 99935ed..c3b3a6a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/LicenseReport.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/LicenseReport.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.report.license.generateLicenseReport -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.named +import io.spine.gradle.register +import io.spine.gradle.report.license.generateLicenseReport import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -42,8 +42,8 @@ import org.gradle.api.tasks.TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.clean + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.clean * * // ... * @@ -54,6 +54,7 @@ import org.gradle.api.tasks.TaskProvider * } * ``` */ +@Suppress("unused") fun JsTasks.licenseReport() { npmLicenseReport().also { generateLicenseReport.configure { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Publish.kt similarity index 87% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Publish.kt index 486d831..7d1baea 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Publish.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.publish.publish -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.named +import io.spine.gradle.publish.publish +import io.spine.gradle.register import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -49,9 +49,9 @@ import org.gradle.api.tasks.TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.assemble - * import io.spine.internal.gradle.javascript.task.publish + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.assemble + * import io.spine.gradle.javascript.task.publish * * // ... * @@ -103,7 +103,7 @@ private val prepareJsPublicationName = TaskName.of("prepareJsPublication") * Locates `prepareJsPublication` task in this [TaskContainer]. * * This is a lifecycle task that prepares the NPM package in - * [publicationDirectory][io.spine.internal.gradle.javascript.JsEnvironment.publicationDir] + * [publicationDirectory][io.spine.gradle.javascript.JsEnvironment.publicationDir] * of the current `JsEnvironment`. */ val TaskContainer.prepareJsPublication: TaskProvider @@ -168,11 +168,11 @@ private val publishJsName = TaskName.of("publishJs") * Locates `publishJs` task in this [TaskContainer]. * * The task publishes the prepared NPM package from - * [publicationDirectory][io.spine.internal.gradle.javascript.JsEnvironment.publicationDir] + * [publicationDirectory][io.spine.gradle.javascript.JsEnvironment.publicationDir] * using `npm publish`. * * Please note, in order to publish an NMP package, a valid - * [npmAuthToken][io.spine.internal.gradle.javascript.JsEnvironment.npmAuthToken] should be + * [npmAuthToken][io.spine.gradle.javascript.JsEnvironment.npmAuthToken] should be * set. If no token is set, a default dummy value is quite enough for the local development. * * @see npm-publish | npm Docs diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Webpack.kt b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Webpack.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Webpack.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Webpack.kt index cbf3aae..7c82ad7 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Webpack.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Webpack.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.javascript.task +package io.spine.gradle.javascript.task -import io.spine.internal.gradle.named -import io.spine.internal.gradle.register -import io.spine.internal.gradle.TaskName +import io.spine.gradle.TaskName +import io.spine.gradle.named +import io.spine.gradle.register import org.gradle.api.tasks.Copy import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider @@ -47,10 +47,10 @@ import org.gradle.api.tasks.TaskProvider * Here's an example of how to apply it in `build.gradle.kts`: * * ``` - * import io.spine.internal.gradle.javascript.javascript - * import io.spine.internal.gradle.javascript.task.assemble - * import io.spine.internal.gradle.javascript.task.publish - * import io.spine.internal.gradle.javascript.task.webpack + * import io.spine.gradle.javascript.javascript + * import io.spine.gradle.javascript.task.assemble + * import io.spine.gradle.javascript.task.publish + * import io.spine.gradle.javascript.task.webpack * * // ... * @@ -63,6 +63,7 @@ import org.gradle.api.tasks.TaskProvider * } * ``` */ +@Suppress("unused") fun JsTasks.webpack() { assembleJs.configure { @@ -92,6 +93,7 @@ private val copyBundledJsName = TaskName.of("copyBundledJs", Copy::class) * * The task copies bundled JavaScript sources to the publication directory. */ +@Suppress("unused") val TaskContainer.copyBundledJs: TaskProvider get() = named(copyBundledJsName) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt b/buildSrc/src/main/kotlin/io/spine/gradle/kotlin/KotlinConfig.kt similarity index 87% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/kotlin/KotlinConfig.kt index af31ca1..65cdebd 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/kotlin/KotlinConfig.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,15 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.kotlin +package io.spine.gradle.kotlin import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile /** * Sets [Java toolchain](https://kotlinlang.org/docs/gradle.html#gradle-java-toolchains-support) - * to the specified version (e.g. 11 or 8). + * to the specified version (e.g., 11 or 8). */ fun KotlinJvmProjectExtension.applyJvmToolchain(version: Int) { jvmToolchain { @@ -52,9 +52,9 @@ fun KotlinJvmProjectExtension.applyJvmToolchain(version: String) = * Opts-in to experimental features that we use in our codebase. */ @Suppress("unused") -fun KotlinCompile.setFreeCompilerArgs() { - kotlinOptions { - freeCompilerArgs = listOf( +fun KotlinJvmCompilerOptions.setFreeCompilerArgs() { + freeCompilerArgs.addAll( + listOf( "-Xskip-prerelease-check", "-Xjvm-default=all", "-Xinline-classes", @@ -65,5 +65,5 @@ fun KotlinCompile.setFreeCompilerArgs() { "kotlin.ExperimentalStdlibApi," + "kotlin.experimental.ExperimentalTypeInference", ) - } + ) } diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/protobuf/ProtoTaskExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/protobuf/ProtoTaskExtensions.kt new file mode 100644 index 0000000..85ef9fc --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/gradle/protobuf/ProtoTaskExtensions.kt @@ -0,0 +1,418 @@ +/* + * Copyright 2025, 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.gradle.protobuf + +import com.google.protobuf.gradle.GenerateProtoTask +import com.google.protobuf.gradle.ProtobufExtension +import io.spine.gradle.sourceSets +import java.io.File +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths +import java.nio.file.StandardOpenOption.TRUNCATE_EXISTING +import org.gradle.api.Project +import org.gradle.api.file.SourceDirectorySet +import org.gradle.api.tasks.SourceSet +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.getByType +import org.gradle.plugins.ide.idea.GenerateIdeaModule +import org.gradle.plugins.ide.idea.model.IdeaModel +import org.gradle.plugins.ide.idea.model.IdeaModule +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask +import titleCaseFirstChar + +/** + * Obtains the path of the `generated` directory under the project root directory. + */ +private val Project.generatedDir: Path + get() = projectDir.resolve("generated").toPath() + +/** + * Obtains the `generated` directory for the source set of the task. + * + * If [language] is specified returns the subdirectory for this language. + */ +private fun GenerateProtoTask.generatedDir(language: String = ""): File { + val path = "${project.generatedDir}/${sourceSet.name}/$language" + return File(path) +} + +/** + * Configures a [GenerateProtoTask] for the code which cannot use Spine Model Compiler + * (e.g., Spine Base or Spine Validation modules). + * + * The task configuration consists of the following steps: + * + * 1. Adding `"kotlin"` to the list of involved `protoc` builtins. + * + * 2. Turning on the generation of a descriptor set file for each source set. + * These files are placed under the `build/descriptors` directory. + * + * 3. Removing source code generated for `com.google` package for both Java and Kotlin. + * This is done at the final steps of the code generation. + * + * 4. Making `processResource` tasks depend on corresponding `generateProto` tasks. + * If the source set of the configured task isn't `main`, appropriate infix for + * the task names is used. + * + * The usage of this extension in a module build file would be: + * ``` + * protobuf { + * generateProtoTasks.all().configureEach { + * setup() + * } + * } + * ``` + * Using the same code under `subprojects` in a root build file does not seem to work because + * test descriptor set files are not copied to resources. Performing this configuration from + * a module build script solves the issue. + * + * IMPORTANT: In addition to calling `setup`, a submodule must contain a descriptor set reference + * file (`desc.ref`) files placed under `resources`. The descriptor reference file must contain + * a reference to the descriptor set file generated by the corresponding `GenerateProtoTask`. + * + * For example, for the `test` source set, the reference would be `known_types_test.desc`, and + * for the `main` source set, the reference would be `known_types_main.desc`. + * + * See `io.spine.code.proto.DescriptorReference` and `io.spine.code.proto.FileDescriptors` classes + * under the `base` project for more details. + */ +@Suppress("unused") +fun GenerateProtoTask.setup() { + builtins.maybeCreate("kotlin") + setupDescriptorSetFileCreation() + + doLast { + copyGeneratedFiles() + } + + excludeProtocOutput() + + setupKotlinCompile() + dependOnProcessResourcesTask() + makeDirsForIdeaModule() +} + +/** + * Tell `protoc` to generate descriptor set files under the project build dir. + * + * The name of the descriptor set file to be generated + * is made to be unique via the project's Maven coordinates. + * + * As the last step of this task, writes a `desc.ref` file + * for the contextual source set, pointing to the generated descriptor set file. + * This is needed to allow other Spine libraries to locate and load the generated + * descriptor set files properly. + * + * Such a job is usually performed by Spine McJava plugin; + * however, it is not possible to use this plugin (or its code) + * in this repository due to cyclic dependencies. + */ +@Suppress( + "TooGenericExceptionCaught" /* Handling all file-writing failures in the same way.*/ +) +fun GenerateProtoTask.setupDescriptorSetFileCreation() { + // Tell `protoc` generate a descriptor set file. + // The name of the generated file reflects the Maven coordinates of the project. + val ssn = sourceSet.name + generateDescriptorSet = true + val buildDir = project.layout.buildDirectory.asFile.get().path + val descriptorsDir = "$buildDir/descriptors/${ssn}" + val descriptorName = project.descriptorSetName(sourceSet) + with(descriptorSetOptions) { + path = "$descriptorsDir/$descriptorName" + includeImports = true + includeSourceInfo = true + } + + // Add the descriptor set file into the resources. + project.sourceSets.named(ssn) { + resources.srcDirs(descriptorsDir) + } + + // Create a `desc.ref` in the same resource folder, + // with the name of the descriptor set file created above. + this.doLast { + val descRefFile = File(descriptorsDir, "desc.ref") + descRefFile.createNewFile() + try { + Files.write(descRefFile.toPath(), setOf(descriptorName), TRUNCATE_EXISTING) + } catch (e: Exception) { + project.logger.error("Error writing `${descRefFile.absolutePath}`.", e) + throw e + } + } +} + +/** + * Returns a name of the descriptor file for the given [sourceSet], + * reflecting the Maven coordinates of Gradle artifact, and the source set + * for which the descriptor set name is to be generated. + * + * The returned value is just a file name and does not contain a file path. + */ +private fun Project.descriptorSetName(sourceSet: SourceSet) = + arrayOf( + group.toString(), + name, + sourceSet.name, + version.toString() + ).joinToString(separator = "_", postfix = ".desc") + +/** + * Copies files from the [outputBaseDir][GenerateProtoTask.outputBaseDir] into + * a subdirectory of [generatedDir][Project.generatedDir] for + * the current [sourceSet][GenerateProtoTask.sourceSet]. + * + * Also removes sources belonging to the `com.google` package in the target directory. + */ +private fun GenerateProtoTask.copyGeneratedFiles() { + project.copy { + from(outputBaseDir) + into(generatedDir()) + } + deleteComGoogle("java") + deleteComGoogle("kotlin") +} + +/** + * Remove the code generated for Google Protobuf library types. + * + * Java code for the `com.google` package was generated because we wanted + * to have descriptors for all the types, including those from Google Protobuf library. + * We want all the descriptors so that they are included into the resources used by + * the `io.spine.type.KnownTypes` class. + * + * Now, as we have the descriptors _and_ excessive Java or Kotlin code, we delete it to avoid + * classes that duplicate those coming from Protobuf library JARs. + */ +private fun GenerateProtoTask.deleteComGoogle(language: String) { + val comDirectory = generatedDir(language).resolve("com") + val googlePackage = comDirectory.resolve("google") + + project.delete(googlePackage) + + // If the `com` directory becomes empty, delete it too. + if (comDirectory.exists() && comDirectory.isDirectory && comDirectory.list()!!.isEmpty()) { + project.delete(comDirectory) + } +} + +/** + * Exclude [GenerateProtoTask.outputBaseDir] from Java source set directories to avoid + * duplicated source code files. + */ +fun GenerateProtoTask.excludeProtocOutput() { + val protocOutputDir = File(outputBaseDir).parentFile + val java: SourceDirectorySet = sourceSet.java + + // Filter out directories belonging to `build/generated/source/proto`. + val newSourceDirectories = java.sourceDirectories + .filter { !it.residesIn(protocOutputDir) } + .toSet() + // Make sure we start from scratch. + // Not doing this failed the following, real, assignment sometimes. + java.setSrcDirs(listOf()) + java.srcDirs(newSourceDirectories) + + // Add copied files to the Java source set. + java.srcDir(generatedDir("java")) + java.srcDir(generatedDir("kotlin")) +} + +/** + * Make sure Kotlin compilation explicitly depends on this `GenerateProtoTask` to avoid racing. + */ +fun GenerateProtoTask.setupKotlinCompile() { + val kotlinCompile = project.kotlinCompilationTaskFor(sourceSet) + kotlinCompile?.dependsOn(this) +} + +/** + * Make the tasks `processResources` depend on `generateProto` tasks explicitly so that: + * 1) Descriptor set files get into resources, avoiding the racing conditions + * during the build. + * + * 2) We don't have the warning "Execution optimizations have been disabled..." issued + * by Gradle during the build because Protobuf Gradle Plugin does not set + * dependencies between `generateProto` and `processResources` tasks. + */ +fun GenerateProtoTask.dependOnProcessResourcesTask() { + val processResources = processResourceTaskName(sourceSet.name) + project.tasks[processResources].dependsOn(this) +} + +/** + * 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.titleCaseFirstChar() + return "process${infix}Resources" +} + +private fun Project.kotlinCompilationTaskFor(sourceSet: SourceSet): KotlinCompilationTask<*>? { + val taskName = sourceSet.getCompileTaskName("Kotlin") + return tasks.named(taskName, KotlinCompilationTask::class.java).orNull +} + +private fun File.residesIn(directory: File): Boolean = + canonicalFile.startsWith(directory.absolutePath) + +/** + * Ensures that generated directories for Java and Kotlin are created before [GenerateIdeaModule]. + * + * This works as advised by `Utils.groovy` from Protobuf Gradle plugin: + * ``` + * This is required because the IntelliJ IDEA plugin does not allow adding source directories + * that do not exist. The IntelliJ IDEA config files should be valid from the start even if + * a user runs './gradlew idea' before running './gradlew generateProto'. + * ``` + */ +fun GenerateProtoTask.makeDirsForIdeaModule() { + project.plugins.withId("idea") { + val javaDir = generatedDir("java") + val kotlinDir = generatedDir("kotlin") + project.tasks.withType(GenerateIdeaModule::class.java).forEach { + it.doFirst { + javaDir.mkdirs() + kotlinDir.mkdirs() + } + } + } +} + +/** + * Prints diagnostic output of `sourceDirs` and `generatedSourceDirs` of an [IdeaModule]. + * + * To get a handle on [IdeaModule] please use the following code: + * + * ```kotlin + * val module = project.extensions.findByType(IdeaModel::class.java)!!.module + * ``` + */ +@Suppress("unused") // To be used when debugging build scripts. +fun IdeaModule.printSourceDirectories() { + println("**** [IDEA] Source directories:") + sourceDirs.forEach { println(it) } + println() + println("**** [IDEA] Generated source directories:") + generatedSourceDirs.forEach { println(it) } + println() + println("**** [IDEA] Excluded directories:") + excludeDirs.forEach { println(it) } +} + +/** + * Obtains the directory where the Protobuf Gradle Plugin should place the generated code. + * + * The directory is fixed to be `$buildDir/generated/source/proto` and cannot be + * changed by the settings of the plugin. Even though [ProtobufExtension] has a property + * [generatedFilesBaseDir][ProtobufExtension.getGeneratedFilesBaseDir], which is supposed + * to be used for this purpose, it is declared with `@PackageScope` and thus cannot be + * accessed from outside the plugin. The Protobuf Gradle Plugin (at v0.9.2) does not + * modify the value of the property either. + */ +val Project.generatedSourceProtoDir: Path + get() = layout.buildDirectory.dir("generated/source/proto").get().asFile.toPath() + +/** + * Ensures that the sources generated by Protobuf Gradle Plugin + * are not included in the IDEA project. + * + * IDEA should only see the sources generated by ProtoData as + * we define in [GenerateProtoTask.excludeProtocOutput]. + */ +@Suppress("unused") +fun Project.configureIdea() { + + fun filterSources(sources: Set, excludeDir: File): Set = + sources.filter { !it.residesIn(excludeDir) }.toSet() + + pluginManager.withPlugin("idea") { + val idea = extensions.getByType() + with(idea.module) { + val protocOutput = file(generatedSourceProtoDir) + val protocTargets = protocTargets() + excludeWithNested(protocOutput.toPath(), protocTargets) + sourceDirs = filterSources(sourceDirs, protocOutput) + testSources.filter { !it.residesIn(protocOutput) } + generatedSourceDirs = generatedDir.resolve(protocTargets) + .map { it.toFile() } + .toSet() + } + } +} + +/** + * Lists target directories for Protobuf code generation. + * + * The directory names are in the following format: + * + * `/` + */ +private fun Project.protocTargets(): List { + val protobufTasks = tasks.withType(GenerateProtoTask::class.java) + val codegenTargets = sequence { + protobufTasks.forEach { task -> + val sourceSet = task.sourceSet.name + val builtins = task.builtins.map { builtin -> builtin.name } + val plugins = task.plugins.map { plugin -> plugin.name } + val combined = builtins + plugins + combined.forEach { subdir -> + yield(Paths.get(sourceSet, subdir)) + } + } + } + return codegenTargets.toList() +} + +private fun Path.resolve(subdirs: Iterable): List = + subdirs.map { + resolve(it) + } + +/** + * Excludes the given directory and its subdirectories from + * being seen as ones with the source code. + * + * The primary use of this extension is to exclude `build/generated/source/proto` and its + * subdirectories to avoid duplication of types in the generated code with those in + * produced by ProtoData under the `$projectDir/generated/` directory. + */ +private fun IdeaModule.excludeWithNested(directory: Path, subdirs: Iterable) { + excludeDirs.add(directory.toFile()) + directory.resolve(subdirs).forEach { + excludeDirs.add(it.toFile()) + } +} + +@Suppress("unused") // To be used when debugging build scripts. +private fun printExcluded(dir: Any) { + println(" [IDEA] Excluding directory: $dir") +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CheckVersionIncrement.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt similarity index 80% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CheckVersionIncrement.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt index e797527..9e38068 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CheckVersionIncrement.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.gradle.publish import com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES import com.fasterxml.jackson.dataformat.xml.XmlMapper -import io.spine.internal.gradle.Repository +import io.spine.gradle.Repository import java.io.FileNotFoundException import java.net.URL import org.gradle.api.DefaultTask @@ -70,8 +70,9 @@ open class CheckVersionIncrement : DefaultTask() { val versions = metadata?.versioning?.versions val versionExists = versions?.contains(version) ?: false if (versionExists) { - throw GradleException(""" - Version `$version` is already published to maven repository `$repoUrl`. + throw GradleException( + """ + The version `$version` is already published to the Maven repository `$repoUrl`. Try incrementing the library version. All available versions are: ${versions?.joinToString(separator = ", ")}. @@ -88,13 +89,28 @@ open class CheckVersionIncrement : DefaultTask() { private fun Project.artifactPath(): String { val group = this.group as String - val name = "spine-${this.name}" + val name = "${artifactPrefix()}${this.name}" val pathElements = ArrayList(group.split('.')) pathElements.add(name) val path = pathElements.joinToString(separator = "/") return path } + + /** + * Returns the artifact prefix used for the publishing of this project. + * + * All current Spine modules should be using `SpinePublishing`. + * Therefore, the corresponding extension should be present in the root project. + * However, just in case, we define the "standard" prefix here as well. + * + * This value MUST be the same as defined by the defaults in `SpinePublishing`. + */ + private fun Project.artifactPrefix(): String { + val ext = rootProject.extensions.findByType(SpinePublishing::class.java) + val result = ext?.artifactPrefix ?: SpinePublishing.DEFAULT_PREFIX + return result + } } private data class MavenMetadata(var versioning: Versioning = Versioning()) { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudArtifactRegistry.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudArtifactRegistry.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudArtifactRegistry.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudArtifactRegistry.kt index 143ea25..1cfa7c2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudArtifactRegistry.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudArtifactRegistry.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.gradle.publish import com.google.auth.oauth2.GoogleCredentials import com.google.cloud.artifactregistry.auth.DefaultCredentialProvider -import io.spine.internal.gradle.Credentials -import io.spine.internal.gradle.Repository +import io.spine.gradle.Credentials +import io.spine.gradle.Repository import java.io.IOException import org.gradle.api.Project diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudRepo.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudRepo.kt index 48cd858..7db15aa 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CloudRepo.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.gradle.publish -import io.spine.internal.gradle.Repository +import io.spine.gradle.Repository /** * CloudRepo Maven repository. * * There is a special treatment for this repository. Usually, fetching and publishing of artifacts * is performed via the same URL. But it is not true for CloudRepo. Fetching is performed via - * public repository, and publishing via private one. Their URLs differ in `/public` infix. + * the public repository, and publishing via the private one. Their URLs differ in `/public` infix. */ internal object CloudRepo { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/GitHubPackages.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/GitHubPackages.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/GitHubPackages.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/GitHubPackages.kt index e1867bf..1072139 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/GitHubPackages.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/GitHubPackages.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.gradle.publish -import io.spine.internal.gradle.Credentials -import io.spine.internal.gradle.Repository +import io.spine.gradle.Credentials +import io.spine.gradle.Repository +import io.spine.gradle.buildDirectory import net.lingala.zip4j.ZipFile import org.gradle.api.Project @@ -90,7 +91,7 @@ private fun Project.readGitHubToken(): String { * use such a workaround. */ private fun Project.readTokenFromArchive(): String { - val targetDir = "${buildDir}/token" + val targetDir = "$buildDirectory/token" file(targetDir).mkdirs() val fileToUnzip = "${rootDir}/buildSrc/aus.weis" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/IncrementGuard.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/IncrementGuard.kt index e69b624..b6683fa 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/IncrementGuard.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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,7 @@ @file:Suppress("unused") -package io.spine.internal.gradle.publish +package io.spine.gradle.publish import org.gradle.api.Plugin import org.gradle.api.Project @@ -45,19 +45,20 @@ class IncrementGuard : Plugin { /** * Adds the [CheckVersionIncrement] task to the project. * - * Only adds the check if the project is built on Travis CI and the job is a pull request. + * The task is created anyway, but it is enabled only if: + * 1. The project is built on GitHub CI, and + * 2. The job is a pull request. * - * The task only runs on non-master branches on GitHub Actions. This is done - * to prevent unexpected CI fails when re-building `master` multiple times, creating git - * tags, and in other cases that go outside of the "usual" development cycle. + * The task only runs on non-master branches on GitHub Actions. + * This is done to prevent unexpected CI fails when re-building `master` multiple times, + * creating git tags, and in other cases that go outside the "usual" development cycle. */ override fun apply(target: Project) { val tasks = target.tasks tasks.register(taskName, CheckVersionIncrement::class.java) { - repository = CloudRepo.published + repository = CloudArtifactRegistry.repository tasks.getByName("check").dependsOn(this) - shouldRunAfter("test") if (!shouldCheckVersion()) { logger.info( "The build does not represent a GitHub Actions feature branch job, " + @@ -72,10 +73,10 @@ class IncrementGuard : Plugin { * Returns `true` if the current build is a GitHub Actions build which represents a push * to a feature branch. * - * Returns `false` if the associated reference is not a branch (e.g. a tag) or if it has + * Returns `false` if the associated reference is not a branch (e.g., a tag) or if it has * the name which ends with `master` or `main`. * - * For example, on the following branhces the method would return `false`: + * For example, on the following branches the method would return `false`: * * 1. `master`. * 2. `main`. diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/JarDsl.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/JarDsl.kt new file mode 100644 index 0000000..1371184 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/JarDsl.kt @@ -0,0 +1,167 @@ +/* + * Copyright 2025, 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.gradle.publish + +/** + * A DSL element of [SpinePublishing] extension which configures publishing of + * [dokkaKotlinJar] artifact. + * + * This artifact contains Dokka-generated documentation. By default, it is not published. + * + * Take a look at the [SpinePublishing.dokkaJar] for a usage example. + * + * @see [artifacts] + */ +class DokkaJar { + /** + * Enables publishing `JAR`s with Dokka-generated documentation for all published modules. + */ + @Suppress("unused") + @Deprecated("Please use `kotlin` and `java` flags instead.") + var enabled = false + + /** + * Controls whether [dokkaKotlinJar] artifact should be published. + * The default value is `true`. + */ + var kotlin = true + + /** + * Controls whether [dokkaJavaJar] artifact should be published. + * The default value is `false`. + */ + var java = false +} + +/** + * A DSL element of [SpinePublishing] extension which allows enabling publishing + * of [testJar] artifact. + * + * This artifact contains compilation output of `test` source set. By default, it is not published. + * + * Take a look on [SpinePublishing.testJar] for a usage example. + + * @see [artifacts] + */ +class TestJar { + + /** + * Set of modules, for which a test JAR will be published. + */ + var inclusions: Set = emptySet() + + /** + * Enables test JAR publishing for all published modules. + */ + var enabled = false +} + +/** + * A DSL element of [SpinePublishing] extension which allows disabling publishing + * of [protoJar] artifact. + * + * This artifact contains all the `.proto` definitions from `sourceSets.main.proto`. By default, + * it is published. + * + * Take a look on [SpinePublishing.protoJar] for a usage example. + * + * @see [artifacts] + */ +class ProtoJar { + + /** + * Set of modules, for which a proto JAR will not be published. + */ + var exclusions: Set = emptySet() + + /** + * Disables proto JAR publishing for all published modules. + */ + var disabled = false +} + +/** + * Flags for turning optional JAR artifacts in a project. + */ +internal data class JarFlags( + + /** + * Tells whether [sourcesJar] artifact should be published. + * + * Default value is `true`. + */ + val sourcesJar: Boolean = true, + + /** + * Tells whether [javadocJar] artifact should be published. + * + * Default value is `true`. + */ + val javadocJar: Boolean = true, + + /** + * Tells whether [protoJar] artifact should be published. + */ + val publishProtoJar: Boolean, + + /** + * Tells whether [testJar] artifact should be published. + */ + val publishTestJar: Boolean, + + /** + * Tells whether [dokkaKotlinJar] artifact should be published. + */ + val publishDokkaKotlinJar: Boolean, + + /** + * Tells whether [dokkaJavaJar] artifact should be published. + */ + val publishDokkaJavaJar: Boolean +) { + internal companion object { + /** + * Creates an instance of [JarFlags] for the project with the given name, + * taking the setup parameters from JAR DSL elements. + */ + fun create( + projectName: String, + protoJar: ProtoJar, + testJar: TestJar, + dokkaJar: DokkaJar + ): JarFlags { + val addProtoJar = (protoJar.exclusions.contains(projectName) || protoJar.disabled).not() + val addTestJar = testJar.inclusions.contains(projectName) || testJar.enabled + return JarFlags( + sourcesJar = true, + javadocJar = true, + addProtoJar, addTestJar, + dokkaJar.kotlin, dokkaJar.java + ) + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/ProtoExts.kt similarity index 50% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/ProtoExts.kt index ef048f2..874b7f9 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/ProtoExts.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,14 +24,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +package io.spine.gradle.publish -import io.spine.internal.gradle.sourceSets +import io.spine.gradle.sourceSets import java.io.File import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.file.FileTreeElement import org.gradle.api.file.SourceDirectorySet -import org.gradle.kotlin.dsl.get - +import org.gradle.api.tasks.bundling.Jar /** * Tells whether there are any Proto sources in "main" source set. @@ -43,13 +44,46 @@ internal fun Project.hasProto(): Boolean { } /** - * Locates Proto sources in "main" source set. + * Locates directories with proto sources under the "main" source sets. * - * "main" source set is added by `java` plugin. Special treatment for Proto sources is needed, - * because they are not Java-related, and, thus, not included in `sourceSets["main"].allSource`. + * Special treatment for Proto sources is needed, because they are not Java-related, and, + * thus, not included in `sourceSets["main"].allSource`. */ internal fun Project.protoSources(): Set { - val mainSourceSet = sourceSets["main"] - val protoSourceDirs = mainSourceSet.extensions.findByName("proto") as SourceDirectorySet? - return protoSourceDirs?.srcDirs ?: emptySet() + val mainSourceSets = sourceSets.filter { + ss -> ss.name.endsWith("main", ignoreCase = true) + } + + val protoExtensions = mainSourceSets.mapNotNull { + it.extensions.findByName("proto") as SourceDirectorySet? + } + + val protoDirs = mutableSetOf() + protoExtensions.forEach { + protoDirs.addAll(it.srcDirs) + } + + return protoDirs +} + +/** + * Checks if the given file belongs to the Google `.proto` sources. + */ +internal fun FileTreeElement.isGoogleProtoSource(): Boolean { + val pathSegments = relativePath.segments + return pathSegments.isNotEmpty() && pathSegments[0].equals("google") +} + +/** + * The reference to the `generateProto` task of a `main` source set. + */ +internal fun Project.generateProto(): Task? = tasks.findByName("generateProto") + +/** + * Makes this [Jar] task depend on the [generateProto] task, if it exists in the same project. + */ +internal fun Jar.dependOnGenerateProto() { + project.generateProto()?.let { + this.dependsOn(it) + } } diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/Publications.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/Publications.kt new file mode 100644 index 0000000..c9acef8 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/Publications.kt @@ -0,0 +1,234 @@ +/* + * Copyright 2025, 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.gradle.publish + +import io.spine.gradle.Repository +import io.spine.gradle.isSnapshot +import org.gradle.api.Project +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.tasks.TaskProvider +import org.gradle.api.tasks.bundling.Jar +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.create + +/** + * The name of the Maven Publishing Gradle plugin. + */ +private const val MAVEN_PUBLISH = "maven-publish" + +/** + * Abstract base for handlers of publications in a project + * with [spinePublishing] settings declared. + */ +internal sealed class PublicationHandler( + protected val project: Project, + private val destinations: Set +) { + + fun apply() = with(project) { + if (!hasCustomPublishing) { + apply(plugin = MAVEN_PUBLISH) + } + + pluginManager.withPlugin(MAVEN_PUBLISH) { + handlePublications() + registerDestinations() + configurePublishTask(destinations) + } + } + + /** + * Either handles publications already declared in the given project, + * or creates new ones. + */ + abstract fun handlePublications() + + /** + * Goes through the [destinations] and registers each as a repository for publishing + * in the given Gradle project. + */ + private fun registerDestinations() { + val repositories = project.publishingExtension.repositories + destinations.forEach { destination -> + repositories.register(project, destination) + } + } + + /** + * Copies the attributes of Gradle [Project] to this [MavenPublication]. + * + * The following project attributes are copied: + * * [group][Project.getGroup]; + * * [version][Project.getVersion]; + * * [description][Project.getDescription]. + * + * Also, this function adds the [artifactPrefix][SpinePublishing.artifactPrefix] to + * the [artifactId][MavenPublication.setArtifactId] of this publication, + * if the prefix is not added yet. + * + * Finally, the Apache Software License 2.0 is set as the only license + * under which the published artifact is distributed. + */ + protected fun MavenPublication.copyProjectAttributes() { + groupId = project.group.toString() + val prefix = project.spinePublishing.artifactPrefix + if (!artifactId.startsWith(prefix)) { + artifactId = prefix + artifactId + } + version = project.version.toString() + pom.description.set(project.description) + + pom.licenses { + license { + name.set("The Apache Software License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + } +} + +/** + * Adds a Maven repository to the project specifying credentials, if they are + * [available][Repository.credentials] from the root project. + */ +private fun RepositoryHandler.register(project: Project, repository: Repository) { + val isSnapshot = project.version.toString().isSnapshot() + val target = if (isSnapshot) repository.snapshots else repository.releases + val credentials = repository.credentials(project.rootProject) + maven { + url = project.uri(target) + credentials { + username = credentials?.username + password = credentials?.password + } + } +} + +/** + * A publication for a typical Java project. + * + * In Gradle, to publish something, one should create a publication. + * A publication has a name and consists of one or more artifacts plus information about + * those artifacts – the metadata. + * + * An instance of this class represents [MavenPublication] named "mavenJava". It is generally + * accepted that a publication with this name contains a Java project published to one or + * more Maven repositories. + * + * By default, only a jar with the compilation output of `main` source set and its + * metadata files are published. Other artifacts are specified through the + * [constructor parameter][jarFlags]. Please, take a look on [specifyArtifacts] for additional info. + * + * @param jarFlags + * flags for additional JARs published along with the compilation output. + * @param destinations + * Maven repositories to which the produced artifacts will be sent. + * @see + * Maven Publish Plugin | Publications + */ +internal class StandardJavaPublicationHandler( + project: Project, + private val jarFlags: JarFlags, + destinations: Set, +) : PublicationHandler(project, destinations) { + + /** + * Creates a new "mavenJava" [MavenPublication] in the given project. + */ + override fun handlePublications() { + val jars = project.artifacts(jarFlags) + val publications = project.publications + publications.create("mavenJava") { + copyProjectAttributes() + specifyArtifacts(jars) + } + } + + /** + * Specifies which artifacts this [MavenPublication] will contain. + * + * A typical Maven publication contains: + * + * 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 + * 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). + * The presence of ".module" is optional, but useful when a publication is consumed by Gradle. + * + * @see Maven – POM Reference + * @see + * Understanding Gradle Module Metadata + */ + private fun MavenPublication.specifyArtifacts(jars: Set>) { + + /* "java" component provides a jar with compilation output of "main" source set. + It is NOT defined as another `Jar` task intentionally. Doing that will leave the + publication without correct ".pom" and ".module" metadata files generated. + */ + val javaComponent = project.components.findByName("java") + javaComponent?.let { + from(it) + } + + /* Other artifacts are represented by `Jar` tasks. Those artifacts don't bring any other + metadata in comparison with `Component` (such as dependencies notation). + */ + jars.forEach { + artifact(it) + } + } +} + +/** + * A handler for custom publications, which are declared under the [publications] + * section of a module. + * + * Such publications should be treated differently than [StandardJavaPublicationHandler], + * which is created for a module. Instead, since the publications are already declared, + * this class only [assigns maven coordinates][copyProjectAttributes]. + * + * A module which declares custom publications must be specified in + * the [SpinePublishing.modulesWithCustomPublishing] property. + * + * If a module with [publications] declared locally is not specified as one with custom publishing, + * it may cause a name clash between an artifact produced by the [standard][MavenPublication] + * publication, and custom ones. To have both standard and custom publications, + * please specify custom artifact IDs or classifiers for each custom publication. + */ +internal class CustomPublicationHandler(project: Project, destinations: Set) : + PublicationHandler(project, destinations) { + + override fun handlePublications() { + project.publications.forEach { + (it as MavenPublication).copyProjectAttributes() + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingExts.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingExts.kt new file mode 100644 index 0000000..62c639b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingExts.kt @@ -0,0 +1,278 @@ +/* + * Copyright 2025, 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.gradle.publish + +import dokkaKotlinJar +import io.spine.gradle.Repository +import io.spine.gradle.sourceSets +import java.util.* +import org.gradle.api.InvalidUserDataException +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.publish.PublicationContainer +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.TaskProvider +import org.gradle.api.tasks.bundling.Jar +import org.gradle.kotlin.dsl.findByType +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.named +import org.gradle.kotlin.dsl.register +import org.gradle.kotlin.dsl.withType + +/** + * Obtains [PublishingExtension] of this project. + */ +internal val Project.publishingExtension: PublishingExtension + get() = extensions.getByType() + +/** + * Obtains [PublicationContainer] of this project. + */ +internal val Project.publications: PublicationContainer + get() = publishingExtension.publications + +/** + * Obtains [SpinePublishing] extension from this [Project]. + * + * If this [Project] doesn't have one, it returns [SpinePublishing] + * declared in the root project. + */ +internal val Project.spinePublishing: SpinePublishing + get() { + val local = this.extensions.findByType() + if (local != null) { + return local + } + val fromRoot = this.rootProject.extensions.findByType() + if (fromRoot != null) { + return fromRoot + } + error("`SpinePublishing` is not found in `${project.name}`.") + } + +/** + * Tells if this project has custom publishing. + */ +internal val Project.hasCustomPublishing: Boolean + get() = spinePublishing.modulesWithCustomPublishing.contains(name) + +private const val PUBLISH_TASK = "publish" + +/** + * Locates `publish` task in this [TaskContainer]. + * + * This task publishes all defined publications to all defined repositories. To achieve that, + * the task depends on all `publish`*PubName*`PublicationTo`*RepoName*`Repository` tasks. + * + * Please note, task execution would not copy publications to the local Maven cache. + * + * @see + * Tasks | Maven Publish Plugin + */ +internal val TaskContainer.publish: TaskProvider + get() = named(PUBLISH_TASK) + +/** + * Sets dependencies for `publish` task in this [Project]. + * + * This method performs the following: + * + * 1. When this [Project] is not a root, makes `publish` task in a root project + * depend on a local `publish`. + * 2. Makes local `publish` task verify that credentials are present for each + * of destination repositories. + */ +internal fun Project.configurePublishTask(destinations: Set) { + attachCredentialsVerification(destinations) + bindToRootPublish() +} + +private fun Project.attachCredentialsVerification(destinations: Set) { + val checkCredentials = tasks.registerCheckCredentialsTask(destinations) + val localPublish = tasks.publish + localPublish.configure { dependsOn(checkCredentials) } +} + +private fun Project.bindToRootPublish() { + if (project == rootProject) { + return + } + + val localPublish = tasks.publish + val rootPublish = rootProject.tasks.getOrCreatePublishTask() + rootPublish.configure { dependsOn(localPublish) } +} + +/** + * Use this task accessor when it is not guaranteed that the task is present + * in this [TaskContainer]. + */ +private fun TaskContainer.getOrCreatePublishTask(): TaskProvider = + if (names.contains(PUBLISH_TASK)) { + named(PUBLISH_TASK) + } else { + register(PUBLISH_TASK) + } + +private fun TaskContainer.registerCheckCredentialsTask( + destinations: Set +): TaskProvider = + register("checkCredentials") { + doLast { + destinations.forEach { it.ensureCredentials(project) } + } + } + +private fun Repository.ensureCredentials(project: Project) { + val credentials = credentials(project) + if (Objects.isNull(credentials)) { + throw InvalidUserDataException( + "No valid credentials for repository `${this}`. Please make sure " + + "to pass username/password or a valid `.properties` file." + ) + } +} + +/** + * Excludes Google `.proto` sources from all artifacts. + * + * Goes through all registered `Jar` tasks and filters out Google's files. + */ +@Suppress("unused") +fun TaskContainer.excludeGoogleProtoFromArtifacts() { + withType().configureEach { + exclude { it.isGoogleProtoSource() } + } +} + +/** + * Locates or creates `sourcesJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains sources from `main` source set. + * The task makes sure that sources from the directories below will be included into + * a resulted archive: + * + * - Kotlin + * - Java + * - Proto + * + * Java and Kotlin sources are default to `main` source set since it is created by `java` plugin. + * For Proto sources to be included – [special treatment][protoSources] is needed. + */ +internal fun Project.sourcesJar(): TaskProvider = tasks.getOrCreate("sourcesJar") { + dependOnGenerateProto() + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) // Puts Java and Kotlin sources. + from(protoSources()) // Puts Proto sources. + exclude("desc.ref", "*.desc") // Exclude descriptor files and the descriptor reference. +} + +/** + * Locates or creates `protoJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains only + * [Proto sources][protoSources] from `main` source set. + */ +internal fun Project.protoJar(): TaskProvider = tasks.getOrCreate("protoJar") { + dependOnGenerateProto() + archiveClassifier.set("proto") + from(protoSources()) +} + +/** + * Locates or creates `testJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains compilation output + * of `test` source set. + */ +internal fun Project.testJar(): TaskProvider = tasks.getOrCreate("testJar") { + archiveClassifier.set("test") + from(sourceSets["test"].output) +} + +/** + * Locates or creates `javadocJar` task in this [Project]. + * + * The output of this task is a `jar` archive. The archive contains Javadoc, + * generated upon Java sources from `main` source set. If javadoc for Kotlin is also needed, + * apply Dokka plugin. It tunes `javadoc` task to generate docs upon Kotlin sources as well. + */ +fun Project.javadocJar(): TaskProvider = tasks.getOrCreate("javadocJar") { + archiveClassifier.set("javadoc") + val javadocFiles = layout.buildDirectory.files("/docs/javadoc") + from(javadocFiles) + dependsOn("javadoc") +} + +internal fun TaskContainer.getOrCreate(name: String, init: Jar.() -> Unit): TaskProvider = + if (names.contains(name)) { + named(name) + } else { + register(name) { + init() + } + } + +/** + * Obtains as a set of [Jar] tasks, output of which is used as Maven artifacts. + * + * By default, only a jar with Java compilation output is included into publication. This method + * registers tasks which produce additional artifacts according to the values of [jarFlags]. + * + * @return the list of the registered tasks. + */ +internal fun Project.artifacts(jarFlags: JarFlags): Set> { + val tasks = mutableSetOf>() + + if (jarFlags.sourcesJar) { + tasks.add(sourcesJar()) + } + + if (jarFlags.javadocJar) { + tasks.add(javadocJar()) + } + + // We don't want to have an empty "proto.jar" when a project doesn't have any Proto files. + if (hasProto() && jarFlags.publishProtoJar) { + tasks.add(protoJar()) + } + + // Here, we don't have the corresponding `hasTests()` check, since this artifact is disabled + // by default. And turning it on means "We have tests and need them to be published." + if (jarFlags.publishTestJar) { + tasks.add(testJar()) + } + + if (jarFlags.publishDokkaKotlinJar) { + tasks.add(dokkaKotlinJar()) + } + + return tasks +} + diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingRepos.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingRepos.kt new file mode 100644 index 0000000..f383e68 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingRepos.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2025, 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.gradle.publish + +import io.spine.gradle.Repository + +/** + * Repositories to which we may publish. + */ +object PublishingRepos { + + val cloudArtifactRegistry = CloudArtifactRegistry.repository + + /** + * Obtains a GitHub repository by the given name. + */ + fun gitHub(repoName: String): Repository = GitHubPackages.repository(repoName) +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt similarity index 72% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt index 9f63de1..2f74536 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,17 +24,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.publish +@file:Suppress("TooManyFunctions") -import io.spine.internal.gradle.Repository +package io.spine.gradle.publish + +import dokkaJavaJar +import dokkaKotlinJar +import io.spine.gradle.Repository import org.gradle.api.Project -import org.gradle.api.publish.PublicationContainer -import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.plugins.MavenPublishPlugin import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.findByType -import org.gradle.kotlin.dsl.getByType /** * Configures [SpinePublishing] extension. @@ -76,7 +77,7 @@ import org.gradle.kotlin.dsl.getByType * `spinePublishing` extension within `subprojectA` itself would lead to an exception. * * In Gradle, in order to publish something somewhere one should create a publication. In each - * of published modules, the extension will create a [publication][MavenJavaPublication] + * of published modules, the extension will create a [publication][StandardJavaPublicationHandler] * named "mavenJava". All artifacts, published by this extension belong to this publication. * * By default, along with the compilation output of "main" source set, the extension publishes @@ -103,20 +104,24 @@ import org.gradle.kotlin.dsl.getByType * 3. [javadocJar] - javadoc, generated upon Java sources from "main" source set. * If javadoc for Kotlin is also needed, apply Dokka plugin. It tunes `javadoc` task to generate * docs upon Kotlin sources as well. + * 4. [dokkaKotlinJar] - documentation generated by Dokka for Kotlin and Java sources + * using the Kotlin API mode. + * 5. [dokkaJavaJar] - documentation generated by Dokka for Kotlin and Java sources + * * using the Java API mode. * * Additionally, [testJar] artifact can be published. This artifact contains compilation output * of "test" source set. Use [SpinePublishing.testJar] to enable its publishing. * - * @see [registerArtifacts] + * @see [artifacts] */ -fun Project.spinePublishing(configuration: SpinePublishing.() -> Unit) { +fun Project.spinePublishing(block: SpinePublishing.() -> Unit) { apply() val name = SpinePublishing::class.java.simpleName val extension = with(extensions) { findByType() ?: create(name, project) } extension.run { - configuration() + block() configured() } } @@ -132,6 +137,14 @@ fun Project.spinePublishing(configuration: SpinePublishing.() -> Unit) { */ open class SpinePublishing(private val project: Project) { + companion object { + + /** + * The default prefix added before a module name when publishing artifacts. + */ + const val DEFAULT_PREFIX = "spine-" + } + private val protoJar = ProtoJar() private val testJar = TestJar() private val dokkaJar = DokkaJar() @@ -139,7 +152,7 @@ open class SpinePublishing(private val project: Project) { /** * Set of modules to be published. * - * Both module's name or path can be used. + * Both the module's name or path can be used. * * Use this property if the extension is configured from a root project's build file. * @@ -149,6 +162,22 @@ open class SpinePublishing(private val project: Project) { */ var modules: Set = emptySet() + /** + * Controls whether the published module needs standard publications. + * + * If `true`, the module should configure publications on its own. + * Otherwise, the extension will configure standard [ones][StandardJavaPublicationHandler]. + * + * This property is analogue of [modulesWithCustomPublishing] for projects, + * for which [spinePublishing] is configured individually. + * + * Setting of this property and having a non-empty [modules] will lead + * to an exception. + * + * Default value is `false`. + */ + var customPublishing = false + /** * Set of modules that have custom publications and do not need standard ones. * @@ -176,16 +205,14 @@ open class SpinePublishing(private val project: Project) { /** * A prefix to be added before the name of each artifact. - * - * Default value is "spine-". */ - var artifactPrefix: String = "spine-" + var artifactPrefix: String = DEFAULT_PREFIX /** * Allows disabling publishing of [protoJar] artifact, containing all Proto sources * from `sourceSets.main.proto`. * - * Here's an example of how to disable it for some of published modules: + * Here's an example of how to disable it for some of the published modules: * * ``` * spinePublishing { @@ -211,20 +238,20 @@ open class SpinePublishing(private val project: Project) { * } * ``` * - * The resulting artifact is available under "proto" classifier. I.e., in Gradle 7+, one could - * depend on it like this: + * The resulting artifact is available under "proto" classifier. + * For example, in Gradle 7+, one could depend on it like this: * * ``` * implementation("io.spine:spine-client:$version@proto") * ``` */ - fun protoJar(configuration: ProtoJar.() -> Unit) = protoJar.run(configuration) + fun protoJar(block: ProtoJar.() -> Unit) = protoJar.run(block) /** * Allows enabling publishing of [testJar] artifact, containing compilation output * of "test" source set. * - * Here's an example of how to enable it for some of published modules: + * Here's an example of how to enable it for some of the published modules: * * ``` * spinePublishing { @@ -250,38 +277,42 @@ open class SpinePublishing(private val project: Project) { * } * ``` * - * The resulting artifact is available under "test" classifier. I.e., in Gradle 7+, one could - * depend on it like this: + * The resulting artifact is available under "test" classifier. For example, + * in Gradle 7+, one could depend on it like this: * * ``` * implementation("io.spine:spine-client:$version@test") * ``` */ - fun testJar(configuration: TestJar.() -> Unit) = testJar.run(configuration) - + fun testJar(block: TestJar.() -> Unit) = testJar.run(block) /** - * Configures publishing of [dokkaJar] artifact, containing Dokka-generated documentation. By - * default, publishing of the artifact is disabled. + * Configures publishing of [dokkaKotlinJar] and [dokkaJavaJar] artifacts, + * containing Dokka-generated documentation. + * + * By default, publishing of the [dokkaKotlinJar] artifact is enabled, and [dokkaJavaJar] + * is disabled. * * Remember that the Dokka Gradle plugin should be applied to publish this artifact as it is * produced by the `dokkaHtml` task. It can be done by using the - * [io.spine.internal.dependency.Dokka] dependency object or by applying the - * `buildSrc/src/main/kotlin/dokka-for-java` script plugin for Java projects. + * [io.spine.dependency.build.Dokka] dependency object or by applying the + * `buildSrc/src/main/kotlin/dokka-for-kotlin` or + * `buildSrc/src/main/kotlin/dokka-for-java` script plugins. * * Here's an example of how to use this option: * * ``` * spinePublishing { * dokkaJar { - * enabled = true + * kotlin = false + * java = true * } * } * ``` * * The resulting artifact is available under "dokka" classifier. */ - fun dokkaJar(configuration: DokkaJar.() -> Unit) = dokkaJar.run(configuration) + fun dokkaJar(block: DokkaJar.() -> Unit) = dokkaJar.run(block) /** * Called to notify the extension that its configuration is completed. @@ -292,17 +323,13 @@ open class SpinePublishing(private val project: Project) { internal fun configured() { ensureProtoJarExclusionsArePublished() ensureTestJarInclusionsArePublished() - ensuresModulesNotDuplicated() - - val protoJarExclusions = protoJar.exclusions - val testJarInclusions = testJar.inclusions - val publishedProjects = publishedProjects() + ensureModulesNotDuplicated() + ensureCustomPublishingNotMisused() - publishedProjects.forEach { project -> - val name = project.name - val includeProtoJar = (protoJarExclusions.contains(name) || protoJar.disabled).not() - val includeTestJar = (testJarInclusions.contains(name) || testJar.enabled) - setUpPublishing(project, includeProtoJar, includeTestJar, dokkaJar.enabled) + val projectsToPublish = projectsToPublish() + projectsToPublish.forEach { project -> + val jarFlags = JarFlags.create(project.name, protoJar, testJar, dokkaJar) + project.setUpPublishing(jarFlags) } } @@ -318,50 +345,46 @@ open class SpinePublishing(private val project: Project) { * * @see modules */ - private fun publishedProjects() = modules.union(modulesWithCustomPublishing) - .map { name -> project.project(name) } - .ifEmpty { setOf(project) } + private fun projectsToPublish(): Collection { + if (project.subprojects.isEmpty()) { + return setOf(project) + } + return modules.union(modulesWithCustomPublishing) + .map { name -> project.project(name) } + .ifEmpty { setOf(project) } + } /** * Sets up `maven-publish` plugin for the given project. * - * Firstly, an instance of [PublishingConfig] is assembled for the project. - * Then, this config is applied. + * Firstly, an instance of [PublicationHandler] is created for the project depending + * on the nature of the publication process configured. + * Then, this the handler is scheduled to apply on [Project.afterEvaluate]. * - * This method utilizes `project.afterEvaluate` closure. General rule of thumb is to avoid using - * of this closure, as it configures a project when its configuration is considered completed. + * General rule of thumb is to avoid using [Project.afterEvaluate] of this closure, + * as it configures a project when its configuration is considered completed. * Which is quite counter-intuitive. * - * The root cause why it is used here is a possibility to configure publishing of multiple - * modules from a root project. When this possibility is employed, in fact, we configure - * publishing for a module, build file of which has not been even evaluated by that time. - * That leads to an unexpected behavior. + * We selected to use [Project.afterEvaluate] so that we can configure publishing of multiple + * modules from a root project. When we do this, we configure publishing for a module, + * build file of which has not been even evaluated yet. * * The simplest example here is specifying of `version` and `group` for Maven coordinates. * Let's suppose, they are declared in a module's build file. It is a common practice. * But publishing of the module is configured from a root project's build file. By the time, * when we need to specify them, we just don't know them. As a result, we have to use - * `project.afterEvaluate` in order to guarantee that a module will be configured by the time + * [Project.afterEvaluate] in order to guarantee that a module will be configured by the time * we configure publishing for it. */ - private fun setUpPublishing( - project: Project, - includeProtoJar: Boolean, - includeTestJar: Boolean, - includeDokkaJar: Boolean - ) { - val artifactId = artifactId(project) - val customPublishing = modulesWithCustomPublishing.contains(project.name) - val publishingConfig = if (customPublishing) { - PublishingConfig(artifactId, destinations) + private fun Project.setUpPublishing(jarFlags: JarFlags) { + val customPublishing = modulesWithCustomPublishing.contains(name) || customPublishing + val handler = if (customPublishing) { + CustomPublicationHandler(project, destinations) } else { - PublishingConfig( - artifactId, destinations, - includeProtoJar, includeTestJar, includeDokkaJar - ) + StandardJavaPublicationHandler(project, jarFlags, destinations) } - project.afterEvaluate { - publishingConfig.apply(project) + afterEvaluate { + handler.apply() } } @@ -411,7 +434,7 @@ open class SpinePublishing(private val project: Project) { * We allow configuration of publishing from two places - a root project and module itself. * Here we verify that publishing of a module is not configured in both places simultaneously. */ - private fun ensuresModulesNotDuplicated() { + private fun ensureModulesNotDuplicated() { val rootProject = project.rootProject if (rootProject == project) { return @@ -427,16 +450,11 @@ open class SpinePublishing(private val project: Project) { } } } -} - -/** - * Obtains [PublishingExtension] of this project. - */ -internal val Project.publishingExtension: PublishingExtension - get() = extensions.getByType() -/** - * Obtains [PublicationContainer] of this project. - */ -internal val Project.publications: PublicationContainer - get() = publishingExtension.publications + private fun ensureCustomPublishingNotMisused() { + if (modules.isNotEmpty() && customPublishing) { + error("`customPublishing` property can be set only if `spinePublishing` extension " + + "is open in an individual module, so `modules` property should be empty.") + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/CodebaseFilter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/CodebaseFilter.kt similarity index 94% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/CodebaseFilter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/CodebaseFilter.kt index 89e2912..a5b9e72 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/CodebaseFilter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/CodebaseFilter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage import com.google.errorprone.annotations.CanIgnoreReturnValue -import io.spine.internal.gradle.report.coverage.FileFilter.generatedOnly +import io.spine.gradle.report.coverage.FileFilter.generatedOnly import java.io.File import kotlin.streams.toList import org.gradle.api.Project diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtension.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtension.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtension.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtension.kt index 97ab594..ae4734c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtension.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtension.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage /** * File extensions. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtensions.kt similarity index 85% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtensions.kt index 4a42797..89c8789 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage -import io.spine.internal.gradle.report.coverage.FileExtension.COMPILED_CLASS -import io.spine.internal.gradle.report.coverage.FileExtension.JAVA_SOURCE -import io.spine.internal.gradle.report.coverage.PathMarker.ANONYMOUS_CLASS -import io.spine.internal.gradle.report.coverage.PathMarker.GENERATED -import io.spine.internal.gradle.report.coverage.PathMarker.GRPC_SRC_FOLDER -import io.spine.internal.gradle.report.coverage.PathMarker.JAVA_OUTPUT_FOLDER -import io.spine.internal.gradle.report.coverage.PathMarker.JAVA_SRC_FOLDER -import io.spine.internal.gradle.report.coverage.PathMarker.SPINE_JAVA_SRC_FOLDER +import io.spine.gradle.report.coverage.FileExtension.COMPILED_CLASS +import io.spine.gradle.report.coverage.FileExtension.JAVA_SOURCE +import io.spine.gradle.report.coverage.PathMarker.ANONYMOUS_CLASS +import io.spine.gradle.report.coverage.PathMarker.GENERATED +import io.spine.gradle.report.coverage.PathMarker.GRPC_SRC_FOLDER +import io.spine.gradle.report.coverage.PathMarker.JAVA_OUTPUT_FOLDER +import io.spine.gradle.report.coverage.PathMarker.JAVA_SRC_FOLDER +import io.spine.gradle.report.coverage.PathMarker.SPINE_JAVA_SRC_FOLDER import java.io.File /** diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileFilter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileFilter.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileFilter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileFilter.kt index 1f4b382..5b26cc7 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/FileFilter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileFilter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage import java.io.File diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/JacocoConfig.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/JacocoConfig.kt similarity index 82% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/JacocoConfig.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/JacocoConfig.kt index 5e7fff4..de5d00b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/JacocoConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/JacocoConfig.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,19 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage -import io.spine.internal.gradle.applyPlugin -import io.spine.internal.gradle.findTask -import io.spine.internal.gradle.report.coverage.TaskName.check -import io.spine.internal.gradle.report.coverage.TaskName.copyReports -import io.spine.internal.gradle.report.coverage.TaskName.jacocoRootReport -import io.spine.internal.gradle.report.coverage.TaskName.jacocoTestReport -import io.spine.internal.gradle.sourceSets +import io.spine.dependency.test.Jacoco +import io.spine.gradle.applyPlugin +import io.spine.gradle.findTask +import io.spine.gradle.report.coverage.TaskName.check +import io.spine.gradle.report.coverage.TaskName.copyReports +import io.spine.gradle.report.coverage.TaskName.jacocoRootReport +import io.spine.gradle.report.coverage.TaskName.jacocoTestReport +import io.spine.gradle.sourceSets import java.io.File import java.util.* import org.gradle.api.Project -import org.gradle.api.Task import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.plugins.BasePlugin import org.gradle.api.tasks.Copy @@ -45,7 +45,9 @@ import org.gradle.api.tasks.SourceSetOutput import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.TaskProvider import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.the import org.gradle.testing.jacoco.plugins.JacocoPlugin +import org.gradle.testing.jacoco.plugins.JacocoPluginExtension import org.gradle.testing.jacoco.tasks.JacocoReport /** @@ -89,12 +91,14 @@ class JacocoConfig( */ fun applyTo(project: Project) { project.applyPlugin(BasePlugin::class.java) - project.afterEvaluate { - val javaProjects: Iterable = eligibleProjects(project) - val reportsDir = project.rootProject.buildDir.resolve(reportsDirSuffix) - JacocoConfig(project.rootProject, reportsDir, javaProjects) - .configure() - } + val javaProjects: Iterable = eligibleProjects(project) + val reportsDir = project.rootProject.layout + .buildDirectory.dir(reportsDirSuffix).get().asFile + JacocoConfig( + project.rootProject, + reportsDir, + javaProjects + ).configure() } /** @@ -120,12 +124,22 @@ class JacocoConfig( } private fun configure() { + configureVersion() + configureTask() + } + + private fun configureVersion() { + val jacoco = rootProject.the() + jacoco.toolVersion = Jacoco.version + } + + private fun configureTask() { val tasks = rootProject.tasks val copyReports = registerCopy(tasks) val rootReport = registerRootReport(tasks, copyReports) - rootProject - .findTask(check.name) - .dependsOn(rootReport) + tasks.named(check.name) { + dependsOn(rootReport) + } } private fun registerRootReport( @@ -134,9 +148,14 @@ class JacocoConfig( ): TaskProvider { val allSourceSets = Projects(projects).sourceSets() val mainJavaSrcDirs = allSourceSets.mainJavaSrcDirs() - val humanProducedSourceFolders = FileFilter.producedByHuman(mainJavaSrcDirs) - - val filter = CodebaseFilter(rootProject, mainJavaSrcDirs, allSourceSets.mainOutputs()) + val humanProducedSourceFolders = + FileFilter.producedByHuman(mainJavaSrcDirs) + + val filter = CodebaseFilter( + rootProject, + mainJavaSrcDirs, + allSourceSets.mainOutputs() + ) val humanProducedCompiledFiles = filter.humanProducedCompiledFiles() val rootReport = tasks.register(jacocoRootReport.name, JacocoReport::class.java) { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/PathMarker.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/PathMarker.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/PathMarker.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/PathMarker.kt index 00fdf24..26bb135 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/PathMarker.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/PathMarker.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage /** * Fragments of file path which allow to detect the type of the file. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/TaskName.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/TaskName.kt similarity index 86% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/TaskName.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/TaskName.kt index 76d3458..7c0e386 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/coverage/TaskName.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/TaskName.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.coverage +package io.spine.gradle.report.coverage /** - * The names of Gradle tasks involved into the JaCoCo reporting. + * The names of Gradle tasks involved in the JaCoCo reporting. */ @Suppress("EnumEntryName", "EnumNaming") /* Dubbing the actual values in Gradle. */ internal enum class TaskName { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Configuration.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Configuration.kt similarity index 92% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Configuration.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/Configuration.kt index 65fd036..f6e06fd 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Configuration.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Configuration.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import com.github.jk1.license.ConfigurationData diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/LicenseReporter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt similarity index 88% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/LicenseReporter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt index be3e250..9b7a57f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/LicenseReporter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,13 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import com.github.jk1.license.LicenseReportExtension import com.github.jk1.license.LicenseReportExtension.ALL import com.github.jk1.license.LicenseReportPlugin -import io.spine.internal.gradle.applyPlugin -import io.spine.internal.gradle.findTask +import io.spine.gradle.applyPlugin +import io.spine.gradle.findTask import java.io.File import org.gradle.api.Project import org.gradle.api.Task @@ -80,11 +80,17 @@ object LicenseReporter { */ fun generateReportIn(project: Project) { project.applyPlugin(LicenseReportPlugin::class.java) - val reportOutputDir = project.buildDir.resolve(Paths.relativePath) + val reportOutputDir = project.layout.buildDirectory.dir(Paths.relativePath).get().asFile with(project.the()) { outputDir = reportOutputDir.absolutePath - excludeGroups = arrayOf("io.spine", "io.spine.tools", "io.spine.gcloud") + excludeGroups = arrayOf( + "io.spine", + "io.spine.gcloud", + "io.spine.protodata", + "io.spine.tools", + "io.spine.validation" + ) configurations = ALL renderers = arrayOf(MarkdownReportRenderer(Paths.outputFilename)) @@ -146,7 +152,8 @@ object LicenseReporter { rootProject: Project ) { val paths = sourceProjects.map { - "${it.buildDir}/${Paths.relativePath}/${Paths.outputFilename}" + val buildDir = it.layout.buildDirectory.asFile.get() + "$buildDir/${Paths.relativePath}/${Paths.outputFilename}" } println("Merging the license reports from the all projects.") val mergedContent = paths.joinToString("\n\n\n") { (File(it)).readText() } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/MarkdownReportRenderer.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/MarkdownReportRenderer.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/MarkdownReportRenderer.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/MarkdownReportRenderer.kt index ebd62d5..b158210 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/MarkdownReportRenderer.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/MarkdownReportRenderer.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,12 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import com.github.jk1.license.LicenseReportExtension import com.github.jk1.license.ProjectData import com.github.jk1.license.render.ReportRenderer -import io.spine.internal.markup.MarkdownDocument +import io.spine.docs.MarkdownDocument import java.io.File import org.gradle.api.Project @@ -54,9 +54,8 @@ internal class MarkdownReportRenderer( } private fun outputFile(project: Project): File { - val config = - project.extensions.findByName("licenseReport") as LicenseReportExtension - return File(config.outputDir).resolve(filename) + val ext = project.extensions.findByName("licenseReport") as LicenseReportExtension + return File(ext.outputDir).resolve(filename) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ModuleDataExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/ModuleDataExtensions.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ModuleDataExtensions.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/ModuleDataExtensions.kt index c219dec..0aca30f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ModuleDataExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/ModuleDataExtensions.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import com.github.jk1.license.ModuleData -import io.spine.internal.markup.MarkdownDocument +import io.spine.docs.MarkdownDocument import kotlin.reflect.KCallable /** @@ -49,7 +49,7 @@ internal fun MarkdownDocument.printSection( } /** - * Prints the metadata of the module to the specified [Markdown document][out]. + * Prints the module metadata to this [MarkdownDocument]. */ private fun MarkdownDocument.printModule(module: ModuleData) { ol() @@ -105,7 +105,7 @@ private fun MarkdownDocument.printProjectUrl(projectUrl: String?, indent: Int) { } /** - * Prints the links to the the source code licenses. + * Prints the links to the source code licenses. */ @Suppress("SameParameterValue" /* Indentation is consistent across the list. */) private fun MarkdownDocument.printLicenses(licenses: Set, indent: Int) { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Paths.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt similarity index 89% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Paths.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt index cf1f460..975a73b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Paths.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license /** * Filesystem paths used by [LicenseReporter]. @@ -40,7 +40,7 @@ internal object Paths { * Its contents describe the licensing information for each of the Java dependencies * which are referenced by Gradle projects in the repository. */ - internal const val outputFilename = "license-report.md" + internal const val outputFilename = "dependencies.md" /** * The path to a directory, to which a per-project report is generated. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ProjectDependencies.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/ProjectDependencies.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ProjectDependencies.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/ProjectDependencies.kt index 164df07..d9e569c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/ProjectDependencies.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/ProjectDependencies.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import com.github.jk1.license.ModuleData import com.github.jk1.license.ProjectData -import io.spine.internal.markup.MarkdownDocument +import io.spine.docs.MarkdownDocument /** * Dependencies of some [Gradle project][ProjectData] classified by the Gradle configuration diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Tasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Tasks.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Tasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/Tasks.kt index 4206f3d..05df91a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Tasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Tasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license import org.gradle.api.Task import org.gradle.api.tasks.TaskContainer diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Template.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Template.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Template.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/license/Template.kt index f8f835e..adda37b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/Template.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Template.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.license +package io.spine.gradle.report.license -import io.spine.internal.gradle.artifactId -import io.spine.internal.markup.MarkdownDocument +import io.spine.docs.MarkdownDocument +import io.spine.gradle.artifactId import java.util.* import org.gradle.api.Project diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyScope.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyScope.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyScope.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyScope.kt index 6a11b7c..1b4f478 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyScope.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyScope.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom /** * A Maven dependency scope. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt index 49326e9..eda2493 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,13 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom import groovy.xml.MarkupBuilder import java.io.Writer import java.util.* import kotlin.reflect.full.isSubclassOf import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency import org.gradle.api.internal.artifacts.dependencies.AbstractExternalModuleDependency import org.gradle.kotlin.dsl.withGroovyBuilder @@ -126,13 +127,34 @@ private fun Project.depsFromAllConfigurations(): Set { } configuration.dependencies.filter { it.isExternal() } .forEach { dependency -> - val moduleDependency = ModuleDependency(project, configuration, dependency) + val forcedVersion = configuration.forcedVersionOf(dependency) + val moduleDependency = + if (forcedVersion != null) { + ModuleDependency(project, configuration, dependency, forcedVersion) + } else { + ModuleDependency(project, configuration, dependency) + } result.add(moduleDependency) } } return result } +/** + * Searches for a forced version of given [dependency] in this [Configuration]. + * + * Returns `null`, if it wasn't forced. + */ +private fun Configuration.forcedVersionOf(dependency: Dependency): String? { + val forcedModules = resolutionStrategy.forcedModules + val maybeForced = forcedModules.firstOrNull { + it.group == dependency.group + && it.name == dependency.name + && it.version != null + } + return maybeForced?.version +} + /** * Tells whether the dependency is an external module dependency. */ @@ -160,8 +182,8 @@ private fun Project.deduplicate(dependencies: Set): List - group.value.maxByOrNull { dep -> dep.version!! }!! - } + group.value.maxByOrNull { dep -> dep.version ?: "" } + }.filterNotNull() return filtered } @@ -177,7 +199,7 @@ private fun Project.logDuplicate(dependency: String, versions: List { companion object { - private val COMPARATOR = compareBy { it.module } + private val COMPARATOR = compareBy { it.project } .thenBy { it.configuration.name } .thenBy { it.group } .thenBy { it.name } - .thenBy { it.version } + .thenBy { it.factualVersion } } + override fun getVersion(): String? = factualVersion + /** * A project dependency with its [scope][DependencyScope]. * * Doesn't contain any info about an origin module and configuration. */ - val scoped = ScopedDependency.of(dependency, configuration) + val scoped = ScopedDependency.of(this, configuration) /** * GAV coordinates of this dependency. * * Gradle's [Dependency] is a mutable object. Its properties can change their - * values with time. In parcticular, the version can be changed as more + * values with time. In particular, the version can be changed as more * configurations are getting resolved. This is why this property is calculated. */ val gav: String - get() = "$group:$name:$version" + get() = "$group:$name:$factualVersion" override fun compareTo(other: ModuleDependency): Int = COMPARATOR.compare(this, other) @@ -76,17 +79,17 @@ internal class ModuleDependency( other as ModuleDependency - if (module != other.module) return false + if (project != other.project) return false if (configuration != other.configuration) return false - if (dependency != other.dependency) return false + if (gav != other.gav) return false return true } override fun hashCode(): Int { - var result = module.hashCode() + var result = project.hashCode() result = 31 * result + configuration.hashCode() - result = 31 * result + dependency.hashCode() + result = 31 * result + gav.hashCode() return result } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomFormatting.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomFormatting.kt similarity index 96% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomFormatting.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomFormatting.kt index 446b3cb..ba673bb 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomFormatting.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomFormatting.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom import java.io.StringWriter import java.lang.System.lineSeparator diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomGenerator.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt similarity index 82% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomGenerator.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt index 8b9ab50..9144e2f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomGenerator.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,11 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom import org.gradle.api.Project import org.gradle.api.plugins.BasePlugin -import org.gradle.kotlin.dsl.extra /** * Generates a `pom.xml` file that contains dependencies of the root project as @@ -76,20 +75,21 @@ object PomGenerator { plugin(BasePlugin::class.java) } - val task = project.tasks.create("generatePom") - task.doLast { - val pomFile = project.projectDir.resolve("pom.xml") - project.delete(pomFile) + val task = project.tasks.register("generatePom") { + doLast { + val pomFile = project.projectDir.resolve("pom.xml") + project.delete(pomFile) - val projectData = project.metadata() - val writer = PomXmlWriter(projectData) - writer.writeTo(pomFile) + val projectData = project.metadata() + val writer = PomXmlWriter(projectData) + writer.writeTo(pomFile) + } + + val assembleTask = project.tasks.findByName("assemble")!! + dependsOn(assembleTask) } val buildTask = project.tasks.findByName("build")!! buildTask.finalizedBy(task) - - val assembleTask = project.tasks.findByName("assemble")!! - task.dependsOn(assembleTask) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomXmlWriter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.kt similarity index 91% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomXmlWriter.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.kt index 3df3403..5312219 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/PomXmlWriter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom -import io.spine.internal.gradle.report.pom.PomFormatting.writeBlocks -import io.spine.internal.gradle.report.pom.PomFormatting.writeStart +import io.spine.gradle.report.pom.PomFormatting.writeBlocks +import io.spine.gradle.report.pom.PomFormatting.writeStart import java.io.File import java.io.FileWriter import java.io.StringWriter diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ProjectMetadata.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ProjectMetadata.kt similarity index 96% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ProjectMetadata.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ProjectMetadata.kt index 40c84f2..ffb89a2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ProjectMetadata.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ProjectMetadata.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom import groovy.xml.MarkupBuilder import java.io.StringWriter diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ScopedDependency.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ScopedDependency.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ScopedDependency.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ScopedDependency.kt index cb841dd..7c67a32 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ScopedDependency.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ScopedDependency.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,13 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom -import io.spine.internal.gradle.report.pom.DependencyScope.compile -import io.spine.internal.gradle.report.pom.DependencyScope.provided -import io.spine.internal.gradle.report.pom.DependencyScope.runtime -import io.spine.internal.gradle.report.pom.DependencyScope.test -import io.spine.internal.gradle.report.pom.DependencyScope.undefined +import io.spine.gradle.report.pom.DependencyScope.compile +import io.spine.gradle.report.pom.DependencyScope.provided +import io.spine.gradle.report.pom.DependencyScope.runtime +import io.spine.gradle.report.pom.DependencyScope.test +import io.spine.gradle.report.pom.DependencyScope.undefined import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/SpineLicense.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/SpineLicense.kt similarity index 93% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/SpineLicense.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/report/pom/SpineLicense.kt index 7c95db2..114395e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/SpineLicense.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/SpineLicense.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.report.pom +package io.spine.gradle.report.pom import groovy.xml.MarkupBuilder import java.io.StringWriter diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Logging.kt b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Logging.kt similarity index 95% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Logging.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/testing/Logging.kt index 00143e6..6fb7eab 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Logging.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Logging.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.testing +package io.spine.gradle.testing import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.testing.TestDescriptor diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Multiproject.kt similarity index 90% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/testing/Multiproject.kt index b540923..1f5ed49 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Multiproject.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.testing +package io.spine.gradle.testing +import io.spine.gradle.publish.testJar import org.gradle.api.Project -import io.spine.internal.gradle.publish.testJar /** * Exposes the test classes of this project as a new "testArtifacts" configuration. @@ -57,7 +57,7 @@ import io.spine.internal.gradle.publish.testJar * * Don't forget that this exposure mechanism works only for projects that reside within the same * multi-project build. In order to share the test classes with external projects, publish a - * dedicated [testJar][io.spine.internal.gradle.publish.SpinePublishing.testJar] artifact. + * dedicated [testJar][io.spine.gradle.publish.SpinePublishing.testJar] artifact. */ @Suppress("unused") fun Project.exposeTestConfiguration() { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Tasks.kt b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Tasks.kt similarity index 84% rename from buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Tasks.kt rename to buildSrc/src/main/kotlin/io/spine/gradle/testing/Tasks.kt index cf5ba42..971c4b4 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Tasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/testing/Tasks.kt @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.internal.gradle.testing +package io.spine.gradle.testing import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.testing.Test @@ -47,6 +47,9 @@ import org.gradle.kotlin.dsl.register fun TaskContainer.registerTestTasks() { withType(Test::class.java).configureEach { filter { + // There could be cases with no matching tests. E.g. tests could be based on Kotest, + // which has custom task types and names. + isFailOnNoMatchingTests = false includeTestsMatching("*Test") includeTestsMatching("*Spec") } @@ -72,7 +75,7 @@ private const val SLOW_TAG = "slow" /** * Executes JUnit tests filtering out the ones tagged as `slow`. */ -private open class FastTest : Test() { +private abstract class FastTest : Test() { init { description = "Executes all JUnit tests but the ones tagged as `slow`." group = "Verification" @@ -86,11 +89,12 @@ private open class FastTest : Test() { /** * Executes JUnit tests tagged as `slow`. */ -private open class SlowTest : Test() { +private abstract class SlowTest : Test() { init { description = "Executes JUnit tests tagged as `slow`." group = "Verification" - + // No slow tests -- no problem. + filter.isFailOnNoMatchingTests = false this.useJUnitPlatform { includeTags(SLOW_TAG) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt deleted file mode 100644 index 501df00..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -// https://github.com/JetBrains/kotlin -// https://github.com/Kotlin -object Kotlin { - /** - * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. - */ - @Suppress("MemberVisibilityCanBePrivate") // used directly from outside - const val version = "1.7.20" - const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${version}" - const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${version}" - const val stdLibCommon = "org.jetbrains.kotlin:kotlin-stdlib-common:${version}" - const val stdLibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${version}" -} diff --git a/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 8f43433..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.dependency - -import org.gradle.api.plugins.ExtensionAware -import org.gradle.kotlin.dsl.extra - -/** - * Dependencies on Spine modules. - * - * @constructor - * Creates a new instance of `Spine` taking the property values - * of versions from the given project's extra properties. - */ -@Suppress("unused") -class Spine(p: ExtensionAware) { - - /** - * Default versions for the modules of Spine, unless they are - * configured in `versions.gradle.kts`. - */ - object DefaultVersion { - - /** - * The version of ProtoData to be used in the project. - * - * We do it here instead of `versions.gradle.kts` because we later use - * it in a `plugins` section in a build script. - * - * This version cannot be re-defined via `version.gradle.kts` like versions - * of other subprojects like [base] or [core]. So, if you want to use another version, - * please update this value in your `buildSrc. - * - * Development of ProtoData uses custom convention for using custom version - * of ProtoData in its integration tests. Please see `ProtoData/version.gradle.kts` - * for details. - * - * @see [ProtoData] - */ - const val protoData = "0.3.0" - - /** - * The default version of `base` to use. - * @see [Spine.base] - */ - const val base = "2.0.0-SNAPSHOT.120" - - /** - * The default version of `core-java` to use. - * @see [Spine.CoreJava.client] - * @see [Spine.CoreJava.server] - */ - const val core = "2.0.0-SNAPSHOT.119" - - /** - * The version of `model-compiler` to use. - * @see [Spine.modelCompiler] - */ - const val mc = "2.0.0-SNAPSHOT.90" - - /** - * The version of `mc-java` to use. - */ - const val mcJava = "2.0.0-SNAPSHOT.105" - - /** - * The version of `base-types` to use. - * @see [Spine.baseTypes] - */ - const val baseTypes = "2.0.0-SNAPSHOT.112" - - /** - * The version of `time` to use. - * @see [Spine.time] - */ - const val time = "2.0.0-SNAPSHOT.120" - - /** - * The version of `change` to use. - * @see [Spine.change] - */ - const val change = "2.0.0-SNAPSHOT.117" - - /** - * The version of `text` to use. - * - * @see Spine.text - */ - const val text = "2.0.0-SNAPSHOT.1" - - /** - * The version of `tool-base` to use. - * @see [Spine.toolBase] - */ - const val toolBase = "2.0.0-SNAPSHOT.111" - - /** - * The version of `validation` to use. - * @see [Spine.validation] - */ - const val validation = "2.0.0-SNAPSHOT.61" - - /** - * The version of Javadoc Tools to use. - * @see [Spine.javadocTools] - */ - const val javadocTools = "2.0.0-SNAPSHOT.75" - } - - companion object { - const val group = "io.spine" - const val toolsGroup = "io.spine.tools" - - /** - * The version of ProtoData to be used in the project. - * - * We do it here instead of `versions.gradle.kts` because we later use - * it in a `plugins` section in a build script. - * - * @see [ProtoData] - */ - const val protoDataVersion = DefaultVersion.protoData - } - - val base = "$group:spine-base:${p.baseVersion}" - val baseTypes = "$group:spine-base-types:${p.baseTypesVersion}" - val time = "$group:spine-time:${p.timeVersion}" - val change = "$group:spine-change:${p.changeVersion}" - val text = "$group:spine-text:${p.textVersion}" - - val testlib = "$toolsGroup:spine-testlib:${p.baseVersion}" - val testUtilTime = "$toolsGroup:spine-testutil-time:${p.timeVersion}" - val toolBase = "$toolsGroup:spine-tool-base:${p.toolBaseVersion}" - val pluginBase = "$toolsGroup:spine-plugin-base:${p.toolBaseVersion}" - val pluginTestlib = "$toolsGroup:spine-plugin-testlib:${p.toolBaseVersion}" - val modelCompiler = "$toolsGroup:spine-model-compiler:${p.mcVersion}" - - /** - * Coordinates of the McJava plugin bundle which uses version of the bundle - * from [ExtensionAware.mcJavaVersion] property. - * - * This property and [ExtensionAware.mcJavaVersion] are deprecated because - * we discourage using versions of Spine components outside of this dependency - * object class. - */ - @Deprecated(message = "Please use `McJava.pluginLib` instead") - @Suppress("DEPRECATION") - val mcJavaPlugin = "$toolsGroup:spine-mc-java-plugins:${p.mcJavaVersion}:all" - - object McJava { - const val version = DefaultVersion.mcJava - const val pluginId = "io.spine.mc-java" - const val pluginLib = "$toolsGroup:spine-mc-java-plugins:${version}:all" - } - - /** - * Does not allow re-definition via a project property. - * Please change [DefaultVersion.javadocTools]. ˚ - */ - val javadocTools = "$toolsGroup::${DefaultVersion.javadocTools}" - - @Deprecated("Please use `validation.runtime`", replaceWith = ReplaceWith("validation.runtime")) - val validate = "$group:spine-validate:${p.baseVersion}" - - val validation = Validation(p) - - val coreJava = CoreJava(p) - val client = coreJava.client // Added for brevity. - val server = coreJava.server // Added for brevity. - - private val ExtensionAware.baseVersion: String - get() = "baseVersion".asExtra(this, DefaultVersion.base) - - private val ExtensionAware.baseTypesVersion: String - get() = "baseTypesVersion".asExtra(this, DefaultVersion.baseTypes) - - private val ExtensionAware.timeVersion: String - get() = "timeVersion".asExtra(this, DefaultVersion.time) - - private val ExtensionAware.changeVersion: String - get() = "changeVersion".asExtra(this, DefaultVersion.change) - - private val ExtensionAware.textVersion: String - get() = "textVersion".asExtra(this, DefaultVersion.text) - - private val ExtensionAware.mcVersion: String - get() = "mcVersion".asExtra(this, DefaultVersion.mc) - - @Deprecated(message = "Please use `Spine.McJava` dependency object instead.") - private val ExtensionAware.mcJavaVersion: String - get() = "mcJavaVersion".asExtra(this, DefaultVersion.mcJava) - - private val ExtensionAware.toolBaseVersion: String - get() = "toolBaseVersion".asExtra(this, DefaultVersion.toolBase) - - /** - * Dependencies on Spine validation modules. - * - * See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/). - */ - class Validation(p: ExtensionAware) { - companion object { - const val group = "io.spine.validation" - } - val runtime = "$group:spine-validation-java-runtime:${p.validationVersion}" - val java = "$group:spine-validation-java:${p.validationVersion}" - val model = "$group:spine-validation-model:${p.validationVersion}" - val config = "$group:spine-validation-configuration:${p.validationVersion}" - - private val ExtensionAware.validationVersion: String - get() = "validationVersion".asExtra(this, DefaultVersion.validation) - } - - /** - * Dependencies on ProtoData modules. - * - * See [`SpineEventEngine/ProtoData`](https://github.com/SpineEventEngine/ProtoData/). - */ - object ProtoData { - const val group = "io.spine.protodata" - const val version = protoDataVersion - const val compiler = "$group:protodata-compiler:$version" - - const val codegenJava = "io.spine.protodata:protodata-codegen-java:$version" - - const val pluginId = "io.spine.protodata" - const val pluginLib = "${Spine.group}:protodata:$version" - } - - /** - * Dependencies on `core-java` modules. - * - * See [`SpineEventEngine/core-java`](https://github.com/SpineEventEngine/core-java/). - */ - class CoreJava(p: ExtensionAware) { - val core = "$group:spine-core:${p.coreVersion}" - val client = "$group:spine-client:${p.coreVersion}" - val server = "$group:spine-server:${p.coreVersion}" - val testUtilServer = "$toolsGroup:spine-testutil-server:${p.coreVersion}" - - private val ExtensionAware.coreVersion: String - get() = "coreVersion".asExtra(this, DefaultVersion.core) - } -} - -/** - * Obtains the value of the extension property named as this string from the given project. - * - * @param p the project declaring extension properties - * @param defaultValue - * the default value to return, if the project does not have such a property. - * If `null` then rely on the property declaration, even if this would cause an error. - */ -private fun String.asExtra(p: ExtensionAware, defaultValue: String? = null): String { - return if (p.extra.has(this) || defaultValue == null) { - p.extra[this] as String - } else { - defaultValue - } -} 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 deleted file mode 100644 index ca32203..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.gradle.protobuf - -import com.google.protobuf.gradle.GenerateProtoTask -import java.io.File -import java.lang.System.lineSeparator -import org.gradle.api.Task -import org.gradle.configurationcache.extensions.capitalized -import org.gradle.kotlin.dsl.get - -/** - * Configures protobuf code generation task for the code which cannot use Spine Model Compiler - * (e.g. the `base` project). - * - * The task configuration consists of the following steps: - * - * 1. Adding `"kotlin"` to the list of involved `protoc` plugins. - * - * 2. Generation of descriptor set file is turned on for each source set. - * These files are placed under the `build/descriptors` directory. - * - * 3. Removing source code generated for `com.google` package for both Java and Kotlin. - * This is done at the final steps of the code generation. - * - * 4. Adding suppression of deprecation warnings in the generated Kotlin code. - * - * 5. Making `processResource` tasks depend on corresponding `generateProto` tasks. - * If the source set of the configured task isn't `main`, appropriate infix for - * the task names is used. - * - * The usage of this extension in a module build file would be: - * ``` - * val generatedDir by extra("$projectDir/generated") - * protobuf { - * generateProtoTasks { - * for (task in all()) { - * task.setup(generatedDir) - * } - * } - * } - * ``` - * Using the same code under `subprojects` in a root build file does not seem to work because - * test descriptor set files are not copied to resources. Performing this configuration from - * subprojects solves the issue. - * - * IMPORTANT: In addition to calling `setup`, a submodule must contain a descriptor set reference - * file (`desc.ref`) files placed under `resources`. The descriptor reference file must contain - * a reference to the descriptor set file generated by the corresponding `GenerateProtoTask`. - * - * For example, for the `test` source set, the reference would be `known_types_test.desc`, and - * for the `main` source set, the reference would be `known_types_main.desc`. - * - * See `io.spine.code.proto.DescriptorReference` and `io.spine.code.proto.FileDescriptors` classes - * under the `base` project for more details. - */ -@Suppress("unused") -fun GenerateProtoTask.setup(generatedDir: String) { - - builtins.maybeCreate("kotlin") - - /** - * Generate descriptor set files. - */ - val ssn = sourceSet.name - generateDescriptorSet = true - with(descriptorSetOptions) { - path = "${project.buildDir}/descriptors/${ssn}/known_types_${ssn}.desc" - includeImports = true - includeSourceInfo = true - } - - doLast { - deleteComGoogle(generatedDir, ssn, "java") - deleteComGoogle(generatedDir, ssn, "kotlin") - suppressDeprecationsInKotlin(generatedDir, ssn) - } - - /** - * Make the tasks `processResources` depend on `generateProto` tasks explicitly so that: - * 1) descriptor set files get into resources, avoiding the racing conditions - * during the build. - * 2) we don't have the warning "Execution optimizations have been disabled..." issued - * by Gradle during the build because Protobuf Gradle Plugin does not set - * dependencies between `generateProto` and `processResources` tasks. - */ - val processResources = processResourceTaskName(ssn) - project.tasks[processResources].dependsOn(this) -} - -/** - * Remove the code generated for Google Protobuf library types. - * - * Java code for the `com.google` package was generated because we wanted - * to have descriptors for all the types, including those from Google Protobuf library. - * We want all the descriptors so that they are included into the resources used by - * the `io.spine.type.KnownTypes` class. - * - * Now, as we have the descriptors _and_ excessive Java or Kotlin code, we delete it to avoid - * classes that duplicate those coming from Protobuf library JARs. - */ -private fun Task.deleteComGoogle(generatedDir: String, ssn: String, language: String) { - val comDirectory = File("${generatedDir}/${ssn}/$language/com") - val googlePackage = comDirectory.resolve("google") - project.delete(googlePackage) - - // If the `com` directory becomes empty, delete it too. - if (comDirectory.exists() && comDirectory.isDirectory && comDirectory.list()!!.isEmpty()) { - project.delete(comDirectory) - } -} - -/** - * Obtains the name of the task `processResource` task for the given source set name. - */ -private fun processResourceTaskName(sourceSetName: String): String { - val infix = if (sourceSetName == "main") "" else sourceSetName.capitalized() - return "process${infix}Resources" -} - -/** - * Obtains the path to this source code file, starting from `buildSrc`. - */ -private object SourcePath { - - val value: String - get() { - val thisClass = SourcePath::class.java - val filePath = thisClass.`package`.name.replace('.', '/') + "/ProtoTaskExtensions.kt" - return "buildSrc/src/main/kotlin/$filePath" - } -} - -/** - * The comment added to the top of the Kotlin file generated by Protobuf. - */ -private val suppressionComment = "// Suppressed by `${SourcePath.value}`." - -/** - * The text of the suppression. - */ -private const val SUPPRESS_DEPRECATION = "@file:Suppress(\"DEPRECATION\")" - -/** - * This file adds [SUPPRESS_DEPRECATION] to the top of a Kotlin file generated - * by Protobuf compiler. - */ -fun suppressDeprecationsInKotlin(generatedDir: String, ssn: String) { - val kotlinDir = File("${generatedDir}/${ssn}/kotlin") - - kotlinDir.walk().iterator().forEachRemaining { - val file = it - if (!file.name.endsWith(".kt")) { - return@forEachRemaining - } - val lines = file.readLines() - if (lines.isEmpty()) { - return@forEachRemaining - } - if (lines[0] == suppressionComment) { - return@forEachRemaining - } - val withSuppression = mutableListOf() - withSuppression.add(suppressionComment) - withSuppression.add(SUPPRESS_DEPRECATION + lineSeparator()) - withSuppression.addAll(lines) - val text = withSuppression.joinToString(lineSeparator()) - file.writeText(text) - } -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt deleted file mode 100644 index e6860cd..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.gradle.publish - -import io.spine.internal.gradle.sourceSets -import org.gradle.api.Project -import org.gradle.api.file.FileTreeElement -import org.gradle.api.tasks.TaskContainer -import org.gradle.api.tasks.TaskProvider -import org.gradle.api.tasks.bundling.Jar -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.named -import org.gradle.kotlin.dsl.register -import org.gradle.kotlin.dsl.withType - -/** - * Excludes Google `.proto` sources from all artifacts. - * - * Goes through all registered `Jar` tasks and filters out Google's files. - */ -@Suppress("unused") -fun TaskContainer.excludeGoogleProtoFromArtifacts() { - withType().configureEach { - exclude { it.isGoogleProtoSource() } - } -} - -/** - * Checks if the given file belongs to the Google `.proto` sources. - */ -private fun FileTreeElement.isGoogleProtoSource(): Boolean { - val pathSegments = relativePath.segments - return pathSegments.isNotEmpty() && pathSegments[0].equals("google") -} - -/** - * Locates or creates `sourcesJar` task in this [Project]. - * - * The output of this task is a `jar` archive. The archive contains sources from `main` source set. - * The task makes sure that sources from the directories below will be included into - * a resulted archive: - * - * - Kotlin - * - Java - * - Proto - * - * Java and Kotlin sources are default to `main` source set since it is created by `java` plugin. - * For Proto sources to be included – [special treatment][protoSources] is needed. - */ -internal fun Project.sourcesJar() = tasks.getOrCreate("sourcesJar") { - archiveClassifier.set("sources") - from(sourceSets["main"].allSource) // Puts Java and Kotlin sources. - from(protoSources()) // Puts Proto sources. -} - -/** - * Locates or creates `protoJar` task in this [Project]. - * - * The output of this task is a `jar` archive. The archive contains only - * [Proto sources][protoSources] from `main` source set. - */ -internal fun Project.protoJar() = tasks.getOrCreate("protoJar") { - archiveClassifier.set("proto") - from(protoSources()) -} - -/** - * Locates or creates `testJar` task in this [Project]. - * - * The output of this task is a `jar` archive. The archive contains compilation output - * of `test` source set. - */ -internal fun Project.testJar() = tasks.getOrCreate("testJar") { - archiveClassifier.set("test") - from(sourceSets["test"].output) -} - -/** - * Locates or creates `javadocJar` task in this [Project]. - * - * The output of this task is a `jar` archive. The archive contains Javadoc, - * generated upon Java sources from `main` source set. If javadoc for Kotlin is also needed, - * apply Dokka plugin. It tunes `javadoc` task to generate docs upon Kotlin sources as well. - */ -internal fun Project.javadocJar() = tasks.getOrCreate("javadocJar") { - archiveClassifier.set("javadoc") - from(files("$buildDir/docs/javadoc")) - dependsOn("javadoc") -} - -/** - * Locates or creates `dokkaJar` task in this [Project]. - * - * The output of this task is a `jar` archive. The archive contains the Dokka output, generated upon - * Java sources from `main` source set. Requires Dokka to be configured in the target project by - * applying `dokka-for-java` plugin. - */ -internal fun Project.dokkaJar() = tasks.getOrCreate("dokkaJar") { - archiveClassifier.set("dokka") - from(files("$buildDir/docs/dokka")) - dependsOn("dokkaHtml") -} - -private fun TaskContainer.getOrCreate(name: String, init: Jar.() -> Unit): TaskProvider = - if (names.contains(name)) { - named(name) - } else { - register(name) { - init() - } - } 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 deleted file mode 100644 index ad8f8fe..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Publications.kt +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.gradle.publish - -import io.spine.internal.gradle.Repository -import io.spine.internal.gradle.isSnapshot -import org.gradle.api.Project -import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.publish.maven.MavenPublication -import org.gradle.api.tasks.TaskProvider -import org.gradle.api.tasks.bundling.Jar -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.get - -/** - * Abstract base for handlers of publications in a project - * with [spinePublishing] settings declared. - */ -internal sealed class PublicationHandler( - private val artifactId: String, - private val destinations: Set -) { - - /** - * Registers this publication in the given project. - */ - fun registerIn(project: Project) { - handlePublications(project) - registerDestinations(project) - } - - /** - * Either handles publications already declared in the given project, - * or creates new ones. - */ - abstract fun handlePublications(project: Project) - - /** - * Takes a group name and a version from the given [project] and assigns - * them to this publication. - */ - protected fun MavenPublication.assignMavenCoordinates(project: Project) { - groupId = project.group.toString() - artifactId = this@PublicationHandler.artifactId - version = project.version.toString() - } - - /** - * Goes through the [destinations] and registers each as a repository for publishing - * in the given Gradle project. - */ - private fun registerDestinations(project: Project) { - val gradleRepositories = project.publishingExtension.repositories - destinations.forEach { destination -> - gradleRepositories.register(project, destination) - } - } - - /** - * Adds a Maven repository to the project specifying credentials, if they are - * [available][Repository.credentials] from the root project. - */ - private fun RepositoryHandler.register(project: Project, repository: Repository) { - val isSnapshot = project.version.toString().isSnapshot() - val target = if (isSnapshot) repository.snapshots else repository.releases - val credentials = repository.credentials(project.rootProject) - maven { - url = project.uri(target) - credentials { - username = credentials?.username - password = credentials?.password - } - } - } -} - -/** - * A publication for a typical Java project. - * - * In Gradle, in order to publish something somewhere one should create a publication. - * A publication has a name and consists of one or more artifacts plus information about - * those artifacts – the metadata. - * - * An instance of this class represents [MavenPublication] named "mavenJava". It is generally - * accepted that a publication with this name contains a Java project published to one or - * more Maven repositories. - * - * By default, only a jar with the compilation output of `main` source set and its - * metadata files are published. Other artifacts are specified through the - * [constructor parameter][jars]. Please, take a look on [specifyArtifacts] for additional info. - * - * @param artifactId - * a name that a project is known by. - * @param jars - * list of artifacts to be published along with the compilation output. - * @param destinations - * Maven repositories to which the produced artifacts will be sent. - * @see - * Maven Publish Plugin | Publications - */ -internal class MavenJavaPublication( - artifactId: String, - private val jars: Set>, - destinations: Set, -) : PublicationHandler(artifactId, destinations) { - - /** - * Creates a new "mavenJava" [MavenPublication] in the given project. - */ - override fun handlePublications(project: Project) { - project.publications.create("mavenJava") { - assignMavenCoordinates(project) - specifyArtifacts(project, jars) - } - } -} - -/** - * Specifies which artifacts this [MavenPublication] will contain. - * - * 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 metadata file that has ".module" extension. - * - * 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. - * - * @see Maven – POM Reference - * @see - * Understanding Gradle Module Metadata - */ -private fun MavenPublication.specifyArtifacts(project: Project, jars: Set>) { - - /* "java" component provides a jar with compilation output of "main" source set. - It is NOT defined as another `Jar` task intentionally. Doing that will leave the - publication without correct ".pom" and ".module" metadata files generated. - */ - from(project.components["java"]) - - /* Other artifacts are represented by `Jar` tasks. Those artifacts don't bring any other - metadata in comparison with `Component` (such as dependencies notation). - */ - jars.forEach { - artifact(it) - } -} - -/** - * A handler for custom publications, which are declared under the [publications] - * section of a module. - * - * Such publications should be treated differently than [MavenJavaPublication], - * which is created for a module. Instead, since the publications are already declared, - * this class only [assigns maven coordinates][assignMavenCoordinates]. - * - * A module which declares custom publications must be specified in - * the [SpinePublishing.modulesWithCustomPublishing] property. - * - * If a module with [publications] declared locally is not specified as one with custom publishing, - * it may cause a name clash between an artifact produced by the [standard][MavenPublication] - * publication, and custom ones. In order to have both standard and custom publications, - * please specify custom artifact IDs or classifiers for each custom publication. - */ -internal class CustomPublications(artifactId: String, destinations: Set) : - PublicationHandler(artifactId, destinations) { - - override fun handlePublications(project: Project) { - project.publications.forEach { - val publication = it as MavenPublication - publication.assignMavenCoordinates(project) - } - } -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt deleted file mode 100644 index 4d9a3f6..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.gradle.publish - -import io.spine.internal.gradle.Repository -import org.gradle.api.Project -import org.gradle.api.tasks.TaskProvider -import org.gradle.api.tasks.bundling.Jar -import org.gradle.kotlin.dsl.apply - -/** - * Information, required to set up publishing of a project using `maven-publish` plugin. - * - * @param artifactId - * a name that a project is known by. - * @param destinations - * set of repositories, to which the resulting artifacts will be sent. - * @param includeProtoJar - * tells whether [protoJar] artifact should be published. - * @param includeTestJar - * tells whether [testJar] artifact should be published. - * @param includeDokkaJar - * tells whether [dokkaJar] artifact should be published. - * @param customPublishing - * tells whether subproject declares own publishing and standard one - * should not be applied. - */ -internal class PublishingConfig private constructor( - val artifactId: String, - val destinations: Set, - val customPublishing: Boolean, - val includeTestJar: Boolean, - val includeDokkaJar: Boolean, - val includeProtoJar: Boolean -) { - /** - * Creates an instance for standard publishing of a project module, - * specified under [SpinePublishing.modules]. - */ - constructor( - artifactId: String, - destinations: Set, - includeProtoJar: Boolean = true, - includeTestJar: Boolean = false, - includeDokkaJar: Boolean = false - ) : this(artifactId, destinations, false, includeTestJar, includeDokkaJar, includeProtoJar) - - /** - * Creates an instance for publishing a module specified - * under [SpinePublishing.modulesWithCustomPublishing]. - */ - constructor(artifactId: String, destinations: Set) : - this(artifactId, destinations, customPublishing = true, - includeTestJar = false, includeDokkaJar = false, includeProtoJar = false) -} -/** - * Applies this configuration to the given project. - * - * This method does the following: - * - * 1. Applies `maven-publish` plugin to the project. - * 2. Registers [MavenJavaPublication] in Gradle's - * [PublicationContainer][org.gradle.api.publish.PublicationContainer]. - * 4. Configures "publish" task. - * - * The actual list of resulted artifacts is determined by [registerArtifacts]. - */ -internal fun PublishingConfig.apply(project: Project) = with(project) { - apply(plugin = "maven-publish") - handlePublication(project) - configurePublishTask(destinations) -} - -private fun PublishingConfig.handlePublication(project: Project) { - if (customPublishing) { - handleCustomPublications(project) - } else { - createStandardPublication(project) - } -} - -private fun PublishingConfig.handleCustomPublications(project: Project) { - project.logger.info("The project `${project.name}` is set to provide custom publishing.") - val publications = CustomPublications( - artifactId = artifactId, - destinations = destinations - ) - publications.registerIn(project) -} - -private fun PublishingConfig.createStandardPublication(project: Project) { - val artifacts = project.registerArtifacts(includeProtoJar, includeTestJar, includeDokkaJar) - val publication = MavenJavaPublication( - artifactId = artifactId, - jars = artifacts, - destinations = destinations - ) - publication.registerIn(project) -} - -/** - * Registers [Jar] tasks, output of which is used as Maven artifacts. - * - * By default, only a jar with java compilation output is included into publication. This method - * registers tasks which produce additional artifacts. - * - * The list of additional artifacts to be registered: - * - * 1. [sourcesJar] – Java, Kotlin and Proto source files. - * 2. [protoJar] – only Proto source files. - * 3. [javadocJar] – documentation, generated upon Java files. - * 4. [testJar] – compilation output of "test" source set. - * 5. [dokkaJar] - documentation generated by Dokka. - * - * Registration of [protoJar], [testJar] and [dokkaJar] is optional. It can be controlled by the - * method's parameters. - * - * @return the list of the registered tasks. - */ -private fun Project.registerArtifacts( - includeProtoJar: Boolean = true, - includeTestJar: Boolean = false, - includeDokkaJar: Boolean = false -): Set> { - - val artifacts = mutableSetOf( - sourcesJar(), - javadocJar(), - ) - - // We don't want to have an empty "proto.jar" when a project doesn't have any Proto files. - if (hasProto() && includeProtoJar) { - artifacts.add(protoJar()) - } - - // Here, we don't have the corresponding `hasTests()` check, since this artifact is disabled - // by default. And turning it on means "We have tests and need them to be published." - if (includeTestJar) { - artifacts.add(testJar()) - } - - if(includeDokkaJar) { - artifacts.add(dokkaJar()) - } - - return artifacts -} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt deleted file mode 100644 index b132638..0000000 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.internal.gradle.publish - -import io.spine.internal.gradle.Repository -import java.util.* -import org.gradle.api.InvalidUserDataException -import org.gradle.api.Project -import org.gradle.api.Task -import org.gradle.api.tasks.TaskContainer -import org.gradle.api.tasks.TaskProvider - -private const val PUBLISH = "publish" - -/** - * Locates `publish` task in this [TaskContainer]. - * - * This task publishes all defined publications to all defined repositories. To achieve that, - * the task depends on all `publish`*PubName*`PublicationTo`*RepoName*`Repository` tasks. - * - * Please note, task execution would not copy publications to the local Maven cache. - * - * @see - * Tasks | Maven Publish Plugin - */ -internal val TaskContainer.publish: TaskProvider - get() = named(PUBLISH) - -/** - * Sets dependencies for `publish` task in this [Project]. - * - * This method performs the following: - * - * 1. When this [Project] is not a root, makes `publish` task in a root project - * depend on a local `publish`. - * 2. Makes local `publish` task verify that credentials are present for each - * of destination repositories. - */ -internal fun Project.configurePublishTask(destinations: Set) { - attachCredentialsVerification(destinations) - bindToRootPublish() -} - -private fun Project.attachCredentialsVerification(destinations: Set) { - val checkCredentials = tasks.registerCheckCredentialsTask(destinations) - val localPublish = tasks.publish - localPublish.configure { dependsOn(checkCredentials) } -} - -private fun Project.bindToRootPublish() { - if (project == rootProject) { - return - } - - val localPublish = tasks.publish - val rootPublish = rootProject.tasks.getOrCreatePublishTask() - rootPublish.configure { dependsOn(localPublish) } -} - -/** - * Use this task accessor when it is not guaranteed that the task is present - * in this [TaskContainer]. - */ -private fun TaskContainer.getOrCreatePublishTask() = - if (names.contains(PUBLISH)) { - named(PUBLISH) - } else { - register(PUBLISH) - } - -private fun TaskContainer.registerCheckCredentialsTask(destinations: Set) = - register("checkCredentials") { - doLast { - destinations.forEach { it.ensureCredentials(project) } - } - } - -private fun Repository.ensureCredentials(project: Project) { - val credentials = credentials(project) - if (Objects.isNull(credentials)) { - throw InvalidUserDataException( - "No valid credentials for repository `${this}`. Please make sure " + - "to pass username/password or a valid `.properties` file." - ) - } -} diff --git a/buildSrc/src/main/kotlin/jacoco-kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/jacoco-kotlin-jvm.gradle.kts new file mode 100644 index 0000000..48fb126 --- /dev/null +++ b/buildSrc/src/main/kotlin/jacoco-kotlin-jvm.gradle.kts @@ -0,0 +1,67 @@ +/* + * Copyright 2025, 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. + */ + +import io.spine.gradle.buildDirectory + +plugins { + jacoco +} + +/** + * Configures [JacocoReport] task to run in a Kotlin Multiplatform project for + * `commonMain` and `jvmMain` source sets. + * + * This script plugin must be applied using the following construct at the end of + * a `build.gradle.kts` file of a module: + * + * ```kotlin + * apply(plugin="jacoco-kotlin-jvm") + * ``` + * Please do not apply this script plugin in the `plugins {}` block because `jacocoTestReport` + * task is not yet available at this stage. + */ +@Suppress("unused") +private val about = "" + +/** + * Configure Jacoco task with custom input from this Kotlin Multiplatform project. + */ +@Suppress("unused") +val jacocoTestReport: JacocoReport by tasks.getting(JacocoReport::class) { + + val classFiles = File("$buildDirectory/classes/kotlin/jvm/") + .walkBottomUp() + .toSet() + classDirectories.setFrom(classFiles) + + val coverageSourceDirs = arrayOf( + "src/commonMain", + "src/jvmMain" + ) + sourceDirectories.setFrom(files(coverageSourceDirs)) + + executionData.setFrom(files("$buildDirectory/jacoco/jvmTest.exec")) +} diff --git a/buildSrc/src/main/kotlin/jvm-module.gradle.kts b/buildSrc/src/main/kotlin/jvm-module.gradle.kts new file mode 100644 index 0000000..5b1577e --- /dev/null +++ b/buildSrc/src/main/kotlin/jvm-module.gradle.kts @@ -0,0 +1,204 @@ +/* + * Copyright 2025, 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. + */ + +import BuildSettings.javaVersion +import io.spine.dependency.build.CheckerFramework +import io.spine.dependency.build.Dokka +import io.spine.dependency.build.ErrorProne +import io.spine.dependency.lib.Guava +import io.spine.dependency.lib.JavaX +import io.spine.dependency.lib.Protobuf +import io.spine.dependency.local.Logging +import io.spine.dependency.local.Reflect +import io.spine.dependency.local.TestLib +import io.spine.dependency.test.JUnit +import io.spine.dependency.test.Jacoco +import io.spine.dependency.test.Kotest +import io.spine.gradle.checkstyle.CheckStyleConfig +import io.spine.gradle.github.pages.updateGitHubPages +import io.spine.gradle.javac.configureErrorProne +import io.spine.gradle.javac.configureJavac +import io.spine.gradle.javadoc.JavadocConfig +import io.spine.gradle.kotlin.applyJvmToolchain +import io.spine.gradle.kotlin.setFreeCompilerArgs +import io.spine.gradle.report.license.LicenseReporter +import io.spine.gradle.testing.configureLogging +import io.spine.gradle.testing.registerTestTasks + +plugins { + `java-library` + id("net.ltgt.errorprone") + id("pmd-settings") + id("project-report") + id("dokka-for-java") + kotlin("jvm") + id("io.kotest") + id("org.jetbrains.kotlinx.kover") + id("detekt-code-analysis") + id("dokka-for-kotlin") +} + +LicenseReporter.generateReportIn(project) +JavadocConfig.applyTo(project) +CheckStyleConfig.applyTo(project) + +project.run { + configureJava(javaVersion) + configureKotlin(javaVersion) + addDependencies() + forceConfigurations() + + val generatedDir = "$projectDir/generated" + setTaskDependencies(generatedDir) + setupTests() + + configureGitHubPages() +} + +typealias Module = Project + +fun Module.configureJava(javaVersion: JavaLanguageVersion) { + java { + toolchain.languageVersion.set(javaVersion) + } + + tasks { + withType().configureEach { + configureJavac() + configureErrorProne() + } + } +} + +fun Module.configureKotlin(javaVersion: JavaLanguageVersion) { + kotlin { + applyJvmToolchain(javaVersion.asInt()) + explicitApi() + compilerOptions { + jvmTarget.set(BuildSettings.jvmTarget) + setFreeCompilerArgs() + } + } + + kover { + useJacoco(version = Jacoco.version) + } + + koverReport { + defaults { + xml { + onCheck = true + } + } + } +} + +/** + * These dependencies are applied to all subprojects and do not have to + * be included explicitly. + * + * We expose production code dependencies as API because they are used + * by the framework parts that depend on `base`. + */ +fun Module.addDependencies() = dependencies { + errorprone(ErrorProne.core) + + Protobuf.libs.forEach { api(it) } + api(Guava.lib) + + compileOnlyApi(CheckerFramework.annotations) + compileOnlyApi(JavaX.annotations) + ErrorProne.annotations.forEach { compileOnlyApi(it) } + + implementation(Logging.lib) + + testImplementation(Guava.testLib) + testImplementation(JUnit.runner) + testImplementation(JUnit.pioneer) + JUnit.api.forEach { testImplementation(it) } + + testImplementation(TestLib.lib) + testImplementation(Kotest.frameworkEngine) + testImplementation(Kotest.datatest) + testImplementation(Kotest.runnerJUnit5Jvm) + testImplementation(JUnit.runner) +} + +fun Module.forceConfigurations() { + with(configurations) { + forceVersions() + excludeProtobufLite() + all { + resolutionStrategy { + force( + JUnit.bom, + JUnit.runner, + Dokka.BasePlugin.lib, + Reflect.lib, + ) + } + } + } +} + +fun Module.setupTests() { + tasks { + registerTestTasks() + test.configure { + useJUnitPlatform { + includeEngines("junit-jupiter") + } + configureLogging() + } + } +} + +fun Module.setTaskDependencies(generatedDir: String) { + tasks { + val cleanGenerated by registering(Delete::class) { + delete(generatedDir) + } + clean.configure { + dependsOn(cleanGenerated) + } + + project.afterEvaluate { + val publish = tasks.findByName("publish") + publish?.dependsOn("${project.path}:updateGitHubPages") + } + } + afterEvaluate { + configureTaskDependencies() + } +} + +fun Module.configureGitHubPages() { + val docletVersion = project.version.toString() + updateGitHubPages(docletVersion) { + allowInternalJavadoc.set(true) + rootFolder.set(rootDir) + } +} diff --git a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts index 03e69a6..0373ee0 100644 --- a/buildSrc/src/main/kotlin/pmd-settings.gradle.kts +++ b/buildSrc/src/main/kotlin/pmd-settings.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.Pmd +import io.spine.dependency.build.Pmd plugins { pmd diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 2898ec8..b63d327 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.gradle.publish.SpinePublishing +import io.spine.gradle.publish.SpinePublishing import java.nio.file.Files.createDirectories import java.nio.file.Files.createFile import java.text.SimpleDateFormat @@ -91,7 +91,8 @@ val manifestAttributes = mapOf( "Build-OS" to buildOs(), IMPLEMENTATION_TITLE.toString() to implementationTitle(), IMPLEMENTATION_VERSION.toString() to project.version, - IMPLEMENTATION_VENDOR.toString() to "TeamDev" + IMPLEMENTATION_VENDOR.toString() to "TeamDev", + "Bundle-License" to "https://www.apache.org/licenses/LICENSE-2.0.txt" ) /** @@ -102,7 +103,7 @@ val manifestAttributes = mapOf( * when running tests. We cannot depend on the `Jar` from `resources` because it would * form a circular dependency. */ -val exposeManifestForTests by tasks.creating { +val exposeManifestForTests by tasks.registering { val outputFile = layout.buildDirectory.file("resources/main/META-INF/MANIFEST.MF") outputs.file(outputFile).withPropertyName("manifestFile") @@ -111,7 +112,7 @@ val exposeManifestForTests by tasks.creating { val manifest = Manifest() // The manifest version attribute is crucial for writing. - // It it's absent nothing would be written. + // If it's absent, nothing would be written. manifest.mainAttributes[MANIFEST_VERSION] = "1.0" manifestAttributes.forEach { entry -> diff --git a/buildSrc/src/main/resources/dokka/styles/custom-styles.css b/buildSrc/src/main/resources/dokka/styles/custom-styles.css index 83545f3..ca629f9 100644 --- a/buildSrc/src/main/resources/dokka/styles/custom-styles.css +++ b/buildSrc/src/main/resources/dokka/styles/custom-styles.css @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 diff --git a/change/build.gradle.kts b/change/build.gradle.kts index e86264b..d5e48d5 100644 --- a/change/build.gradle.kts +++ b/change/build.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -24,9 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import io.spine.internal.dependency.Spine -import io.spine.internal.gradle.protobuf.suppressDeprecationsInKotlin -import io.spine.internal.gradle.publish.IncrementGuard +import io.spine.dependency.local.Base +import io.spine.dependency.local.Spine +import io.spine.dependency.local.Time +import io.spine.dependency.local.Validation +import io.spine.gradle.publish.IncrementGuard import io.spine.protodata.gradle.plugin.LaunchProtoData plugins { @@ -38,56 +40,7 @@ plugins { apply() dependencies { - val spine = Spine(project) - protoData(spine.validation.java) - implementation(spine.base) - implementation(spine.validation.runtime) - testImplementation(spine.testUtilTime) -} - -val generatedDir:String by extra("$projectDir/generated") - -/** - * Manually add generated directories to source sets so that IDEA sees them. - */ -sourceSets { - main { - java.srcDir("$generatedDir/main/java") - kotlin.srcDir("$generatedDir/main/kotlin") - } - test { - java.srcDir("$generatedDir/test/java") - kotlin.srcDir("$generatedDir/test/kotlin") - } -} - -/** - * Suppress the "legacy" validation from McJava in favour of tha based on ProtoData. - */ -modelCompiler.java.codegen.validation().skipValidation() - -protoData { - renderers( - "io.spine.validation.java.PrintValidationInsertionPoints", - "io.spine.validation.java.JavaValidationRenderer", - - // Suppress warnings in the generated code. - "io.spine.protodata.codegen.java.file.PrintBeforePrimaryDeclaration", - "io.spine.protodata.codegen.java.suppress.SuppressRenderer" - - ) - plugins( - "io.spine.validation.ValidationPlugin", - ) -} - -/** - * Manually suppress deprecations in the generated Kotlin code until ProtoData does it. - */ -tasks.withType().forEach { task -> - task.doLast { - sourceSets.forEach { sourceSet -> - suppressDeprecationsInKotlin(generatedDir, sourceSet.name) - } - } + implementation(Base.lib) + implementation(Validation.runtime) + testImplementation(Time.testLib) } diff --git a/config b/config index 44b4fae..99fb7ce 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 44b4faead5eb87f944974aa38c87ded7a126f241 +Subproject commit 99fb7ce679e6c71713fd6c21c24e0cd19304b118 diff --git a/license-report.md b/dependencies.md similarity index 64% rename from license-report.md rename to dependencies.md index 1c46789..da43e70 100644 --- a/license-report.md +++ b/dependencies.md @@ -1,122 +1,115 @@ -# Dependencies of `io.spine:spine-change:2.0.0-SNAPSHOT.118` +# Dependencies of `io.spine:spine-change:2.0.0-SNAPSHOT.200` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.9.0. +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.16. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. - * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) - * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : com.google.flogger. **Name** : flogger-system-backend. **Version** : 0.7.4. - * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) - * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.guava. **Name** : guava. **Version** : 31.1-jre. +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 1.3. +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.6. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.19.6. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.19.6. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : io.spine.validation. **Name** : spine-validation-java-runtime. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** -1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.5. - * **Project URL:** [https://checkerframework.org](https://checkerframework.org) - * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) - * **License:** [The MIT License](http://opensource.org/licenses/MIT) - -1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.21.3. - * **Project URL:** [https://checkerframework.org](https://checkerframework.org) +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) -1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0. - * **Project URL:** [http://www.jetbrains.org](http://www.jetbrains.org) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.0.2. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.7.20. - * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) - * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. + * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) + * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) ## Compile, tests, and tooling 1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.48. * **Project URL:** [http://beust.com/jcommander](http://beust.com/jcommander) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.82. - * **Project URL:** [https://jcommander.org](https://jcommander.org) - * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.13.4.**No license information found** -1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-annotations. **Version** : 2.13.4. - * **Project URL:** [http://github.com/FasterXML/jackson](http://github.com/FasterXML/jackson) +1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-bom](https://github.com/FasterXML/jackson-bom) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-core. **Version** : 2.13.4. +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-annotations. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-core. **Version** : 2.15.3. * **Project URL:** [https://github.com/FasterXML/jackson-core](https://github.com/FasterXML/jackson-core) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-databind. **Version** : 2.13.4.2. - * **Project URL:** [http://github.com/FasterXML/jackson](http://github.com/FasterXML/jackson) +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-databind. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-xml. **Version** : 2.13.4. +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-xml. **Version** : 2.15.3. * **Project URL:** [https://github.com/FasterXML/jackson-dataformat-xml](https://github.com/FasterXML/jackson-dataformat-xml) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.13.4. +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-yaml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformats-text](https://github.com/FasterXML/jackson-dataformats-text) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.fasterxml.woodstox. **Name** : woodstox-core. **Version** : 6.3.1. +1. **Group** : com.fasterxml.woodstox. **Name** : woodstox-core. **Version** : 6.5.1. * **Project URL:** [https://github.com/FasterXML/woodstox](https://github.com/FasterXML/woodstox) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -125,6 +118,10 @@ * **Project URL:** [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.1.8. + * **Project URL:** [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.github.kevinstern. **Name** : software-and-algorithms. **Version** : 1.0. * **Project URL:** [https://www.github.com/KevinStern/software-and-algorithms](https://www.github.com/KevinStern/software-and-algorithms) * **License:** [MIT License](http://www.opensource.org/licenses/mit-license.php) @@ -133,43 +130,72 @@ * **Project URL:** [http://source.android.com/](http://source.android.com/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) -1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.0.1. - * **Project URL:** [https://github.com/googleapis/java-iam/proto-google-common-protos](https://github.com/googleapis/java-iam/proto-google-common-protos) +1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. + * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.1. - * **Project URL:** [https://github.com/google/auto/tree/master/common](https://github.com/google/auto/tree/master/common) +1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.2. + * **Project URL:** [https://github.com/google/auto/tree/main/common](https://github.com/google/auto/tree/main/common) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.0.1. - * **Project URL:** [https://github.com/google/auto/tree/master/service](https://github.com/google/auto/tree/master/service) +1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. + * **Project URL:** [https://github.com/google/auto/tree/main/service](https://github.com/google/auto/tree/main/service) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.9. - * **Project URL:** [https://github.com/google/auto/tree/master/value](https://github.com/google/auto/tree/master/value) +1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.10.2. + * **Project URL:** [https://github.com/google/auto/tree/main/value](https://github.com/google/auto/tree/main/value) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.9.0. +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.16. +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-aa-embeddable. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-cmdline. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-common-deps. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-gradle-plugin. **Version** : 2.1.20-1.0.31. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_annotation](https://errorprone.info/error_prone_annotation) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.16. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.16. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_check_api](https://errorprone.info/error_prone_check_api) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.16. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_core](https://errorprone.info/error_prone_core) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.16. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.36.0. + * **Project URL:** [https://errorprone.info/error_prone_type_annotations](https://errorprone.info/error_prone_type_annotations) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.errorprone. **Name** : javac. **Version** : 9+181-r4173-1. @@ -184,65 +210,64 @@ * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.gradle. **Name** : osdetector-gradle-plugin. **Version** : 1.7.0. - * **Project URL:** [https://github.com/google/osdetector-gradle-plugin](https://github.com/google/osdetector-gradle-plugin) - * **License:** [Apache License 2.0](http://opensource.org/licenses/Apache-2.0) +1. **Group** : com.google.googlejavaformat. **Name** : google-java-format. **Version** : 1.19.1. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.guava. **Name** : guava. **Version** : 31.1-jre. +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.guava. **Name** : guava-testlib. **Version** : 31.1-jre. +1. **Group** : com.google.guava. **Name** : guava-testlib. **Version** : 32.1.3-jre. * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 1.3. +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : com.google.protobuf. **Name** : protobuf-gradle-plugin. **Version** : 0.8.19. - * **Project URL:** [https://github.com/google/protobuf-gradle-plugin](https://github.com/google/protobuf-gradle-plugin) - * **License:** [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.6. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.19.6. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.19.6. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.6. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.3. +1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.5. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.truth.extensions. **Name** : truth-java8-extension. **Version** : 1.1.3. +1. **Group** : com.google.truth.extensions. **Name** : truth-java8-extension. **Version** : 1.1.5. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.truth.extensions. **Name** : truth-liteproto-extension. **Version** : 1.1.3. +1. **Group** : com.google.truth.extensions. **Name** : truth-liteproto-extension. **Version** : 1.1.5. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.truth.extensions. **Name** : truth-proto-extension. **Version** : 1.1.3. +1. **Group** : com.google.truth.extensions. **Name** : truth-proto-extension. **Version** : 1.1.5. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.puppycrawl.tools. **Name** : checkstyle. **Version** : 10.3.4. +1. **Group** : com.puppycrawl.tools. **Name** : checkstyle. **Version** : 10.12.1. * **Project URL:** [https://checkstyle.org/](https://checkstyle.org/) * **License:** [LGPL-2.1+](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) -1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 2.7.0. +1. **Group** : com.sksamuel.aedile. **Name** : aedile-core. **Version** : 1.3.1. + * **Project URL:** [http://www.github.com/sksamuel/aedile](http://www.github.com/sksamuel/aedile) + * **License:** [The Apache 2.0 License](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 4.0.10. * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) @@ -250,196 +275,253 @@ * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-ksp. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : commons-codec. **Name** : commons-codec. **Version** : 1.15. +1. **Group** : commons-codec. **Name** : commons-codec. **Version** : 1.16.0. * **Project URL:** [https://commons.apache.org/proper/commons-codec/](https://commons.apache.org/proper/commons-codec/) - * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : commons-collections. **Name** : commons-collections. **Version** : 3.2.2. * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : commons-lang. **Name** : commons-lang. **Version** : 2.6. - * **Project URL:** [http://commons.apache.org/lang/](http://commons.apache.org/lang/) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : dev.drewhamilton.poko. **Name** : poko-annotations. **Version** : 0.17.1. + * **Project URL:** [https://github.com/drewhamilton/Poko](https://github.com/drewhamilton/Poko) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : dev.drewhamilton.poko. **Name** : poko-annotations-jvm. **Version** : 0.17.1. + * **Project URL:** [https://github.com/drewhamilton/Poko](https://github.com/drewhamilton/Poko) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.6.3. - * **Project URL:** [http://picocli.info](http://picocli.info) +1. **Group** : dev.zacsweers.autoservice. **Name** : auto-service-ksp. **Version** : 1.2.0. + * **Project URL:** [https://github.com/ZacSweers/auto-service-ksp](https://github.com/ZacSweers/auto-service-ksp) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.7.4. + * **Project URL:** [https://picocli.info](https://picocli.info) * **License:** [The Apache Software License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : io.github.davidburstrom.contester. **Name** : contester-breakpoint. **Version** : 0.2.0. * **Project URL:** [https://github.com/davidburstrom/contester](https://github.com/davidburstrom/contester) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k. **Version** : 0.0.1. +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k. **Version** : 0.6.0. + * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k-jvm. **Version** : 0.6.0. * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.github.java-diff-utils. **Name** : java-diff-utils. **Version** : 4.0. - * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) +1. **Group** : io.github.eisop. **Name** : dataflow-errorprone. **Version** : 3.41.0-eisop1. + * **Project URL:** [https://eisop.github.io/](https://eisop.github.io/) + * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) + +1. **Group** : io.github.java-diff-utils. **Name** : java-diff-utils. **Version** : 4.12. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-api. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-api. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-cli. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-cli. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-core. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-core. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-metrics. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-metrics. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-parser. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-parser. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-psi-utils. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-psi-utils. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-html. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-html. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-md. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-md. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-sarif. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-sarif. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-txt. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-txt. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-xml. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-xml. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-complexity. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-complexity. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-coroutines. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-coroutines. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-documentation. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-documentation. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-empty. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-empty. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-errorprone. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-errorprone. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-exceptions. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-exceptions. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-naming. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-naming. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-performance. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-performance. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-style. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-style. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-tooling. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-tooling. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-utils. **Version** : 1.21.0. +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-utils. **Version** : 1.23.8. * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.grpc. **Name** : protoc-gen-grpc-java. **Version** : 1.46.0. +1. **Group** : io.grpc. **Name** : protoc-gen-grpc-java. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.25.0. +1. **Group** : io.kotest. **Name** : kotest-assertions-api. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-api-jvm. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core-jvm. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared-jvm. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common-jvm. **Version** : 5.9.1. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) -1. **Group** : io.spine.protodata. **Name** : protodata-codegen-java. **Version** : 0.3.0.**No license information found** -1. **Group** : io.spine.protodata. **Name** : protodata-fat-cli. **Version** : 0.3.0.**No license information found** -1. **Group** : io.spine.protodata. **Name** : protodata-protoc. **Version** : 0.3.0.**No license information found** -1. **Group** : io.spine.validation. **Name** : spine-validation-configuration. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** -1. **Group** : io.spine.validation. **Name** : spine-validation-context. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** -1. **Group** : io.spine.validation. **Name** : spine-validation-java. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** -1. **Group** : io.spine.validation. **Name** : spine-validation-java-runtime. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** -1. **Group** : io.spine.validation. **Name** : spine-validation-model. **Version** : 2.0.0-SNAPSHOT.61.**No license information found** +1. **Group** : it.unimi.dsi. **Name** : fastutil-core. **Version** : 8.5.12. + * **Project URL:** [http://fastutil.di.unimi.it/](http://fastutil.di.unimi.it/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + 1. **Group** : javax.annotation. **Name** : javax.annotation-api. **Version** : 1.3.2. * **Project URL:** [http://jcp.org/en/jsr/detail?id=250](http://jcp.org/en/jsr/detail?id=250) * **License:** [CDDL + GPLv2 with classpath exception](https://github.com/javaee/javax.annotation/blob/master/LICENSE) +1. **Group** : javax.inject. **Name** : javax.inject. **Version** : 1. + * **Project URL:** [http://code.google.com/p/atinject/](http://code.google.com/p/atinject/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : junit. **Name** : junit. **Version** : 4.13.1. * **Project URL:** [http://junit.org](http://junit.org) * **License:** [Eclipse Public License 1.0](http://www.eclipse.org/legal/epl-v10.html) -1. **Group** : kr.motd.maven. **Name** : os-maven-plugin. **Version** : 1.7.0. - * **Project URL:** [https://github.com/trustin/os-maven-plugin/](https://github.com/trustin/os-maven-plugin/) - * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) - -1. **Group** : net.java.dev.jna. **Name** : jna. **Version** : 5.6.0. - * **Project URL:** [https://github.com/java-native-access/jna](https://github.com/java-native-access/jna) - * **License:** [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - * **License:** [LGPL, version 2.1](http://www.gnu.org/licenses/licenses.html) - -1. **Group** : net.ltgt.gradle. **Name** : gradle-errorprone-plugin. **Version** : 3.0.1.**No license information found** -1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 11.4. +1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 12.2. * **Project URL:** [http://www.saxonica.com/](http://www.saxonica.com/) * **License:** [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/2.0/) -1. **Group** : net.sourceforge.pmd. **Name** : pmd-core. **Version** : 6.50.0. +1. **Group** : net.sourceforge.pmd. **Name** : pmd-core. **Version** : 6.55.0. * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) -1. **Group** : net.sourceforge.pmd. **Name** : pmd-java. **Version** : 6.50.0. +1. **Group** : net.sourceforge.pmd. **Name** : pmd-java. **Version** : 6.55.0. * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) 1. **Group** : net.sourceforge.saxon. **Name** : saxon. **Version** : 9.1.0.8. @@ -471,19 +553,15 @@ * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.5. +1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.3. * **Project URL:** [https://checkerframework.org](https://checkerframework.org) * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) * **License:** [The MIT License](http://opensource.org/licenses/MIT) -1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.21.3. - * **Project URL:** [https://checkerframework.org](https://checkerframework.org) +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) -1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.24.0. - * **Project URL:** [https://checkerframework.org](https://checkerframework.org) - * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) - 1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -493,27 +571,29 @@ * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The BSD License](http://www.opensource.org/licenses/bsd-license.php) -1. **Group** : org.eclipse.jgit. **Name** : org.eclipse.jgit. **Version** : 4.4.1.201607150455-r. - * **License:** Eclipse Distribution License (New BSD License) - -1. **Group** : org.freemarker. **Name** : freemarker. **Version** : 2.3.31. +1. **Group** : org.freemarker. **Name** : freemarker. **Version** : 2.3.32. * **Project URL:** [https://freemarker.apache.org/](https://freemarker.apache.org/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.hamcrest. **Name** : hamcrest-core. **Version** : 1.3. - * **License:** [New BSD License](http://www.opensource.org/licenses/bsd-license.php) +1. **Group** : org.hamcrest. **Name** : hamcrest. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) -1. **Group** : org.jacoco. **Name** : org.jacoco.agent. **Version** : 0.8.8. - * **License:** [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0/) +1. **Group** : org.hamcrest. **Name** : hamcrest-core. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) -1. **Group** : org.jacoco. **Name** : org.jacoco.ant. **Version** : 0.8.8. - * **License:** [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0/) +1. **Group** : org.jacoco. **Name** : org.jacoco.agent. **Version** : 0.8.12. + * **License:** [EPL-2.0](https://www.eclipse.org/legal/epl-2.0/) -1. **Group** : org.jacoco. **Name** : org.jacoco.core. **Version** : 0.8.8. - * **License:** [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0/) +1. **Group** : org.jacoco. **Name** : org.jacoco.ant. **Version** : 0.8.12. + * **License:** [EPL-2.0](https://www.eclipse.org/legal/epl-2.0/) -1. **Group** : org.jacoco. **Name** : org.jacoco.report. **Version** : 0.8.8. - * **License:** [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0/) +1. **Group** : org.jacoco. **Name** : org.jacoco.core. **Version** : 0.8.12. + * **License:** [EPL-2.0](https://www.eclipse.org/legal/epl-2.0/) + +1. **Group** : org.jacoco. **Name** : org.jacoco.report. **Version** : 0.8.12. + * **License:** [EPL-2.0](https://www.eclipse.org/legal/epl-2.0/) 1. **Group** : org.javassist. **Name** : javassist. **Version** : 3.28.0-GA. * **Project URL:** [http://www.javassist.org/](http://www.javassist.org/) @@ -521,199 +601,262 @@ * **License:** [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) * **License:** [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html) -1. **Group** : org.jboss.forge.roaster. **Name** : roaster-api. **Version** : 2.24.0.Final. +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-api. **Version** : 2.28.0.Final. * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) -1. **Group** : org.jboss.forge.roaster. **Name** : roaster-jdt. **Version** : 2.24.0.Final. +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-jdt. **Version** : 2.28.0.Final. * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) -1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0. - * **Project URL:** [http://www.jetbrains.org](http://www.jetbrains.org) +1. **Group** : org.jcommander. **Name** : jcommander. **Version** : 1.85. + * **Project URL:** [https://jcommander.org](https://jcommander.org) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.0.2. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : markdown. **Version** : 0.5.2. + * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains. **Name** : markdown. **Version** : 0.3.1.**No license information found** -1. **Group** : org.jetbrains. **Name** : markdown-jvm. **Version** : 0.3.1. +1. **Group** : org.jetbrains. **Name** : markdown-jvm. **Version** : 0.5.2. * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : dokka-analysis. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : analysis-kotlin-descriptors. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : dokka-base. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : analysis-markdown. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : dokka-core. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : dokka-base. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : dokka-core. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : kotlin-analysis-compiler. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : gfm-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : kotlin-analysis-intellij. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.7.20. +1. **Group** : org.jetbrains.dokka. **Name** : jekyll-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : org.jetbrains.intellij.deps. **Name** : trove4j. **Version** : 1.0.20200330. * **Project URL:** [https://github.com/JetBrains/intellij-deps-trove4j](https://github.com/JetBrains/intellij-deps-trove4j) * **License:** [GNU LESSER GENERAL PUBLIC LICENSE 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.21. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-build-tools-api. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-build-tools-impl. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.21. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 2.0.21. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-runner. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-client. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.21. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 2.0.21. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 2.0.21. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.7.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 2.1.20. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.6.3.**No license information found** -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core. **Version** : 1.6.3.**No license information found** -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core-jvm. **Version** : 1.6.3. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 2.1.20. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 2.1.20. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 2.1.20. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 2.1.20. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : atomicfu. **Version** : 0.23.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.atomicfu](https://github.com/Kotlin/kotlinx.atomicfu) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.10.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core. **Version** : 1.10.1. * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.7.5. +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core-jvm. **Version** : 1.10.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-jdk8. **Version** : 1.10.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.8.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.9.1. * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core. **Version** : 1.1.0.**No license information found** -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core-jvm. **Version** : 1.1.0. +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-bom. **Version** : 1.6.3. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core. **Version** : 1.6.3. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core-jvm. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core-jvm. **Version** : 1.6.3. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json. **Version** : 1.6.3. * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json. **Version** : 1.1.0.**No license information found** -1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json-jvm. **Version** : 1.1.0. +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json-jvm. **Version** : 1.4.1. * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jsoup. **Name** : jsoup. **Version** : 1.14.3. +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json-jvm. **Version** : 1.6.3. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jsoup. **Name** : jsoup. **Version** : 1.16.1. * **Project URL:** [https://jsoup.org/](https://jsoup.org/) * **License:** [The MIT License](https://jsoup.org/license) -1. **Group** : org.junit. **Name** : junit-bom. **Version** : 5.9.1.**No license information found** -1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-api. **Version** : 5.9.1. +1. **Group** : org.jspecify. **Name** : jspecify. **Version** : 1.0.0. + * **Project URL:** [http://jspecify.org/](http://jspecify.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.junit. **Name** : junit-bom. **Version** : 5.10.0. * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-engine. **Version** : 5.9.1. +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-api. **Version** : 5.10.0. * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-params. **Version** : 5.9.1. +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-engine. **Version** : 5.10.0. * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.junit.platform. **Name** : junit-platform-commons. **Version** : 1.9.1. +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-params. **Version** : 5.10.0. * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.junit.platform. **Name** : junit-platform-engine. **Version** : 1.9.1. +1. **Group** : org.junit.platform. **Name** : junit-platform-commons. **Version** : 1.10.0. * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.opentest4j. **Name** : opentest4j. **Version** : 1.2.0. - * **Project URL:** [https://github.com/ota4j-team/opentest4j](https://github.com/ota4j-team/opentest4j) - * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.1. - * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) - * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.2. - * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) - * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.junit.platform. **Name** : junit-platform-engine. **Version** : 1.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) -1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.3. - * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) - * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) - * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.opentest4j. **Name** : opentest4j. **Version** : 1.3.0. + * **Project URL:** [https://github.com/ota4j-team/opentest4j](https://github.com/ota4j-team/opentest4j) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.ow2.asm. **Name** : asm-analysis. **Version** : 9.2. +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.ow2.asm. **Name** : asm-commons. **Version** : 9.2. +1. **Group** : org.ow2.asm. **Name** : asm-commons. **Version** : 9.6. * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.ow2.asm. **Name** : asm-tree. **Version** : 9.2. +1. **Group** : org.ow2.asm. **Name** : asm-tree. **Version** : 9.6. * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 4.0.1. * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) @@ -722,15 +865,19 @@ * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [WTFPL](http://www.wtfpl.net/) -1. **Group** : org.xmlresolver. **Name** : xmlresolver. **Version** : 4.4.3. +1. **Group** : org.snakeyaml. **Name** : snakeyaml-engine. **Version** : 2.7. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml-engine](https://bitbucket.org/snakeyaml/snakeyaml-engine) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.xmlresolver. **Name** : xmlresolver. **Version** : 5.1.2. * **Project URL:** [https://github.com/xmlresolver/xmlresolver](https://github.com/xmlresolver/xmlresolver) * **License:** [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0) -1. **Group** : org.yaml. **Name** : snakeyaml. **Version** : 1.30. +1. **Group** : org.yaml. **Name** : snakeyaml. **Version** : 2.1. * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Nov 07 15:31:30 EET 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Mar 27 10:27:34 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..9bbc975 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 52f73a8..37f853b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-rc-1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68..965e398 100755 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ # 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 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/pom.xml b/pom.xml index f9ccb8f..89126b0 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine spine-change -2.0.0-SNAPSHOT.118 +2.0.0-SNAPSHOT.200 2015 @@ -26,43 +26,64 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base - 2.0.0-SNAPSHOT.120 + 2.0.0-SNAPSHOT.307 compile io.spine.validation spine-validation-java-runtime - 2.0.0-SNAPSHOT.61 + 2.0.0-SNAPSHOT.305 compile org.jetbrains.kotlin - kotlin-stdlib-jdk8 - 1.7.20 + kotlin-stdlib + 2.1.20 compile io.spine.tools spine-testlib - 2.0.0-SNAPSHOT.120 + 2.0.0-SNAPSHOT.185 test io.spine.tools - spine-testutil-time - 2.0.0-SNAPSHOT.120 + spine-time-testlib + 2.0.0-SNAPSHOT.200 test org.junit.jupiter junit-jupiter-engine - 5.9.1 + 5.10.0 test + + com.google.auto.service + auto-service-annotations + 1.1.1 + provided + + + com.google.devtools.ksp + symbol-processing + 2.1.20-1.0.31 + + + com.google.devtools.ksp + symbol-processing-api + 2.1.20-1.0.31 + + + com.google.devtools.ksp + symbol-processing-cmdline + 2.1.20-1.0.31 + com.google.errorprone error_prone_core - 2.16 + 2.36.0 com.google.errorprone @@ -77,103 +98,122 @@ all modules and does not describe the project structure per-subproject. com.puppycrawl.tools checkstyle - 10.3.4 + 10.12.1 + + + dev.zacsweers.autoservice + auto-service-ksp + 1.2.0 io.gitlab.arturbosch.detekt detekt-cli - 1.21.0 + 1.23.8 io.grpc protoc-gen-grpc-java - 1.46.0 + 1.59.0 io.spine.protodata protodata-fat-cli - 0.3.0 + 0.93.4 io.spine.protodata protodata-protoc - 0.3.0 + 0.93.4 io.spine.tools spine-dokka-extensions - 2.0.0-SNAPSHOT.4 + 2.0.0-SNAPSHOT.6 io.spine.tools - spine-mc-java-checks - 2.0.0-SNAPSHOT.105 - provided + spine-mc-java-plugins + 2.0.0-SNAPSHOT.306 io.spine.tools - spine-mc-java-plugins - 2.0.0-SNAPSHOT.105 + spine-mc-java-routing + 2.0.0-SNAPSHOT.306 io.spine.validation - spine-validation-java - 2.0.0-SNAPSHOT.61 + spine-validation-java-bundle + 2.0.0-SNAPSHOT.302 net.sourceforge.pmd pmd-java - 6.50.0 + 6.55.0 org.jacoco org.jacoco.agent - 0.8.8 + 0.8.12 org.jacoco org.jacoco.ant - 0.8.8 + 0.8.12 org.jetbrains.dokka - dokka-analysis - 1.7.20 + analysis-kotlin-descriptors + 1.9.20 org.jetbrains.dokka dokka-base - 1.7.20 + 1.9.20 org.jetbrains.dokka dokka-core - 1.7.20 + 1.9.20 + + + org.jetbrains.dokka + gfm-plugin + 1.9.20 org.jetbrains.dokka javadoc-plugin - 1.7.20 + 1.9.20 + + + org.jetbrains.dokka + jekyll-plugin + 1.9.20 org.jetbrains.dokka kotlin-as-java-plugin - 1.7.20 + 1.9.20 + + + org.jetbrains.kotlin + kotlin-build-tools-impl + 2.1.20 org.jetbrains.kotlin kotlin-compiler-embeddable - 1.7.20 + 2.1.20 org.jetbrains.kotlin kotlin-klib-commonizer-embeddable - 1.7.20 + 2.1.20 org.jetbrains.kotlin kotlin-scripting-compiler-embeddable - 1.7.20 + 2.1.20 diff --git a/version.gradle.kts b/version.gradle.kts index 893fb4a..4f3d2b7 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, 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 @@ -27,6 +27,6 @@ /** * The version of this library. * - * For dependencies on Spine modules please see [io.spine.internal.dependency.Spine]. + * For dependencies on Spine modules please see [io.spine.dependency.local.Spine]. */ -val versionToPublish by extra("2.0.0-SNAPSHOT.118") +val versionToPublish by extra("2.0.0-SNAPSHOT.200")