From 0f590cdfcefebc87ab838bac61908e729c640de9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 22 Feb 2022 19:12:41 +0200 Subject: [PATCH 01/98] Bump Gradle -> 7.4 --- gradle/wrapper/gradle-wrapper.properties | 2 +- license-report.md | 6 +++--- pom.xml | 7 +------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..41dfb879 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/license-report.md b/license-report.md index 2026509a..06f059fe 100644 --- a/license-report.md +++ b/license-report.md @@ -457,7 +457,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 19 17:13:59 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). +This report was generated on **Thu Feb 17 19:23:14 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). @@ -971,7 +971,7 @@ This report was generated on **Wed Jan 19 17:13:59 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 19 17:14:00 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). +This report was generated on **Thu Feb 17 19:23:15 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). @@ -1401,4 +1401,4 @@ This report was generated on **Wed Jan 19 17:14:00 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 19 17:14:01 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 Feb 17 19:23:15 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 diff --git a/pom.xml b/pom.xml index cd66e8e3..c167ad6d 100644 --- a/pom.xml +++ b/pom.xml @@ -146,11 +146,6 @@ all modules and does not describe the project structure per-subproject. checkstyle 9.2 - - net.sourceforge.pmd - pmd-java - 6.36.0 - net.sourceforge.pmd pmd-java @@ -189,4 +184,4 @@ all modules and does not describe the project structure per-subproject. - \ No newline at end of file + From a3ff20b8b08e8ed0732269ee03ddcdbe86573bc8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 22 Feb 2022 19:14:04 +0200 Subject: [PATCH 02/98] Update config --- .github/workflows/build-on-ubuntu.yml | 9 ++++++++- .github/workflows/build-on-windows.yml | 7 +++++++ .../kotlin/io/spine/internal/dependency/ErrorProne.kt | 2 +- .../kotlin/io/spine/internal/gradle/javac/ErrorProne.kt | 4 +++- config | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-on-ubuntu.yml b/.github/workflows/build-on-ubuntu.yml index 2ae160ca..0217c322 100644 --- a/.github/workflows/build-on-ubuntu.yml +++ b/.github/workflows/build-on-ubuntu.yml @@ -22,8 +22,15 @@ jobs: shell: bash run: ./gradlew build --stacktrace + # See: https://github.com/marketplace/actions/junit-report-action + - name: Publish Test Report + uses: mikepenz/action-junit-report@v2.8.4 + if: always() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + - name: Upload code coverage report uses: codecov/codecov-action@v2 with: - fail_ci_if_error: true + fail_ci_if_error: false verbose: true diff --git a/.github/workflows/build-on-windows.yml b/.github/workflows/build-on-windows.yml index d2ffe613..a11a7daa 100644 --- a/.github/workflows/build-on-windows.yml +++ b/.github/workflows/build-on-windows.yml @@ -22,3 +22,10 @@ jobs: shell: cmd # For the reason on `--no-daemon` see https://github.com/actions/cache/issues/454 run: gradlew.bat build --stacktrace --no-daemon + + # See: https://github.com/marketplace/actions/junit-report-action + - name: Publish Test Report + uses: mikepenz/action-junit-report@v2.8.4 + if: always() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt index ca73fedc..ab326153 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("unused") object ErrorProne { // https://github.com/google/error-prone - private const val version = "2.10.0" + private const val version = "2.11.0" // https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts private const val javacPluginVersion = "9+181-r4173-1" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt index 72c46235..df31e581 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt @@ -49,6 +49,7 @@ import org.gradle.process.CommandLineArgumentProvider * } *``` */ +@Suppress("unused") fun JavaCompile.configureErrorProne() { options.errorprone .errorproneArgumentProviders @@ -67,7 +68,8 @@ private object ErrorProneConfig { listOf( // Exclude generated sources from being analyzed by ErrorProne. - "-XepExcludedPaths:.*/generated/.*", + // Include all directories started from `generated`, such as `generated-proto`. + "-XepExcludedPaths:.*/generated.*/.*", // Turn the check off until ErrorProne can handle `@Nested` JUnit classes. // See issue: https://github.com/google/error-prone/issues/956 diff --git a/config b/config index ea978cf4..003c6872 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit ea978cf4326806fe6c60c43f18201814b0779a3b +Subproject commit 003c687208a827dfe87bd5419315c258205839f2 From 04bbed26554f4d67d27475fe7911b5f32d57aade Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 22 Feb 2022 19:14:09 +0200 Subject: [PATCH 03/98] Update config --- buildSrc/build.gradle.kts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8ce1aa24..591c5ae3 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -28,9 +28,6 @@ * This script uses two declarations of the constant [licenseReportVersion] because * currently there is no way to define a constant _before_ a build script of `buildSrc`. * We cannot use imports or do something else before the `buildscript` or `plugin` clauses. - * - * Therefore, when a version of [io.spine.internal.dependency.LicenseReport] changes, it should be - * changed in the Kotlin object _and_ in this file below twice. */ plugins { @@ -38,7 +35,7 @@ plugins { groovy `kotlin-dsl` pmd - val licenseReportVersion = "2.0" + val licenseReportVersion = "2.1" id("com.github.jk1.dependency-license-report").version(licenseReportVersion) } @@ -57,7 +54,7 @@ repositories { val jacksonVersion = "2.13.0" val googleAuthToolVersion = "2.1.2" -val licenseReportVersion = "2.0" +val licenseReportVersion = "2.1" val grGitVersion = "3.1.1" /** From d93696bb36a66d23f17b1214d3f60d810e7e4e48 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 22 Feb 2022 19:17:31 +0200 Subject: [PATCH 04/98] Bump version -> `2.0.0-SNAPSHOT.91` --- license-report.md | 78 ++++++++++++++++++++-------------------------- pom.xml | 15 ++++++--- version.gradle.kts | 2 +- 3 files changed, 44 insertions(+), 51 deletions(-) diff --git a/license-report.md b/license-report.md index 06f059fe..76941427 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.90` +# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.91` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -11,7 +11,7 @@ * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -130,10 +130,6 @@ * **Project URL:** [https://github.com/google/auto/tree/master/value](https://github.com/google/auto/tree/master/value) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.code.findbugs. **Name** : jFormatString. **Version** : 3.0.0. - * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) - * **License:** [GNU Lesser Public License](http://www.gnu.org/licenses/lgpl.html) - 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) @@ -142,19 +138,19 @@ * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -445,9 +441,9 @@ * **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** : 2.1.2. - * **Project URL:** [http://pcollections.org](http://pcollections.org) - * **License:** [The MIT License](http://www.opensource.org/licenses/mit-license.php) +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. + * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) + * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) 1. **Group** : org.reflections. **Name** : reflections. **Version** : 0.10.2. * **Project URL:** [http://github.com/ronmamo/reflections](http://github.com/ronmamo/reflections) @@ -457,12 +453,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Feb 17 19:23:14 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). +This report was generated on **Tue Feb 22 19:16:15 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). -# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.90` +# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.91` ## Runtime 1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.9. @@ -477,7 +473,7 @@ This report was generated on **Thu Feb 17 19:23:14 EET 2022** using [Gradle-Lice * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -644,10 +640,6 @@ This report was generated on **Thu Feb 17 19:23:14 EET 2022** using [Gradle-Lice * **Project URL:** [https://github.com/google/auto/tree/master/value](https://github.com/google/auto/tree/master/value) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.code.findbugs. **Name** : jFormatString. **Version** : 3.0.0. - * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) - * **License:** [GNU Lesser Public License](http://www.gnu.org/licenses/lgpl.html) - 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) @@ -656,19 +648,19 @@ This report was generated on **Thu Feb 17 19:23:14 EET 2022** using [Gradle-Lice * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -959,9 +951,9 @@ This report was generated on **Thu Feb 17 19:23:14 EET 2022** using [Gradle-Lice * **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** : 2.1.2. - * **Project URL:** [http://pcollections.org](http://pcollections.org) - * **License:** [The MIT License](http://www.opensource.org/licenses/mit-license.php) +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. + * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) + * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) 1. **Group** : org.reflections. **Name** : reflections. **Version** : 0.10.2. * **Project URL:** [http://github.com/ronmamo/reflections](http://github.com/ronmamo/reflections) @@ -971,12 +963,12 @@ This report was generated on **Thu Feb 17 19:23:14 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Feb 17 19:23:15 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). +This report was generated on **Tue Feb 22 19:16:15 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). -# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.90` +# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.91` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -987,7 +979,7 @@ This report was generated on **Thu Feb 17 19:23:15 EET 2022** using [Gradle-Lice * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1090,10 +1082,6 @@ This report was generated on **Thu Feb 17 19:23:15 EET 2022** using [Gradle-Lice * **Project URL:** [https://github.com/google/auto/tree/master/value](https://github.com/google/auto/tree/master/value) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.code.findbugs. **Name** : jFormatString. **Version** : 3.0.0. - * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) - * **License:** [GNU Lesser Public License](http://www.gnu.org/licenses/lgpl.html) - 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) @@ -1102,19 +1090,19 @@ This report was generated on **Thu Feb 17 19:23:15 EET 2022** using [Gradle-Lice * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. * **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.10.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.11.0. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1389,9 +1377,9 @@ This report was generated on **Thu Feb 17 19:23:15 EET 2022** using [Gradle-Lice * **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** : 2.1.2. - * **Project URL:** [http://pcollections.org](http://pcollections.org) - * **License:** [The MIT License](http://www.opensource.org/licenses/mit-license.php) +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. + * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) + * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) 1. **Group** : org.reflections. **Name** : reflections. **Version** : 0.10.2. * **Project URL:** [http://github.com/ronmamo/reflections](http://github.com/ronmamo/reflections) @@ -1401,4 +1389,4 @@ This report was generated on **Thu Feb 17 19:23:15 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Feb 17 19:23:15 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 **Tue Feb 22 19:16:16 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 diff --git a/pom.xml b/pom.xml index c167ad6d..127348be 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools tool-base -2.0.0-SNAPSHOT.90 +2.0.0-SNAPSHOT.91 2015 @@ -122,18 +122,18 @@ all modules and does not describe the project structure per-subproject. com.google.errorprone error_prone_annotations - 2.10.0 + 2.11.0 provided com.google.errorprone error_prone_core - 2.10.0 + 2.11.0 com.google.errorprone error_prone_type_annotations - 2.10.0 + 2.11.0 provided @@ -146,6 +146,11 @@ all modules and does not describe the project structure per-subproject. checkstyle 9.2 + + net.sourceforge.pmd + pmd-java + 6.39.0 + net.sourceforge.pmd pmd-java @@ -184,4 +189,4 @@ all modules and does not describe the project structure per-subproject. - + \ No newline at end of file diff --git a/version.gradle.kts b/version.gradle.kts index c20bb892..1489150e 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -25,4 +25,4 @@ */ val baseVersion: String by extra("2.0.0-SNAPSHOT.86") -val versionToPublish: String by extra("2.0.0-SNAPSHOT.90") +val versionToPublish: String by extra("2.0.0-SNAPSHOT.91") From 74e167ce5090b1d806e9b80df25659a172b58649 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 23 Feb 2022 22:00:59 +0200 Subject: [PATCH 05/98] Introduce `MavenArtifact` dependency --- .../io/spine/tools/code/version/Dependency.kt | 32 ++++++++++ .../spine/tools/code/version/MavenArtifact.kt | 60 +++++++++++++++++++ .../tools/code/version/MavenArtifactTest.kt | 50 ++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt create mode 100644 tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt new file mode 100644 index 00000000..a4be20bc --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt @@ -0,0 +1,32 @@ +/* + * 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.tools.code.version + +/** + * A dependency of a software component on another software component. + */ +public interface Dependency diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt new file mode 100644 index 00000000..b8d23b9e --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt @@ -0,0 +1,60 @@ +/* + * 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.tools.code.version + +/** + * A dependency on a software artifact. + */ +public data class MavenArtifact(val coordinates: String) : Dependency { + + public companion object { + + /** + * The prefix to be used before [coordinates] in the string representation of + * a Maven artifact dependency. + */ + public const val PREFIX: String = "maven:" + + /** + * Obtains the instance from the given string representation. + * + * @param value Maven coordinates with the leading [PREFIX]. + * @throws IllegalArgumentException if the given value does not start with [PREFIX]. + */ + public fun parse(value: String): MavenArtifact { + require(value.startsWith(PREFIX)) + val coordinates = value.substring(PREFIX.length) + return MavenArtifact(coordinates) + } + } + + /** + * Obtains the string representation in the format: + * `maven:::`. + */ + override fun toString(): String = "$PREFIX$coordinates" +} diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt new file mode 100644 index 00000000..0b6c56ab --- /dev/null +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt @@ -0,0 +1,50 @@ +/* + * 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.tools.code.version + +import com.google.common.truth.Truth.assertThat +import io.spine.tools.code.version.MavenArtifact.Companion.PREFIX +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows + +class `'MavenArtifact' should` { + + @Test + fun `parse string form`() { + val artifact = MavenArtifact.parse("maven:io.spine:spine-foo-bar:2.0.0-SNAPSHOT.91") + assertThat(artifact.coordinates).isEqualTo("io.spine:spine-foo-bar:2.0.0-SNAPSHOT.91") + } + + @Test + fun `require 'maven' prefix when parsing`() { + val coordinates = "com.example:foo-bar:1.0" + assertThrows { MavenArtifact.parse(coordinates) } + + val parsed = MavenArtifact.parse(PREFIX + coordinates) + assertThat(parsed.coordinates).isEqualTo(coordinates) + } +} From 1f45c9c83d6df14d4db7648cdf6919e94aade1d1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 23 Feb 2022 22:29:19 +0200 Subject: [PATCH 06/98] Introduce `KManifest` --- .../spine/tools/code/version/Dependencies.kt | 42 ++++++++++ .../io/spine/tools/code/version/KManifest.kt | 81 +++++++++++++++++++ .../spine/tools/code/version/KManifestTest.kt | 40 +++++++++ .../src/test/resources/META-INF/MANIFEST.MF | 2 + 4 files changed, 165 insertions(+) create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt create mode 100644 tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt create mode 100644 tool-base/src/test/resources/META-INF/MANIFEST.MF diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt new file mode 100644 index 00000000..27fb0f42 --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.code.version + +import com.google.common.annotations.VisibleForTesting + +public class Dependencies(public val list: List){ + + public companion object { + + @VisibleForTesting + internal fun parse(deps: String): Dependencies { + val list: List = listOf() + //TODO:2022-02-23:alexander.yevsyukov: Implement + return Dependencies(list) + } + } +} diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt new file mode 100644 index 00000000..a51f5d7b --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt @@ -0,0 +1,81 @@ +/* + * 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.tools.code.version + +import java.util.jar.Attributes.Name +import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION +import java.util.jar.Manifest + + +public class KManifest(private val impl: Manifest) { + + public companion object { + + /** + * The path to the manifest file in program resources. + */ + private const val MANIFEST_MF = "META-INF/MANIFEST.MF" + + /** + * The name of the custom manifest attribute containing a list of dependencies. + */ + public const val DEPENDS_ON_ATTR: String = "Depends-On" + + /** + * Loads the manifest from the program resources. + */ + public fun load(cl: ClassLoader): KManifest { + val stream = cl.getResourceAsStream(MANIFEST_MF) + stream.use { + val impl = Manifest(it) + return KManifest(impl) + } + } + } + + /** + * Obtains the [`Implementation-Version`][IMPLEMENTATION_VERSION] attribute of the manifest. + */ + public val implementationVersion: String + get() { + val loaded = impl.mainAttributes[IMPLEMENTATION_VERSION] + require(loaded != null) + val version = loaded.toString() + return version + } + + /** + * Obtains the dependencies declared in the ['Depends-On'][DEPENDS_ON_ATTR] attribute + * of the manifest. + */ + public val dependencies: Dependencies + get() { + val depsValue = impl.mainAttributes[Name(DEPENDS_ON_ATTR)].toString() + val deps = Dependencies.parse(depsValue) + return deps + } +} diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt new file mode 100644 index 00000000..1ebeabe3 --- /dev/null +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt @@ -0,0 +1,40 @@ +/* + * 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.tools.code.version + +import com.google.common.truth.Truth.assertThat +import org.junit.jupiter.api.Test + +class `'KManifest' should` { + + @Test + fun `load version from resources`() { + val manifest = KManifest.load(javaClass.classLoader) + + assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.91") + } +} diff --git a/tool-base/src/test/resources/META-INF/MANIFEST.MF b/tool-base/src/test/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..06cb4a2d --- /dev/null +++ b/tool-base/src/test/resources/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Implementation-Version: 2.0.0-SNAPSHOT.91 From 44f4ac9526e0b5e82c454b0a1f9964a44bc93d17 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 23 Feb 2022 22:29:37 +0200 Subject: [PATCH 07/98] Add symver dependency --- tool-base/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/tool-base/build.gradle.kts b/tool-base/build.gradle.kts index df3630f9..6bfb6c9d 100644 --- a/tool-base/build.gradle.kts +++ b/tool-base/build.gradle.kts @@ -31,6 +31,7 @@ import io.spine.internal.dependency.Spine dependencies { api(JavaPoet.lib) api(JavaX.annotations) + implementation("io.github.z4kn4fein:semver:1.2.1") val spine = Spine(project) api(spine.base) From 49a051f44305972aa3a7decdd0aa917dcbf65204 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 16:45:45 +0300 Subject: [PATCH 08/98] Update config --- .idea/misc.xml | 44 +- buildSrc/build.gradle.kts | 12 + .../src/main/kotlin/dokka-for-java.gradle.kts | 85 ++++ .../internal/dependency/AnimalSniffer.kt | 2 +- .../io/spine/internal/dependency/AssertK.kt | 3 +- .../spine/internal/dependency/BouncyCastle.kt | 1 + .../spine/internal/dependency/CheckStyle.kt | 2 +- .../internal/dependency/CheckerFramework.kt | 2 +- .../spine/internal/dependency/CommonsCli.kt | 2 +- .../io/spine/internal/dependency/Dokka.kt | 46 +- .../io/spine/internal/dependency/Grpc.kt | 2 +- .../io/spine/internal/dependency/Gson.kt | 2 +- .../io/spine/internal/dependency/Guava.kt | 2 +- .../spine/internal/dependency/HttpClient.kt | 2 +- .../io/spine/internal/dependency/Jackson.kt | 5 +- .../io/spine/internal/dependency/JavaJwt.kt | 3 +- .../io/spine/internal/dependency/JavaPoet.kt | 1 + .../io/spine/internal/dependency/Klaxon.kt | 2 +- .../spine/internal/dependency/KotlinSemver.kt | 34 ++ .../io/spine/internal/dependency/Pmd.kt | 2 +- .../io/spine/internal/dependency/Protobuf.kt | 2 +- .../io/spine/internal/dependency/Roaster.kt | 3 +- .../spine/internal/dependency/TestKitTruth.kt | 42 ++ .../internal/gradle/DependencyResolution.kt | 9 +- .../internal/gradle/ProjectExtensions.kt | 23 +- .../io/spine/internal/gradle/Repositories.kt | 5 +- .../io/spine/internal/gradle/VersionWriter.kt | 18 +- .../internal/gradle/dart/task/Publish.kt | 2 +- .../gradle/javadoc/ExcludeInternalDoclet.kt | 2 +- .../internal/gradle/javadoc/JavadocConfig.kt | 68 ++- .../gradle/javascript/task/Publish.kt | 2 +- .../internal/gradle/publish/Artifacts.kt | 135 ++++++ .../internal/gradle/publish/CloudRepo.kt | 68 +++ .../spine/internal/gradle/publish/DokkaJar.kt | 43 ++ .../internal/gradle/publish/IncrementGuard.kt | 2 +- .../gradle/publish/MavenJavaPublication.kt | 155 +++++++ .../spine/internal/gradle/publish/ProtoJar.kt | 51 +++ .../internal/gradle/publish/ProtoLocators.kt | 55 +++ .../gradle/publish/PublishingConfig.kt | 125 ++++++ .../gradle/publish/PublishingRepos.kt | 8 +- .../gradle/publish/SpinePublishing.kt | 409 ++++++++++++++++++ .../io/spine/internal/gradle/publish/Tasks.kt | 110 +++++ .../spine/internal/gradle/publish/TestJar.kt | 50 +++ .../internal/gradle/testing/Multiproject.kt | 77 ++++ .../main/resources/dokka/assets/logo-icon.svg | 17 + .../resources/dokka/styles/custom-styles.css | 43 ++ config | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- license-report.md | 36 +- pom.xml | 6 + 50 files changed, 1752 insertions(+), 72 deletions(-) create mode 100644 buildSrc/src/main/kotlin/dokka-for-java.gradle.kts create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/MavenJavaPublication.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt create mode 100644 buildSrc/src/main/resources/dokka/assets/logo-icon.svg create mode 100644 buildSrc/src/main/resources/dokka/styles/custom-styles.css diff --git a/.idea/misc.xml b/.idea/misc.xml index 11f87a38..742d5ebf 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -21,22 +21,48 @@ - + + + + \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 591c5ae3..70ee40e8 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -93,6 +93,16 @@ val errorProneVersion = "2.0.2" */ val protobufPluginVersion = "0.8.18" +/** + * The version of Dokka Gradle Plugins. + * + * Please keep in sync with [io.spine.internal.dependency.Dokka.version]. + * + * @see + * Dokka Releases + */ +val dokkaVersion = "1.6.10" + dependencies { implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") @@ -105,4 +115,6 @@ dependencies { implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorProneVersion}") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") + implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") + implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") } diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts new file mode 100644 index 00000000..d82c3b4f --- /dev/null +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -0,0 +1,85 @@ +/* + * 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 io.spine.internal.dependency.Dokka +import java.time.LocalDate +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration +import org.jetbrains.dokka.gradle.DokkaTask + +plugins { + id("org.jetbrains.dokka") +} + +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) +} + +tasks.withType().configureEach { + dokkaSourceSets.configureEach { + skipEmptyPackages.set(true) + } + + 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 we can pass our css files overriding styles generated + * by Dokka; + * - `customAssets` property to provide resources. We need to provide an image with the name + * "logo-icon.svg" to overwrite the default one 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" + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt index 2541920a..068ae59c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AnimalSniffer.kt @@ -28,6 +28,6 @@ package io.spine.internal.dependency // https://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/ object AnimalSniffer { - private const val version = "1.19" + private const val version = "1.21" const val lib = "org.codehaus.mojo:animal-sniffer-annotations:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt index 753d6bb5..8d42b619 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/AssertK.kt @@ -31,7 +31,8 @@ package io.spine.internal.dependency * * [AssertK](https://github.com/willowtreeapps/assertk) */ +@Suppress("unused") object AssertK { - private const val version = "0.23.1" + private const val version = "0.25" const val libJvm = "com.willowtreeapps.assertk:assertk-jvm:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt index 77ed6769..c0567edd 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/BouncyCastle.kt @@ -27,6 +27,7 @@ package io.spine.internal.dependency // https://www.bouncycastle.org/java.html +@Suppress("unused") object BouncyCastle { const val libPkcsJdk15 = "org.bouncycastle:bcpkix-jdk15on:1.68" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt index 1d838fee..1e3effba 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckStyle.kt @@ -30,5 +30,5 @@ package io.spine.internal.dependency // See `io.spine.internal.gradle.checkstyle.CheckStyleConfig`. @Suppress("unused") object CheckStyle { - const val version = "9.2" + const val version = "10.1" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt index 8ede0ea3..75cc67f2 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CheckerFramework.kt @@ -28,7 +28,7 @@ package io.spine.internal.dependency // https://checkerframework.org/ object CheckerFramework { - private const val version = "3.21.0" + private const val version = "3.21.3" const val annotations = "org.checkerframework:checker-qual:${version}" @Suppress("unused") val dataflow = listOf( diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt index ac0d35bc..79a4036c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/CommonsCli.kt @@ -33,6 +33,6 @@ package io.spine.internal.dependency * [Commons CLI](https://commons.apache.org/proper/commons-cli/) */ object CommonsCli { - private const val version = "1.4" + private const val version = "1.5.0" const val lib = "commons-cli:commons-cli:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt index 95cf018f..167c5af3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt @@ -29,6 +29,48 @@ package io.spine.internal.dependency // https://github.com/Kotlin/dokka @Suppress("unused") object Dokka { - const val version = "1.5.0" - const val pluginId = "org.jetbrains.dokka" + private const val group = "org.jetbrains.dokka" + + /** + When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. + */ + const val version = "1.6.10" + + object GradlePlugin { + const val id = "org.jetbrains.dokka" + + /** + * The version of this plugin is already specified in `buildSrc/build.gradle.kts` file. + * Thus, when applying the plugin in project's build files, only the [id] should be used. + */ + const val lib = "${group}:dokka-gradle-plugin:${version}" + } + + object BasePlugin { + const val lib = "${group}:dokka-base:${version}" + } + + /** + * To generate the documentation as seen from Java perspective use this plugin. + * + * @see + * Dokka output formats + */ + object KotlinAsJavaPlugin { + const val lib = "${group}:kotlin-as-java-plugin:${version}" + } + + /** + * Custom Dokka plugins developed for Spine-specific needs like excluding by `@Internal` + * annotation. + * + * @see + * Custom Dokka Plugins + */ + object SpineExtensions { + private const val group = "io.spine.tools" + + const val version = "2.0.0-SNAPSHOT.2" + const val lib = "${group}:spine-dokka-extensions:${version}" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt index d9dd7220..22996e4d 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("unused") object Grpc { @Suppress("MemberVisibilityCanBePrivate") - const val version = "1.43.1" + const val version = "1.45.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}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt index bca49156..e161ee1e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Gson.kt @@ -33,6 +33,6 @@ package io.spine.internal.dependency * [Gson](https://github.com/google/gson) */ object Gson { - private const val version = "2.8.9" + private const val version = "2.9.0" 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/internal/dependency/Guava.kt index 22e67e0d..faaf3b8b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Guava.kt @@ -35,7 +35,7 @@ package io.spine.internal.dependency */ // https://github.com/google/guava object Guava { - private const val version = "31.0.1-jre" + private const val version = "31.1-jre" const val lib = "com.google.guava:guava:${version}" const val testLib = "com.google.guava:guava-testlib:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt index bf63778c..849f1f4a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/HttpClient.kt @@ -32,7 +32,7 @@ package io.spine.internal.dependency @Suppress("unused") object HttpClient { // https://github.com/googleapis/google-http-java-client - const val version = "1.40.1" + 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}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt index d0345748..71f7e08c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt @@ -28,11 +28,12 @@ package io.spine.internal.dependency @Suppress("unused") object Jackson { - private const val version = "2.13.1" + private const val version = "2.13.2" + private const val databindVersion = "2.13.2.2" // https://github.com/FasterXML/jackson-core const val core = "com.fasterxml.jackson.core:jackson-core:${version}" // https://github.com/FasterXML/jackson-databind - const val databind = "com.fasterxml.jackson.core:jackson-databind:${version}" + const val databind = "com.fasterxml.jackson.core:jackson-databind:${databindVersion}" // https://github.com/FasterXML/jackson-dataformat-xml/releases const val dataformatXml = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${version}" // https://github.com/FasterXML/jackson-dataformats-text/releases diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt index 2581e355..424c45fb 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaJwt.kt @@ -31,7 +31,8 @@ package io.spine.internal.dependency * * [Java JWT](https://github.com/auth0/java-jwt) */ +@Suppress("unused") object JavaJwt { - private const val version = "3.18.1" + private const val version = "3.19.1" 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/internal/dependency/JavaPoet.kt index f17445a5..e9bdb9b3 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/JavaPoet.kt @@ -27,6 +27,7 @@ package io.spine.internal.dependency // https://github.com/square/javapoet +@Suppress("unused") object JavaPoet { private const val version = "1.13.0" const val lib = "com.squareup:javapoet:${version}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt index 7ee30e55..160fdbfb 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Klaxon.kt @@ -32,6 +32,6 @@ package io.spine.internal.dependency * [Klaxon](https://github.com/cbeust/klaxon) */ object Klaxon { - private const val version = "5.5" + private const val version = "5.6" const val lib = "com.beust:klaxon:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt new file mode 100644 index 00000000..47fd7de4 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinSemver.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +// https://github.com/z4kn4fein/kotlin-semver +@Suppress("unused") +object KotlinSemver { + private const val version = "1.2.1" + const val lib = "io.github.z4kn4fein:semver:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt index 595a1cb2..badd7717 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Pmd.kt @@ -29,5 +29,5 @@ package io.spine.internal.dependency // https://pmd.github.io/ @Suppress("unused") // Will be used when `config/gradle/pmd.gradle` migrates to Kotlin. object Pmd { - const val version = "6.41.0" + const val version = "6.44.0" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt index c9146a07..1da0906a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("MemberVisibilityCanBePrivate") // used directly from outside object Protobuf { private const val group = "com.google.protobuf" - const val version = "3.19.3" + const val version = "3.19.4" val libs = listOf( "${group}:protobuf-java:${version}", "${group}:protobuf-java-util:${version}", diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt index 4fec98fe..2d237060 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt @@ -27,6 +27,7 @@ package io.spine.internal.dependency // https://github.com/forge/roaster +@Suppress("unused") object Roaster { /** @@ -36,7 +37,7 @@ object Roaster { * * Please see [this issue][https://github.com/SpineEventEngine/config/issues/220] for details. */ - private const val version = "2.23.2.Final" + private const val version = "2.24.0.Final" const val api = "org.jboss.forge.roaster:roaster-api:${version}" const val jdt = "org.jboss.forge.roaster:roaster-jdt:${version}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt new file mode 100644 index 00000000..8d572d9b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/TestKitTruth.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +/** + * Gradle TestKit extension for Google Truth. + * + * Source code: + * https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/tree/main/testkit-truth + * + * Usage description: + * https://dev.to/autonomousapps/gradle-all-the-way-down-testing-your-gradle-plugin-with-gradle-testkit-2hmc + */ +@Suppress("unused") +object TestKitTruth { + private const val version = "1.1" + const val lib = "com.autonomousapps:testkit-truth:$version" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt index 6663afb8..168c0798 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt @@ -35,6 +35,7 @@ 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 @@ -44,6 +45,8 @@ import io.spine.internal.dependency.Okio import io.spine.internal.dependency.Plexus import io.spine.internal.dependency.Protobuf import io.spine.internal.dependency.Truth +import org.gradle.api.NamedDomainObjectContainer +import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.artifacts.ResolutionStrategy import org.gradle.api.artifacts.dsl.RepositoryHandler @@ -59,7 +62,7 @@ fun doForceVersions(configurations: ConfigurationContainer) { /** * Forces dependencies used in the project. */ -fun ConfigurationContainer.forceVersions() { +fun NamedDomainObjectContainer.forceVersions() { all { resolutionStrategy { failOnVersionConflict() @@ -82,6 +85,8 @@ private fun ResolutionStrategy.forceProductionDependencies() { ErrorProne.core, Guava.lib, FindBugs.annotations, + Flogger.lib, + Flogger.Runtime.systemBackend, Kotlin.reflect, Kotlin.stdLib, Kotlin.stdLibCommon, @@ -119,7 +124,7 @@ private fun ResolutionStrategy.forceTransitiveDependencies() { ) } -fun ConfigurationContainer.excludeProtobufLite() { +fun NamedDomainObjectContainer.excludeProtobufLite() { fun excludeProtoLite(configurationName: String) { named(configurationName).get().exclude( diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt index e11c7ec5..a2e34b3a 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/ProjectExtensions.kt @@ -26,12 +26,13 @@ package io.spine.internal.gradle -import io.spine.internal.gradle.publish.PublishExtension +import io.spine.internal.gradle.publish.SpinePublishing import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.SourceSetContainer +import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.getByType /** @@ -72,16 +73,20 @@ fun Project.findTask(name: String): T { } /** - * Obtains the Maven artifact ID of the project taking into account - * the value of the [PublishExtension.spinePrefix] property. + * Obtains Maven artifact ID of this [Project]. * - * If the project has a [PublishExtension] installed, then the extension is used for - * [obtaining][PublishExtension.artifactId] the artifact ID. - * - * Otherwise, the project name is returned. + * The method checks if [SpinePublishing] extension is configured upon this project. If yes, + * returns [SpinePublishing.artifactId] for the project. Otherwise, a project's name is returned. */ val Project.artifactId: String get() { - val publishExtension = rootProject.extensions.findByType(PublishExtension::class.java) - return publishExtension?.artifactId(this) ?: name + + // Publishing of a project can be configured either from the project itself or + // from its root project. This is why it is required to check both places. + + val spinePublishing = extensions.findByType() + ?: rootProject.extensions.findByType() + + val artifactId = spinePublishing?.artifactId(this) + return artifactId ?: name } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt index 2bd381e9..db807672 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt @@ -26,6 +26,7 @@ package io.spine.internal.gradle +import io.spine.internal.gradle.publish.CloudRepo import io.spine.internal.gradle.publish.PublishingRepos import io.spine.internal.gradle.publish.PublishingRepos.gitHub import java.io.File @@ -111,8 +112,8 @@ object Repos { ) val oldSpineSnapshots = PublishingRepos.mavenTeamDev.snapshots - val spine = PublishingRepos.cloudRepo.releases - val spineSnapshots = PublishingRepos.cloudRepo.snapshots + val spine = CloudRepo.published.releases + val spineSnapshots = CloudRepo.published.snapshots val artifactRegistry = PublishingRepos.cloudArtifactRegistry.releases val artifactRegistrySnapshots = PublishingRepos.cloudArtifactRegistry.snapshots diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt index 500c9252..bcec4a56 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/VersionWriter.kt @@ -26,7 +26,6 @@ package io.spine.internal.gradle -import io.spine.internal.gradle.publish.PublishExtension import java.util.* import org.gradle.api.DefaultTask import org.gradle.api.Plugin @@ -88,17 +87,14 @@ abstract class WriteVersions : DefaultTask() { } /** - * Creates a `.properties` file with versions named after the name of the project, - * taking in account the value of the [PublishExtension.spinePrefix] property. + * Creates a `.properties` file with versions, named after the value + * of [Project.artifactId] property. * - * If the property is set to `true`, the name of the file would be: - * ``` - * versions-spine-.properties - * ``` - * If the property is set to `false`, the name of the file would be: - * ``` - * versions-spine-.properties - * ``` + * The name of the file would be: `versions-.properties`. + * + * By default, value of [Project.artifactId] property is a project's name with "spine-" prefix. + * For example, if a project's name is "tools", then the name of the file would be: + * `versions-spine-tools.properties`. */ @TaskAction private fun writeFile() { diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt index 284788ee..92eb2904 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dart/task/Publish.kt @@ -28,7 +28,7 @@ package io.spine.internal.gradle.dart.task import io.spine.internal.gradle.TaskName import io.spine.internal.gradle.base.assemble -import io.spine.internal.gradle.java.publish.publish +import io.spine.internal.gradle.publish.publish import io.spine.internal.gradle.named import io.spine.internal.gradle.register import org.gradle.api.tasks.Copy diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt index 9de4148a..72d7f6a1 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/ExcludeInternalDoclet.kt @@ -65,7 +65,7 @@ class ExcludeInternalDoclet(val version: String) { } /** - * Creates a custom Javadoc task for the [project] which excludes the the types + * Creates a custom Javadoc task for the [project] which excludes the types * annotated as `@Internal`. * * The task is registered under [taskName]. diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt index cfb14281..f6002cad 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javadoc/JavadocConfig.kt @@ -26,6 +26,7 @@ package io.spine.internal.gradle.javadoc +import java.io.File import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.tasks.javadoc.Javadoc @@ -39,6 +40,13 @@ import org.gradle.external.javadoc.StandardJavadocDocletOptions @Suppress("unused") object JavadocConfig { + /** + * Link to the documentation for Java 11 Standard Library API. + * + * OpenJDK SE 11 is used for the reference. + */ + private const val standardLibraryAPI = "https://cr.openjdk.java.net/~iris/se/11/latestSpec/api/" + @Suppress("MemberVisibilityCanBePrivate") // opened to be visible from docs. val tags = listOf( JavadocTag("apiNote", "API Note"), @@ -49,15 +57,54 @@ object JavadocConfig { val encoding = Encoding("UTF-8") fun applyTo(project: Project) { - val docletOptions = project.tasks.javadocTask().options as StandardJavadocDocletOptions + val javadocTask = project.tasks.javadocTask() + discardJavaModulesInLinks(javadocTask) + val docletOptions = javadocTask.options as StandardJavadocDocletOptions + configureDoclet(docletOptions) + } + + /** + * Discards using of Java 9 modules in URL links generated by javadoc for our codebase. + * + * This fixes navigation to classes through the search results. + * + * The issue appeared after migration to Java 11. When javadoc is generated for a project + * that does not declare Java 9 modules, search results contain broken links with appended + * `undefined` prefix to the URL. This `undefined` was meant to be a name of a Java 9 module. + * + * See: [Issue #334](https://github.com/SpineEventEngine/config/issues/334) + */ + private fun discardJavaModulesInLinks(javadoc: Javadoc) { + + // We ask `Javadoc` task to modify "search.js" and override a method, responsible for + // the formation of URL prefixes. We can't specify the option "--no-module-directories", + // because it leads to discarding of all module prefixes in generated links. That means, + // links to the types from the standard library would not work, as they are declared + // within modules since Java 9. + + val discardModulePrefix = """ + + getURLPrefix = function(ui) { + return ""; + }; + """.trimIndent() + + javadoc.doLast { + val destinationDir = javadoc.destinationDir!!.absolutePath + val searchScript = File("$destinationDir/search.js") + searchScript.appendText(discardModulePrefix) + } + } + + private fun configureDoclet(docletOptions: StandardJavadocDocletOptions) { docletOptions.encoding = encoding.name reduceParamWarnings(docletOptions) registerCustomTags(docletOptions) + linkStandardLibraryAPI(docletOptions) } /** - * Configures the [Javadoc] task for the passed [docletOptions] to avoid numerous warnings - * for missing `@param` tags. + * Configures `javadoc` tool to avoid numerous warnings for missing `@param` tags. * * As suggested by Stephen Colebourne: * [https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html] @@ -72,10 +119,21 @@ object JavadocConfig { } /** - * Registers custom [tags] for the passed doclet options which in turn belong - * to some particular [Javadoc] task. + * Registers custom [tags] for the passed doclet options. */ fun registerCustomTags(docletOptions: StandardJavadocDocletOptions) { docletOptions.tags = tags.map { it.toString() } } + + /** + * Links the documentation for Java 11 Standard Library API. + * + * This documentation is used to be referenced to when navigating to the types from the + * standard library (`String`, `List`, etc.). + * + * OpenJDK SE 11 is used for the reference. + */ + private fun linkStandardLibraryAPI(docletOptions: StandardJavadocDocletOptions) { + docletOptions.addStringOption("link", standardLibraryAPI) + } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt index 9cd40c01..486d831c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/task/Publish.kt @@ -26,7 +26,7 @@ package io.spine.internal.gradle.javascript.task -import io.spine.internal.gradle.java.publish.publish +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 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 new file mode 100644 index 00000000..e6860cdd --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt @@ -0,0 +1,135 @@ +/* + * 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/CloudRepo.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt new file mode 100644 index 00000000..48cd8585 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/CloudRepo.kt @@ -0,0 +1,68 @@ +/* + * 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 + +/** + * 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. + */ +internal object CloudRepo { + + private const val name = "CloudRepo" + private const val credentialsFile = "cloudrepo.properties" + private const val publicUrl = "https://spine.mycloudrepo.io/public/repositories" + private val privateUrl = publicUrl.replace("/public", "") + + /** + * CloudRepo repository for fetching of artifacts. + * + * Use this instance to depend on artifacts from this repository. + */ + val published = Repository( + name = name, + releases = "$publicUrl/releases", + snapshots = "$publicUrl/snapshots", + credentialsFile = credentialsFile + ) + + /** + * CloudRepo repository for publishing of artifacts. + * + * Use this instance to push new artifacts to this repository. + */ + val destination = Repository( + name = name, + releases = "$privateUrl/releases", + snapshots = "$privateUrl/snapshots", + credentialsFile = credentialsFile + ) +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt new file mode 100644 index 00000000..1ddd1fb9 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DokkaJar.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.gradle.publish + +/** + * A DSL element of [SpinePublishing] extension which configures publishing of [dokkaJar] 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 [registerArtifacts] + */ +class DokkaJar { + /** + * Enables publishing `JAR`s with Dokka-generated documentation for all published modules. + */ + var enabled = false +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt index 95ba41f0..0423ee08 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/IncrementGuard.kt @@ -54,7 +54,7 @@ class IncrementGuard : Plugin { override fun apply(target: Project) { val tasks = target.tasks tasks.register(taskName, CheckVersionIncrement::class.java) { - repository = PublishingRepos.cloudRepo + repository = CloudRepo.published tasks.getByName("check").dependsOn(this) shouldRunAfter("test") diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/MavenJavaPublication.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/MavenJavaPublication.kt new file mode 100644 index 00000000..cb5fa2f0 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/MavenJavaPublication.kt @@ -0,0 +1,155 @@ +/* + * 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.PublishingExtension +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 +import org.gradle.kotlin.dsl.getByType + +/** + * 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. + * + * See: [Maven Publish Plugin | Publications](https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:publications) + * + * @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. + */ +internal class MavenJavaPublication( + private val artifactId: String, + private val jars: Set>, + private val destinations: Set, +) { + + /** + * Registers this publication in the given project. + * + * The only prerequisite for the project is to have `maven-publish` plugin applied. + */ + fun registerIn(project: Project) { + createPublication(project) + registerDestinations(project) + } + + /** + * Creates a new "mavenJava" [MavenPublication] in the given project. + */ + private fun createPublication(project: Project) { + val gradlePublishing = project.extensions.getByType() + val gradlePublications = gradlePublishing.publications + gradlePublications.create("mavenJava") { + specifyMavenCoordinates(project) + specifyArtifacts(project) + } + } + + private fun MavenPublication.specifyMavenCoordinates(project: Project) { + groupId = project.group.toString() + artifactId = this@MavenJavaPublication.artifactId + version = project.version.toString() + } + + /** + * 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](https://maven.apache.org/pom.html) + * [Understanding Gradle Module Metadata](https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html) + */ + private fun MavenPublication.specifyArtifacts(project: Project) { + + // "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) + } + } + + /** + * Goes through the [destinations] and registers each as a repository for publishing + * in the given Gradle project. + */ + private fun registerDestinations(project: Project) { + val gradlePublishing = project.extensions.getByType() + val isSnapshot = project.version.toString().isSnapshot() + val gradleRepositories = gradlePublishing.repositories + destinations.forEach { destination -> + gradleRepositories.register(destination, isSnapshot, project) + } + } + + private fun RepositoryHandler.register( + repository: Repository, + isSnapshot: Boolean, + project: Project + ) { + 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 + } + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt new file mode 100644 index 00000000..b9ffb592 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoJar.kt @@ -0,0 +1,51 @@ +/* + * 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 + +/** + * 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 [registerArtifacts] + */ +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 +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt new file mode 100644 index 00000000..ef048f2b --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/ProtoLocators.kt @@ -0,0 +1,55 @@ +/* + * 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 java.io.File +import org.gradle.api.Project +import org.gradle.api.file.SourceDirectorySet +import org.gradle.kotlin.dsl.get + + +/** + * Tells whether there are any Proto sources in "main" source set. + */ +internal fun Project.hasProto(): Boolean { + val protoSources = protoSources() + val result = protoSources.any { it.exists() } + return result +} + +/** + * Locates Proto sources in "main" source set. + * + * "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`. + */ +internal fun Project.protoSources(): Set { + val mainSourceSet = sourceSets["main"] + val protoSourceDirs = mainSourceSet.extensions.findByName("proto") as SourceDirectorySet? + return protoSourceDirs?.srcDirs ?: emptySet() +} 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 new file mode 100644 index 00000000..f2f252e0 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt @@ -0,0 +1,125 @@ +/* + * 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. + */ +internal class PublishingConfig( + val artifactId: String, + val destinations: Set, + val includeProtoJar: Boolean = true, + val includeTestJar: Boolean = false, + val includeDokkaJar: Boolean = 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") + createPublication(project) + configurePublishTask(destinations) +} + +private fun PublishingConfig.createPublication(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/PublishingRepos.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingRepos.kt index d64b722c..5abdc10f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingRepos.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingRepos.kt @@ -41,12 +41,7 @@ object PublishingRepos { credentialsFile = "credentials.properties" ) - val cloudRepo = Repository( - name = "CloudRepo", - releases = "https://spine.mycloudrepo.io/public/repositories/releases", - snapshots = "https://spine.mycloudrepo.io/public/repositories/snapshots", - credentialsFile = "cloudrepo.properties" - ) + val cloudRepo = CloudRepo.destination val cloudArtifactRegistry = CloudArtifactRegistry.repository @@ -55,4 +50,3 @@ object PublishingRepos { */ 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/internal/gradle/publish/SpinePublishing.kt new file mode 100644 index 00000000..1b10f71e --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt @@ -0,0 +1,409 @@ +/* + * 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.kotlin.dsl.create +import org.gradle.kotlin.dsl.findByType + +/** + * Configures [SpinePublishing] extension. + * + * This extension sets up publishing of artifacts to Maven repositories. + * + * The extension can be configured for single- and multi-module projects. + * + * When used with a multi-module project, the extension should be opened in a root project's + * build file. The published modules are specified explicitly by their names: + * + * ``` + * spinePublishing { + * modules = setOf( + * "subprojectA", + * "subprojectB", + * ) + * destinations = setOf( + * PublishingRepos.cloudRepo, + * PublishingRepos.cloudArtifactRegistry, + * ) + * } + * ``` + * + * When used with a single-module project, the extension should be opened in a project's build file. + * Only destinations should be specified: + * + * ``` + * spinePublishing { + * destinations = setOf( + * PublishingRepos.cloudRepo, + * PublishingRepos.cloudArtifactRegistry, + * ) + * } + * ``` + * + * It is worth to mention, that publishing of a module can be configured only from a single place. + * For example, declaring `subprojectA` as published in a root project and opening + * `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] + * 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 + * the following artifacts: + * + * 1. [sourcesJar] – sources from "main" source set. Includes "hand-made" Java, + * Kotlin and Proto files. In order to include the generated code into this artifact, a module + * should specify those files as a part of "main" source set. + * + * Here's an example of how to do that: + * + * ``` + * sourceSets { + * val generatedDir by extra("$projectDir/generated") + * val generatedSpineDir by extra("$generatedDir/main/java") + * main { + * java.srcDir(generatedSpineDir) + * } + * } + * ``` + * 2. [protoJar] – only Proto sources from "main" source set. It's published only if + * Proto files are actually present in the source set. Publication of this artifact is optional + * and can be disabled via [SpinePublishing.protoJar]. + * 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. + * + * Additionally, [testJar] artifact can be published. This artifact contains compilation output + * of "test" source set. Use [SpinePublishing.testJar] to enable its publishing. + * + * @see [registerArtifacts] + */ +fun Project.spinePublishing(configuration: SpinePublishing.() -> Unit) { + val name = SpinePublishing::class.java.simpleName + val extension = with(extensions) { findByType() ?: create(name, project) } + extension.run { + configuration() + configured() + } +} + +/** + * A Gradle extension for setting up publishing of spine modules using `maven-publish` plugin. + * + * @param project a project in which the extension is opened. By default, this project will be + * published as long as a [set][modules] of modules to publish is not specified explicitly. + * + * @see spinePublishing + */ +open class SpinePublishing(private val project: Project) { + + private val protoJar = ProtoJar() + private val testJar = TestJar() + private val dokkaJar = DokkaJar() + + /** + * Set of modules to be published. + * + * Both module's name or path can be used. + * + * Use this property if the extension is configured from a root project's build file. + * + * If left empty, the [project], in which the extension is opened, will be published. + * + * Empty by default. + */ + var modules: Set = emptySet() + + /** + * Set of repositories, to which the resulting artifacts will be sent. + * + * Usually, Spine-related projects are published to one or more repositories, + * declared in [PublishingRepos]: + * + * ``` + * destinations = setOf( + * PublishingRepos.cloudRepo, + * PublishingRepos.cloudArtifactRegistry, + * PublishingRepos.gitHub("base"), + * ) + * ``` + * + * Empty by default. + */ + var destinations: Set = emptySet() + + /** + * A prefix to be added before the name of each artifact. + * + * Default value is "spine-". + */ + var artifactPrefix: String = "spine-" + + /** + * 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: + * + * ``` + * spinePublishing { + * modules = setOf( + * "subprojectA", + * "subprojectB", + * ) + * protoJar { + * exclusions = setOf( + * "subprojectB", + * ) + * } + * } + * ``` + * + * For all modules, or when the extension is configured within a published module itself: + * + * ``` + * spinePublishing { + * protoJar { + * disabled = true + * } + * } + * ``` + * + * The resulting artifact is available under "proto" classifier. I.e., 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) + + /** + * 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: + * + * ``` + * spinePublishing { + * modules = setOf( + * "subprojectA", + * "subprojectB", + * ) + * testJar { + * inclusions = setOf( + * "subprojectB", + * ) + * } + * } + * ``` + * + * For all modules, or when the extension is configured within a published module itself: + * + * ``` + * spinePublishing { + * testJar { + * enabled = true + * } + * } + * ``` + * + * The resulting artifact is available under "test" classifier. I.e., 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) + + + /** + * Configures publishing of [dokkaJar] artifact, containing Dokka-generated documentation. By + * default, publishing of the artifact 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. + * + * Here's an example of how to use this option: + * + * ``` + * spinePublishing { + * dokkaJar { + * enabled = true + * } + * } + * ``` + * + * The resulting artifact is available under "dokka" classifier. + */ + fun dokkaJar(configuration: DokkaJar.() -> Unit) = dokkaJar.run(configuration) + + /** + * Called to notify the extension that its configuration is completed. + * + * On this stage the extension will validate the received configuration and set up + * `maven-publish` plugin for each published module. + */ + internal fun configured() { + + ensureProtoJarExclusionsArePublished() + ensureTestJarInclusionsArePublished() + ensuresModulesNotDuplicated() + + val protoJarExclusions = protoJar.exclusions + val testJarInclusions = testJar.inclusions + val publishedProjects = publishedProjects() + + 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) + } + } + + /** + * Maps the names of published modules to [Project] instances. + * + * The method considers two options: + * + * 1. The [set][modules] of subprojects to publish is not empty. It means that the extension + * is opened from a root project. + * 2. The [set][modules] is empty. Then, the [project] in which the extension is opened + * will be published. + * + * @see modules + */ + private fun publishedProjects() = modules.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. + * + * 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. + * 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. + * + * 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 + * we configure publishing for it. + */ + private fun setUpPublishing( + project: Project, + includeProtoJar: Boolean, + includeTestJar: Boolean, + includeDokkaJar: Boolean + ) { + val artifactId = artifactId(project) + val publishingConfig = PublishingConfig( + artifactId, + destinations, + includeProtoJar, + includeTestJar, + includeDokkaJar + ) + project.afterEvaluate { + publishingConfig.apply(project) + } + } + + /** + * Obtains an artifact ID for the given project. + * + * It consists of a project's name and [prefix][artifactPrefix]: + * ``. + */ + internal fun artifactId(project: Project): String = "$artifactPrefix${project.name}" + + /** + * Ensures that all modules, marked as excluded from [protoJar] publishing, + * are actually published. + * + * It makes no sense to tell a module don't publish [protoJar] artifact, if the module is not + * published at all. + */ + private fun ensureProtoJarExclusionsArePublished() { + val nonPublishedExclusions = protoJar.exclusions.minus(modules) + if (nonPublishedExclusions.isNotEmpty()) { + throw IllegalStateException("One or more modules are marked as `excluded from proto " + + "JAR publication`, but they are not even published: $nonPublishedExclusions") + } + } + + /** + * Ensures that all modules, marked as included into [testJar] publishing, + * are actually published. + * + * It makes no sense to tell a module publish [testJar] artifact, if the module is not + * published at all. + */ + private fun ensureTestJarInclusionsArePublished() { + val nonPublishedInclusions = testJar.inclusions.minus(modules) + if (nonPublishedInclusions.isNotEmpty()) { + throw IllegalStateException("One or more modules are marked as `included into test " + + "JAR publication`, but they are not even published: $nonPublishedInclusions") + } + } + + /** + * Ensures that publishing of a module is configured only from a single place. + * + * 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() { + val rootProject = project.rootProject + if (rootProject == project) { + return + } + + val rootExtension = with(rootProject.extensions) { findByType() } + rootExtension?.let { rootPublishing -> + val thisProject = setOf(project.name, project.path) + if (thisProject.minus(rootPublishing.modules).size != 2) { + throw IllegalStateException("Publishing of `$thisProject` module is already " + + "configured in a root project!") + } + } + } +} 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 new file mode 100644 index 00000000..b132638c --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt @@ -0,0 +1,110 @@ +/* + * 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/io/spine/internal/gradle/publish/TestJar.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt new file mode 100644 index 00000000..97233992 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/TestJar.kt @@ -0,0 +1,50 @@ +/* + * 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 + +/** + * 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 [registerArtifacts] + */ +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 +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt new file mode 100644 index 00000000..25ccac94 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/testing/Multiproject.kt @@ -0,0 +1,77 @@ +/* + * 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.testing + +import org.gradle.api.Project +import io.spine.internal.gradle.publish.testJar + +/** + * Exposes the test classes of this project as a new "testArtifacts" configuration. + * + * This allows other projects to depend on the test classes from this project within a Gradle + * multi-project build. It is helpful in case the dependant projects re-use abstract test suites + * of some "parent" project. + * + * Please note that this utility requires Gradle `java` plugin to be applied. Hence, it is + * recommended to call this extension method from `java` scope. + * + * Here's an example of how to expose the test classes of "projectA": + * + * ``` + * java { + * exposeTestConfiguration() + * } + * ``` + * + * Here's an example of how to consume the exposed classes in "projectB": + * + * ``` + * dependencies { + * testImplementation(project(path = ":projectA", configuration = "testArtifacts")) + * } + * ``` + * + * 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. + */ +@Suppress("unused") +fun Project.exposeTestConfiguration() { + + if (pluginManager.hasPlugin("java").not()) { + throw IllegalStateException( + "Can't expose the test configuration because `java` plugin has not been applied." + ) + } + + configurations.create("testArtifacts") { + extendsFrom(configurations.getByName("testRuntimeClasspath")) + outgoing { + artifact(testJar()) + } + } +} diff --git a/buildSrc/src/main/resources/dokka/assets/logo-icon.svg b/buildSrc/src/main/resources/dokka/assets/logo-icon.svg new file mode 100644 index 00000000..ced7f0d7 --- /dev/null +++ b/buildSrc/src/main/resources/dokka/assets/logo-icon.svg @@ -0,0 +1,17 @@ + + + + diff --git a/buildSrc/src/main/resources/dokka/styles/custom-styles.css b/buildSrc/src/main/resources/dokka/styles/custom-styles.css new file mode 100644 index 00000000..72e9c618 --- /dev/null +++ b/buildSrc/src/main/resources/dokka/styles/custom-styles.css @@ -0,0 +1,43 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +:root, +:root.theme-dark { + --color-dark: #007bff; +} + +.library-name a::before { + background-image: url('https://spine.io/img/spine-sign-white.svg') +} + +.cover a, +.main-subrow.keyValue a { + font-family: monospace; +} + +:root.theme-dark dt { + color: #fff; +} diff --git a/config b/config index 003c6872..760a3472 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 003c687208a827dfe87bd5419315c258205839f2 +Subproject commit 760a3472bb04d3e60beeb0df4c7d63bdadc7de8c diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb879..aa991fce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/license-report.md b/license-report.md index 76941427..1712dec0 100644 --- a/license-report.md +++ b/license-report.md @@ -64,6 +64,11 @@ * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -247,6 +252,11 @@ * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -453,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Feb 22 19:16:15 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). +This report was generated on **Sat Apr 16 16:36:07 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -541,6 +551,11 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -757,6 +772,11 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -963,7 +983,7 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Feb 22 19:16:15 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). +This report was generated on **Sat Apr 16 16:36:07 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1020,6 +1040,11 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1187,6 +1212,11 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1389,4 +1419,4 @@ This report was generated on **Tue Feb 22 19:16:15 EET 2022** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Feb 22 19:16:16 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 **Sat Apr 16 16:36:07 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 127348be..11103a00 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,12 @@ all modules and does not describe the project structure per-subproject. 1.13.0 compile + + io.github.z4kn4fein + semver + 1.2.1 + compile + io.spine spine-base From 1cc54475af329b391a93cb576470e3da2c4521cf Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 17:00:38 +0300 Subject: [PATCH 09/98] Bump version in tests --- .../test/kotlin/io/spine/tools/code/version/KManifestTest.kt | 2 +- tool-base/src/test/resources/META-INF/MANIFEST.MF | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt index 1ebeabe3..c972f380 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt @@ -35,6 +35,6 @@ class `'KManifest' should` { fun `load version from resources`() { val manifest = KManifest.load(javaClass.classLoader) - assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.91") + assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.92") } } diff --git a/tool-base/src/test/resources/META-INF/MANIFEST.MF b/tool-base/src/test/resources/META-INF/MANIFEST.MF index 06cb4a2d..af407ec1 100644 --- a/tool-base/src/test/resources/META-INF/MANIFEST.MF +++ b/tool-base/src/test/resources/META-INF/MANIFEST.MF @@ -1,2 +1,2 @@ Manifest-Version: 1.0 -Implementation-Version: 2.0.0-SNAPSHOT.91 +Implementation-Version: 2.0.0-SNAPSHOT.92 From d0809f2b1ab8dc58d1936204f72f91681a045117 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 17:01:50 +0300 Subject: [PATCH 10/98] Update config --- .idea/misc.xml | 37 +++------- .../internal/gradle/publish/Artifacts.kt | 13 ++++ .../gradle/publish/PublishingConfig.kt | 16 +++-- .../gradle/publish/SpinePublishing.kt | 70 ++++++++++++++++--- .../io/spine/internal/gradle/publish/Tasks.kt | 44 ++++++++++-- 5 files changed, 131 insertions(+), 49 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 742d5ebf..53408739 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -21,40 +21,19 @@ 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 index 81acb3ae..e6860cdd 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt @@ -112,6 +112,19 @@ internal fun Project.javadocJar() = tasks.getOrCreate("javadocJar") { 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) 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 index d1e355d8..f2f252e0 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/PublishingConfig.kt @@ -39,12 +39,14 @@ import org.gradle.kotlin.dsl.apply * @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. */ internal class PublishingConfig( val artifactId: String, val destinations: Set, val includeProtoJar: Boolean = true, val includeTestJar: Boolean = false, + val includeDokkaJar: Boolean = false ) /** @@ -65,7 +67,7 @@ internal fun PublishingConfig.apply(project: Project) = with(project) { } private fun PublishingConfig.createPublication(project: Project) { - val artifacts = project.registerArtifacts(includeProtoJar, includeTestJar) + val artifacts = project.registerArtifacts(includeProtoJar, includeTestJar, includeDokkaJar) val publication = MavenJavaPublication( artifactId = artifactId, jars = artifacts, @@ -86,15 +88,17 @@ private fun PublishingConfig.createPublication(project: Project) { * 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] and [testJar] is optional. It can be controlled by the method's - * parameters. + * 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 + includeTestJar: Boolean = false, + includeDokkaJar: Boolean = false ): Set> { val artifacts = mutableSetOf( @@ -113,5 +117,9 @@ private fun Project.registerArtifacts( artifacts.add(testJar()) } + if(includeDokkaJar) { + artifacts.add(dokkaJar()) + } + return artifacts } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt index 73687f6e..1b10f71e 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/SpinePublishing.kt @@ -116,12 +116,16 @@ fun Project.spinePublishing(configuration: SpinePublishing.() -> Unit) { /** * A Gradle extension for setting up publishing of spine modules using `maven-publish` plugin. * + * @param project a project in which the extension is opened. By default, this project will be + * published as long as a [set][modules] of modules to publish is not specified explicitly. + * * @see spinePublishing */ open class SpinePublishing(private val project: Project) { private val protoJar = ProtoJar() private val testJar = TestJar() + private val dokkaJar = DokkaJar() /** * Set of modules to be published. @@ -239,6 +243,30 @@ open class SpinePublishing(private val project: Project) { */ fun testJar(configuration: TestJar.() -> Unit) = testJar.run(configuration) + + /** + * Configures publishing of [dokkaJar] artifact, containing Dokka-generated documentation. By + * default, publishing of the artifact 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. + * + * Here's an example of how to use this option: + * + * ``` + * spinePublishing { + * dokkaJar { + * enabled = true + * } + * } + * ``` + * + * The resulting artifact is available under "dokka" classifier. + */ + fun dokkaJar(configuration: DokkaJar.() -> Unit) = dokkaJar.run(configuration) + /** * Called to notify the extension that its configuration is completed. * @@ -253,20 +281,36 @@ open class SpinePublishing(private val project: Project) { val protoJarExclusions = protoJar.exclusions val testJarInclusions = testJar.inclusions - val publishedModules = modules.ifEmpty { setOf(project.name) } + val publishedProjects = publishedProjects() - publishedModules.forEach { module -> - val includeProtoJar = (protoJarExclusions.contains(module) || protoJar.disabled).not() - val includeTestJar = (testJarInclusions.contains(module) || testJar.enabled) - setUpPublishing(module, includeProtoJar, includeTestJar) + 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) } } /** - * Sets up `maven-publish` plugin for the given module. + * Maps the names of published modules to [Project] instances. + * + * The method considers two options: * - * Firstly, an instance of [PublishingConfig] is assembled for the module. Then, this - * config is applied to the module. + * 1. The [set][modules] of subprojects to publish is not empty. It means that the extension + * is opened from a root project. + * 2. The [set][modules] is empty. Then, the [project] in which the extension is opened + * will be published. + * + * @see modules + */ + private fun publishedProjects() = modules.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. * * 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. @@ -284,14 +328,19 @@ open class SpinePublishing(private val project: Project) { * `project.afterEvaluate` in order to guarantee that a module will be configured by the time * we configure publishing for it. */ - private fun setUpPublishing(module: String, includeProtoJar: Boolean, includeTestJar: Boolean) { - val project = project.project(module) + private fun setUpPublishing( + project: Project, + includeProtoJar: Boolean, + includeTestJar: Boolean, + includeDokkaJar: Boolean + ) { val artifactId = artifactId(project) val publishingConfig = PublishingConfig( artifactId, destinations, includeProtoJar, includeTestJar, + includeDokkaJar ) project.afterEvaluate { publishingConfig.apply(project) @@ -358,4 +407,3 @@ open class SpinePublishing(private val project: Project) { } } } - 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 index ebd065c7..b132638c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Tasks.kt @@ -30,27 +30,61 @@ 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. Makes `publish` task in a root project depend on local `publish`. + * 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) { - val rootPublish = rootProject.tasks.getOrCreatePublishTask() - val localPublish = tasks.getOrCreatePublishTask() + attachCredentialsVerification(destinations) + bindToRootPublish() +} + +private fun Project.attachCredentialsVerification(destinations: Set) { val checkCredentials = tasks.registerCheckCredentialsTask(destinations) - rootPublish.configure { dependsOn(localPublish) } + val localPublish = tasks.publish localPublish.configure { dependsOn(checkCredentials) } } -private const val PUBLISH = "publish" +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) From 81e1f5aba28d4a2bfd3d367dab1083ae0581a16f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 18:31:07 +0300 Subject: [PATCH 11/98] Update version numbers --- license-report.md | 42 ++++++++++++++++++++++++++++++++++++------ pom.xml | 9 ++------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/license-report.md b/license-report.md index fd909880..54a6298b 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.91` +# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.92` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -64,6 +64,11 @@ * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -247,6 +252,11 @@ * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -453,12 +463,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.91` +# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.92` ## Runtime 1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.9. @@ -541,6 +551,11 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -757,6 +772,11 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -963,12 +983,12 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.91` +# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.92` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -1020,6 +1040,11 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1187,6 +1212,11 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1389,4 +1419,4 @@ This report was generated on **Thu Mar 31 18:03:10 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 31 18:03:11 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sat Apr 16 17:00:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index e8e87c20..17a96bdb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools tool-base -2.0.0-SNAPSHOT.91 +2.0.0-SNAPSHOT.92 2015 @@ -152,11 +152,6 @@ all modules and does not describe the project structure per-subproject. checkstyle 10.1 - - net.sourceforge.pmd - pmd-java - 6.39.0 - net.sourceforge.pmd pmd-java @@ -195,4 +190,4 @@ all modules and does not describe the project structure per-subproject. - \ No newline at end of file + From b4622447486c762a44bbb3caa10a7d65cbdeb1e6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 22:31:25 +0300 Subject: [PATCH 12/98] Add missing EOF --- .idea/misc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 53408739..049d1eb2 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -44,4 +44,4 @@ - \ No newline at end of file + From 01b2ea4fb49741bdfcdfdb2ffecb214e8a356b43 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 22:35:02 +0300 Subject: [PATCH 13/98] Add customization of manifests --- .../io/spine/tools/code/version/KManifest.kt | 23 ++++++- .../tools/code/version/KManifestWriter.kt | 61 +++++++++++++++++++ .../spine/tools/code/version/KManifestTest.kt | 40 ++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt index a51f5d7b..b47785ca 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt @@ -26,12 +26,15 @@ package io.spine.tools.code.version +import com.google.common.annotations.VisibleForTesting +import java.io.InputStream +import java.util.jar.Attributes import java.util.jar.Attributes.Name import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Manifest -public class KManifest(private val impl: Manifest) { +public open class KManifest(protected val impl: Manifest) { public companion object { @@ -50,6 +53,17 @@ public class KManifest(private val impl: Manifest) { */ public fun load(cl: ClassLoader): KManifest { val stream = cl.getResourceAsStream(MANIFEST_MF) + check(stream != null) { + "Unable to load the `$MANIFEST_MF` file from resources." + } + return load(stream) + } + + /** + * Loads the manifest from the given input stream. + */ + @VisibleForTesting + internal fun load(stream: InputStream): KManifest { stream.use { val impl = Manifest(it) return KManifest(impl) @@ -57,12 +71,14 @@ public class KManifest(private val impl: Manifest) { } } + protected val mainAttributes: Attributes = impl.mainAttributes + /** * Obtains the [`Implementation-Version`][IMPLEMENTATION_VERSION] attribute of the manifest. */ public val implementationVersion: String get() { - val loaded = impl.mainAttributes[IMPLEMENTATION_VERSION] + val loaded = mainAttributes[IMPLEMENTATION_VERSION] require(loaded != null) val version = loaded.toString() return version @@ -74,7 +90,8 @@ public class KManifest(private val impl: Manifest) { */ public val dependencies: Dependencies get() { - val depsValue = impl.mainAttributes[Name(DEPENDS_ON_ATTR)].toString() + val dependsOnAttr = mainAttributes[Name(DEPENDS_ON_ATTR)] + val depsValue = dependsOnAttr.toString() val deps = Dependencies.parse(depsValue) return deps } diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt new file mode 100644 index 00000000..e82271c9 --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt @@ -0,0 +1,61 @@ +/* + * 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.tools.code.version + +import java.io.OutputStream +import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION +import java.util.jar.Attributes.Name.MANIFEST_VERSION +import java.util.jar.Manifest + +/** + * Allows to configure and write a manifest file. + */ +public class KManifestWriter: KManifest(Manifest()) { + + init { + // The `Manifest-Version` version attribute must be initialized. + // Otherwise, `java.util.jar.Attributes.writeMain()` skips writing its content. + mainAttributes[MANIFEST_VERSION] = "1.0" + } + + /** + * Sets the [`Implementation-Version`][IMPLEMENTATION_VERSION] attribute of the manifest. + * + * @param value a non-empty version string + */ + public fun implementationVersion(value: String) { + require(value.isNotEmpty()) + mainAttributes[IMPLEMENTATION_VERSION] = value + } + + /** + * Writes the manifest to the given stream. + */ + public fun write(stream: OutputStream) { + impl.write(stream) + } +} diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt index c972f380..8a03dde5 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt @@ -27,7 +27,14 @@ package io.spine.tools.code.version import com.google.common.truth.Truth.assertThat +import io.spine.testing.TestValues.randomString +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test +import org.junit.jupiter.api.io.TempDir class `'KManifest' should` { @@ -37,4 +44,37 @@ class `'KManifest' should` { assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.92") } + + @Nested + inner class `provide configuration via writer object for` { + + private lateinit var manifest: KManifest + + private lateinit var version: String + + @BeforeEach + fun initManifest(@TempDir tmp: File) { + version = randomString() + + val writer = KManifestWriter() + writer.implementationVersion(version) + + val file = tmp.resolve("MANIFEST.MF") + val output = FileOutputStream(file) + output.use { + writer.write(it) + } + + val input = FileInputStream(file) + input.use { + manifest = KManifest.load(input) + } + } + + @Test + fun implementationVersion() { + assertThat(manifest.implementationVersion) + .isEqualTo(version) + } + } } From ebb395e5adc4f672f035e8bf582def324c1965d3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 22:35:39 +0300 Subject: [PATCH 14/98] Update build time --- license-report.md | 6 +++--- pom.xml | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/license-report.md b/license-report.md index 54a6298b..67d48950 100644 --- a/license-report.md +++ b/license-report.md @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -983,7 +983,7 @@ This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1419,4 +1419,4 @@ This report was generated on **Sat Apr 16 17:00:25 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 17:00:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sat Apr 16 22:31:27 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 17a96bdb..42fd38df 100644 --- a/pom.xml +++ b/pom.xml @@ -152,6 +152,11 @@ all modules and does not describe the project structure per-subproject. checkstyle 10.1 + + net.sourceforge.pmd + pmd-java + 6.39.0 + net.sourceforge.pmd pmd-java @@ -190,4 +195,4 @@ all modules and does not describe the project structure per-subproject. - + \ No newline at end of file From e0fda9e89008bd53f8be99da0cd7596e5ad892e8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 22:59:39 +0300 Subject: [PATCH 15/98] Remove unused scripts --- buildSrc/src/main/groovy/checkstyle.gradle | 43 -- .../src/main/groovy/dart/build-tasks.gradle | 68 -- .../main/groovy/dart/pub-publish-tasks.gradle | 79 --- buildSrc/src/main/groovy/generate-pom.gradle | 611 ------------------ buildSrc/src/main/groovy/jacoco.gradle | 216 ------- buildSrc/src/main/groovy/javac-args.gradle | 71 -- .../src/main/groovy/js/build-tasks.gradle | 165 ----- .../src/main/groovy/js/configure-proto.gradle | 116 ---- buildSrc/src/main/groovy/js/js.gradle | 218 ------- buildSrc/src/main/groovy/js/npm-cli.gradle | 91 --- .../main/groovy/js/npm-publish-tasks.gradle | 89 --- .../groovy/js/update-package-version.gradle | 84 --- .../main/groovy/license-report-common.gradle | 42 -- .../main/groovy/license-report-project.gradle | 211 ------ .../main/groovy/license-report-repo.gradle | 75 --- buildSrc/src/main/groovy/publish-proto.gradle | 231 ------- buildSrc/src/main/groovy/publish.gradle | 132 ---- buildSrc/src/main/groovy/run-build.gradle | 84 --- buildSrc/src/main/groovy/slow-tests.gradle | 49 -- .../src/main/groovy/test-artifacts.gradle | 45 -- buildSrc/src/main/groovy/test-output.gradle | 62 -- buildSrc/src/main/resources/pmd.xml | 148 ----- 22 files changed, 2930 deletions(-) delete mode 100644 buildSrc/src/main/groovy/checkstyle.gradle delete mode 100644 buildSrc/src/main/groovy/dart/build-tasks.gradle delete mode 100644 buildSrc/src/main/groovy/dart/pub-publish-tasks.gradle delete mode 100644 buildSrc/src/main/groovy/generate-pom.gradle delete mode 100644 buildSrc/src/main/groovy/jacoco.gradle delete mode 100644 buildSrc/src/main/groovy/javac-args.gradle delete mode 100644 buildSrc/src/main/groovy/js/build-tasks.gradle delete mode 100644 buildSrc/src/main/groovy/js/configure-proto.gradle delete mode 100644 buildSrc/src/main/groovy/js/js.gradle delete mode 100644 buildSrc/src/main/groovy/js/npm-cli.gradle delete mode 100644 buildSrc/src/main/groovy/js/npm-publish-tasks.gradle delete mode 100644 buildSrc/src/main/groovy/js/update-package-version.gradle delete mode 100644 buildSrc/src/main/groovy/license-report-common.gradle delete mode 100644 buildSrc/src/main/groovy/license-report-project.gradle delete mode 100644 buildSrc/src/main/groovy/license-report-repo.gradle delete mode 100644 buildSrc/src/main/groovy/publish-proto.gradle delete mode 100644 buildSrc/src/main/groovy/publish.gradle delete mode 100644 buildSrc/src/main/groovy/run-build.gradle delete mode 100644 buildSrc/src/main/groovy/slow-tests.gradle delete mode 100644 buildSrc/src/main/groovy/test-artifacts.gradle delete mode 100644 buildSrc/src/main/groovy/test-output.gradle delete mode 100644 buildSrc/src/main/resources/pmd.xml diff --git a/buildSrc/src/main/groovy/checkstyle.gradle b/buildSrc/src/main/groovy/checkstyle.gradle deleted file mode 100644 index db3d5c52..00000000 --- a/buildSrc/src/main/groovy/checkstyle.gradle +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * This script configures Gradle Checkstyle plugin. - */ - -import io.spine.internal.dependency.CheckStyle - -println("`checkstyle.gradle` script is deprecated. Please use the `CheckStyleConfig` utility instead.") - -apply plugin: 'checkstyle' - -checkstyle { - toolVersion = "${CheckStyle.version}" - configFile = file("$rootDir/config/quality/checkstyle.xml") - - // Disable checking the test sources. - checkstyleTest.enabled = false -} diff --git a/buildSrc/src/main/groovy/dart/build-tasks.gradle b/buildSrc/src/main/groovy/dart/build-tasks.gradle deleted file mode 100644 index 6206a93b..00000000 --- a/buildSrc/src/main/groovy/dart/build-tasks.gradle +++ /dev/null @@ -1,68 +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.apache.tools.ant.taskdefs.condition.Os - -println("`build-tasks.gradle` script is deprecated. " + - "Please use `DartTasks.build()` extension instead.") - -final def GROUP = 'Dart' -final def packageIndex = "$projectDir/.packages" as File -final def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? '.bat' : '' -final def PUB_EXECUTABLE = 'pub' + extension - -task resolveDependencies(type: Exec) { - group = GROUP - description = 'Fetches the dependencies declared via `pubspec.yaml`.' - - inputs.file "$projectDir/pubspec.yaml" - outputs.file packageIndex - - commandLine PUB_EXECUTABLE, 'get' - - mustRunAfter 'cleanPackageIndex' -} - -tasks['assemble'].dependsOn 'resolveDependencies' - -task cleanPackageIndex(type: Delete) { - group = GROUP - description = 'Deletes the `.packages` file on this Dart module.' - delete = [packageIndex] -} - -tasks['clean'].dependsOn 'cleanPackageIndex' - -task testDart(type: Exec) { - group = GROUP - description = 'Runs Dart tests declared in the `./test` directory. See `https://pub.dev/packages/test#running-tests`.' - - commandLine PUB_EXECUTABLE, 'run', 'test' - - dependsOn 'resolveDependencies' -} - -tasks['check'].dependsOn 'testDart' diff --git a/buildSrc/src/main/groovy/dart/pub-publish-tasks.gradle b/buildSrc/src/main/groovy/dart/pub-publish-tasks.gradle deleted file mode 100644 index 7e625e57..00000000 --- a/buildSrc/src/main/groovy/dart/pub-publish-tasks.gradle +++ /dev/null @@ -1,79 +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.apache.tools.ant.taskdefs.condition.Os - -println("`pub-publish-tasks.gradle` script is deprecated. " + - "Please use `DartTasks.publish()` extension instead.") - -final def publicationDir = "$buildDir/pub/publication/$project.name" -final def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? '.bat' : '' -final def PUB_EXECUTABLE = 'pub' + extension - -task stagePubPublication(type: Copy) { - description = 'Prepares the Dart package for Pub publication.' - - from fileTree(projectDir) { - include '**/*.dart', 'pubspec.yaml', '**/*.md' - exclude 'proto/', 'generated/', 'build/', '**/.*' - } - from "$rootDir/LICENSE" - into publicationDir - - doLast { - logger.debug("Prepared Pub publication in directory `$publicationDir`.") - } - - dependsOn 'assemble' -} - -/** - * A Dart analog of {@code publish}. - */ -task publishToPub(type: Exec) { - description = 'Publishes this package to Pub.' - - workingDir publicationDir - commandLine PUB_EXECUTABLE, 'publish', '--trace' - final sayYes = new ByteArrayInputStream('y'.getBytes()) - standardInput(sayYes) - - dependsOn 'stagePubPublication' -} - -/** - * A Dart analog of {@code publishToMavenLocal}. - */ -task activateLocally(type: Exec) { - description = 'Activates this package locally.' - - commandLine PUB_EXECUTABLE, 'global', 'activate', '--source', 'path', publicationDir, '--trace' - - workingDir publicationDir - dependsOn 'stagePubPublication' -} - -tasks['publish'].dependsOn 'publishToPub' diff --git a/buildSrc/src/main/groovy/generate-pom.gradle b/buildSrc/src/main/groovy/generate-pom.gradle deleted file mode 100644 index 2cd39810..00000000 --- a/buildSrc/src/main/groovy/generate-pom.gradle +++ /dev/null @@ -1,611 +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:noinspection GroovyVariableCanBeFinal - -import groovy.xml.MarkupBuilder -import org.gradle.api.internal.artifacts.dependencies.AbstractExternalModuleDependency - -import java.util.function.Function - -import static java.util.stream.Collectors.toSet - -/** - * This script generates a {@code pom.xml} file that contains dependencies of the root project as - * well as the dependencies of its subprojects. - * - * The generated {@code pom.xml} is not usable for {@code maven} build tasks and is merely a - * description of project dependencies. - * - * Configures the {@code build} task to generate the {@code pom.xml} file. - * - * To generate the pom, {@code apply} from this file. - * - * Note that the generated {@code pom.xml} includes the group ID, artifact ID and the version of the - * project this script was applied to. In case you want to override the default values, do so in - * the {@code ext} block like so: - * - *
- * {@code
- * ext {
- *     groupId = 'custom-group-id'
- *     artifactId = 'custom-artifact-id'
- *     version = 'custom-version'
- * }
- * }
- * 
- * - * By default, those values are taken from the {@code project} object, which may or may not include - * them. If the project does not have these values and they are not specified in the {@code ext} - * block, the result {@code pom.xml} file is going to contain empty blocks, - * e.g. {@code } - */ - -println("`generate-pom.gradle` script is deprecated. Please use the `PomGenerator` utility instead.") - -// In some cases, the `base` plugin, which is by default is added by e.g. `java`, is not yet added. -// `base` plugin defines the `build` task. This script needs it. -apply plugin: 'base' - -ext { - pomFile = "${projectDir}${File.separator}pom.xml" -} - -task generatePom { - - doLast { - delete pomFile - final ExtraPropertiesExtension extension = rootProject.ext - final RootProjectData projectData = RootProjectData.fromEither(project, extension) - final ProjectPomXml result = ProjectPomXml.from(projectData) - result.writeTo(pomFile) - } -} - -build.finalizedBy generatePom -generatePom.dependsOn assemble - -/** - * A {@code pom.xml} file that contains dependencies of the project and its subprojects. - * - *

It is not usable for {@code maven} build tasks and serves as a description of project first - * level dependencies, i.e. transitive dependencies are not included - */ -class ProjectPomXml { - - private static final String XML_METADATA = "" - private static final String PROJECT_SCHEMA_LOCATION = "" - private static final String MODEL_VERSION = "4.0.0" - private static final String CLOSING_PROJECT_TAG = "" - private static final String SPINE_INCEPTION_YEAR = "2015" - private static final String NEW_LINE = System.lineSeparator() - - private final Project project - private final String groupId - private final String artifactId - private final String version - - private ProjectPomXml(final Project project, - final String groupId, - final String artifactId, - final String version) { - this.project = project - this.groupId = groupId - this.artifactId = artifactId - this.version = version - } - - /** Creates a new instance based on the specified project data. */ - static ProjectPomXml from(final RootProjectData projectData) { - return new ProjectPomXml(projectData.project(), - projectData.groupId(), - projectData.artifactId(), - projectData.version()) - } - - /** - * Writes the {@code pom.xml} file containing dependencies of this project and its subprojects to the specified - * location. - * - *

If a file with the specified location exists, its contents will be substituted with a new - * {@code pom.xml}. - * - * @param filePath path to write {@code pom.xml} file to - */ - void writeTo(final String filePath) { - final FileWriter fileWriter = new FileWriter(filePath) - final StringWriter stringWriter = new StringWriter() - writeHeader(stringWriter) - - writeBlocks(stringWriter, - describingComment(), - rootProjectData(), - inceptionYear(), - licence(), - projectDependencies() - ) - fileWriter.write(stringWriter.toString()) - fileWriter.close() - } - - /** - * Writes the specified lines using the specified writer, dividing them by platforms line - * separator. - * - * The written lines are also padded with platforms line separator from both sides - */ - static void writeBlocks(final StringWriter writer, final String... lines) { - writer.write(NEW_LINE) - for (final String line : lines) { - writer.write(line) - writer.write(NEW_LINE) - writer.write(NEW_LINE) - } - writer.write(NEW_LINE) - } - - /** - * Obtains a String that represents a tag with the inception year of Spine. - */ - private static String inceptionYear() { - final Writer writer = new StringWriter() - final MarkupBuilder xmlBuilder = new MarkupBuilder(writer) - xmlBuilder.inceptionYear(SPINE_INCEPTION_YEAR) - return writer.toString() - } - - /** - * Obtains licence information about Spine. - * - *

More on licences here. - */ - private static String licence() { - final Writer writer = new StringWriter() - SpineLicenceAsXml.writeUsing(writer) - return writer.toString() - } - - /** - * Obtains a string that contains project dependencies as XML. - * - *

Obtained string also contains a closing project tag. - */ - private String projectDependencies() { - Writer writer = new StringWriter() - ProjectDependenciesAsXml projectDeps = ProjectDependenciesAsXml.of(project) - projectDeps.writeUsing(writer) - writer.write(NEW_LINE) - writer.write(CLOSING_PROJECT_TAG) - return writer.toString() - } - - /** - * Obtains a description comment that describes the nature of the generated {@code pom.xml} file. - */ - private static String describingComment() { - String description = - System.lineSeparator() + - "This file was generated using the Gradle `generatePom` task. " + - System.lineSeparator() + - "This file is not suitable for `maven` build tasks. It only describes the " + - "first-level dependencies of " + - System.lineSeparator() + - "all modules and does not describe the project " + - "structure per-subproject." + - System.lineSeparator() - String descriptionComment = - String.format("", - System.lineSeparator(), - description, - System.lineSeparator()) - return descriptionComment - } - - /** - * Obtains a string that contains the name and the version of the current project. - */ - private String rootProjectData() { - Writer writer = new StringWriter() - MarkupBuilder xmlBuilder = new MarkupBuilder(writer) - xmlBuilder.groupId(this.groupId) - xmlBuilder.artifactId(this.artifactId) - xmlBuilder.version(this.version) - return writer.toString() - } - - /** - * Writes the XML metadata using the specified writer. - */ - private static void writeHeader(StringWriter stringWriter) { - stringWriter.write(XML_METADATA) - stringWriter.write(System.lineSeparator()) - stringWriter.write(PROJECT_SCHEMA_LOCATION) - stringWriter.write(System.lineSeparator()) - stringWriter.write(MODEL_VERSION) - stringWriter.write(System.lineSeparator()) - } -} - -/** - * Dependencies of the project expressed as XML. - * - *

Subprojects dependencies are included, transitive dependencies are not included. - * - *

Example: - *

- * {@code
- *  
- *      
- *          io.spine
- *          base
- *          1.0.0-pre7
- *}
- * 
- */ -class ProjectDependenciesAsXml { - - private final Set firstLevelDependencies - - private ProjectDependenciesAsXml(Set dependencySet) { - this.firstLevelDependencies = new TreeSet<>(dependencySet) - } - - /** Creates a new instance based on the specified project. */ - static ProjectDependenciesAsXml of(Project project) { - Set dependencies = projectDependencies(project) - return new ProjectDependenciesAsXml(dependencies) - } - - /** - * Writes the dependencies using the specified writer. - * - *

Used writer will not be closed. - */ - void writeUsing(Writer writer) { - MarkupBuilder xmlBuilder = new MarkupBuilder(writer) - xmlBuilder.dependencies() { - firstLevelDependencies - .forEach { projectDep -> - xmlBuilder.dependency { - groupId(projectDep.dependency().group) - artifactId(projectDep.dependency().name) - version(projectDep.dependency().version) - if (projectDep.hasDefinedScope()) { - scope(projectDep.scopeName()) - } - } - } - } - } - - private static Set projectDependencies(Project project) { - Set firstLevelDependencies = new HashSet<>() - firstLevelDependencies.addAll(dependenciesFromAllConfigurations(project)) - project.subprojects.forEach { subproject -> - Set subprojectDeps = dependenciesFromAllConfigurations(subproject) - firstLevelDependencies.addAll(subprojectDeps) - } - return firstLevelDependencies.stream().sorted().distinct().collect(toSet()) - } - - private static Set dependenciesFromAllConfigurations(Project project) { - Set result = new HashSet<>() - project.configurations.forEach { c -> - def configuration = c - if (isResolvable(c)) { - // Force configuration resolution. - configuration.resolvedConfiguration - } - configuration.dependencies.forEach { - if (isExternal(it)) { - DependencyWithScope dependency = DependencyWithScope.of(it, configuration) - result.add(dependency) - } - } - } - return result - } - - static boolean isResolvable(Configuration config) { - config.hasProperty("canBeResolved") && config.canBeResolved - } - - private static boolean isExternal(Dependency dependency) { - return AbstractExternalModuleDependency.isAssignableFrom(dependency.class) - } -} - -/** - * A project dependency with its scope. - * - * @see - * - * More on dependency scopes . - */ -class DependencyWithScope implements Comparable { - - private final Dependency dependency - private final DependencyScope scope - - /** - * A map that contains the relations of known Gradle configuration names - * to their Maven dependency scope equivalents. - */ - private static Map CONFIG_TO_SCOPE - - - /** - * Performs comparison of {@code DependencyWithScope} instances based on the following rules: - * - *

    - *
  • Compares the scope of the dependency first. Dependencies with lower scope - * {@linkplain #dependencyPriority priority} number goes first. - *
  • For dependencies with same scope does the lexicographical group name comparison. - *
  • For dependencies within the same group does the lexicographical artifact - * name comparison. - *
  • For dependencies with the same artifact name does the lexicographical artifact - * version comparison. - *
- */ - private static final Comparator COMPARATOR = Comparator - .comparingInt { it.dependencyPriority() } - .thenComparing((Function) { it.dependency().group }) - .thenComparing((Function) { it.dependency().name }) - .thenComparing((Function) { it.dependency().version }) - - static { - final DependencyScope compile = DependencyScope.compile - final DependencyScope runtime = DependencyScope.runtime - final DependencyScope provided = DependencyScope.provided - - CONFIG_TO_SCOPE = new HashMap<>() - - /* - * Configurations from the Gradle Java plugin that are known to be mapped to the `compile` - * scope. - * - * Dependencies with the `compile` Maven scope are propagated to dependent projects. - * - * More at https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations - */ - CONFIG_TO_SCOPE.put("compile", compile) - CONFIG_TO_SCOPE.put("implementation", compile) - CONFIG_TO_SCOPE.put("api", compile) - - /* - * Configurations from the Gradle Java plugin that are known to be mapped to the `runtime` - * scope. - * - * Dependencies with the `runtime` Maven scopes are required for execution only. - */ - CONFIG_TO_SCOPE.put("runtime", runtime) - CONFIG_TO_SCOPE.put("runtimeOnly", runtime) - CONFIG_TO_SCOPE.put("runtimeClasspath", runtime) - CONFIG_TO_SCOPE.put("default", runtime) - - - /* - * Configurations from the Gradle Java plugin that are known to be mapped to the `provided` - * scope. - * - * Dependencies with the `provided` Maven scope are not propagated to dependent projects - * but are required during the compilation. - */ - CONFIG_TO_SCOPE.put("compileOnly", provided) - CONFIG_TO_SCOPE.put("compileOnlyApi", provided) - CONFIG_TO_SCOPE.put("annotationProcessor", provided) - } - - private DependencyWithScope(Dependency dependency, DependencyScope scope) { - this.dependency = dependency - this.scope = scope - } - - /** - * Creates a new instance based on the specified dependency and its configuration. - * - *

The scope of the dependency is based on the name of the configuration. - */ - static DependencyWithScope of(Dependency dependency, Configuration configuration) { - String configurationName = configuration.name - if (CONFIG_TO_SCOPE.containsKey(configurationName)) { - return new DependencyWithScope(dependency, CONFIG_TO_SCOPE.get(configurationName)) - } - if (configurationName.toLowerCase().startsWith("test")) { - return new DependencyWithScope(dependency, DependencyScope.test) - } - return new DependencyWithScope(dependency, DependencyScope.undefined) - } - - /** - * Obtains the layout priority of a scope. - * - * Layout priority determines what scopes come first in the generated {@code pom.xml} file. - * Dependencies with a lower priority number go on top. - */ - int dependencyPriority() { - switch(scope) { - case DependencyScope.compile: - return 0 - case DependencyScope.runtime: - return 1 - case DependencyScope.test: - return 2 - default: - return 3 - } - } - - /** Obtains the scope name of this dependency .*/ - String scopeName() { - return scope.name() - } - - /** Obtains the Gradle dependency. */ - Dependency dependency() { - return this.dependency - } - - /** Obtains the Maven scope of this dependency. */ - DependencyScope scope() { - return this.scope - } - - /** - * Returns {@code true} if this dependency has a defined scope, returns {@code false} otherwise. - */ - boolean hasDefinedScope() { return scope != DependencyScope.undefined } - - @Override - boolean equals(o) { - if (this.is(o)) return true - if (getClass() != o.class) return false - - DependencyWithScope that = (DependencyWithScope) o - - if (dependency.group != that.dependency.group) return false - if (dependency.name != that.dependency.name) return false - if (dependency.version != that.dependency.version) return false - - return true - } - - @Override - int hashCode() { - int result = (dependency != null ? dependency.hashCode() : 0) - return result - } - - @Override - int compareTo(DependencyWithScope o) { - return COMPARATOR.compare(this, o) - } - - /** - * A Maven dependency scope. - */ - static enum DependencyScope { - undefined, - compile, - provided, - runtime, - test, - system - /* - `import` is also a scope, however, it can't be used outside the `` - section, which is outside of the scope of this script - */ - } -} - -/** - * Information about the licences used by Spine in XML form. - */ -class SpineLicenceAsXml { - - private static final String NAME = "Apache License, Version 2.0" - private static final String URL = "https://www.apache.org/licenses/LICENSE-2.0.txt" - private static final String DISTRIBUTION = "repo" - - /** Prevents instantiation. */ - private SpineLicenceAsXml() { - } - - /** - * Writes information about the Spine licence using the specified writer. - */ - static void writeUsing(Writer fileWriter) { - MarkupBuilder xmlBuilder = new MarkupBuilder(fileWriter) - xmlBuilder.licenses { - license { - name(NAME) - url(SpineLicenceAsXml.URL) - distribution(DISTRIBUTION) - } - } - } -} - -/** - * Information about the root project. - * - *

Root project is the project for which the {@code generatePom} is executed. - * - *

Includes group ID, artifact name and the version. - */ -class RootProjectData { - - private final Project project - private final String groupId - private final String artifactId - private final String version - - private RootProjectData(Project project, String group, String artifactId, String version) { - this.project = project - this.groupId = group - this.artifactId = artifactId - this.version = version - } - - /** - * Creates a new instance. - * - *

Data from the specified project is prioritized. - * If a property (group ID, artifact name or version) is not found in the project, - * it is taken from the specified extension. - */ - static RootProjectData fromEither(Project project, /* or */ ExtraPropertiesExtension extension) { - boolean groupMissingFromProject = project.group == null || project.group.isEmpty() - boolean nameMissingFromProject = project.name == null || project.name.isEmpty() - boolean versionMissingFromProject = project.version == null || project.version.isEmpty() - - String groupId = groupMissingFromProject ? extension.groupId : project.group - String name = nameMissingFromProject ? extension.artifactId : project.name - String version = versionMissingFromProject ? extension.version : project.version - - return new RootProjectData(project, groupId, name, version) - } - - /** Obtains the project object matching the root project. */ - Project project() { - return this.project - } - - /** Obtains the group ID of the root project. */ - String groupId() { - return this.groupId - } - - /** Obtains the artifact ID of the root project. */ - String artifactId() { - return this.artifactId - } - - /** Obtains the version of the root project. */ - String version() { - return this.version - } -} diff --git a/buildSrc/src/main/groovy/jacoco.gradle b/buildSrc/src/main/groovy/jacoco.gradle deleted file mode 100644 index cef391a4..00000000 --- a/buildSrc/src/main/groovy/jacoco.gradle +++ /dev/null @@ -1,216 +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. - */ - -// Apply this script to enable the combined JaCoCo test report. -// -// This task combines the XML report results from all Java sub-projects. -// Inspired by: https://gist.github.com/aalmiray/e6f54aa4b3803be0bcac -// -// This task runs after `:check` task. - -import groovy.io.FileType - -import java.util.stream.Collectors - -// Required to grab dependencies for `jacocoRootReport` task. -repositories { - mavenCentral() -} - -println("`jacoco.gradle` script is deprecated. Please use the `JacocoConfig` instead.") - -// Adds the `:check` task. -apply plugin: 'base' - -final def javaProjects = subprojects.findAll { it.pluginManager.hasPlugin('jacoco') } -final def jacocoReports = file("${rootProject.buildDir}/subreports/jacoco/") - -task copyReports(dependsOn: javaProjects.jacocoTestReport, type: Copy) { - description = "Copies JaCoCo reports from subprojects into a single directory in the root project." - - from files(javaProjects.jacocoTestReport.executionData) - into jacocoReports - - rename { "${UUID.randomUUID().toString()}.exec" } -} - -// Create an combined coverage report across Java modules, -// excluding the generated content from the coverage stats. -// -task jacocoRootReport(dependsOn: ':copyReports', type: JacocoReport) { - - final def sourceDirs = CodebaseFilter.nonGeneratedOnly(files(javaProjects.sourceSets.main.java.srcDirs)) - additionalSourceDirs.from sourceDirs - sourceDirectories.from sourceDirs - executionData.from fileTree(jacocoReports) - - final def filter = new CodebaseFilter(project, - javaProjects.sourceSets.main.java.srcDirs, - javaProjects.sourceSets.main.output) - final def nonGeneratedFiles = files(filter.findNonGeneratedCompiledFiles()) - classDirectories.from nonGeneratedFiles - additionalClassDirs.from nonGeneratedFiles - - reports { - html.required.set(true) - xml.required.set(true) - csv.required.set(false) - } - onlyIf = { - true - } -} - -check.dependsOn jacocoRootReport - -/** - * Serves to distinguish the {@code .java} and {@code .class} files built from - * the Protobuf definitions from the human-created production code. - */ -class CodebaseFilter { - - private static final String GENERATED_PATH_MARKER = "generated" - - private static final String JAVA_SRC_FOLDER_MARKER = "/java/" - private static final String SPINE_JAVA_SRC_FOLDER_MARKER = "main/spine/" - private static final String GRPC_SRC_FOLDER_MARKER = "/main/grpc/" - - private static final String JAVA_OUTPUT_FOLDER_MARKER = "/main/" - - private static final String JAVA_SOURCE_FILE_EXTENSION = ".java" - private static final String COMPILED_CLASS_FILE_EXTENSION = ".class" - private static final String ANONYMOUS_CLASS_MARKER = '$' - private static final String ANONYMOUS_CLASS_PATTERN = "\\${ANONYMOUS_CLASS_MARKER}" - - private final Project project - private final def javaSrcDirs - private final def outputDirs - - CodebaseFilter(final Project project, final javaSrcDirs, final outputDirs) { - this.project = project - this.javaSrcDirs = javaSrcDirs - this.outputDirs = outputDirs - } - - static FileCollection nonGeneratedOnly(final FileCollection files) { - return files.filter { - !it.absolutePath.contains(GENERATED_PATH_MARKER) - } - } - - static FileCollection generatedOnly(final FileCollection files) { - return files.filter { - it.absolutePath.contains(GENERATED_PATH_MARKER) - } - } - - private static String parseClassName(final File file, final String sourceFolderMarker, final String extension) { - - final def index = file.absolutePath.lastIndexOf(sourceFolderMarker) - if (index > 0) { - def filePathInFolder = file.absolutePath.substring(index + sourceFolderMarker.length()) - if (filePathInFolder.endsWith(extension)) { - filePathInFolder = filePathInFolder.substring(0, filePathInFolder.length() - extension.length()) - - final def className = filePathInFolder.replace('/', '.') - return className - } else { - return null - } - } else { - return null - } - } - - private LinkedList getGeneratedClassNames() { - final def sourceFiles = project.files(javaSrcDirs) - final def generatedSourceFiles = generatedOnly(sourceFiles) - - final def generatedClassNames = [] - generatedSourceFiles.each { final folder -> - if (folder.exists() && folder.isDirectory()) { - folder.eachFileRecurse(FileType.FILES) { final aFile -> - final def name = parseClassName(aFile, JAVA_SRC_FOLDER_MARKER, JAVA_SOURCE_FILE_EXTENSION) - if (name != null) { - generatedClassNames.add(name) - } else { - // Try another folder prefix; perhaps this file is gRPC service. - final def generatedByGrpc = parseClassName(aFile, - GRPC_SRC_FOLDER_MARKER, - JAVA_SOURCE_FILE_EXTENSION) - if (generatedByGrpc != null) { - generatedClassNames.add(generatedByGrpc) - } else { - // Try one more folder prefix; perhaps this file is generated by Spine. - final def generatedBySpine = - parseClassName(aFile, SPINE_JAVA_SRC_FOLDER_MARKER, JAVA_SOURCE_FILE_EXTENSION) - if (generatedBySpine != null) { - generatedClassNames.add(generatedBySpine) - } - } - } - } - } - } - - return generatedClassNames - } - - List findNonGeneratedCompiledFiles() { - log("Source dirs for code coverage calculation:") - final def srcDirs = project.files(javaSrcDirs) - srcDirs.each { - log(" - ${it}") - } - - final def generatedClassNames = getGeneratedClassNames() - log(generatedClassNames.join('\n')) - final def nonGeneratedClassTree = outputDirs - .stream() - .flatMap { it.getClassesDirs().files.stream() } - .map { final srcFile -> - log("Filtering out the generated classes for ${srcFile}") - - // Return the filtered `fileTree`s as a collected result. - return project.fileTree(dir: srcFile, exclude: { final details -> - def className = parseClassName(details.file, JAVA_OUTPUT_FOLDER_MARKER, COMPILED_CLASS_FILE_EXTENSION) - - // Handling anonymous classes as well. - // They should be associated with the same `.java` file as their parent class. - if (className != null && className.contains(ANONYMOUS_CLASS_MARKER)) { - // Assuming there cannot be more than a single `$`. - className = className.split(ANONYMOUS_CLASS_PATTERN)[0] - } - return generatedClassNames.contains(className) - }) - }.collect(Collectors.toList()) - return nonGeneratedClassTree - } - - private void log(final String message) { - project.logger.debug(message) - } -} diff --git a/buildSrc/src/main/groovy/javac-args.gradle b/buildSrc/src/main/groovy/javac-args.gradle deleted file mode 100644 index 9bfb780e..00000000 --- a/buildSrc/src/main/groovy/javac-args.gradle +++ /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. - */ - -/* - * This script configures Java Compiler. - */ - -println("`javac-args.gradle` script is deprecated. Please use `JavaCompile.configureJavac()` " + - "and `JavaCompile.configureErrorProne()` utilities instead.") - -tasks.withType(JavaCompile) { - - if (JavaVersion.current() != JavaVersion.VERSION_1_8) { - throw new GradleException("Spine Event Engine can be built with JDK 8 only." + - " Supporting JDK 11 and above at build-time is planned in 2.0 release." + - " Please use the pre-built binaries available in the Spine Maven repository." + - " See https://github.com/SpineEventEngine/base/issues/457.") - } - - // Explicitly states the encoding of the source and test source files, ensuring - // correct execution of the `javac` task. - // - // Also promotes compiler warnings to errors, so that the build fails on warnings. - // This includes Error Prone warnings - options.encoding = 'UTF-8' - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - // The last command line argument is temporarily commented out because of - // this issue: https://github.com/SpineEventEngine/config/issues/173 - // Please restore when the issue is resolved. - // << "-Werror" - - // Configure Error Prone: - // 1. Exclude generated sources from being analyzed by Error Prone. - // 2. Turn the check off until Error Prone can handle `@Nested` JUnit classes. - // See issue: https://github.com/google/error-prone/issues/956 - // 3. Turn off checks which report unused methods and unused method parameters. - // See issue: https://github.com/SpineEventEngine/config/issues/61 - // - // For more config details see: - // https://github.com/tbroyer/gradle-errorprone-plugin/tree/master#usage - - options.errorprone.errorproneArgs.addAll('-XepExcludedPaths:.*/generated/.*', - '-Xep:ClassCanBeStatic:OFF', - '-Xep:UnusedMethod:OFF', - '-Xep:UnusedVariable:OFF', - '-Xep:CheckReturnValue:OFF', - '-Xep:FloggerSplitLogStatement:OFF') -} diff --git a/buildSrc/src/main/groovy/js/build-tasks.gradle b/buildSrc/src/main/groovy/js/build-tasks.gradle deleted file mode 100644 index 78202430..00000000 --- a/buildSrc/src/main/groovy/js/build-tasks.gradle +++ /dev/null @@ -1,165 +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. - */ - -/** - * This script declares common Gradle tasks required for JavaScript modules. - * - *

Most of the tasks launch a separate process which runs an NPM CLI command, so it's necessary - * that the NPM command line tool is installed. - * - *

This script doesn't configure Protobuf plugin and Spine's Protobuf JS plugin. - */ - -println("`build-tasks.gradle` script is deprecated. Please use `javascript` extension instead.") - -ext { - JAVA_SCRIPT_TASK_GROUP = 'JavaScript' - - workDirectory = "$projectDir" - nodeModulesDir = "$projectDir/node_modules" - packageJsonFile = "$projectDir/package.json" - - npm = { final String... command -> - ext.executeNpm(workDirectory as File, command) - } -} - -apply plugin: 'base' -apply from: "$rootDir" + io.spine.internal.gradle.Scripts.commonPath + "js/npm-cli.gradle" -apply from: "$rootDir" + io.spine.internal.gradle.Scripts.commonPath + "js/update-package-version.gradle" - -/** - * Compiles Protobuf sources into JavaScript. - * - *

This is a lifecycle task. It performs no action but triggers all the tasks which perform - * the compilation. - */ -task compileProtoToJs { - group = JAVA_SCRIPT_TASK_GROUP - description = "Compiles Protobuf sources to JavaScript." -} - -/** - * Installs the module dependencies using the `npm install` command. - * - * The `npm install` command is executed with the vulnerability check disabled since - * it cannot fail the task execution despite on vulnerabilities found. - * - * To check installed Node packages for vulnerabilities execute `auditNodePackages` task. - */ -task installNodePackages { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Installs the module`s Node dependencies.' - - inputs.file packageJsonFile - outputs.dir nodeModulesDir - - doLast { - // To turn off npm audit when installing all packages. Use `auditNodePackages` task - // to check installed Node packages for vulnerabilities. - npm 'set', 'audit', 'false' - npm 'install' - } -} - -/** - * Audits the module dependencies using the `npm audit` command. - * - * Sets the minimum level of vulnerability for `npm audit` to exit with a non-zero exit code - * to "high". - */ -task auditNodePackages { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Audits the module`s Node dependencies.' - dependsOn installNodePackages - - inputs.dir nodeModulesDir - - doLast { - npm 'set', 'audit-level', 'critical' - try { - npm 'audit' - } catch (final Exception ignored) { - npm 'audit', '--registry' 'http://registry.npmjs.eu' - } - } -} - -check.dependsOn auditNodePackages - -/** - * Cleans output of `buildJs` and dependant tasks. - */ -task cleanJs { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Cleans the output of JavaScript build.' - - clean.dependsOn cleanJs - - doLast { - delete buildJs.outputs - delete compileProtoToJs.outputs - delete installNodePackages.outputs - } -} - -/** - * Assembles the JS sources. - * - * This task is an analog of `build` for JS. - * - * To include a task into the JS build, depend `buildJs` onto that task. - */ -task buildJs { - group = JAVA_SCRIPT_TASK_GROUP - description = "Assembles the JavaScript source files." - - dependsOn updatePackageVersion - dependsOn installNodePackages - dependsOn compileProtoToJs - assemble.dependsOn buildJs -} - -/** - * Tests the JS sources. - * - * If `check` task is scheduled to run, this task is automatically added to - * the task graph and will be executed after `test` task completion. - */ -task testJs { - group = JAVA_SCRIPT_TASK_GROUP - description = "Tests the JavaScript source files." - - dependsOn installNodePackages - dependsOn compileProtoToJs - check.dependsOn testJs - - testJs.mustRunAfter test -} - -idea.module { - excludeDirs += file(nodeModulesDir) -} diff --git a/buildSrc/src/main/groovy/js/configure-proto.gradle b/buildSrc/src/main/groovy/js/configure-proto.gradle deleted file mode 100644 index d0966a41..00000000 --- a/buildSrc/src/main/groovy/js/configure-proto.gradle +++ /dev/null @@ -1,116 +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 io.spine.internal.dependency.Protobuf -import io.spine.internal.gradle.Scripts - -/** - * Configures how the Proto definitions of the project are compiled into JavaScript and their - * publishing. - * - * Use this script if the project contains Proto files that should be published as a separate NPM - * module. - * - * The prerequisites for using the script are: - * - * 1. The Spine Proto JS plugin applied to the project - * (see https://github.com/SpineEventEngine/base/tree/master/tools/mc-js). - * - * 2. The extension variable `versionToPublishJs` configured to represent the version under which - * the NPM packages should be published. - */ - -println("`configure-proto.gradle` script is deprecated. Please use `javascript` extension instead.") - -ext { - genProtoBaseDir = "$projectDir/generated" - genProtoMain = "$genProtoBaseDir/main/js" - genProtoTest = "$genProtoBaseDir/test/js" -} - -apply from: "$rootDir" + io.spine.internal.gradle.Scripts.commonPath + "js/npm-publish-tasks.gradle" - -/** - * Configures the JS code generation. - */ -protobuf { - generatedFilesBaseDir = genProtoBaseDir - protoc { - artifact = Protobuf.protoc - } - generateProtoTasks { - all().each { final task -> - task.builtins { - // For information on JavaScript code generation please see - // https://github.com/google/protobuf/blob/master/js/README.md - js { - option "import_style=commonjs" - } - - task.generateDescriptorSet = true - final def testClassifier = task.sourceSet.name == "test" ? "_test" : "" - final def descriptorName = - "${project.group}_${project.name}_${project.version}${testClassifier}.desc" - task.descriptorSetOptions.path = - "${projectDir}/build/descriptors/${task.sourceSet.name}/${descriptorName}" - } - compileProtoToJs.dependsOn task - } - } -} - -/** - * Configures the generation of additional features for the Proto messages via - * Spine Proto JS plugin. - */ -protoJs { - mainGenProtoDir = genProtoMain - testGenProtoDir = genProtoTest - - generateParsersTask().dependsOn compileProtoToJs - buildJs.dependsOn generateParsersTask() -} - -/** - * Prepares Proto files for publication, see {@code npm-publish-tasks.gradle}. - */ -prepareJsPublication { - - doLast { - copy { - from (projectDir) { - include 'package.json' - include '.npmrc' - } - - from (genProtoMain) { - include '**' - } - - into publicationDirectory - } - } -} diff --git a/buildSrc/src/main/groovy/js/js.gradle b/buildSrc/src/main/groovy/js/js.gradle deleted file mode 100644 index 963f6b87..00000000 --- a/buildSrc/src/main/groovy/js/js.gradle +++ /dev/null @@ -1,218 +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. - */ - -/** - * A script configuring the build of a JavaScript module, which is going to be published to NPM. - * - *

In particular, the script brings tasks to: - *

    - *
  1. Install NPM dependencies. - *
  2. Compile Protobuf sources to JavaScript. - *
  3. Test and generate coverage reports for JavaScript sources. - *
  4. Update the version in `package.json` depending on the `versionToPublishJs` property. - *
  5. Clean up the build output of a JavaScript module. - *
- * - *

The script is based on other scripts from `config` submodule. - */ - -println("`js.gradle` script is deprecated. Please use `javascript` extension instead.") - -ext { - srcDir = "$projectDir/main" - testSrcDir = "$projectDir/test" - genProtoBaseDir = projectDir - genProtoSubDir = "proto" - genProtoMain = "$genProtoBaseDir/main/$genProtoSubDir" - genProtoTest = "$genProtoBaseDir/test/$genProtoSubDir" - nycOutputDir = "$projectDir/.nyc_output" -} - -apply from: "$rootDir" + io.spine.internal.gradle.Scripts.commonPath + "js/npm-publish-tasks.gradle" - -/** - * Cleans old module dependencies and build outputs. - */ -task deleteCompiled { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Cleans old module dependencies and build outputs.' - - clean.dependsOn deleteCompiled - - doLast { - delete genProtoMain - delete genProtoTest - delete coverageJs.outputs - } -} - -/** - * Customizes the task already defined in `config` module by running Webpack build. - */ -buildJs { - - outputs.dir "$projectDir/dist" - - doLast { - npm 'run', 'build' - npm 'run', 'build-dev' - } -} - -/** - * Customizes the task already defined in `config` module by running - * the JavaScript tests. - */ -testJs { - - doLast { - npm 'run', 'test' - } -} - -/** - * Copies bundled JS sources to the temporary NPM publication directory. - */ -task copyBundledJs(type: Copy) { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Copies assembled JavaScript sources to the NPM publication directory.' - - from buildJs.outputs - into "$publicationDirectory/dist" - - dependsOn buildJs -} - -/** - * Transpiles JS sources before publishing them to NPM. - * - * Puts the resulting files to the temporary NPM publication directory. - */ -task transpileSources { - group = JAVA_SCRIPT_TASK_GROUP - description = "Transpiles sources before publishing." - - doLast { - npm 'run', 'transpile-before-publish' - } -} - -/** - * Defines files to copy by the task. - */ -prepareJsPublication { - - doLast { - copy { - from (projectDir) { - include 'package.json' - include '.npmrc' - } - into publicationDirectory - } - } - - //TODO:2019-02-05:dmytro.grankin: temporarily don't publish a bundle, see https://github.com/SpineEventEngine/web/issues/61 - //dependsOn copyBundledJs - dependsOn transpileSources -} - -/** - * Runs the JavaScript tests and collects the code coverage. - */ -task coverageJs { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Runs the JS tests and collects the code coverage info.' - - outputs.dir nycOutputDir - - final def runsOnWindows = org.gradle.internal.os.OperatingSystem.current().isWindows() - final def coverageScript = runsOnWindows ? 'coverage:win' : 'coverage:unix' - - doLast { - npm 'run', coverageScript - } - - dependsOn buildJs - - rootProject.check.dependsOn coverageJs -} - -/** - * Generates the report on NPM dependencies and their licenses. - */ -task npmLicenseReport { - - doLast { - npm 'run', 'license-report' - } -} - -/** - * Runs NPM license report straight after the Gradle license report. - */ -//TODO:2021-09-22:alexander.yevsyukov: Resolve this dependency. -//generateLicenseReport.finalizedBy npmLicenseReport - -apply plugin: 'io.spine.mc-js' - -protoJs { - generatedMainDir = genProtoMain - generatedTestDir = genProtoTest - - generateParsersTask().dependsOn compileProtoToJs - buildJs.dependsOn generateParsersTask() - testJs.dependsOn buildJs -} - - -protobuf { - generatedFilesBaseDir = genProtoBaseDir - protoc { - artifact = io.spine.internal.dependency.Protobuf.compiler - } - generateProtoTasks { - all().each { final task -> - task.builtins { - // Do not use java builtin output in this project. - remove java - - // For information on JavaScript code generation please see - // https://github.com/google/protobuf/blob/master/js/README.md - js { - option "import_style=commonjs" - outputSubDir = genProtoSubDir - } - - task.generateDescriptorSet = true - final def testClassifier = task.sourceSet.name == "test" ? "_test" : "" - final def descriptorName = "${project.group}_${project.name}_${project.version}${testClassifier}.desc" - task.descriptorSetOptions.path = "${projectDir}/build/descriptors/${task.sourceSet.name}/${descriptorName}" - } - compileProtoToJs.dependsOn task - } - } -} diff --git a/buildSrc/src/main/groovy/js/npm-cli.gradle b/buildSrc/src/main/groovy/js/npm-cli.gradle deleted file mode 100644 index cc273357..00000000 --- a/buildSrc/src/main/groovy/js/npm-cli.gradle +++ /dev/null @@ -1,91 +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.apache.tools.ant.taskdefs.condition.Os - -/** - * The script allowing to run NPM commands from Gradle. - */ - -println("`npm-cli.gradle` script is deprecated. Please use `javascript` extension instead.") - -/** - * The name of an environmental variable which contains the NPM auth token. - * - *

The token is used for publishing only. - * - *

It is required to set this variable before invoking NPM commands. - */ -ext.NPM_TOKEN_VARIABLE = "NPM_TOKEN" - -/** - * @return the value of `NPM_TOKEN` environmental variable or a stub value, if the token is not set - */ -String npmToken() { - final def tokenVarValue = System.getenv(NPM_TOKEN_VARIABLE) - final def token = tokenVarValue?.isEmpty() ? "PUBLISHING_FORBIDDEN" : tokenVarValue - return token -} - -/** - * Executes the given command depending on the current OS. - * - * @param workingDirArg the directory to execute the command in - * @param windowsCommand the command to execute is the OS is Windows - * @param unixCommand the command to execute is the OS is Unix-like - * @param params the command params, platform-independent - */ -def execMultiplatform(final File workingDirArg, - final String windowsCommand, - final String unixCommand, - final String[] params) { - exec { - final String command = Os.isFamily(Os.FAMILY_WINDOWS) ? windowsCommand : unixCommand - final List resultingParams = [command] + Arrays.asList(params) - workingDir = workingDirArg - commandLine = resultingParams - environment NPM_TOKEN_VARIABLE, npmToken() - } -} - -def runNpm(final File launchDir, final String[] params) { - execMultiplatform launchDir, 'npm.cmd', 'npm', params -} - -ext { - - /** - * Executes an {@code npm} CLI command. - * - * For example, to execute command {@code npm run compile}, invoke this function as follows: - * {@code executeNpm 'run', 'compile'} - * - * @param params the command parameters - */ - executeNpm = { final File from = projectDir, final String... params -> - runNpm(from, params) - } -} diff --git a/buildSrc/src/main/groovy/js/npm-publish-tasks.gradle b/buildSrc/src/main/groovy/js/npm-publish-tasks.gradle deleted file mode 100644 index 63abf673..00000000 --- a/buildSrc/src/main/groovy/js/npm-publish-tasks.gradle +++ /dev/null @@ -1,89 +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. - */ - -/** - * The script declares tasks for publishing to NPM. - * - *

In order to publish the NPM module, it is required that the {@code NPM_TOKEN} environment - * variable is set to a valid NPM auth token. If the token is not set, a dummy value is added to - * the NPM execution process, which is sufficient for the local development. - */ - -println("`npm-publish-tasks.gradle` script is deprecated. " + - "Please use `javascript` extension instead.") - -apply from: "$rootDir" + io.spine.internal.gradle.Scripts.commonPath + "js/build-tasks.gradle" - -ext { - publicationDirectory = "$buildDir/npm-publication/" -} - -/** - * A task to prepare files for publication. - * - *

Does nothing by default, so a user should configure this task - * to copy all required files to the {@code publicationDirectory}. - * - *

The task is performed before {@code link} and {@code publishJs} tasks. - * - *

The task isn't a {@code copy} task since it causes side effects - * like a removal of the publication directory. See https://github.com/gradle/gradle/issues/1012. - */ -task prepareJsPublication { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Prepares the NPM package for publish.' - - dependsOn buildJs -} - -/** - * Publishes the NPM package locally with `npm link`. - */ -task link { - group = JAVA_SCRIPT_TASK_GROUP - description = "Publishes the NPM package locally." - - doLast { - executeNpm(publicationDirectory as File, 'link') - } - - dependsOn prepareJsPublication -} - -/** - * Publishes the NPM package with `npm publish`. - */ -task publishJs { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Publishes the NPM package.' - - doLast { - executeNpm(publicationDirectory as File, 'publish') - } - - dependsOn prepareJsPublication - publish.dependsOn publishJs -} diff --git a/buildSrc/src/main/groovy/js/update-package-version.gradle b/buildSrc/src/main/groovy/js/update-package-version.gradle deleted file mode 100644 index b6b64b8f..00000000 --- a/buildSrc/src/main/groovy/js/update-package-version.gradle +++ /dev/null @@ -1,84 +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 groovy.json.JsonOutput -import groovy.json.JsonSlurper - -/** - * This script declares a task to update the version in in a package.json file. - */ - -println("`update-package-version.gradle` script is deprecated. " + - "Please use `javascript` extension instead.") - -/** - * Updates the package.json version to the specified one. - * - *

The path of the package.json and the version to set has default values, - * but can be redefined: - * - *

{@code
- * updatePackageVersion.packageJsonPath = "custom/package.json"
- * updatePackageVersion.newVersion = npmPackageVersion
- * }
- */ -task updatePackageVersion() { - group = JAVA_SCRIPT_TASK_GROUP - description = 'Updates the version in package.json.' - - ext.packageJsonPath = packageJsonFile - ext.newVersion = versionToPublishJs - - doLast { - updatePackageJsonVersion(packageJsonPath as String, newVersion as String) - } -} - -void updatePackageJsonVersion(final String packageJsonPath, final String newVersion) { - def final packageJsonObject = readJsonFile(packageJsonPath) - - packageJsonObject['version'] = newVersion - updatePackageJson(packageJsonObject, packageJsonPath) -} - -Object readJsonFile(final String sourcePath) { - def final packageJsonFile = file(sourcePath) - return new JsonSlurper().parseText(packageJsonFile.text) -} - -static void updatePackageJson(final jsonObject, final String destinationPath) { - def final updatedText = JsonOutput.toJson(jsonObject) - def final prettyText = prettify(updatedText) - new File(destinationPath).text = prettyText -} - -static String prettify(final String jsonText) { - def prettyText = JsonOutput.prettyPrint(jsonText) - prettyText = prettyText.replace(' ', ' ') - prettyText = prettyText.replaceAll(/\{\s+}/, '{}') - prettyText = prettyText + '\n' - return prettyText -} diff --git a/buildSrc/src/main/groovy/license-report-common.gradle b/buildSrc/src/main/groovy/license-report-common.gradle deleted file mode 100644 index f506cf24..00000000 --- a/buildSrc/src/main/groovy/license-report-common.gradle +++ /dev/null @@ -1,42 +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. - */ - -/** - * This script defines the common configuration for license report scripts. - */ - -println("`license-report-common.gradle` script is deprecated. " + - "Please use the `LicenseReporter` utility instead.") - -apply plugin: 'base' - -ext.licenseReportConfig = [ - // The output filename - outputFilename : "license-report.md", - - // The path to a directory, to which a per-project report is generated. - relativePath : "/reports/dependency-license/dependency" -] diff --git a/buildSrc/src/main/groovy/license-report-project.gradle b/buildSrc/src/main/groovy/license-report-project.gradle deleted file mode 100644 index d6cfb9f8..00000000 --- a/buildSrc/src/main/groovy/license-report-project.gradle +++ /dev/null @@ -1,211 +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:noinspection UnnecessaryQualifiedReference - -import com.github.jk1.license.* -import com.github.jk1.license.render.ReportRenderer -import io.spine.internal.gradle.publish.PublishExtension - -/** - * This script plugin generates the license report for all dependencies used in a project. - * - *

Transitive dependencies are included. - * - *

Use `generateLicenseReport` task to trigger the generation. - */ - -buildscript { - repositories { - gradlePluginPortal() - } - - dependencies { - classpath io.spine.internal.dependency.LicenseReport.lib - } -} - -println("`license-report-project.gradle` script is deprecated. " + - "Please use the `LicenseReporter` utility instead.") - - -apply plugin: io.spine.internal.dependency.LicenseReport.GradlePlugin.id - -final def commonPath = io.spine.internal.gradle.Scripts.commonPath -apply from: "${rootDir}/${commonPath}/license-report-common.gradle" - -final reportOutputDir = "${project.buildDir}" + licenseReportConfig.relativePath -licenseReport { - outputDir = "$reportOutputDir" - excludeGroups = ['io.spine', 'io.spine.tools', 'io.spine.gcloud'] - configurations = ALL - renderers = [new MarkdownReportRenderer(licenseReportConfig.outputFilename)] -} - -/** - * Renders the dependency report in markdown. - */ -class MarkdownReportRenderer implements ReportRenderer { - - private Project project - private LicenseReportExtension config - private File output - private String fileName - - MarkdownReportRenderer(final String fileName) { - this.fileName = fileName - } - - @Input - String getFileNameCache() { return this.fileName } - - void render(final ProjectData data) { - project = data.project - config = project.licenseReport - output = new File(config.outputDir, fileName) - final String prefix = prefixFor(project) - output.text = """ - \n# Dependencies of `${project.group}:$prefix${project.name}:${project.version}` -""" - printDependencies(data) - output << """ - - \n The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -""" - output << "\n\nThis report was generated on **${new Date()}**" - output << " 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)." - } - - /** - * Obtains the artifact prefix for the passed project. - * - *

If the {@code PublishExtension} has the property {@code spinePrefix} set to {@code true} - * returns {@code "spine-"}, otherwise an empty string. - */ - private static String prefixFor(final Project project) { - final publishExtension = project.rootProject.extensions.findByType(PublishExtension.class) - final prefix = (publishExtension?.spinePrefix?.getOrElse(false) ?: false) - ? "spine-" - : "" - prefix - } - - private void printDependencies(final ProjectData data) { - - final runtimeDependencies = new HashSet() - final compileToolingDependencies = new HashSet() - - data.configurations.each { final ConfigurationData config -> - - - if(["runtime", "runtimeClasspath"].indexOf(config.name) != -1) { - runtimeDependencies.addAll(config.dependencies) - } else { - compileToolingDependencies.addAll(config.dependencies) - } - } - - output << "\n## Runtime" - runtimeDependencies.toArray().sort().each { - printModuleDependency(it) - } - - output << "\n## Compile, tests and tooling" - compileToolingDependencies.toArray().sort().each { - printModuleDependency(it) - } - } - - private void printModuleDependency(final ModuleData data) { - boolean projectUrlDone = false - output << "\n1." - - if (data.group) { - output << " **Group:** $data.group" - } - if (data.name) { - output << " **Name:** $data.name" - } - if (data.version) { - output << " **Version:** $data.version" - } - if (data.poms.isEmpty() && data.manifests.isEmpty()) { - output << " **No license information found**" - return - } - - if (!data.manifests.isEmpty() && !data.poms.isEmpty()) { - final ManifestData manifest = data.manifests.first() - final PomData pomData = data.poms.first() - if (manifest.url && pomData.projectUrl && manifest.url == pomData.projectUrl) { - output << "\n * **Project URL:** [$manifest.url]($manifest.url)" - projectUrlDone = true - } - } - - if (!data.manifests.isEmpty()) { - final ManifestData manifest = data.manifests.first() - if (manifest.url && !projectUrlDone) { - output << "\n * **Manifest Project URL:** [$manifest.url]($manifest.url)" - } - if (manifest.license) { - if (manifest.license.startsWith("http")) { - output << "\n * **Manifest license URL:** [$manifest.license]($manifest.license)" - - } else if (manifest.hasPackagedLicense) { - output << "\n * **Packaged License File:** [$manifest.license]($manifest.url)" - } else { - output << "\n * **Manifest License:** $manifest.license (Not packaged)" - - } - } - } - - if (!data.poms.isEmpty()) { - final PomData pomData = data.poms.first() - if (pomData.projectUrl && !projectUrlDone) { - output << "\n * **POM Project URL:** [$pomData.projectUrl]($pomData.projectUrl)" - - } - if (pomData.licenses) { - pomData.licenses.each { final License license -> - output << "\n * **POM License: $license.name**" - - if (license.url) { - if (license.url.startsWith("http")) { - output << " - [$license.url]($license.url)" - } else { - output << " **License:** $license.url" - - } - } - } - } - } - output << '\n' - } -} diff --git a/buildSrc/src/main/groovy/license-report-repo.gradle b/buildSrc/src/main/groovy/license-report-repo.gradle deleted file mode 100644 index c8212a85..00000000 --- a/buildSrc/src/main/groovy/license-report-repo.gradle +++ /dev/null @@ -1,75 +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. - */ - -/** - * This script launches the per-project license report generation, concatenates the results - * and puts the resulting file into a repository root folder. - * - * If the repository consists just of a single root project, the generation is configured - * just for it alone. - * - * The script also configures the `build` task to be finalized by the license report routines. - * - * See `license-report-project.gradle` for a per-project license report generation. - */ - -println("`license-report-repo.gradle` script is deprecated. " + - "Please use the `LicenseReporter` utility instead.") - - -final def commonPath = io.spine.internal.gradle.Scripts.commonPath -apply from: "${rootDir}/${commonPath}/license-report-common.gradle" - -task reportLicensesInRepo { final Task task -> - def targetProjects; - if (subprojects.isEmpty()) { - println "Configuring the license report for a single root project." - targetProjects = [task.project] - } else { - println "Configuring the license report for all subprojects of a root project." - targetProjects = subprojects - } - - targetProjects.forEach { - final def generateLicenseReport = it.tasks.findByName('generateLicenseReport') - task.dependsOn(generateLicenseReport) - generateLicenseReport.dependsOn(it.tasks.findByName('assemble')) - } - - doLast { - final paths = targetProjects.stream().collect { - "${it.buildDir}${licenseReportConfig.relativePath}/${licenseReportConfig.outputFilename}" - } - - println "Aggregating the reports from the target projects." - final aggregatedContent = paths.collect { (new File(it)).getText() }.join("\n\n\n") - - (new File("$rootDir/$licenseReportConfig.outputFilename")).text = aggregatedContent - } -} - -build.finalizedBy reportLicensesInRepo -reportLicensesInRepo.dependsOn assemble diff --git a/buildSrc/src/main/groovy/publish-proto.gradle b/buildSrc/src/main/groovy/publish-proto.gradle deleted file mode 100644 index 113743cb..00000000 --- a/buildSrc/src/main/groovy/publish-proto.gradle +++ /dev/null @@ -1,231 +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. - */ - -/** - * This plugin enables a project to publish a JAR containing all the {@code .proto} definitions - * found in the project classpath, which is the definitions from {@code sourceSets.main.proto} and - * the proto files extracted from the JAR dependencies of the project. - * - *

The relative file paths are kept. - * - *

To depend onto such artifact of e.g. the spine-client module, use: - *

- *     {@code
- *     dependencies {
- *         compile "io.spine:spine-client:$version@proto"
- *     }
- *     }
- * 
- * - *

To enable the artifact publishing for a project, apply this plugin to it: - *

- *     {@code
- *     apply from: "$rootDir/config/gradle/publish-proto.gradle"
- *     }
- * 
- */ - -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - //noinspection UnnecessaryQualifiedReference - classpath io.spine.internal.dependency.Guava.lib - } -} - -task assembleProto(type: Jar) { - description "Assembles a JAR artifact with all Proto definitions from the classpath." - from { collectProto() } - include { isProtoFileOrDir(it.file) } - classifier 'proto' -} - -artifacts { - archives assembleProto -} - -/** - * Collects all the directories from current project and its dependencies (including zip tree - * directories) which contain {@code .proto} definitions. - * - *

The directories may in practice include files of other extension. The caller should take care - * of handling those files respectively. - * - *

It's guaranteed that there are no other Proto definitions in the current project classpath - * except those included into the returned {@code Collection}. - */ -Collection collectProto() { - final def dependencies = configurations.runtimeClasspath.files - final def jarFiles = dependencies.collect { JarFileName.ofFile(it) } - final def result = new HashSet<>() - for (final File jarFile in dependencies) { - if (jarFile.name.endsWith(".jar")) { - final def zipTree = zipTree(jarFile) - try { - for (final File file in zipTree) { - if (isProtoFile(file)) { - result.add(getProtoRoot(file, jarFiles)) - } - } - } catch (GradleException e) { - /* - * As the :assembleProto task configuration is resolved first upon the project - * configuration (and we don't have the dependencies there yet) and then upon - * the execution, the task should complete successfully. - * - * To make sure the configuration phase passes, we suppress the GradleException - * thrown by `zipTree()` indicating that the given file, which is a dependency JAR - * file does not exist. - * - * Though, if this error is thrown on the execution phase, this IS an error. Thus, - * we log an error message. - * - * As a side effect, the message is shown upon `./gradlew clean build` or upon - * a newly created version of framework build etc. - */ - logger.debug( - "${e.message}${System.lineSeparator()}The proto artifact may be corrupted." - ) - } - } - } - result.addAll(sourceSets.main.proto.srcDirs) - return result -} - -/** - * Returns the root directory containing a Proto package. - * - * @param member the member File of the Proto package - * @param jarNames the full listing of the project JAR dependencies - */ -static File getProtoRoot(final File member, final Collection jarNames) { - File pkg = member - while (!jarNames.contains(jarName(pkg.parentFile))) { - pkg = pkg.parentFile - } - return pkg.parentFile -} - -/** - * Retrieves the name of the given folder trimmed by {@code ".jar"} suffix. - * - *

More formally, returns the name of the given {@link File} if the name does not contain - * {@code ".jar"} substring or the substring of the name containing the characters from the start - * to the {@code ".jar"} sequence (inclusively). - * - *

This transformation corresponds to finding the name of a JAR file which was extracted to - * the given directory with Gradle {@code zipTree()} API. - * - * @param jar the folder to get the JAR name for - */ -static JarFileName jarName(final File jar) { - final String unpackedJarInfix = ".jar" - final String name = jar.name - final int index = name.lastIndexOf(unpackedJarInfix) - if (index < 0) { - return null - } else { - return JarFileName.ofValue(name.substring(0, index + unpackedJarInfix.length())) - } -} - -/** - * Checks if the given abstract pathname represents either a {@code .proto} file, or a directory - * containing proto files. - * - *

If {@code candidate} is a directory, scans its children recursively. - * - * @param candidate the {@link File} to check - * @return {@code true} if the {@code candidate} {@linkplain #isProtoFile is a Protobuf file} or - * a directory containing at least one Protobuf file - */ -static boolean isProtoFileOrDir(final File candidate) { - final Deque filesToCheck = new LinkedList<>() - filesToCheck.push(candidate) - if (candidate.isDirectory() && candidate.list().length == 0) { - return false - } - while (!filesToCheck.isEmpty()) { - final File file = filesToCheck.pop() - if (isProtoFile(file)) { - return true - } - if (file.isDirectory()) { - file.listFiles().each { filesToCheck.push(it) } - } - } - return false -} - -/** - * Checks if the given file is a {@code .proto} file. - * - * @param file the file to check - * @return {@code true} if the {@code file} is a Protobuf file, {@code false} otherwise - */ -static boolean isProtoFile(final File file) { - return file.isFile() && file.name.endsWith(".proto") -} - -/** - * The filename of a JAR dependency of the project. - */ -final class JarFileName { - - final String value - - private JarFileName(final String value) { - this.value = value - } - - static JarFileName ofFile(final File jar) { - return new JarFileName(jar.name) - } - - static JarFileName ofValue(final String value) { - return new JarFileName(value) - } - - boolean equals(final o) { - if (this.is(o)) return true - if (getClass() != o.class) return false - - final JarFileName that = (JarFileName) o - - if (value != that.value) return false - - return true - } - - int hashCode() { - return (value != null ? value.hashCode() : 0) - } -} diff --git a/buildSrc/src/main/groovy/publish.gradle b/buildSrc/src/main/groovy/publish.gradle deleted file mode 100644 index db93ce2d..00000000 --- a/buildSrc/src/main/groovy/publish.gradle +++ /dev/null @@ -1,132 +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. - */ - -/* - Apply this script to add ability to publish the needed artifacts. - - To publish more artifacts for a certain project, add them to the archives configuration: - ``` - artifacts { - archives myCustomJarTask - } - ``` - */ - -println("`publish.gradle` script is deprecated. Please use the `Publish` plugin instead.") - -task publish { - doLast { - // Keep the task for dynamic generation while publishing. - } -} - -void dependPublish(final project) { - final credentialsTasks = getTasksByName("readPublishingCredentials", false) - project.getTasksByName("publish", false).each { final task -> - task.dependsOn credentialsTasks - } - publish.dependsOn project.getTasksByName("publish", false) -} - -projectsToPublish.each { - project(":$it") { final currentProject -> - apply plugin: 'maven-publish' - - logger.debug("Applying `maven-publish` plugin to ${currentProject.name}.") - - currentProject.artifacts { - archives sourceJar - archives testOutputJar - archives javadocJar - } - - final propertyName = "spinePrefix" - final ext = rootProject.ext - final boolean spinePrefix = ext.has(propertyName) ? ext.get(propertyName) : true - - // Artifact IDs are composed as "spine-". Example: - // - // "spine-mc-java" - // - // That helps to distinguish resulting JARs in the final assembly, such as WAR package. - // - final String artifactIdForPublishing = - spinePrefix ? - "spine-${currentProject.name}" : - currentProject.name - - final def publishingAction = { - currentProject.publishing { - publications { - mavenJava(MavenPublication) { - groupId = "${currentProject.group}" - artifactId = "${artifactIdForPublishing}" - version = "${currentProject.version}" - - from components.java - - artifacts = configurations.archives.allArtifacts - } - } - } - } - if (currentProject.state.executed) { - publishingAction() - } else { - currentProject.afterEvaluate(publishingAction) - } - - final boolean isSnapshots = currentProject.version.matches('.+[-\\.]SNAPSHOT([\\+\\.]\\d+)?') - - publishing { - repositories { - maven { - final String publicRepo = (isSnapshots - ? publishToRepository.snapshots - : publishToRepository.releases - ) - - // Special treatment for CloudRepo URL. - // Reading is performed via public repositories, and publishing via private - // ones that differ in the `/public` infix. - final urlToPublish = publicRepo.replace("/public", "") - - // Assign URL to the plugin property. - url = urlToPublish - - final creds = rootProject.publishToRepository.credentials(project) - - credentials { - username = creds.username - password = creds.password - } - } - } - } - - dependPublish(project) - } -} diff --git a/buildSrc/src/main/groovy/run-build.gradle b/buildSrc/src/main/groovy/run-build.gradle deleted file mode 100644 index fd245957..00000000 --- a/buildSrc/src/main/groovy/run-build.gradle +++ /dev/null @@ -1,84 +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. - */ - -/** - * Apply this script if it is needed to execute {@code ./gradlew clean build} task - * from another project. - */ - -configure(project.rootProject) { - - ext { - - /** - * Executes {@code ./gradlew clean build} command, if there is a {@code 'clean'} task. - * Otherwise, executes {@code ./gradlew build}. - * - * @param directory the project root directory in which to execute the build - */ - runBuild = { final String directory -> - final boolean shouldClean = gradle.getTaskGraph().hasTask(':clean') - final def command = [] - final def runsOnWindows = org.gradle.internal.os.OperatingSystem.current().isWindows() - final def script = runsOnWindows ? "gradlew.bat" : "gradlew" - command.add("$rootDir/$script".toString()) - if (shouldClean) { - command.add('clean') - } - command.add('build') - command.add('--console=plain') - command.add('--debug') - command.add('--stacktrace') - - // Ensure build error output log. - // Since we're executing this task in another process, we redirect error output to - // the file under the `build` directory. - final File buildDir = new File(directory, "build") - if (!buildDir.exists()) { - buildDir.mkdir() - } - final File errorOut = new File(buildDir, 'error-out.txt') - final File debugOut = new File(buildDir, 'debug-out.txt') - - final def process = new ProcessBuilder() - .command(command) - .directory(file(directory)) - .redirectError(errorOut) - .redirectOutput(debugOut) - .start() - if (!process.waitFor(10, TimeUnit.MINUTES)) { - /* The timeout is set because of Gradle process execution under Windows. - See the following locations for details: - https://github.com/gradle/gradle/pull/8467#issuecomment-498374289 - https://github.com/gradle/gradle/issues/3987 - https://discuss.gradle.org/t/weirdness-in-gradle-exec-on-windows/13660/6 - */ - throw new GradleException("Build FAILED. See $errorOut for details.") - } - } - } -} - diff --git a/buildSrc/src/main/groovy/slow-tests.gradle b/buildSrc/src/main/groovy/slow-tests.gradle deleted file mode 100644 index 5b9797a7..00000000 --- a/buildSrc/src/main/groovy/slow-tests.gradle +++ /dev/null @@ -1,49 +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. - */ - -println("`slow-tests.gradle` script is deprecated. " + - "Please use `TaskContainer.registerTestTasks()` instead.") - -final def slowTag = 'slow' // See io.spine.testing.SlowTest - -task fastTest(type: Test) { - description = 'Executes all JUnit tests but the ones tagged as "slow".' - group = 'Verification' - - useJUnitPlatform { - excludeTags slowTag - } -} - -task slowTest(type: Test) { - description = 'Executes JUnit tests tagged as "slow".' - group = 'Verification' - - useJUnitPlatform { - includeTags slowTag - } - shouldRunAfter fastTest -} diff --git a/buildSrc/src/main/groovy/test-artifacts.gradle b/buildSrc/src/main/groovy/test-artifacts.gradle deleted file mode 100644 index 06a5e055..00000000 --- a/buildSrc/src/main/groovy/test-artifacts.gradle +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Apply this script if it is needed to use test classes of the current project in other projects. -// The dependency looks like this: -// -// testCompile project(path: ":projectWithTests", configuration: 'testArtifacts') -// - -println("`test-artifacts.gradle` script is deprecated. " + - "Please use the `Project.exposeTestArtifacts()` utility instead.") - -configurations { - testArtifacts.extendsFrom testRuntime -} -task testJar(type: Jar) { - classifier "test" - from sourceSets.test.output -} -artifacts { - testArtifacts testJar -} diff --git a/buildSrc/src/main/groovy/test-output.gradle b/buildSrc/src/main/groovy/test-output.gradle deleted file mode 100644 index 4dc27512..00000000 --- a/buildSrc/src/main/groovy/test-output.gradle +++ /dev/null @@ -1,62 +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. - */ - -/* - * This plugin configured the test output as follows: - * - * - the standard streams of the tests execution are logged; - * - exceptions thrown in tests are logged; - * - after all the tests are executed, a short test summary is logged; the summary shown the number - * of tests and their results. - */ - -println("`test-output.gradle` script is deprecated. Please use `Test.configureLogging()` instead.") - -tasks.withType(Test).each { - it.testLogging { - showStandardStreams = true - showExceptions = true - showStackTraces = true - showCauses = true - exceptionFormat = 'full' - } - - it.afterSuite { final testDescriptor, final result -> - // If the descriptor has no parent, then it is the root test suite, i.e. it includes the - // info about all the run tests. - if (!testDescriptor.parent) { - logger.lifecycle( - """ - Test summary: - >> ${result.testCount} tests - >> ${result.successfulTestCount} succeeded - >> ${result.failedTestCount} failed - >> ${result.skippedTestCount} skipped - """ - ) - } - } -} diff --git a/buildSrc/src/main/resources/pmd.xml b/buildSrc/src/main/resources/pmd.xml deleted file mode 100644 index 734aeacc..00000000 --- a/buildSrc/src/main/resources/pmd.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - A set of PMD rules applied to Spine Event Engine projects. - - - - .*/generated/.* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 911df41f3fc70e0155462d71e64a5bbbe7eaef93 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 23:03:06 +0300 Subject: [PATCH 16/98] Bump dependencies --- .../spine/internal/dependency/ErrorProne.kt | 2 +- .../io/spine/internal/dependency/Grpc.kt | 2 +- .../io/spine/internal/dependency/Kotlin.kt | 2 +- .../io/spine/internal/dependency/Protobuf.kt | 2 +- license-report.md | 198 +++++++++--------- pom.xml | 8 +- 6 files changed, 107 insertions(+), 107 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt index ab326153..e62b4b41 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("unused") object ErrorProne { // https://github.com/google/error-prone - private const val version = "2.11.0" + private const val version = "2.13.1" // https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts private const val javacPluginVersion = "9+181-r4173-1" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt index 22996e4d..c9d55667 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Grpc.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("unused") object Grpc { @Suppress("MemberVisibilityCanBePrivate") - const val version = "1.45.0" + const val version = "1.45.1" const val api = "io.grpc:grpc-api:${version}" const val auth = "io.grpc:grpc-auth:${version}" const val core = "io.grpc:grpc-core:${version}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt index 5fc4cace..67664068 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency // https://github.com/Kotlin object Kotlin { @Suppress("MemberVisibilityCanBePrivate") // used directly from outside - const val version = "1.6.10" + const val version = "1.6.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}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt index 1da0906a..5987a368 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("MemberVisibilityCanBePrivate") // used directly from outside object Protobuf { private const val group = "com.google.protobuf" - const val version = "3.19.4" + const val version = "3.20.0" val libs = listOf( "${group}:protobuf-java:${version}", "${group}:protobuf-java-util:${version}", diff --git a/license-report.md b/license-report.md index 67d48950..c9f8a078 100644 --- a/license-report.md +++ b/license-report.md @@ -11,7 +11,7 @@ * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -45,16 +45,16 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) @@ -90,23 +90,23 @@ * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -115,7 +115,7 @@ * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -143,19 +143,19 @@ * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -192,20 +192,20 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. * **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) * **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. @@ -313,7 +313,7 @@ * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -361,7 +361,7 @@ * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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) @@ -385,19 +385,19 @@ * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -483,7 +483,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -520,16 +520,16 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.3. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -588,23 +588,23 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -635,7 +635,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -663,19 +663,19 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -712,20 +712,20 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. * **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) * **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. @@ -833,7 +833,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -881,7 +881,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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) @@ -905,19 +905,19 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -983,7 +983,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -999,7 +999,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1025,16 +1025,16 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) @@ -1062,23 +1062,23 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1087,7 +1087,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -1115,19 +1115,19 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1156,20 +1156,20 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. * **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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. * **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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. * **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) * **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. @@ -1269,7 +1269,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -1317,7 +1317,7 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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) @@ -1341,19 +1341,19 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic * **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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1419,4 +1419,4 @@ This report was generated on **Sat Apr 16 22:31:26 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 22:31:27 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 42fd38df..16d06474 100644 --- a/pom.xml +++ b/pom.xml @@ -128,24 +128,24 @@ all modules and does not describe the project structure per-subproject. com.google.errorprone error_prone_annotations - 2.11.0 + 2.13.1 provided com.google.errorprone error_prone_core - 2.11.0 + 2.13.1 com.google.errorprone error_prone_type_annotations - 2.11.0 + 2.13.1 provided com.google.protobuf protoc - 3.19.4 + 3.20.0 com.puppycrawl.tools From 5dee374f85d4ef8c24cf7423ddfeed63b0b641e1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 16 Apr 2022 23:50:27 +0300 Subject: [PATCH 17/98] Expose Maven artifact properties --- .../spine/tools/code/version/MavenArtifact.kt | 35 +++++++++++++++- .../tools/code/version/MavenArtifactTest.kt | 40 ++++++++++++++++++- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt index b8d23b9e..53342a90 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt @@ -31,6 +31,39 @@ package io.spine.tools.code.version */ public data class MavenArtifact(val coordinates: String) : Dependency { + /** + * The group to which the artifact belongs. + */ + public val group: String + + /** + * The ID of the artifact within the group. + */ + public val name: String + + /** + * The version of the artifact. + */ + public val version: String + + init { + val parts = coordinates.split(":") + require(parts.size == 3) { + "Maven coordinates must have 3 parts. Encountered: `$coordinates`." + } + + fun requireNonEmpty(value: String, propName: String): String { + require(value.isNotEmpty()) { + "The `${propName}` part of Maven coordinates must not be empty." + } + return value + } + + group = requireNonEmpty(parts[0], "group") + name = requireNonEmpty(parts[1], "name") + version = requireNonEmpty(parts[2], "version") + } + public companion object { /** @@ -54,7 +87,7 @@ public data class MavenArtifact(val coordinates: String) : Dependency { /** * Obtains the string representation in the format: - * `maven:::`. + * `maven:::`. */ override fun toString(): String = "$PREFIX$coordinates" } diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt index 0b6c56ab..b71c6064 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt @@ -35,8 +35,9 @@ class `'MavenArtifact' should` { @Test fun `parse string form`() { - val artifact = MavenArtifact.parse("maven:io.spine:spine-foo-bar:2.0.0-SNAPSHOT.91") - assertThat(artifact.coordinates).isEqualTo("io.spine:spine-foo-bar:2.0.0-SNAPSHOT.91") + val coordinates = "io.spine:spine-foo-bar:2.0.0-SNAPSHOT.91" + val artifact = MavenArtifact.parse("maven:$coordinates") + assertThat(artifact.coordinates).isEqualTo(coordinates) } @Test @@ -47,4 +48,39 @@ class `'MavenArtifact' should` { val parsed = MavenArtifact.parse(PREFIX + coordinates) assertThat(parsed.coordinates).isEqualTo(coordinates) } + + @Test + fun `require 3 parts in Maven coordinates`() { + assertThrows { + MavenArtifact("fiz") + } + assertThrows { + MavenArtifact("fiz:baz") + } + + assertThrows { + MavenArtifact(":baz:bar") + } + + assertThrows { + MavenArtifact("fiz::bar") + } + + assertThrows { + MavenArtifact("fiz:baz:") + } + } + + @Test + fun `expose properties of coordinates`() { + val group = "io.spine" + val name = "tool-base" + val version = "2.0.0" + + val ma = MavenArtifact("$group:$name:$version") + + assertThat(ma.group).isEqualTo(group) + assertThat(ma.name).isEqualTo(name) + assertThat(ma.version).isEqualTo(version) + } } From ceb7a933004d29bc5e41b63cd6d9f46aaeeb35e7 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 17 Apr 2022 12:01:19 +0300 Subject: [PATCH 18/98] Update config --- .idea/misc.xml | 2 +- buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt | 2 +- config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 049d1eb2..53408739 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -44,4 +44,4 @@ - + \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt index 167c5af3..3a3b2bd7 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt @@ -32,7 +32,7 @@ object Dokka { private const val group = "org.jetbrains.dokka" /** - When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. + * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. */ const val version = "1.6.10" diff --git a/config b/config index 760a3472..58dce515 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 760a3472bb04d3e60beeb0df4c7d63bdadc7de8c +Subproject commit 58dce51596c488ce02beefa31c6ff7b8b2b3d59f From 43db72210bfd03b6c7567fd178e7005930103637 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 17 Apr 2022 12:04:27 +0300 Subject: [PATCH 19/98] Improve diag. message --- .../main/kotlin/io/spine/tools/code/version/MavenArtifact.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt index 53342a90..5299ba2d 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt @@ -54,7 +54,8 @@ public data class MavenArtifact(val coordinates: String) : Dependency { fun requireNonEmpty(value: String, propName: String): String { require(value.isNotEmpty()) { - "The `${propName}` part of Maven coordinates must not be empty." + "The `${propName}` part of Maven coordinates must not be empty." + + " Encountered: `$coordinates`." } return value } From c62e023a7f779c9550cfe7329f31f41323cc4c97 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Apr 2022 12:50:43 +0300 Subject: [PATCH 20/98] Test string form --- .../spine/tools/code/version/MavenArtifactTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt index b71c6064..5eac09d9 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt @@ -27,6 +27,7 @@ package io.spine.tools.code.version import com.google.common.truth.Truth.assertThat +import io.spine.testing.TestValues.randomString import io.spine.tools.code.version.MavenArtifact.Companion.PREFIX import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows @@ -83,4 +84,16 @@ class `'MavenArtifact' should` { assertThat(ma.name).isEqualTo(name) assertThat(ma.version).isEqualTo(version) } + + @Test + fun `have string form with protocol prefix`() { + val group = randomString() + val name = randomString() + val version = randomString() + + val coordinates = "$group:$name:$version" + val ma = MavenArtifact(coordinates) + + assertThat(ma.toString()).isEqualTo("$PREFIX$coordinates") + } } From b243e54422cfe1837f20e9b5de81ef564d76add9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Apr 2022 15:49:43 +0300 Subject: [PATCH 21/98] Add parsing of dependencies --- .../{version => manifest}/Dependencies.kt | 33 ++++++++++++++++--- .../code/{version => manifest}/Dependency.kt | 2 +- .../code/{version => manifest}/KManifest.kt | 2 +- .../{version => manifest}/KManifestWriter.kt | 2 +- .../{version => manifest}/MavenArtifact.kt | 2 +- .../{version => manifest}/KManifestTest.kt | 2 +- .../MavenArtifactTest.kt | 4 +-- 7 files changed, 36 insertions(+), 11 deletions(-) rename tool-base/src/main/kotlin/io/spine/tools/code/{version => manifest}/Dependencies.kt (61%) rename tool-base/src/main/kotlin/io/spine/tools/code/{version => manifest}/Dependency.kt (97%) rename tool-base/src/main/kotlin/io/spine/tools/code/{version => manifest}/KManifest.kt (98%) rename tool-base/src/main/kotlin/io/spine/tools/code/{version => manifest}/KManifestWriter.kt (98%) rename tool-base/src/main/kotlin/io/spine/tools/code/{version => manifest}/MavenArtifact.kt (98%) rename tool-base/src/test/kotlin/io/spine/tools/code/{version => manifest}/KManifestTest.kt (98%) rename tool-base/src/test/kotlin/io/spine/tools/code/{version => manifest}/MavenArtifactTest.kt (96%) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt similarity index 61% rename from tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt rename to tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index 27fb0f42..437519ae 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -24,19 +24,44 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest import com.google.common.annotations.VisibleForTesting +/** + * Dependencies of a software component. + */ public class Dependencies(public val list: List){ public companion object { + /** + * Parses comma-separated list of dependencies. + */ @VisibleForTesting - internal fun parse(deps: String): Dependencies { - val list: List = listOf() - //TODO:2022-02-23:alexander.yevsyukov: Implement + internal fun parse(value: String): Dependencies { + val list: MutableList = mutableListOf() + val deps = value.split(",") + deps.forEach { + val dep = parseDependency(it) + list.add(dep) + } return Dependencies(list) } } } + +/** + * Parses a dependency from the given string representation. + * + * Only [MavenArtifact] is currently supported. + * + * @throws IllegalStateException if the given string does not start with [MavenArtifact.PREFIX]. + */ +private fun parseDependency(value: String): Dependency { + if (value.startsWith(MavenArtifact.PREFIX)) { + val result = MavenArtifact.parse(value) + return result + } + throw IllegalStateException("Unsupported dependency format: `$value`.") +} diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt similarity index 97% rename from tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt rename to tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt index a4be20bc..c6abe023 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/Dependency.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest /** * A dependency of a software component on another software component. diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt similarity index 98% rename from tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt rename to tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index b47785ca..854c90c2 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest import com.google.common.annotations.VisibleForTesting import java.io.InputStream diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt similarity index 98% rename from tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt rename to tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt index e82271c9..f4ac6c2a 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/KManifestWriter.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest import java.io.OutputStream import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt similarity index 98% rename from tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt rename to tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt index 5299ba2d..95b7a032 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/version/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest /** * A dependency on a software artifact. diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt similarity index 98% rename from tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt rename to tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index 8a03dde5..bb0f2a0d 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest import com.google.common.truth.Truth.assertThat import io.spine.testing.TestValues.randomString diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/MavenArtifactTest.kt similarity index 96% rename from tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt rename to tool-base/src/test/kotlin/io/spine/tools/code/manifest/MavenArtifactTest.kt index 5eac09d9..5004cf27 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/version/MavenArtifactTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/MavenArtifactTest.kt @@ -24,11 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.code.version +package io.spine.tools.code.manifest import com.google.common.truth.Truth.assertThat import io.spine.testing.TestValues.randomString -import io.spine.tools.code.version.MavenArtifact.Companion.PREFIX +import io.spine.tools.code.manifest.MavenArtifact.Companion.PREFIX import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows From 9af46412cf93d4450fcff240d2bb9317b38994ce Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Apr 2022 18:48:20 +0300 Subject: [PATCH 22/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index c9f8a078..334f1864 100644 --- a/license-report.md +++ b/license-report.md @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -983,7 +983,7 @@ This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1419,4 +1419,4 @@ This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 16 23:01:25 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Mon Apr 18 15:48:33 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From dfcbd2211a5b21c0afc53eb74b9d4e78d0240170 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 18 Apr 2022 23:05:50 +0300 Subject: [PATCH 23/98] Allow writing into existing manifest --- .../kotlin/io/spine/tools/code/manifest/KManifest.kt | 5 +++-- .../io/spine/tools/code/manifest/KManifestWriter.kt | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 854c90c2..384c3be7 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -46,7 +46,8 @@ public open class KManifest(protected val impl: Manifest) { /** * The name of the custom manifest attribute containing a list of dependencies. */ - public const val DEPENDS_ON_ATTR: String = "Depends-On" + @JvmField + public val DEPENDS_ON_ATTR: Name = Name("Depends-On") /** * Loads the manifest from the program resources. @@ -90,7 +91,7 @@ public open class KManifest(protected val impl: Manifest) { */ public val dependencies: Dependencies get() { - val dependsOnAttr = mainAttributes[Name(DEPENDS_ON_ATTR)] + val dependsOnAttr = mainAttributes[DEPENDS_ON_ATTR] val depsValue = dependsOnAttr.toString() val deps = Dependencies.parse(depsValue) return deps diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt index f4ac6c2a..cf6071dd 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt @@ -34,12 +34,19 @@ import java.util.jar.Manifest /** * Allows to configure and write a manifest file. */ -public class KManifestWriter: KManifest(Manifest()) { +public class KManifestWriter(impl: Manifest) : KManifest(impl) { + + /** + * Creates a new instance of the writer with an empty manifest. + */ + public constructor() : this(Manifest()) init { // The `Manifest-Version` version attribute must be initialized. // Otherwise, `java.util.jar.Attributes.writeMain()` skips writing its content. - mainAttributes[MANIFEST_VERSION] = "1.0" + if (mainAttributes[MANIFEST_VERSION] == null) { + mainAttributes[MANIFEST_VERSION] = "1.0" + } } /** From 10e0a66fa138909f993fd3a0e17461a7a148a4c1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 19 Apr 2022 21:53:16 +0300 Subject: [PATCH 24/98] Add Ivy dependency impl. --- .../tools/code/manifest/IvyDependency.kt | 69 +++++++++++++++++++ .../tools/code/manifest/IvyDependencyTest.kt | 64 +++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/manifest/IvyDependency.kt create mode 100644 tool-base/src/test/kotlin/io/spine/tools/code/manifest/IvyDependencyTest.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/IvyDependency.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/IvyDependency.kt new file mode 100644 index 00000000..513e48be --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/IvyDependency.kt @@ -0,0 +1,69 @@ +/* + * 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.tools.code.manifest + +import com.google.common.annotations.VisibleForTesting + +/** + * A test-only implementation of the [Dependency] interface that complements + * the production [MavenArtifact] class which implements the same interface. + * + * The purpose of this class is to provide quasi-production class with a dependency string format + * that contains spaces and quotes. This allows to have meaningful tests for + * the [Dependencies] class handing escaping of unusual characters. + * + * This class belongs to the production code because the [Dependencies] class handles + * the `ivy:` format, delegating parsing to this class. + * + * @see Dependencies.parse + */ +@VisibleForTesting +internal data class IvyDependency(val org: String, val name: String, val rev: String): Dependency { + + companion object { + + /** + * The prefix of the dependency definition. + */ + const val PREFIX: String = "ivy:" + + private val pattern = " org=\"(.+)\" name=\"(.+)\" rev=\"(.+)\"".toRegex() + + fun parse(value: String): IvyDependency { + require(value.startsWith(PREFIX)) + val def = value.substring(PREFIX.length) + val match = pattern.find(def) + check(match != null) { "Unrecognized Ivy dependency format: `$def`." } + val org = match.groupValues[1] + val name = match.groupValues[2] + val rev = match.groupValues[3] + return IvyDependency(org, name, rev) + } + } + + override fun toString(): String = "$PREFIX org=\"$org\" name=\"$name\" rev=\"$rev\"" +} diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/IvyDependencyTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/IvyDependencyTest.kt new file mode 100644 index 00000000..9d51f3ee --- /dev/null +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/IvyDependencyTest.kt @@ -0,0 +1,64 @@ +/* + * 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.tools.code.manifest + +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test + +import com.google.common.truth.Truth.assertThat +import io.spine.testing.TestValues.randomString + +internal class IvyDependencyTest { + + private lateinit var org: String + private lateinit var name: String + private lateinit var rev: String + + private lateinit var strForm: String + + @BeforeEach + fun generateParts() { + org = randomString() + name = randomString() + rev = randomString() + strForm = "${IvyDependency.PREFIX} org=\"$org\" name=\"$name\" rev=\"$rev\"" + } + + @Test + fun `provide string form with all components`() { + val idep = IvyDependency(org, name, rev) + + assertThat(idep.toString()).isEqualTo(strForm) + } + + @Test + fun `parse string representation`() { + val idep = IvyDependency.parse(strForm) + + assertThat(idep).isEqualTo(IvyDependency(org, name, rev)) + } +} From a2c6167e05e670ca7158cbafda8a3aa915353bfb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 19 Apr 2022 22:05:17 +0300 Subject: [PATCH 25/98] Extract constant --- .../kotlin/io/spine/tools/code/manifest/MavenArtifact.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt index 95b7a032..0e5d796f 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt @@ -47,7 +47,7 @@ public data class MavenArtifact(val coordinates: String) : Dependency { public val version: String init { - val parts = coordinates.split(":") + val parts = coordinates.split(SEPARATOR) require(parts.size == 3) { "Maven coordinates must have 3 parts. Encountered: `$coordinates`." } @@ -73,6 +73,11 @@ public data class MavenArtifact(val coordinates: String) : Dependency { */ public const val PREFIX: String = "maven:" + /** + * The separator between [group], [name], and [version] parts of Maven coordinates. + */ + public const val SEPARATOR: String = ":" + /** * Obtains the instance from the given string representation. * From b10ef9203896f0c28a873b505a1e66ad2e8370d5 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 19 Apr 2022 22:06:34 +0300 Subject: [PATCH 26/98] Document string form --- .../kotlin/io/spine/tools/code/manifest/Dependency.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt index c6abe023..ad38752f 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependency.kt @@ -29,4 +29,11 @@ package io.spine.tools.code.manifest /** * A dependency of a software component on another software component. */ -public interface Dependency +public interface Dependency { + + /** + * A string form of a dependency must be prefixed with name of the format, + * such as `"maven:"` or `"ivy:"`. + */ + public override fun toString(): String +} From 96f47184fd9506ccaa39ec1d1d1711df7b3ce0b8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:07:47 +0300 Subject: [PATCH 27/98] Add constructor with parts --- .../kotlin/io/spine/tools/code/manifest/MavenArtifact.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt index 0e5d796f..0dff3f9e 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt @@ -31,6 +31,12 @@ package io.spine.tools.code.manifest */ public data class MavenArtifact(val coordinates: String) : Dependency { + /** + * Creates an artifact with the given parts of the Maven coordinates. + */ + public constructor(group: String, name: String, version: String) : + this("$group$SEPARATOR$name$SEPARATOR$version") + /** * The group to which the artifact belongs. */ From 49d7236cbff1a75c747eb20019be55677aeba7a3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:10:45 +0300 Subject: [PATCH 28/98] Update config --- buildSrc/build.gradle.kts | 4 +- .../src/main/kotlin/dokka-for-java.gradle.kts | 6 ++ .../io/spine/internal/dependency/Kotlin.kt | 3 + .../internal/gradle/dokka/DokkaExtensions.kt | 50 ++++++++++++++++ config | 2 +- license-report.md | 60 +++++++++---------- pom.xml | 8 +-- 7 files changed, 96 insertions(+), 37 deletions(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 70ee40e8..6aacc165 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -63,7 +63,7 @@ val grGitVersion = "3.1.1" * Please check that this value matches one defined in * [io.spine.internal.dependency.Kotlin.version]. */ -val kotlinVersion = "1.6.10" +val kotlinVersion = "1.6.20" /** * The version of Guava used in `buildSrc`. @@ -101,7 +101,7 @@ val protobufPluginVersion = "0.8.18" * @see * Dokka Releases */ -val dokkaVersion = "1.6.10" +val dokkaVersion = "1.6.20" dependencies { implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index d82c3b4f..b70f6e88 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -25,6 +25,8 @@ */ 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 @@ -56,6 +58,10 @@ dependencies { tasks.withType().configureEach { dokkaSourceSets.configureEach { + sourceRoots.setFrom( + onlyJavaSources() + ) + skipEmptyPackages.set(true) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt index 67664068..0de6d842 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt @@ -29,6 +29,9 @@ package io.spine.internal.dependency // https://github.com/JetBrains/kotlin // https://github.com/Kotlin object Kotlin { + /** + * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. + */ @Suppress("MemberVisibilityCanBePrivate") // used directly from outside const val version = "1.6.20" const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${version}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt new file mode 100644 index 00000000..478dfccb --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt @@ -0,0 +1,50 @@ +/* + * 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.dokka + +import java.io.File +import java.time.LocalDate +import org.gradle.api.file.FileCollection +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder + +/** + * 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. + */ +internal fun GradleDokkaSourceSetBuilder.onlyJavaSources(): FileCollection { + return sourceRoots.filter(File::isJavaSourceDirectory) +} + +private fun File.isJavaSourceDirectory(): Boolean { + return isDirectory() && name == "java" +} diff --git a/config b/config index 58dce515..0b24dc36 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 58dce51596c488ce02beefa31c6ff7b8b2b3d59f +Subproject commit 0b24dc364701831ccafa9b32f9aeca43eba95b03 diff --git a/license-report.md b/license-report.md index 334f1864..80a506f9 100644 --- a/license-report.md +++ b/license-report.md @@ -345,19 +345,19 @@ * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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) @@ -365,23 +365,23 @@ * **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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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-jvm. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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) @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -865,19 +865,19 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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) @@ -885,23 +885,23 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic * **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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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-jvm. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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) @@ -983,7 +983,7 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1301,19 +1301,19 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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) @@ -1321,23 +1321,23 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic * **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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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-jvm. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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) @@ -1419,4 +1419,4 @@ This report was generated on **Mon Apr 18 15:48:32 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Apr 18 15:48:33 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Wed Apr 20 18:10:03 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 16d06474..d8d67a87 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-stdlib-jdk8 - 1.6.10 + 1.6.20 compile @@ -181,17 +181,17 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-compiler-embeddable - 1.6.10 + 1.6.20 org.jetbrains.kotlin kotlin-klib-commonizer-embeddable - 1.6.10 + 1.6.20 org.jetbrains.kotlin kotlin-scripting-compiler-embeddable - 1.6.10 + 1.6.20 From c7705ee17c7a6be7b2206dbde5d5cd887fa40027 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:10:53 +0300 Subject: [PATCH 29/98] Update config --- .../src/main/kotlin/io/spine/internal/dependency/Dokka.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt index 3a3b2bd7..b9f811d0 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt @@ -34,7 +34,7 @@ object Dokka { /** * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. */ - const val version = "1.6.10" + const val version = "1.6.20" object GradlePlugin { const val id = "org.jetbrains.dokka" @@ -70,7 +70,7 @@ object Dokka { object SpineExtensions { private const val group = "io.spine.tools" - const val version = "2.0.0-SNAPSHOT.2" + const val version = "2.0.0-SNAPSHOT.3" const val lib = "${group}:spine-dokka-extensions:${version}" } } From 263a4c1a60afd46fe568f38f32d80dedcde7c0b0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:16:37 +0300 Subject: [PATCH 30/98] Parse dependencies with escaped quotes --- .../spine/tools/code/manifest/Dependencies.kt | 82 +++++++++++++++- .../io/spine/tools/code/manifest/KManifest.kt | 5 +- .../code/manifest/`'Dependencies' should`.kt | 93 +++++++++++++++++++ 3 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 tool-base/src/test/kotlin/io/spine/tools/code/manifest/`'Dependencies' should`.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index 437519ae..b084c996 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -36,12 +36,24 @@ public class Dependencies(public val list: List){ public companion object { /** - * Parses comma-separated list of dependencies. + * The separator of dependencies in the string form. + * + * @see toString + * @see parse + */ + public const val SEPARATOR: String = "," + + /** + * Parses comma-separated list of dependencies, with each of them enclosed in + * double quotes ("). */ @VisibleForTesting internal fun parse(value: String): Dependencies { + if (value.isEmpty()) { + return Dependencies(listOf()) + } val list: MutableList = mutableListOf() - val deps = value.split(",") + val deps = splitDeps(value) deps.forEach { val dep = parseDependency(it) list.add(dep) @@ -49,19 +61,79 @@ public class Dependencies(public val list: List){ return Dependencies(list) } } + + /** + * Obtains a string form of the dependencies. + * + * Each dependency is enclosed in double quotes. If string form of a dependency has double + * quotes within, they are escaped with leading backslashes. Dependencies are separated + * with [commas][SEPARATOR]. + */ + override fun toString(): String { + val result = list.joinToString(SEPARATOR) { + val escaped = it.toString().escapeQuotes() + "\"${escaped}\"" + } + return result + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + other as Dependencies + if (list != other.list) return false + return true + } + + override fun hashCode(): Int { + return list.hashCode() + } } +private const val QUOTE: String = "\"" +private const val QUOTE_ESCAPED = "\\\"" +private fun String.escapeQuotes() = replace(QUOTE, QUOTE_ESCAPED) +private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) + /** - * Parses a dependency from the given string representation. + * The regular expression for a non-empty list of dependencies. + * An empty value is handled programmatically before this regexp comes into play. * - * Only [MavenArtifact] is currently supported. + * For the explanation of this regexp, please visit this + * [blog post](https://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes). + * The only difference with the one described in the post is that this regexp handles only + * double quotes. * - * @throws IllegalStateException if the given string does not start with [MavenArtifact.PREFIX]. + * @see Dependencies.toString + * @see Dependencies.parse + */ +private val depsRegex = "((? { + require(value.isNotEmpty()) + val parts = mutableListOf() + val matches = depsRegex.findAll(value) + matches.forEach { matchResult -> + val part = matchResult.groupValues[2] + parts.add(part.unescapeQuotes()) + } + return parts +} + +/** + * Parses a dependency from the given string representation. + * + * @throws IllegalStateException if the given string does not start with a prefix of supported + * dependency format. */ private fun parseDependency(value: String): Dependency { if (value.startsWith(MavenArtifact.PREFIX)) { val result = MavenArtifact.parse(value) return result } + if (value.startsWith(IvyDependency.PREFIX)) { + val result = IvyDependency.parse(value) + return result + } throw IllegalStateException("Unsupported dependency format: `$value`.") } diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 384c3be7..13ece934 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -44,7 +44,10 @@ public open class KManifest(protected val impl: Manifest) { private const val MANIFEST_MF = "META-INF/MANIFEST.MF" /** - * The name of the custom manifest attribute containing a list of dependencies. + * The name of the custom manifest attribute containing a list of dependencies + * of a software component. + * + * @see Dependencies.parse */ @JvmField public val DEPENDS_ON_ATTR: Name = Name("Depends-On") diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/`'Dependencies' should`.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/`'Dependencies' should`.kt new file mode 100644 index 00000000..90d41162 --- /dev/null +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/`'Dependencies' should`.kt @@ -0,0 +1,93 @@ +/* + * 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.tools.code.manifest + +import com.google.common.truth.Truth.assertThat +import io.spine.testing.TestValues.randomString +import org.junit.jupiter.api.Nested +import org.junit.jupiter.api.Test + +internal class `'Dependencies' should` { + + @Test + fun `escapes quotes in string form`() { + val org = "io.spine" + val name = "tool-base" + val rev = "2.0.0" + + val ivyDep = IvyDependency(org, name, rev) + val escaped = ivyDep.toString().replace("\"", "\\\"") + + val deps = Dependencies(listOf(ivyDep)) + val depsStr = deps.toString() + + assertThat(depsStr).isEqualTo("\"${escaped}\"") + } + + /** + * Imaginary case of something unusual in the version component, including comma and + * space characters to test parsing against spaces and commas inside coordinates. + */ + private fun unusualVersion(): String = randomString() + ", and then, some" + + @Nested + inner class Parse { + + @Test + fun `empty string`() { + assertThat(Dependencies.parse("").list).isEmpty() + } + + @Test + fun `one Maven dependency`() { + val group = randomString() + val name = randomString() + val version = unusualVersion() + val ma = MavenArtifact("$group:$name:$version") + val depStr = "\"$ma\"" + + val deps = Dependencies.parse(depStr) + + assertThat(deps.list).hasSize(1) + assertThat(deps.list[0]).isEqualTo(ma) + } + + @Test + fun `several dependencies`() { + val original = listOf( + MavenArtifact("io.spine.tools", "tool-base", "2.0.0"), + IvyDependency("org.gradle", "wrapper", "7.4.2"), + MavenArtifact("io.spine", "core-java", "2.0.1"), + ) + val str = Dependencies(original).toString() + + val parsed = Dependencies.parse(str).list + + assertThat(parsed).isEqualTo(original) + } + } +} From 4f5dacfd153cdad826f964f458d1f2229587d92e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:30:07 +0300 Subject: [PATCH 31/98] Improve names --- .../spine/tools/code/manifest/Dependencies.kt | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index b084c996..9e8f1bc9 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -96,10 +96,11 @@ private fun String.escapeQuotes() = replace(QUOTE, QUOTE_ESCAPED) private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) /** - * The regular expression for a non-empty list of dependencies. - * An empty value is handled programmatically before this regexp comes into play. + * The regular expression for dependency enclosed in double quotes which may also have such + * quotes escape. Does not accept empty strings, which are handled programmatically before this + * regexp comes into play. * - * For the explanation of this regexp, please visit this + * For a detailed explanation of this regexp, please visit this * [blog post](https://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes). * The only difference with the one described in the post is that this regexp handles only * double quotes. @@ -107,17 +108,17 @@ private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) * @see Dependencies.toString * @see Dependencies.parse */ -private val depsRegex = "((? { require(value.isNotEmpty()) - val parts = mutableListOf() - val matches = depsRegex.findAll(value) + val deps = mutableListOf() + val matches = quotedRegex.findAll(value) matches.forEach { matchResult -> - val part = matchResult.groupValues[2] - parts.add(part.unescapeQuotes()) + val dep = matchResult.groupValues[2] + deps.add(dep.unescapeQuotes()) } - return parts + return deps } /** @@ -128,12 +129,10 @@ private fun splitDeps(value: String): List { */ private fun parseDependency(value: String): Dependency { if (value.startsWith(MavenArtifact.PREFIX)) { - val result = MavenArtifact.parse(value) - return result + return MavenArtifact.parse(value) } if (value.startsWith(IvyDependency.PREFIX)) { - val result = IvyDependency.parse(value) - return result + return IvyDependency.parse(value) } throw IllegalStateException("Unsupported dependency format: `$value`.") } From 0648fc584500eaae5da9dec025b0c53c60c8fa61 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:52:29 +0300 Subject: [PATCH 32/98] Try splitting regexp to prevent detekt failure --- .../kotlin/io/spine/tools/code/manifest/Dependencies.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index 9e8f1bc9..55fc0b5f 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -108,7 +108,12 @@ private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) * @see Dependencies.toString * @see Dependencies.parse */ -private val quotedRegex = "((? { require(value.isNotEmpty()) From 1bbdf8d8ab76660b0c431438879c684e1ad8e6c5 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 18:59:35 +0300 Subject: [PATCH 33/98] Temporarily comment out suspected regexp --- .../kotlin/io/spine/tools/code/manifest/Dependencies.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index 55fc0b5f..7742895c 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -108,12 +108,8 @@ private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) * @see Dependencies.toString * @see Dependencies.parse */ -private val quotedRegex = ("((? { require(value.isNotEmpty()) From f170cf6e8e542fc43bfebf1683492c79e3c34ab7 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:01:59 +0300 Subject: [PATCH 34/98] Return regexp back --- .../main/kotlin/io/spine/tools/code/manifest/Dependencies.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt index 7742895c..9e8f1bc9 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Dependencies.kt @@ -108,8 +108,7 @@ private fun String.unescapeQuotes() = replace(QUOTE_ESCAPED, QUOTE) * @see Dependencies.toString * @see Dependencies.parse */ -private val quotedRegex = ".+".toRegex() - //"((? { require(value.isNotEmpty()) From db5b6f778fe304caa71243b1d109005856395f85 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:08:11 +0300 Subject: [PATCH 35/98] Bump detekt -> 1.20.0 --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index f65f98df..6ae5d1ce 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.15.0 + DETEKT_RELEASE_TAG: v1.20.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 03c4c79a4088b5915b0b059520ae44c78b34ce11 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:15:13 +0300 Subject: [PATCH 36/98] Rollback detekt version --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 6ae5d1ce..f65f98df 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.20.0 + DETEKT_RELEASE_TAG: v1.15.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 93168aa9e84463073b51195d4a8990a4f8f3a206 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:18:51 +0300 Subject: [PATCH 37/98] Apply newer detekt workflow --- .github/workflows/detekt-analysis.yml | 123 +++++++++++++++----------- 1 file changed, 69 insertions(+), 54 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index f65f98df..d193ca34 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -1,3 +1,8 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + # This workflow performs a static analysis of your Kotlin source code using # Detekt. # @@ -19,7 +24,7 @@ on: pull_request: branches: [ master ] schedule: - - cron: '19 17 * * 4' + - cron: '44 2 * * 4' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -39,65 +44,75 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 - # Gets the download URL associated with the $DETEKT_RELEASE_TAG - - name: Get Detekt download URL - id: detekt_info - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' - query getReleaseAssetDownloadUrl($tagName: String!) { - repository(name: "detekt", owner: "detekt") { - release(tagName: $tagName) { - releaseAssets(name: "detekt", first: 1) { - nodes { - downloadUrl + # Gets the download URL associated with the $DETEKT_RELEASE_TAG + - name: Get Detekt download URL + id: detekt_info + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' + query getReleaseAssetDownloadUrl($tagName: String!) { + repository(name: "detekt", owner: "detekt") { + release(tagName: $tagName) { + releaseAssets(name: "detekt", first: 1) { + nodes { + downloadUrl + } + } + tagCommit { + oid } } } } - } - ' | \ - jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) - echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" + ' 1> gh_response.json + + DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) + if [ $DETEKT_RELEASE_SHA != "37f0a1d006977512f1f216506cd695039607c3e5" ]; then + echo "Release tag doesn't match expected commit SHA" + exit 1 + fi + + DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) + echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" - # Sets up the detekt cli - - name: Setup Detekt - run: | - dest=$( mktemp -d ) - curl --request GET \ - --url ${{ steps.detekt_info.outputs.download_url }} \ - --silent \ - --location \ - --output $dest/detekt - chmod a+x $dest/detekt - echo $dest >> $GITHUB_PATH + # Sets up the detekt cli + - name: Setup Detekt + run: | + dest=$( mktemp -d ) + curl --request GET \ + --url ${{ steps.detekt_info.outputs.download_url }} \ + --silent \ + --location \ + --output $dest/detekt + chmod a+x $dest/detekt + echo $dest >> $GITHUB_PATH - # Performs static analysis using Detekt - - name: Run Detekt - continue-on-error: true - run: | - detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json + # Performs static analysis using Detekt + - name: Run Detekt + continue-on-error: true + run: | + detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json - # Modifies the SARIF output produced by Detekt so that absolute URIs are relative - # This is so we can easily map results onto their source files - # This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA - - name: Make artifact location URIs relative - continue-on-error: true - run: | - echo "$( - jq \ - --arg github_workspace ${{ github.workspace }} \ - '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \ - ${{ github.workspace }}/detekt.sarif.json - )" > ${{ github.workspace }}/detekt.sarif.json + # Modifies the SARIF output produced by Detekt so that absolute URIs are relative + # This is so we can easily map results onto their source files + # This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA + - name: Make artifact location URIs relative + continue-on-error: true + run: | + echo "$( + jq \ + --arg github_workspace ${{ github.workspace }} \ + '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \ + ${{ github.workspace }}/detekt.sarif.json + )" > ${{ github.workspace }}/detekt.sarif.json - # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v1 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: ${{ github.workspace }}/detekt.sarif.json - checkout_path: ${{ github.workspace }} + # Uploads results to GitHub repository using the upload-sarif action + - uses: github/codeql-action/upload-sarif@v2 + with: + # Path to SARIF file relative to the root of the repository + sarif_file: ${{ github.workspace }}/detekt.sarif.json + checkout_path: ${{ github.workspace }} From a6246203012e87e9014ac5f866c333959de50edf Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:21:54 +0300 Subject: [PATCH 38/98] Apply detekt workflow once more --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index d193ca34..738f5d2f 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -24,7 +24,7 @@ on: pull_request: branches: [ master ] schedule: - - cron: '44 2 * * 4' + - cron: '21 8 * * 5' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From 43594f9a150f36443c88744bbb1c23a19421ff62 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:27:48 +0300 Subject: [PATCH 39/98] Try detekt 1.20 once again --- .github/workflows/detekt-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 738f5d2f..3b08ac69 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -32,7 +32,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.15.0 + DETEKT_RELEASE_TAG: v1.20.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -71,7 +71,7 @@ jobs: ' 1> gh_response.json DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) - if [ $DETEKT_RELEASE_SHA != "37f0a1d006977512f1f216506cd695039607c3e5" ]; then + if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then echo "Release tag doesn't match expected commit SHA" exit 1 fi From 2694b844c505e4719a9d5b287daa9aea604f40cd Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:32:25 +0300 Subject: [PATCH 40/98] Temporarily comment out commit check --- .github/workflows/detekt-analysis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 3b08ac69..4b058a3c 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -70,11 +70,11 @@ jobs: } ' 1> gh_response.json - DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) - if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then - echo "Release tag doesn't match expected commit SHA" - exit 1 - fi +# DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) +# if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then +# echo "Release tag doesn't match expected commit SHA" +# exit 1 +# fi DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" From 8fb1bf539a26a7327efa557db4f72f9a5cfefe03 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:43:11 +0300 Subject: [PATCH 41/98] Restore commented block --- .github/workflows/detekt-analysis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 4b058a3c..3b08ac69 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -70,11 +70,11 @@ jobs: } ' 1> gh_response.json -# DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) -# if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then -# echo "Release tag doesn't match expected commit SHA" -# exit 1 -# fi + DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) + if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then + echo "Release tag doesn't match expected commit SHA" + exit 1 + fi DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" From b2e595708dd90b990808259aee524bc04f25a5f3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:49:09 +0300 Subject: [PATCH 42/98] Comment SHA check again --- .github/workflows/detekt-analysis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 3b08ac69..e2b7caa2 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -70,12 +70,6 @@ jobs: } ' 1> gh_response.json - DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) - if [ $DETEKT_RELEASE_SHA != "8028a0673a9f18fdd91c7eebfae4642941135168" ]; then - echo "Release tag doesn't match expected commit SHA" - exit 1 - fi - DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" From 3b88e1a8f282958dd0694c3f3f365e174f3e5303 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 19:54:29 +0300 Subject: [PATCH 43/98] Copy workflow from ProtoData --- .github/workflows/detekt-analysis.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index e2b7caa2..effa8b1d 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -1,8 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - # This workflow performs a static analysis of your Kotlin source code using # Detekt. # @@ -24,7 +19,7 @@ on: pull_request: branches: [ master ] schedule: - - cron: '21 8 * * 5' + - cron: '19 17 * * 4' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -32,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.20.0 + DETEKT_RELEASE_TAG: v1.15.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -45,7 +40,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 # Gets the download URL associated with the $DETEKT_RELEASE_TAG - name: Get Detekt download URL @@ -53,7 +48,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' + DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' query getReleaseAssetDownloadUrl($tagName: String!) { repository(name: "detekt", owner: "detekt") { release(tagName: $tagName) { @@ -62,15 +57,11 @@ jobs: downloadUrl } } - tagCommit { - oid - } } } } - ' 1> gh_response.json - - DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) + ' | \ + jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" # Sets up the detekt cli @@ -105,7 +96,7 @@ jobs: )" > ${{ github.workspace }}/detekt.sarif.json # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v2 + - uses: github/codeql-action/upload-sarif@v1 with: # Path to SARIF file relative to the root of the repository sarif_file: ${{ github.workspace }}/detekt.sarif.json From 72644aa494065d38351be1aa96befc4b3474a87b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 20:32:13 +0300 Subject: [PATCH 44/98] Update detekt workflow --- .github/workflows/detekt-analysis.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index effa8b1d..67e9e937 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -1,3 +1,8 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + # This workflow performs a static analysis of your Kotlin source code using # Detekt. # @@ -19,7 +24,7 @@ on: pull_request: branches: [ master ] schedule: - - cron: '19 17 * * 4' + - cron: '17 1 * * 4' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -40,7 +45,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Gets the download URL associated with the $DETEKT_RELEASE_TAG - name: Get Detekt download URL @@ -48,7 +53,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' + gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' query getReleaseAssetDownloadUrl($tagName: String!) { repository(name: "detekt", owner: "detekt") { release(tagName: $tagName) { @@ -57,11 +62,21 @@ jobs: downloadUrl } } + tagCommit { + oid + } } } } - ' | \ - jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) + ' 1> gh_response.json + + DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) + if [ $DETEKT_RELEASE_SHA != "37f0a1d006977512f1f216506cd695039607c3e5" ]; then + echo "Release tag doesn't match expected commit SHA" + exit 1 + fi + + DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" # Sets up the detekt cli @@ -96,7 +111,7 @@ jobs: )" > ${{ github.workspace }}/detekt.sarif.json # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v1 + - uses: github/codeql-action/upload-sarif@v2 with: # Path to SARIF file relative to the root of the repository sarif_file: ${{ github.workspace }}/detekt.sarif.json From 63ba1d3c7b6cd32598e36e65ac868431fdbdb8b2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 20:41:39 +0300 Subject: [PATCH 45/98] Remove SHA check --- .github/workflows/detekt-analysis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 67e9e937..3845b46d 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -70,12 +70,6 @@ jobs: } ' 1> gh_response.json - DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json) - if [ $DETEKT_RELEASE_SHA != "37f0a1d006977512f1f216506cd695039607c3e5" ]; then - echo "Release tag doesn't match expected commit SHA" - exit 1 - fi - DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" From e1fefb14f138722eed936a40c728969df6c81af6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 20:50:21 +0300 Subject: [PATCH 46/98] Bump detekt --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 3845b46d..ee1bb506 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -32,7 +32,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.15.0 + DETEKT_RELEASE_TAG: v1.20.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 8efb2f865ac35ee6d175ed7c0f6837799fc1bb21 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 20 Apr 2022 20:52:50 +0300 Subject: [PATCH 47/98] Echo download URL --- .github/workflows/detekt-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index ee1bb506..53581785 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -71,6 +71,7 @@ jobs: ' 1> gh_response.json DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) + echo "Download URL: $DETEKT_DOWNLOAD_URL" echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" # Sets up the detekt cli From 4d434ad690ceeaf987339caae5b079471f08b716 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 16:55:48 +0300 Subject: [PATCH 48/98] Try older script with the newest version tag --- .github/workflows/detekt-analysis.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 53581785..abda5707 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -24,7 +24,7 @@ on: pull_request: branches: [ master ] schedule: - - cron: '17 1 * * 4' + - cron: '19 17 * * 4' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -53,7 +53,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' + DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' query getReleaseAssetDownloadUrl($tagName: String!) { repository(name: "detekt", owner: "detekt") { release(tagName: $tagName) { @@ -62,16 +62,11 @@ jobs: downloadUrl } } - tagCommit { - oid - } } } } - ' 1> gh_response.json - - DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json) - echo "Download URL: $DETEKT_DOWNLOAD_URL" + ' | \ + jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" # Sets up the detekt cli From 14b40c044ed16834bdf25ad1a091653d256e48b3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:00:41 +0300 Subject: [PATCH 49/98] Rollback workflow to initial state --- .github/workflows/detekt-analysis.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index abda5707..effa8b1d 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -1,8 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - # This workflow performs a static analysis of your Kotlin source code using # Detekt. # @@ -32,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.20.0 + DETEKT_RELEASE_TAG: v1.15.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -45,7 +40,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 # Gets the download URL associated with the $DETEKT_RELEASE_TAG - name: Get Detekt download URL @@ -101,7 +96,7 @@ jobs: )" > ${{ github.workspace }}/detekt.sarif.json # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v2 + - uses: github/codeql-action/upload-sarif@v1 with: # Path to SARIF file relative to the root of the repository sarif_file: ${{ github.workspace }}/detekt.sarif.json From 8de04b03b8cdb88fe3575a0bb3fc53c159c3cba2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:02:30 +0300 Subject: [PATCH 50/98] Bump `upload-sarif` --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index effa8b1d..f9c98d0d 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -96,7 +96,7 @@ jobs: )" > ${{ github.workspace }}/detekt.sarif.json # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v1 + - uses: github/codeql-action/upload-sarif@v2 with: # Path to SARIF file relative to the root of the repository sarif_file: ${{ github.workspace }}/detekt.sarif.json From 6a6229d090ef6c5e615dd7895eb21876e5fa29ee Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:04:26 +0300 Subject: [PATCH 51/98] Bump detekt -> v1.20.0 --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index f9c98d0d..0e042052 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.15.0 + DETEKT_RELEASE_TAG: v1.20.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 7367beb3e912cd9ba6bde7956838254db15fc1d3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:08:03 +0300 Subject: [PATCH 52/98] Bump detekt -> v1.19.0 --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 0e042052..4360d2fb 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.20.0 + DETEKT_RELEASE_TAG: v1.19.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 6db91d6891c51d4665bed7602fa85b92668b66ee Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:10:18 +0300 Subject: [PATCH 53/98] Bump detekt -> v1.15.0 --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index 4360d2fb..f9c98d0d 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.19.0 + DETEKT_RELEASE_TAG: v1.15.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 89552070f61d5b0158cfb15fca46d26be8041d00 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:11:51 +0300 Subject: [PATCH 54/98] Bump detekt -> v1.16.0 --- .github/workflows/detekt-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml index f9c98d0d..98192f8a 100644 --- a/.github/workflows/detekt-analysis.yml +++ b/.github/workflows/detekt-analysis.yml @@ -27,7 +27,7 @@ on: env: # Release tag associated with version of Detekt to be installed # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.15.0 + DETEKT_RELEASE_TAG: v1.16.0 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From c5ffda005ea954a606edb5ee6f58622dc294699a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 18:25:17 +0300 Subject: [PATCH 55/98] Remove workflow (see #22) --- .github/workflows/detekt-analysis.yml | 103 -------------------------- 1 file changed, 103 deletions(-) delete mode 100644 .github/workflows/detekt-analysis.yml diff --git a/.github/workflows/detekt-analysis.yml b/.github/workflows/detekt-analysis.yml deleted file mode 100644 index 98192f8a..00000000 --- a/.github/workflows/detekt-analysis.yml +++ /dev/null @@ -1,103 +0,0 @@ -# This workflow performs a static analysis of your Kotlin source code using -# Detekt. -# -# Scans are triggered: -# 1. On every push to default and protected branches -# 2. On every Pull Request targeting the default branch -# 3. On a weekly schedule -# 4. Manually, on demand, via the "workflow_dispatch" event -# -# The workflow should work with no modifications, but you might like to use a -# later version of the Detekt CLI by modifing the $DETEKT_RELEASE_TAG -# environment variable. -name: Scan with Detekt - -on: - # Triggers the workflow on push or pull request events but only for default and protected branches - push: - branches: [ master ] - pull_request: - branches: [ master ] - schedule: - - cron: '19 17 * * 4' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - # Release tag associated with version of Detekt to be installed - # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 - DETEKT_RELEASE_TAG: v1.16.0 - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "scan" - scan: - name: Scan - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Gets the download URL associated with the $DETEKT_RELEASE_TAG - - name: Get Detekt download URL - id: detekt_info - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' - query getReleaseAssetDownloadUrl($tagName: String!) { - repository(name: "detekt", owner: "detekt") { - release(tagName: $tagName) { - releaseAssets(name: "detekt", first: 1) { - nodes { - downloadUrl - } - } - } - } - } - ' | \ - jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) - echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" - - # Sets up the detekt cli - - name: Setup Detekt - run: | - dest=$( mktemp -d ) - curl --request GET \ - --url ${{ steps.detekt_info.outputs.download_url }} \ - --silent \ - --location \ - --output $dest/detekt - chmod a+x $dest/detekt - echo $dest >> $GITHUB_PATH - - # Performs static analysis using Detekt - - name: Run Detekt - continue-on-error: true - run: | - detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json - - # Modifies the SARIF output produced by Detekt so that absolute URIs are relative - # This is so we can easily map results onto their source files - # This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA - - name: Make artifact location URIs relative - continue-on-error: true - run: | - echo "$( - jq \ - --arg github_workspace ${{ github.workspace }} \ - '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \ - ${{ github.workspace }}/detekt.sarif.json - )" > ${{ github.workspace }}/detekt.sarif.json - - # Uploads results to GitHub repository using the upload-sarif action - - uses: github/codeql-action/upload-sarif@v2 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: ${{ github.workspace }}/detekt.sarif.json - checkout_path: ${{ github.workspace }} From 7827047782f41245b67f30f9b91a78f65d29d9c3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 21 Apr 2022 21:38:04 +0300 Subject: [PATCH 56/98] Fix data class decl. --- .../main/kotlin/io/spine/tools/gradle/testing/Replacement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-testlib/src/main/kotlin/io/spine/tools/gradle/testing/Replacement.kt b/plugin-testlib/src/main/kotlin/io/spine/tools/gradle/testing/Replacement.kt index 87f002ff..4fea9c67 100644 --- a/plugin-testlib/src/main/kotlin/io/spine/tools/gradle/testing/Replacement.kt +++ b/plugin-testlib/src/main/kotlin/io/spine/tools/gradle/testing/Replacement.kt @@ -40,7 +40,7 @@ import java.io.File * @param token the name of the token * @param value the value to replace the token occurrences to; may be blank */ -public class Replacement(public val token: String, public val value: String) { +public data class Replacement(public val token: String, public val value: String) { init { require(token.isNotBlank()) From 3d6abf552434452a68a7057caa5990520d45d404 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 26 Apr 2022 16:48:19 +0300 Subject: [PATCH 57/98] Update config --- buildSrc/build.gradle.kts | 35 +++++- .../src/main/kotlin/dokka-for-java.gradle.kts | 5 + .../io/spine/internal/dependency/Kotlin.kt | 2 +- .../io/spine/internal/dependency/Protobuf.kt | 2 +- .../internal/gradle/dokka/DokkaExtensions.kt | 27 ++-- .../internal/gradle/kotlin/KotlinConfig.kt | 5 +- .../gradle/protobuf/ProtoTaskExtensions.kt | 119 ++++++++++++++++++ .../resources/dokka/styles/custom-styles.css | 13 +- config | 2 +- 9 files changed, 190 insertions(+), 20 deletions(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6aacc165..79d04a93 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -63,7 +63,7 @@ val grGitVersion = "3.1.1" * Please check that this value matches one defined in * [io.spine.internal.dependency.Kotlin.version]. */ -val kotlinVersion = "1.6.20" +val kotlinVersion = "1.6.21" /** * The version of Guava used in `buildSrc`. @@ -71,7 +71,7 @@ val kotlinVersion = "1.6.20" * Always use the same version as the one specified in [io.spine.internal.dependency.Guava]. * Otherwise, when testing Gradle plugins, clashes may occur. */ -val guavaVersion = "31.0.1-jre" +val guavaVersion = "31.1-jre" /** * The version of ErrorProne Gradle plugin. @@ -103,6 +103,31 @@ val protobufPluginVersion = "0.8.18" */ val dokkaVersion = "1.6.20" +configurations.all { + resolutionStrategy { + // Force Kotlin lib versions avoiding using those bundled with Gradle. + force( + "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion", + "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion", + "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion", + "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion", + "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" + ) + } +} + +val jvmVersion = JavaLanguageVersion.of(11) + +java { + toolchain.languageVersion.set(jvmVersion) +} + +tasks.withType { + kotlinOptions { + jvmTarget = jvmVersion.toString() + } +} + dependencies { implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion") @@ -113,7 +138,11 @@ dependencies { api("com.github.jk1:gradle-license-report:$licenseReportVersion") implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}") implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorProneVersion}") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") + + // Add explicit dependency to avoid warning on different Kotlin runtime versions. + implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") diff --git a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts index b70f6e88..54af9f8d 100644 --- a/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts +++ b/buildSrc/src/main/kotlin/dokka-for-java.gradle.kts @@ -26,6 +26,7 @@ import io.spine.internal.dependency.Dokka import io.spine.internal.gradle.dokka.onlyJavaSources +import io.spine.internal.gradle.dokka.onlyNonGeneratedSources import java.time.LocalDate import org.jetbrains.dokka.base.DokkaBase @@ -62,6 +63,10 @@ tasks.withType().configureEach { onlyJavaSources() ) + sourceRoots.setFrom( + onlyNonGeneratedSources() + ) + skipEmptyPackages.set(true) } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt index 0de6d842..ecee6863 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Kotlin.kt @@ -33,7 +33,7 @@ object Kotlin { * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. */ @Suppress("MemberVisibilityCanBePrivate") // used directly from outside - const val version = "1.6.20" + const val version = "1.6.21" const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${version}" const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${version}" const val stdLibCommon = "org.jetbrains.kotlin:kotlin-stdlib-common:${version}" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt index 5987a368..437ee2ce 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Protobuf.kt @@ -30,7 +30,7 @@ package io.spine.internal.dependency @Suppress("MemberVisibilityCanBePrivate") // used directly from outside object Protobuf { private const val group = "com.google.protobuf" - const val version = "3.20.0" + const val version = "3.20.1" val libs = listOf( "${group}:protobuf-java:${version}", "${group}:protobuf-java-util:${version}", diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt index 478dfccb..12a4262b 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt @@ -27,24 +27,35 @@ package io.spine.internal.gradle.dokka import java.io.File -import java.time.LocalDate import org.gradle.api.file.FileCollection -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.DokkaBaseConfiguration -import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder /** * 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. + * 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. */ internal fun GradleDokkaSourceSetBuilder.onlyJavaSources(): FileCollection { return sourceRoots.filter(File::isJavaSourceDirectory) } private fun File.isJavaSourceDirectory(): Boolean { - return isDirectory() && name == "java" + return isDirectory && name == "java" +} + +/** + * Returns only non-generated source roots out of all present in the source set. + * + * It is a helper method for generating documentation by Dokka only for non-generated code. + * It helps to filter out source files generated by`Protoc`. + */ +internal fun GradleDokkaSourceSetBuilder.onlyNonGeneratedSources(): FileCollection { + return sourceRoots.filter(File::isNonGeneratedDirectory) +} + +private fun File.isNonGeneratedDirectory(): Boolean { + return isDirectory && !path.contains("/generated/") } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt index 05bafcb0..89dfb7e4 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt @@ -52,13 +52,14 @@ fun KotlinJvmProjectExtension.applyJvmToolchain(version: String) = /** * Opts-in to experimental features that we use in our codebase. */ +@Suppress("unused") fun KotlinCompile.setFreeCompilerArgs() { kotlinOptions { freeCompilerArgs = listOf( "-Xskip-prerelease-check", "-Xjvm-default=all", - "-Xopt-in=kotlin.contracts.ExperimentalContracts", - "-Xopt-in=kotlin.ExperimentalStdlibApi" + "-opt-in=kotlin.contracts.ExperimentalContracts", + "-opt-in=kotlin.ExperimentalStdlibApi" ) } } 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 new file mode 100644 index 00000000..79c2a164 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/protobuf/ProtoTaskExtensions.kt @@ -0,0 +1,119 @@ +/* + * 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 org.gradle.configurationcache.extensions.capitalized +import org.gradle.kotlin.dsl.get + +/** + * Configures protobuf code generation task. + * + * The task configuration consists of the following steps. + * + * 1. Generation of descriptor set file is turned op for each source set. + * These files are placed under the `build/descriptors` directory. + * + * 2. At the final steps of the code generation, the code belonging to + * the `com.google` package is removed. + * + * 3. Make `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 work because + * test descriptor set files are not copied to resources. Performing this configuration from + * subprojects solves the issue. + */ +@Suppress("unused") +fun GenerateProtoTask.setup(generatedDir: String) { + + /** + * 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 + } + + /** + * 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 code, we delete it to avoid + * classes that duplicate those coming from Protobuf library JARs. + */ + doLast { + val comPackage = File("${generatedDir}/${ssn}/java/com") + val googlePackage = comPackage.resolve("google") + + project.delete(googlePackage) + + // We don't need an empty `com` package. + if (comPackage.exists() && comPackage.list()?.isEmpty() == true) { + project.delete(comPackage) + } + } + + /** + * 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) +} + +/** + * Obtains the name of the task `processResource` task for the given source set name. + */ +fun processResourceTaskName(sourceSetName: String): String { + val infix = if (sourceSetName == "main") "" else sourceSetName.capitalized() + return "process${infix}Resources" +} diff --git a/buildSrc/src/main/resources/dokka/styles/custom-styles.css b/buildSrc/src/main/resources/dokka/styles/custom-styles.css index 72e9c618..0e4eb20e 100644 --- a/buildSrc/src/main/resources/dokka/styles/custom-styles.css +++ b/buildSrc/src/main/resources/dokka/styles/custom-styles.css @@ -29,15 +29,20 @@ --color-dark: #007bff; } +:root.theme-dark dt { + color: #fff; +} + .library-name a::before { background-image: url('https://spine.io/img/spine-sign-white.svg') } .cover a, -.main-subrow.keyValue a { - font-family: monospace; +.keyValue > div:first-child > .inline-flex > div:first-child > a { + font-family: var(--default-monospace-font-family); } -:root.theme-dark dt { - color: #fff; +.keyValue > div:first-child > .inline-flex > div:first-child { + overflow: hidden; + text-overflow: ellipsis; } diff --git a/config b/config index 0b24dc36..24f043a1 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 0b24dc364701831ccafa9b32f9aeca43eba95b03 +Subproject commit 24f043a14c41825645ebab94fcde97a01c444e69 From cc8c28585cb29069abdb5b02dbf3c78ef3134147 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 26 Apr 2022 16:48:41 +0300 Subject: [PATCH 58/98] Bump `base` -> `2.0.0-SNAPSHOT.90` --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index 7e17c4fc..8f7fa7e8 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -24,5 +24,5 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -val baseVersion: String by extra("2.0.0-SNAPSHOT.88") +val baseVersion: String by extra("2.0.0-SNAPSHOT.90") val versionToPublish: String by extra("2.0.0-SNAPSHOT.92") From ad7ba8789ca543b00e0bf858a1f5a4ba00f5ad8c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 26 Apr 2022 19:12:38 +0300 Subject: [PATCH 59/98] Remove `pmd` plugin from the root script --- buildSrc/build.gradle.kts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 79d04a93..2ab5e27d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -34,7 +34,6 @@ plugins { java groovy `kotlin-dsl` - pmd val licenseReportVersion = "2.1" id("com.github.jk1.dependency-license-report").version(licenseReportVersion) } @@ -105,8 +104,8 @@ val dokkaVersion = "1.6.20" configurations.all { resolutionStrategy { - // Force Kotlin lib versions avoiding using those bundled with Gradle. force( + // 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", From 66dd9578da47c0be0f41119a752a4211e66ac977 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 26 Apr 2022 19:12:58 +0300 Subject: [PATCH 60/98] Update config --- .idea/misc.xml | 4 +- license-report.md | 156 +++++++++++++++++++++++----------------------- pom.xml | 14 ++--- 3 files changed, 87 insertions(+), 87 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 53408739..ee2691bb 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -38,10 +38,10 @@ - + - \ No newline at end of file + diff --git a/license-report.md b/license-report.md index 80a506f9..d5dc0f3e 100644 --- a/license-report.md +++ b/license-report.md @@ -45,15 +45,15 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. @@ -90,23 +90,23 @@ * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -192,18 +192,18 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -349,55 +349,55 @@ * **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.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Apr 26 19:04:20 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -520,15 +520,15 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.3. @@ -588,23 +588,23 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -712,18 +712,18 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -869,55 +869,55 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -983,7 +983,7 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Apr 26 19:04:21 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1025,15 +1025,15 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. @@ -1062,23 +1062,23 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1156,18 +1156,18 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.0. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1305,55 +1305,55 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic * **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.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.20. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1419,4 +1419,4 @@ This report was generated on **Wed Apr 20 18:10:02 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Apr 20 18:10:03 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Tue Apr 26 19:04:21 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index d8d67a87..ec6f2246 100644 --- a/pom.xml +++ b/pom.xml @@ -50,13 +50,13 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base - 2.0.0-SNAPSHOT.88 + 2.0.0-SNAPSHOT.90 compile io.spine.tools spine-testlib - 2.0.0-SNAPSHOT.88 + 2.0.0-SNAPSHOT.90 compile @@ -68,7 +68,7 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-stdlib-jdk8 - 1.6.20 + 1.6.21 compile @@ -145,7 +145,7 @@ all modules and does not describe the project structure per-subproject. com.google.protobuf protoc - 3.20.0 + 3.20.1 com.puppycrawl.tools @@ -181,17 +181,17 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-compiler-embeddable - 1.6.20 + 1.6.21 org.jetbrains.kotlin kotlin-klib-commonizer-embeddable - 1.6.20 + 1.6.21 org.jetbrains.kotlin kotlin-scripting-compiler-embeddable - 1.6.20 + 1.6.21 From aefda954207d75f9d7433ea7eb793edf78bcbb93 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 26 Apr 2022 19:13:40 +0300 Subject: [PATCH 61/98] Add more `implementation-` attributes --- .../io/spine/tools/code/manifest/KManifest.kt | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 13ece934..d090561b 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -30,10 +30,15 @@ import com.google.common.annotations.VisibleForTesting import java.io.InputStream import java.util.jar.Attributes import java.util.jar.Attributes.Name +import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE +import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Manifest - +/** + * Provides convenience access to standard and custom attributes of a JAR [Manifest] + * used by the tools of the framework. + */ public open class KManifest(protected val impl: Manifest) { public companion object { @@ -75,18 +80,25 @@ public open class KManifest(protected val impl: Manifest) { } } + /** + * Provides access to [main attributes][Manifest.getMainAttributes] of the manifest. + */ protected val mainAttributes: Attributes = impl.mainAttributes + /** + * Obtains the [`Implementation-Title`][IMPLEMENTATION_TITLE] attribute of the manifest. + */ + public val implementationTitle: String? = mainAttributes[IMPLEMENTATION_TITLE]?.toString() + /** * Obtains the [`Implementation-Version`][IMPLEMENTATION_VERSION] attribute of the manifest. */ - public val implementationVersion: String - get() { - val loaded = mainAttributes[IMPLEMENTATION_VERSION] - require(loaded != null) - val version = loaded.toString() - return version - } + public val implementationVersion: String? = mainAttributes[IMPLEMENTATION_VERSION]?.toString() + + /** + * Obtains the [`Implementation-Vendor`][IMPLEMENTATION_VENDOR] attribute of the manifest. + */ + public val implementationVendor: String? = mainAttributes[IMPLEMENTATION_VENDOR]?.toString() /** * Obtains the dependencies declared in the ['Depends-On'][DEPENDS_ON_ATTR] attribute From bbf15a4aecde195128baa1e485d039988d99761d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 28 Apr 2022 15:51:18 +0300 Subject: [PATCH 62/98] Remove `pmd` plugin from the root project --- build.gradle.kts | 1 - license-report.md | 6 +++--- pom.xml | 5 ----- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 32c06a2d..1f4f5522 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,7 +61,6 @@ plugins { `java-library` jacoco idea - pmd `project-report` io.spine.internal.dependency.Protobuf.GradlePlugin.apply { id(id) diff --git a/license-report.md b/license-report.md index d5dc0f3e..c18a2109 100644 --- a/license-report.md +++ b/license-report.md @@ -463,7 +463,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Apr 26 19:04:20 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Apr 28 15:46:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -983,7 +983,7 @@ This report was generated on **Tue Apr 26 19:04:20 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Apr 26 19:04:21 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Apr 28 15:46:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1419,4 +1419,4 @@ This report was generated on **Tue Apr 26 19:04:21 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Apr 26 19:04:21 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Apr 28 15:46:10 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index ec6f2246..23c776a3 100644 --- a/pom.xml +++ b/pom.xml @@ -152,11 +152,6 @@ all modules and does not describe the project structure per-subproject. checkstyle 10.1 - - net.sourceforge.pmd - pmd-java - 6.39.0 - net.sourceforge.pmd pmd-java From d59fb6c31bd5de72d656033a259d8dc6e4ca8191 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 28 Apr 2022 18:12:55 +0300 Subject: [PATCH 63/98] Bump version -> `2.0.0-SNAPSHOT.93` --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index c25c12ed..e215c466 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -25,4 +25,4 @@ */ val baseVersion: String by extra("2.0.0-SNAPSHOT.91") -val versionToPublish: String by extra("2.0.0-SNAPSHOT.92") +val versionToPublish: String by extra("2.0.0-SNAPSHOT.93") From 3840422883e0c59acd6d573321d64737559fb6af Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 28 Apr 2022 18:17:33 +0300 Subject: [PATCH 64/98] Bump versions --- license-report.md | 288 +++++++++++++++++++++++++--------------------- pom.xml | 24 ++-- 2 files changed, 174 insertions(+), 138 deletions(-) diff --git a/license-report.md b/license-report.md index cce82383..340164e4 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.92` +# Dependencies of `io.spine.tools:spine-plugin-base:2.0.0-SNAPSHOT.93` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -11,7 +11,7 @@ * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -45,16 +45,16 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) @@ -64,6 +64,11 @@ * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -85,23 +90,23 @@ * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -110,7 +115,7 @@ * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -138,19 +143,19 @@ * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -187,20 +192,20 @@ * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.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) * **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. @@ -247,6 +252,11 @@ * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -303,7 +313,7 @@ * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -335,59 +345,59 @@ * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -453,12 +463,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Apr 28 18:13:57 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.92` +# Dependencies of `io.spine.tools:spine-plugin-testlib:2.0.0-SNAPSHOT.93` ## Runtime 1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.9. @@ -473,7 +483,7 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -510,16 +520,16 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.3. * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -541,6 +551,11 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -573,23 +588,23 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -620,7 +635,7 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -648,19 +663,19 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -697,20 +712,20 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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) -1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.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) * **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. @@ -757,6 +772,11 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -813,7 +833,7 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -845,59 +865,59 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -963,12 +983,12 @@ This report was generated on **Thu Apr 28 13:23:46 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.92` +# Dependencies of `io.spine.tools:spine-tool-base:2.0.0-SNAPSHOT.93` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -979,7 +999,7 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1005,21 +1025,26 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1037,23 +1062,23 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1062,7 +1087,7 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 2.8.8. +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. * **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) @@ -1090,19 +1115,19 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.13.1. * **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.11.0. +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.13.1. * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) 1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. @@ -1131,20 +1156,20 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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-java. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.20.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.4. +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.20.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.4. - * **License:** [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.20.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.19.4. +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.20.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) * **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. @@ -1187,6 +1212,11 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** +1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. + * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) + * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) + 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) @@ -1239,7 +1269,7 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.15.0. +1. **Group** : org.checkerframework. **Name** : dataflow-errorprone. **Version** : 3.21.1. * **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) @@ -1271,59 +1301,59 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic * **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.intellij.deps. **Name** : trove4j. **Version** : 1.0.20181211. +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.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.6.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-klib-commonizer-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.6.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-reflect. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.6.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-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.6.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-compiler-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.6.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-compiler-impl-embeddable. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.6.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.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.6.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-stdlib. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.6.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-stdlib-common. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.6.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-stdlib-jdk7. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.6.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-stdlib-jdk8. **Version** : 1.6.10. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.6.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) @@ -1389,4 +1419,4 @@ This report was generated on **Thu Apr 28 13:23:47 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 13:23:48 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 34406c5d..7569de28 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools tool-base -2.0.0-SNAPSHOT.92 +2.0.0-SNAPSHOT.93 2015 @@ -41,6 +41,12 @@ all modules and does not describe the project structure per-subproject. 1.13.0 compile + + io.github.z4kn4fein + semver + 1.2.1 + compile + io.spine spine-base @@ -62,7 +68,7 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-stdlib-jdk8 - 1.6.10 + 1.6.21 compile @@ -122,24 +128,24 @@ all modules and does not describe the project structure per-subproject. com.google.errorprone error_prone_annotations - 2.11.0 + 2.13.1 provided com.google.errorprone error_prone_core - 2.11.0 + 2.13.1 com.google.errorprone error_prone_type_annotations - 2.11.0 + 2.13.1 provided com.google.protobuf protoc - 3.19.4 + 3.20.1 com.puppycrawl.tools @@ -170,17 +176,17 @@ all modules and does not describe the project structure per-subproject. org.jetbrains.kotlin kotlin-compiler-embeddable - 1.6.10 + 1.6.21 org.jetbrains.kotlin kotlin-klib-commonizer-embeddable - 1.6.10 + 1.6.21 org.jetbrains.kotlin kotlin-scripting-compiler-embeddable - 1.6.10 + 1.6.21 From d22f8f820f3901d5da1a45fe2f31df93ffb530a2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 29 Apr 2022 23:15:22 +0300 Subject: [PATCH 65/98] Add `toString()` Also: * Expose manifest resource path. --- .../io/spine/tools/code/manifest/KManifest.kt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index d090561b..44bfaf9e 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -27,6 +27,7 @@ package io.spine.tools.code.manifest import com.google.common.annotations.VisibleForTesting +import java.io.ByteArrayOutputStream import java.io.InputStream import java.util.jar.Attributes import java.util.jar.Attributes.Name @@ -34,6 +35,7 @@ import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Manifest +import kotlin.text.Charsets.UTF_8 /** * Provides convenience access to standard and custom attributes of a JAR [Manifest] @@ -46,7 +48,7 @@ public open class KManifest(protected val impl: Manifest) { /** * The path to the manifest file in program resources. */ - private const val MANIFEST_MF = "META-INF/MANIFEST.MF" + public const val RESOURCE_FILE: String = "META-INF/MANIFEST.MF" /** * The name of the custom manifest attribute containing a list of dependencies @@ -61,9 +63,9 @@ public open class KManifest(protected val impl: Manifest) { * Loads the manifest from the program resources. */ public fun load(cl: ClassLoader): KManifest { - val stream = cl.getResourceAsStream(MANIFEST_MF) + val stream = cl.getResourceAsStream(RESOURCE_FILE) check(stream != null) { - "Unable to load the `$MANIFEST_MF` file from resources." + "Unable to load the `$RESOURCE_FILE` file from resources." } return load(stream) } @@ -111,4 +113,17 @@ public open class KManifest(protected val impl: Manifest) { val deps = Dependencies.parse(depsValue) return deps } + + /** + * Prints the content of the underlying [Manifest] instance in + * the form it is stored in a resource file. + */ + override fun toString(): String { + val stream = ByteArrayOutputStream() + stream.use { + impl.write(it) + } + val manifest = String(stream.toByteArray(), UTF_8) + return manifest + } } From 949cdef0a86bb04e1ce432140d166068587e7898 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 29 Apr 2022 23:16:04 +0300 Subject: [PATCH 66/98] Load a version from a manifest --- .../io/spine/tools/code/manifest/Version.kt | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt new file mode 100644 index 00000000..34a1cce6 --- /dev/null +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt @@ -0,0 +1,52 @@ +/* + * 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.tools.code.manifest + +import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION + +/** + * A version of a software component. + */ +public data class Version(val value: String) { + + public companion object { + + /** + * Obtains the version from a JAR manifest resource loaded using the given classloader. + */ + public fun fromManifest(cl: ClassLoader): Version { + val manifest = KManifest.load(cl) + val implVersion = manifest.implementationVersion + check(implVersion != null) { + "Unable to obtain the version:" + + " no `${IMPLEMENTATION_VERSION}` attribute found in the manifest." + } + val version = Version(implVersion) + return version + } + } +} From aff17fb8f763afda0621a5e7c702d1d5419681c0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 29 Apr 2022 23:20:04 +0300 Subject: [PATCH 67/98] Simplify treating absent version --- .../java/io/spine/tools/gradle/DependencyVersions.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin-base/src/main/java/io/spine/tools/gradle/DependencyVersions.java b/plugin-base/src/main/java/io/spine/tools/gradle/DependencyVersions.java index 91321083..f11b48cd 100644 --- a/plugin-base/src/main/java/io/spine/tools/gradle/DependencyVersions.java +++ b/plugin-base/src/main/java/io/spine/tools/gradle/DependencyVersions.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableMap; import io.spine.annotation.Internal; import io.spine.io.Resource; +import org.checkerframework.checker.nullness.qual.Nullable; import java.io.IOException; import java.util.Map; @@ -89,10 +90,7 @@ private static DependencyVersions loadFrom(Map properties) { public Optional versionOf(Dependency dependency) { checkNotNull(dependency); var key = dependency.fileSafeId(); - if (versions.containsKey(key)) { - return Optional.of(versions.get(key)); - } else { - return Optional.empty(); - } + @Nullable String value = versions.get(key); + return Optional.ofNullable(value); } } From 0d3697fce14029f6ab11cfc4927f72c05f646e2d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 30 Apr 2022 14:41:23 +0300 Subject: [PATCH 68/98] Write manifest files on build --- build.gradle.kts | 1 + .../src/main/kotlin/write-manifest.gradle.kts | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 buildSrc/src/main/kotlin/write-manifest.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 1f4f5522..b174457f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -110,6 +110,7 @@ subprojects { plugin("net.ltgt.errorprone") plugin("pmd-settings") plugin(Protobuf.GradlePlugin.id) + plugin("write-manifest") } dependencies { diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts new file mode 100644 index 00000000..daf97c13 --- /dev/null +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -0,0 +1,68 @@ +/* + * 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 java.text.SimpleDateFormat +import java.util.* +import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION +import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE +import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR + +plugins { + java +} + +fun prop(key: String): String = System.getProperties()[key].toString() + +fun currentTime(): String = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(Date()) + +fun buildJdk(): String = + "${prop("java.version")} (${prop("java.vendor")} ${prop("java.vm.version")})" + +fun buildOs(): String = + "${prop("os.name")} ${prop("os.arch")} ${prop("os.version")}" + +tasks.jar { + manifest { + attributes( + mapOf( + "Built-By" to prop("user.name"), + "Build-Timestamp" to currentTime(), + "Created-By" to "Gradle ${gradle.gradleVersion}", + "Build-Jdk" to buildJdk(), + "Build-OS" to buildOs(), + IMPLEMENTATION_TITLE.toString() to "${project.group}:${project.name}", + IMPLEMENTATION_VERSION.toString() to project.version, + IMPLEMENTATION_VENDOR.toString() to "TeamDev" + ) + ) + } +} + +sourceSets { + main { + resources.srcDir("$buildDir/tmp/jar") + } +} From baf0cbd86ef8f7852dd7fca33a69ee6c898f2237 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 30 Apr 2022 14:42:10 +0300 Subject: [PATCH 69/98] Load a manifest by a class --- .../src/main/kotlin/io/spine/tools/code/manifest/Version.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt index 34a1cce6..8d0d7171 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/Version.kt @@ -38,8 +38,8 @@ public data class Version(val value: String) { /** * Obtains the version from a JAR manifest resource loaded using the given classloader. */ - public fun fromManifest(cl: ClassLoader): Version { - val manifest = KManifest.load(cl) + public fun fromManifestOf(cls: Class<*>): Version { + val manifest = KManifest.load(cls) val implVersion = manifest.implementationVersion check(implVersion != null) { "Unable to obtain the version:" + From 1faaed30b88b90a7d5ca1c7251dd6b9b294ac22b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 30 Apr 2022 14:42:37 +0300 Subject: [PATCH 70/98] Remove `semver` dependency --- license-report.md | 36 +++--------------------------------- pom.xml | 6 ------ 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/license-report.md b/license-report.md index 340164e4..8848c3b4 100644 --- a/license-report.md +++ b/license-report.md @@ -64,11 +64,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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -252,11 +247,6 @@ * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -463,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 18:13:57 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -551,11 +541,6 @@ This report was generated on **Thu Apr 28 18:13:57 EEST 2022** using [Gradle-Lic * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -772,11 +757,6 @@ This report was generated on **Thu Apr 28 18:13:57 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -983,7 +963,7 @@ This report was generated on **Thu Apr 28 18:13:57 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1040,11 +1020,6 @@ This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-Lic * **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** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -1212,11 +1187,6 @@ This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-Lic * **Project URL:** [https://github.com/java-diff-utils/java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : io.github.z4kn4fein. **Name** : semver. **Version** : 1.2.1.**No license information found** -1. **Group** : io.github.z4kn4fein. **Name** : semver-jvm. **Version** : 1.2.1. - * **Project URL:** [https://z4kn4fein.github.io/kotlin-semver](https://z4kn4fein.github.io/kotlin-semver) - * **License:** [MIT License](https://raw.githubusercontent.com/z4kn4fein/kotlin-semver/main/LICENSE) - 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) @@ -1419,4 +1389,4 @@ This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Apr 28 18:13:58 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7569de28..a3857387 100644 --- a/pom.xml +++ b/pom.xml @@ -41,12 +41,6 @@ all modules and does not describe the project structure per-subproject. 1.13.0 compile - - io.github.z4kn4fein - semver - 1.2.1 - compile - io.spine spine-base From 76932da728e8894b001650f888e8fe1f479b1e1c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 30 Apr 2022 14:42:46 +0300 Subject: [PATCH 71/98] Remove `semver` dependency --- tool-base/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/tool-base/build.gradle.kts b/tool-base/build.gradle.kts index 6bfb6c9d..df3630f9 100644 --- a/tool-base/build.gradle.kts +++ b/tool-base/build.gradle.kts @@ -31,7 +31,6 @@ import io.spine.internal.dependency.Spine dependencies { api(JavaPoet.lib) api(JavaX.annotations) - implementation("io.github.z4kn4fein:semver:1.2.1") val spine = Spine(project) api(spine.base) From 0b4028342308636d6e09baa78835b4bbf2674e81 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 30 Apr 2022 14:43:19 +0300 Subject: [PATCH 72/98] Load a manifest by a class --- .../test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index bb0f2a0d..0cf19353 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -39,8 +39,8 @@ import org.junit.jupiter.api.io.TempDir class `'KManifest' should` { @Test - fun `load version from resources`() { - val manifest = KManifest.load(javaClass.classLoader) + fun `load itself from resources`() { + val manifest = KManifest.load(javaClass) assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.92") } From 1aa88355305415e88f1fb5d72d924ef24002498d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 1 May 2022 21:46:48 +0300 Subject: [PATCH 73/98] Fix creating manifest for tests --- .../src/main/kotlin/write-manifest.gradle.kts | 57 +++++++++++++------ license-report.md | 6 +- .../io/spine/tools/code/manifest/KManifest.kt | 51 +++++++++++++++-- .../tools/code/manifest/KManifestTest.kt | 7 ++- .../src/test/resources/META-INF/MANIFEST.MF | 2 - 5 files changed, 93 insertions(+), 30 deletions(-) delete mode 100644 tool-base/src/test/resources/META-INF/MANIFEST.MF diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index daf97c13..52cd84ae 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -24,8 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import java.nio.file.Files +import java.nio.file.Files.createDirectories +import java.nio.file.Files.createFile import java.text.SimpleDateFormat import java.util.* +import java.util.jar.Attributes +import java.util.jar.Manifest import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR @@ -44,25 +49,43 @@ fun buildJdk(): String = fun buildOs(): String = "${prop("os.name")} ${prop("os.arch")} ${prop("os.version")}" -tasks.jar { - manifest { - attributes( - mapOf( - "Built-By" to prop("user.name"), - "Build-Timestamp" to currentTime(), - "Created-By" to "Gradle ${gradle.gradleVersion}", - "Build-Jdk" to buildJdk(), - "Build-OS" to buildOs(), - IMPLEMENTATION_TITLE.toString() to "${project.group}:${project.name}", - IMPLEMENTATION_VERSION.toString() to project.version, - IMPLEMENTATION_VENDOR.toString() to "TeamDev" - ) - ) +val manifestAttributes = mapOf( + "Built-By" to prop("user.name"), + "Build-Timestamp" to currentTime(), + "Created-By" to "Gradle ${gradle.gradleVersion}", + "Build-Jdk" to buildJdk(), + "Build-OS" to buildOs(), + IMPLEMENTATION_TITLE.toString() to "${project.group}:${project.name}", + IMPLEMENTATION_VERSION.toString() to project.version, + IMPLEMENTATION_VENDOR.toString() to "TeamDev" +) + +val exposeManifestForTests by tasks.creating { + doLast { + val manifest = Manifest() + manifest.mainAttributes.apply { + // The manifest version attribute is crucial for writing. + put(Attributes.Name.MANIFEST_VERSION, "1.0") + manifestAttributes.forEach { + putValue(it.key, it.value.toString()) + } + } + var file = file("$buildDir/resources/main/META-INF/MANIFEST.MF") + createDirectories(file.toPath().parent) + createFile(file.toPath()) + val stream = file.outputStream() + stream.use { + manifest.write(stream) + } } } -sourceSets { - main { - resources.srcDir("$buildDir/tmp/jar") +tasks.processResources { + dependsOn(exposeManifestForTests) +} + +tasks.jar { + manifest { + attributes(manifestAttributes) } } diff --git a/license-report.md b/license-report.md index 8848c3b4..5bb765b9 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Apr 30 14:41:04 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 44bfaf9e..1a5021f0 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -27,8 +27,11 @@ package io.spine.tools.code.manifest import com.google.common.annotations.VisibleForTesting +import io.spine.io.Resource import java.io.ByteArrayOutputStream import java.io.InputStream +import java.net.JarURLConnection +import java.net.URL import java.util.jar.Attributes import java.util.jar.Attributes.Name import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE @@ -60,14 +63,23 @@ public open class KManifest(protected val impl: Manifest) { public val DEPENDS_ON_ATTR: Name = Name("Depends-On") /** - * Loads the manifest from the program resources. + * Loads the manifest next to the given class. */ - public fun load(cl: ClassLoader): KManifest { - val stream = cl.getResourceAsStream(RESOURCE_FILE) - check(stream != null) { - "Unable to load the `$RESOURCE_FILE` file from resources." + public fun load(cls: Class<*>): KManifest { + val classFile = cls.simpleName + ".class" + val classResource = cls.getResource(classFile)!! + + val urlConnection = classResource.openConnection()!! + if (urlConnection is JarURLConnection) { + val manifest = urlConnection.manifest + return KManifest(manifest) + } + + val classResourcePath = classResource.toString() + if (!classResourcePath.startsWith("jar")) { + return loadNonJar(cls, classResourcePath) } - return load(stream) + return loadFromJar(classResourcePath) } /** @@ -127,3 +139,30 @@ public open class KManifest(protected val impl: Manifest) { return manifest } } + +private fun loadFromJar(classPath: String): KManifest { + val manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1) + + "/" + KManifest.RESOURCE_FILE + val url = URL(manifestPath) + val stream = url.openStream() + return KManifest.load(stream) +} + +private fun loadNonJar(cls: Class<*>, classResourcePath: String): KManifest { + println("**** CLASS RESOURCE PATH: $classResourcePath") + val manifestResource = Resource.file(KManifest.RESOURCE_FILE, cls.classLoader) + val allManifests = manifestResource.locateAll() + println("**** ALL MANIFESTS: $allManifests") + val urlToCommonPrefix = mutableMapOf() + allManifests.forEach { url -> + val commonPrefix = classResourcePath.commonPrefixWith(url.toString()) + urlToCommonPrefix[commonPrefix] = url + } + val longest = urlToCommonPrefix.keys.maxByOrNull { it.length }!! + println("**** LONGEST PREFIX: $longest") + val nearestManifest = urlToCommonPrefix[longest]!! + println("**** NEAREST MANIFEST: $nearestManifest") + val stream = nearestManifest.openStream() + return KManifest.load(stream) +} + diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index 0cf19353..f54f11df 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -40,9 +40,12 @@ class `'KManifest' should` { @Test fun `load itself from resources`() { - val manifest = KManifest.load(javaClass) + val manifest = KManifest.load(KManifest::class.java) - assertThat(manifest.implementationVersion).isEqualTo("2.0.0-SNAPSHOT.92") + assertThat(manifest.implementationTitle) + .isEqualTo("io.spine.tools:tool-base") + assertThat(manifest.implementationVersion) + .isNotEmpty() } @Nested diff --git a/tool-base/src/test/resources/META-INF/MANIFEST.MF b/tool-base/src/test/resources/META-INF/MANIFEST.MF deleted file mode 100644 index af407ec1..00000000 --- a/tool-base/src/test/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Version: 2.0.0-SNAPSHOT.92 From e060cbfe5828d07963cc05127346fd470a051d86 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 1 May 2022 23:55:06 +0300 Subject: [PATCH 74/98] Move writer to tests We won't need this class at runtime because we're going to use Gradle tasks for writing manifests. See `write-manifest.gradle.kts` for details. --- .../io/spine/tools/code/manifest/KManifestWriter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename tool-base/src/{main => test}/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt (91%) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt similarity index 91% rename from tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt rename to tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt index cf6071dd..9f93c6dc 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt @@ -34,12 +34,12 @@ import java.util.jar.Manifest /** * Allows to configure and write a manifest file. */ -public class KManifestWriter(impl: Manifest) : KManifest(impl) { +class KManifestWriter(impl: Manifest) : KManifest(impl) { /** * Creates a new instance of the writer with an empty manifest. */ - public constructor() : this(Manifest()) + constructor() : this(Manifest()) init { // The `Manifest-Version` version attribute must be initialized. @@ -54,7 +54,7 @@ public class KManifestWriter(impl: Manifest) : KManifest(impl) { * * @param value a non-empty version string */ - public fun implementationVersion(value: String) { + fun implementationVersion(value: String) { require(value.isNotEmpty()) mainAttributes[IMPLEMENTATION_VERSION] = value } @@ -62,7 +62,7 @@ public class KManifestWriter(impl: Manifest) : KManifest(impl) { /** * Writes the manifest to the given stream. */ - public fun write(stream: OutputStream) { + fun write(stream: OutputStream) { impl.write(stream) } } From faf20c0ab944f33552096b14d2fc3e37d9063dd7 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 1 May 2022 23:55:19 +0300 Subject: [PATCH 75/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index 5bb765b9..71adc37f 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 21:41:05 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 8b2d24e48135b75445a0719661fa1d99e72527f6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 1 May 2022 23:55:33 +0300 Subject: [PATCH 76/98] Add documentation --- .../src/main/kotlin/write-manifest.gradle.kts | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 52cd84ae..a136d8e3 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -34,21 +34,37 @@ import java.util.jar.Manifest import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR +import java.util.jar.Attributes.Name.MANIFEST_VERSION plugins { java } +/** + * Obtains a string value of a [Sysmtem] property with the given key. + */ fun prop(key: String): String = System.getProperties()[key].toString() +/** + * Obtains the current time in UTC using ISO 8601 format. + */ fun currentTime(): String = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(Date()) +/** + * Obtains the information on the JDK used for the build. + */ fun buildJdk(): String = "${prop("java.version")} (${prop("java.vendor")} ${prop("java.vm.version")})" +/** + * Obtains the information on the operating system used for the build. + */ fun buildOs(): String = "${prop("os.name")} ${prop("os.arch")} ${prop("os.version")}" +/** + * The attributes we put into the JAR manifest. + */ val manifestAttributes = mapOf( "Built-By" to prop("user.name"), "Build-Timestamp" to currentTime(), @@ -60,19 +76,31 @@ val manifestAttributes = mapOf( IMPLEMENTATION_VENDOR.toString() to "TeamDev" ) +/** + * Creates a manifest file in `resources` so that it is available for the tests. + * + * This task does the same what does the block which configures the `tasks.jar` below. + * We cannot use the manifest file created by the `Jar` task because it's not visible + * when running tests. We cannot depend on the `Jar` from `resources` because it would + * form a circular dependency. + */ val exposeManifestForTests by tasks.creating { doLast { val manifest = Manifest() - manifest.mainAttributes.apply { - // The manifest version attribute is crucial for writing. - put(Attributes.Name.MANIFEST_VERSION, "1.0") - manifestAttributes.forEach { - putValue(it.key, it.value.toString()) - } + + // The manifest version attribute is crucial for writing. + // It it's absent nothing would be written. + manifest.mainAttributes[MANIFEST_VERSION] = "1.0" + + manifestAttributes.forEach { entry -> + manifest.mainAttributes.putValue(entry.key, entry.value.toString()) } + var file = file("$buildDir/resources/main/META-INF/MANIFEST.MF") createDirectories(file.toPath().parent) - createFile(file.toPath()) + if (!file.exists()) { + createFile(file.toPath()) + } val stream = file.outputStream() stream.use { manifest.write(stream) From 014ea6146fe41149ce3af5734b09b69be219321d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 5 May 2022 23:03:09 +0300 Subject: [PATCH 77/98] Ignore build timestamp during normalization --- .../src/main/kotlin/write-manifest.gradle.kts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index a136d8e3..a33fefa6 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -62,12 +62,20 @@ fun buildJdk(): String = fun buildOs(): String = "${prop("os.name")} ${prop("os.arch")} ${prop("os.version")}" +/** + * The name of the manifest attribute holding the timestamp of the build. + */ +val BUILD_TIMESTAMP = "Build-Timestamp" + /** * The attributes we put into the JAR manifest. + * + * This map is shared between the [exposeManifestForTests] task and the action which + * customizes the [Jar] task below. */ val manifestAttributes = mapOf( "Built-By" to prop("user.name"), - "Build-Timestamp" to currentTime(), + BUILD_TIMESTAMP to currentTime(), "Created-By" to "Gradle ${gradle.gradleVersion}", "Build-Jdk" to buildJdk(), "Build-OS" to buildOs(), @@ -117,3 +125,17 @@ tasks.jar { attributes(manifestAttributes) } } + +/** + * Makes Gradle ignore the [BUILD_TIMESTAMP] attribute during normalization. + * + * See [Java META-INF normalization](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:meta_inf_normalization) + * sectio of the Gradle documentation for details. + */ +normalization { + runtimeClasspath { + metaInf { + ignoreAttribute(BUILD_TIMESTAMP) + } + } +} From a810911b99993e26e53b10f75242b352fe519a2b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 5 May 2022 23:07:05 +0300 Subject: [PATCH 78/98] Remove unused code Also: * Simplify code flow via applying extension functions. --- .../io/spine/tools/code/manifest/KManifest.kt | 52 ++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 1a5021f0..79fb356d 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -66,20 +66,17 @@ public open class KManifest(protected val impl: Manifest) { * Loads the manifest next to the given class. */ public fun load(cls: Class<*>): KManifest { - val classFile = cls.simpleName + ".class" - val classResource = cls.getResource(classFile)!! - + val classResource = cls.toResourceUrl() val urlConnection = classResource.openConnection()!! if (urlConnection is JarURLConnection) { val manifest = urlConnection.manifest return KManifest(manifest) } - - val classResourcePath = classResource.toString() - if (!classResourcePath.startsWith("jar")) { - return loadNonJar(cls, classResourcePath) + if (!classResource.isInJar()) { + return loadNonJar(cls) } - return loadFromJar(classResourcePath) + throw IllegalStateException("Unable to load manifest file for" + + " the class with the URL `$classResource`.") } /** @@ -140,28 +137,45 @@ public open class KManifest(protected val impl: Manifest) { } } -private fun loadFromJar(classPath: String): KManifest { - val manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1) + - "/" + KManifest.RESOURCE_FILE - val url = URL(manifestPath) - val stream = url.openStream() - return KManifest.load(stream) +/** + * Obtains URL for obtaining this class as a resource. + */ +private fun Class<*>.toResourceUrl(): URL { + val classFile = "$simpleName.class" + val classResource = getResource(classFile)!! + return classResource } -private fun loadNonJar(cls: Class<*>, classResourcePath: String): KManifest { - println("**** CLASS RESOURCE PATH: $classResourcePath") +/** + * Tells if this `URL` refers to a resource inside a JAR archive. + */ +private fun URL.isInJar() = toString().startsWith("jar") + +/** + * Loads a manifest "closest" to the given class. + * + * The location of the manifest file is obtained as one which has the most lengthy + * common prefix with the URL of the class. + * + * Please see [this Stack Overflow answer](https://stackoverflow.com/a/1273432/2395775) + * for details. Even though the answer covers the `"jar:"` case of a protocol, this function + * is meant to handle the URLs with the `"file:"` protocol (primarily used when we test). + * This is so because when we load a manifest from a JAR, we do it via + * [JarURLConnection.getManifest]. + * + * @see KManifest.load + */ +private fun loadNonJar(cls: Class<*>): KManifest { + val classResourcePath = cls.toResourceUrl().toString() val manifestResource = Resource.file(KManifest.RESOURCE_FILE, cls.classLoader) val allManifests = manifestResource.locateAll() - println("**** ALL MANIFESTS: $allManifests") val urlToCommonPrefix = mutableMapOf() allManifests.forEach { url -> val commonPrefix = classResourcePath.commonPrefixWith(url.toString()) urlToCommonPrefix[commonPrefix] = url } val longest = urlToCommonPrefix.keys.maxByOrNull { it.length }!! - println("**** LONGEST PREFIX: $longest") val nearestManifest = urlToCommonPrefix[longest]!! - println("**** NEAREST MANIFEST: $nearestManifest") val stream = nearestManifest.openStream() return KManifest.load(stream) } From ffdf0391e74a62c2f68f5f63e29f7388491f0746 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 5 May 2022 23:07:14 +0300 Subject: [PATCH 79/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index 71adc37f..618a17b8 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 05 22:46:52 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 05 22:46:53 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun May 01 23:42:14 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu May 05 22:46:53 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From acf310907a1bdc78e5074ea5ccc5b62e693bda43 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 5 May 2022 23:53:36 +0300 Subject: [PATCH 80/98] Extend diagnostics for manifest loading failure --- .../io/spine/tools/code/manifest/KManifest.kt | 14 ++++++++++++-- .../io/spine/tools/code/manifest/KManifestTest.kt | 12 ++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 79fb356d..8ae3ab40 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -27,6 +27,7 @@ package io.spine.tools.code.manifest import com.google.common.annotations.VisibleForTesting +import com.google.common.collect.ImmutableList import io.spine.io.Resource import java.io.ByteArrayOutputStream import java.io.InputStream @@ -166,9 +167,8 @@ private fun URL.isInJar() = toString().startsWith("jar") * @see KManifest.load */ private fun loadNonJar(cls: Class<*>): KManifest { + val allManifests = manifestsVisibleTo(cls) val classResourcePath = cls.toResourceUrl().toString() - val manifestResource = Resource.file(KManifest.RESOURCE_FILE, cls.classLoader) - val allManifests = manifestResource.locateAll() val urlToCommonPrefix = mutableMapOf() allManifests.forEach { url -> val commonPrefix = classResourcePath.commonPrefixWith(url.toString()) @@ -180,3 +180,13 @@ private fun loadNonJar(cls: Class<*>): KManifest { return KManifest.load(stream) } +/** + * Obtains the list of all manifests visible to the given class. + */ +@VisibleForTesting +public fun manifestsVisibleTo(cls: Class<*>): ImmutableList { + val manifestResource = Resource.file(KManifest.RESOURCE_FILE, cls.classLoader) + val result = manifestResource.locateAll() + return result +} + diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index f54f11df..761660f0 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -27,6 +27,7 @@ package io.spine.tools.code.manifest import com.google.common.truth.Truth.assertThat +import com.google.common.truth.Truth.assertWithMessage import io.spine.testing.TestValues.randomString import java.io.File import java.io.FileInputStream @@ -40,10 +41,17 @@ class `'KManifest' should` { @Test fun `load itself from resources`() { - val manifest = KManifest.load(KManifest::class.java) + val cls = KManifest::class.java + val manifest = KManifest.load(cls) - assertThat(manifest.implementationTitle) + assertWithMessage( + "Unable to load correct manifest for the class `${cls}`." + + " Visible manifests are: ${System.lineSeparator()}" + + "${manifestsVisibleTo(cls)}" + ) + .that(manifest.implementationTitle) .isEqualTo("io.spine.tools:tool-base") + assertThat(manifest.implementationVersion) .isNotEmpty() } From c9b15ad95b58b7e4df147a4c1458f647e33b4dcc Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 5 May 2022 23:53:43 +0300 Subject: [PATCH 81/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index 618a17b8..db1e34bb 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 22:46:52 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Thu May 05 22:46:52 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 22:46:53 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Thu May 05 22:46:53 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 22:46:53 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From f1804a6a09a3a88e15535c04c9285fcf56d97c1f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 00:12:51 +0300 Subject: [PATCH 82/98] Use `layout` for obtaining a file --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index a33fefa6..fd72e93c 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -24,12 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.nio.file.Files import java.nio.file.Files.createDirectories import java.nio.file.Files.createFile import java.text.SimpleDateFormat import java.util.* -import java.util.jar.Attributes import java.util.jar.Manifest import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE @@ -104,7 +102,9 @@ val exposeManifestForTests by tasks.creating { manifest.mainAttributes.putValue(entry.key, entry.value.toString()) } - var file = file("$buildDir/resources/main/META-INF/MANIFEST.MF") + val fileProvider = + layout.buildDirectory.file("$buildDir/resources/main/META-INF/MANIFEST.MF") + val file = fileProvider.get().getAsFile() createDirectories(file.toPath().parent) if (!file.exists()) { createFile(file.toPath()) From 14459ab4f3c44223fcffb4aac5a4483ffca32d0d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 00:14:47 +0300 Subject: [PATCH 83/98] Improve diagnostic message ... for failure on manifest loading Also: * Remove redundant test. --- .../tools/code/manifest/KManifestTest.kt | 46 ++----------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index 761660f0..abe94ab5 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -28,14 +28,7 @@ package io.spine.tools.code.manifest import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage -import io.spine.testing.TestValues.randomString -import java.io.File -import java.io.FileInputStream -import java.io.FileOutputStream -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir class `'KManifest' should` { @@ -44,10 +37,12 @@ class `'KManifest' should` { val cls = KManifest::class.java val manifest = KManifest.load(cls) + val nl = System.lineSeparator() + val visibleManifests = manifestsVisibleTo(cls).joinToString(nl) assertWithMessage( "Unable to load correct manifest for the class `${cls}`." - + " Visible manifests are: ${System.lineSeparator()}" - + "${manifestsVisibleTo(cls)}" + + " Visible manifests are: $nl" + + visibleManifests ) .that(manifest.implementationTitle) .isEqualTo("io.spine.tools:tool-base") @@ -55,37 +50,4 @@ class `'KManifest' should` { assertThat(manifest.implementationVersion) .isNotEmpty() } - - @Nested - inner class `provide configuration via writer object for` { - - private lateinit var manifest: KManifest - - private lateinit var version: String - - @BeforeEach - fun initManifest(@TempDir tmp: File) { - version = randomString() - - val writer = KManifestWriter() - writer.implementationVersion(version) - - val file = tmp.resolve("MANIFEST.MF") - val output = FileOutputStream(file) - output.use { - writer.write(it) - } - - val input = FileInputStream(file) - input.use { - manifest = KManifest.load(input) - } - } - - @Test - fun implementationVersion() { - assertThat(manifest.implementationVersion) - .isEqualTo(version) - } - } } From 31ed7a1e0157c3de1d0efc92230774a8550555de Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 00:27:34 +0300 Subject: [PATCH 84/98] Simplify file reference --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index fd72e93c..79c15705 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -102,8 +102,7 @@ val exposeManifestForTests by tasks.creating { manifest.mainAttributes.putValue(entry.key, entry.value.toString()) } - val fileProvider = - layout.buildDirectory.file("$buildDir/resources/main/META-INF/MANIFEST.MF") + val fileProvider = layout.buildDirectory.file("resources/main/META-INF/MANIFEST.MF") val file = fileProvider.get().getAsFile() createDirectories(file.toPath().parent) if (!file.exists()) { From cc5f53272b0d0294d09d6275652ad50c6647099e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 00:39:06 +0300 Subject: [PATCH 85/98] Revert to absolute path --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 79c15705..fd72e93c 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -102,7 +102,8 @@ val exposeManifestForTests by tasks.creating { manifest.mainAttributes.putValue(entry.key, entry.value.toString()) } - val fileProvider = layout.buildDirectory.file("resources/main/META-INF/MANIFEST.MF") + val fileProvider = + layout.buildDirectory.file("$buildDir/resources/main/META-INF/MANIFEST.MF") val file = fileProvider.get().getAsFile() createDirectories(file.toPath().parent) if (!file.exists()) { From baaa126cba2b0cbb12bb28591d560ca25e6cbe38 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 00:51:34 +0300 Subject: [PATCH 86/98] Fix diags message --- .../test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index abe94ab5..60371b62 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -40,7 +40,7 @@ class `'KManifest' should` { val nl = System.lineSeparator() val visibleManifests = manifestsVisibleTo(cls).joinToString(nl) assertWithMessage( - "Unable to load correct manifest for the class `${cls}`." + "Unable to load correct manifest for the class `${cls.name}`." + " Visible manifests are: $nl" + visibleManifests ) From c0708d76ee9b8b828bba65182b89810143c02b02 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 01:01:21 +0300 Subject: [PATCH 87/98] Use artifact prefix in impl. title --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 14 +++++++++++++- .../io/spine/tools/code/manifest/KManifestTest.kt | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index fd72e93c..7f83219a 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import io.spine.internal.gradle.publish.SpinePublishing import java.nio.file.Files.createDirectories import java.nio.file.Files.createFile import java.text.SimpleDateFormat @@ -60,6 +61,17 @@ fun buildJdk(): String = fun buildOs(): String = "${prop("os.name")} ${prop("os.arch")} ${prop("os.version")}" +/** The publishing settings from the root project. */ +val spinePublishing = rootProject.the() +val artifactPrefix = spinePublishing.artifactPrefix + +/** + * Obtains the imlementation title for the project using project group, + * artifact prefix from [SpinePublishing], and the name of the project to which + * this script plugin is applied. + */ +fun implementationTitle() = "${project.group}:$artifactPrefix${project.name}" + /** * The name of the manifest attribute holding the timestamp of the build. */ @@ -77,7 +89,7 @@ val manifestAttributes = mapOf( "Created-By" to "Gradle ${gradle.gradleVersion}", "Build-Jdk" to buildJdk(), "Build-OS" to buildOs(), - IMPLEMENTATION_TITLE.toString() to "${project.group}:${project.name}", + IMPLEMENTATION_TITLE.toString() to implementationTitle(), IMPLEMENTATION_VERSION.toString() to project.version, IMPLEMENTATION_VENDOR.toString() to "TeamDev" ) diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index 60371b62..1ae7703c 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -45,7 +45,7 @@ class `'KManifest' should` { + visibleManifests ) .that(manifest.implementationTitle) - .isEqualTo("io.spine.tools:tool-base") + .isEqualTo("io.spine.tools:spine-tool-base") assertThat(manifest.implementationVersion) .isNotEmpty() From 481b609485bd7fcd0fa2da9264df927b693debee Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 01:22:00 +0300 Subject: [PATCH 88/98] Declare output property --- .../src/main/kotlin/write-manifest.gradle.kts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 7f83219a..3a317690 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -103,7 +103,11 @@ val manifestAttributes = mapOf( * form a circular dependency. */ val exposeManifestForTests by tasks.creating { - doLast { + + val outputFile = layout.buildDirectory.file("resources/main/META-INF/MANIFEST.MF") + outputs.file(outputFile) + + fun createManifest(): Manifest { val manifest = Manifest() // The manifest version attribute is crucial for writing. @@ -113,10 +117,11 @@ val exposeManifestForTests by tasks.creating { manifestAttributes.forEach { entry -> manifest.mainAttributes.putValue(entry.key, entry.value.toString()) } + return manifest + } - val fileProvider = - layout.buildDirectory.file("$buildDir/resources/main/META-INF/MANIFEST.MF") - val file = fileProvider.get().getAsFile() + fun writeManifest(manifest: Manifest) { + val file = outputFile.get().getAsFile() createDirectories(file.toPath().parent) if (!file.exists()) { createFile(file.toPath()) @@ -126,6 +131,11 @@ val exposeManifestForTests by tasks.creating { manifest.write(stream) } } + + doLast { + val manifest = createManifest() + writeManifest(manifest) + } } tasks.processResources { @@ -151,3 +161,4 @@ normalization { } } } + From d0a343871a74dbddecea2e6f23d223a584837c76 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 01:33:45 +0300 Subject: [PATCH 89/98] Name the output property --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 3a317690..7735660b 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -34,6 +34,7 @@ import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR import java.util.jar.Attributes.Name.MANIFEST_VERSION +import org.jetbrains.kotlin.gradle.internal.Kapt3GradleSubplugin.Companion.isIncludeCompileClasspath plugins { java @@ -105,7 +106,7 @@ val manifestAttributes = mapOf( val exposeManifestForTests by tasks.creating { val outputFile = layout.buildDirectory.file("resources/main/META-INF/MANIFEST.MF") - outputs.file(outputFile) + outputs.file(outputFile).withPropertyName("manifestFile") fun createManifest(): Manifest { val manifest = Manifest() From 28b0401f836d25606e4b298ead4af3354c9b6976 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 01:37:31 +0300 Subject: [PATCH 90/98] Extract variable --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 7735660b..ae08cf7f 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -123,9 +123,10 @@ val exposeManifestForTests by tasks.creating { fun writeManifest(manifest: Manifest) { val file = outputFile.get().getAsFile() - createDirectories(file.toPath().parent) + val path = file.toPath() + createDirectories(path.parent) if (!file.exists()) { - createFile(file.toPath()) + createFile(path) } val stream = file.outputStream() stream.use { @@ -162,4 +163,3 @@ normalization { } } } - From 0de87f63e6860bcf05683384a6fb3a7d61c195f4 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 01:38:24 +0300 Subject: [PATCH 91/98] Optimise imports --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index ae08cf7f..38c3c566 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -29,12 +29,11 @@ import java.nio.file.Files.createDirectories import java.nio.file.Files.createFile import java.text.SimpleDateFormat import java.util.* -import java.util.jar.Manifest -import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.IMPLEMENTATION_TITLE import java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR +import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION import java.util.jar.Attributes.Name.MANIFEST_VERSION -import org.jetbrains.kotlin.gradle.internal.Kapt3GradleSubplugin.Companion.isIncludeCompileClasspath +import java.util.jar.Manifest plugins { java From 5b082e0cf04b77cf38517d71898dd9dbc6066a0c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 19:12:54 +0300 Subject: [PATCH 92/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index db1e34bb..ea3dd30e 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu May 05 23:33:02 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 47d48cc157206486f0fe28f71865651666910651 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 19:18:16 +0300 Subject: [PATCH 93/98] Update config --- buildSrc/build.gradle.kts | 2 +- .../io/spine/internal/dependency/Jackson.kt | 8 +- .../internal/gradle/kotlin/KotlinConfig.kt | 9 +- .../gradle/report/pom/DependencyWriter.kt | 73 ++++++++++++--- .../gradle/report/pom/ModuleDependency.kt | 92 +++++++++++++++++++ config | 2 +- license-report.md | 6 +- 7 files changed, 172 insertions(+), 20 deletions(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ModuleDependency.kt diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2ab5e27d..16466b40 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -104,8 +104,8 @@ val dokkaVersion = "1.6.20" configurations.all { resolutionStrategy { + // Force Kotlin lib versions avoiding using those bundled with Gradle. force( - // 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", diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt index 71f7e08c..1c92848f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt @@ -28,8 +28,8 @@ package io.spine.internal.dependency @Suppress("unused") object Jackson { - private const val version = "2.13.2" - private const val databindVersion = "2.13.2.2" + const val version = "2.13.2" + const val databindVersion = "2.13.2.2" // https://github.com/FasterXML/jackson-core const val core = "com.fasterxml.jackson.core:jackson-core:${version}" // https://github.com/FasterXML/jackson-databind @@ -40,4 +40,8 @@ object Jackson { const val dataformatYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${version}" // https://github.com/FasterXML/jackson-module-kotlin/releases const val moduleKotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:${version}" + // https://github.com/FasterXML/jackson-bom + const val bom = "com.fasterxml.jackson:jackson-bom:${version}" + // https://github.com/FasterXML/jackson-annotations + const val annotations = "com.fasterxml.jackson.core:jackson-annotations:${version}" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt index 89dfb7e4..863ea462 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt @@ -58,8 +58,13 @@ fun KotlinCompile.setFreeCompilerArgs() { freeCompilerArgs = listOf( "-Xskip-prerelease-check", "-Xjvm-default=all", - "-opt-in=kotlin.contracts.ExperimentalContracts", - "-opt-in=kotlin.ExperimentalStdlibApi" + "-Xinline-classes", + "-opt-in=" + + "kotlin.contracts.ExperimentalContracts," + + "kotlin.io.path.ExperimentalPathApi," + + "kotlin.ExperimentalUnsignedTypes," + + "kotlin.ExperimentalStdlibApi," + + "kotlin.experimental.ExperimentalTypeInference", ) } } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt index 8772219a..49326e95 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/DependencyWriter.kt @@ -38,7 +38,8 @@ import org.gradle.kotlin.dsl.withGroovyBuilder /** * Writes the dependencies of a Gradle project in a `pom.xml` format. * - * Includes the dependencies of the subprojects. Does not include the transitive dependencies. + * Includes the dependencies of the subprojects. Does not include + * the transitive dependencies. * * ``` * @@ -51,6 +52,9 @@ import org.gradle.kotlin.dsl.withGroovyBuilder * * ``` * + * When there are several versions of the same dependency, only the one with + * the newest version is retained. + * * @see PomGenerator */ internal class DependencyWriter @@ -96,32 +100,35 @@ private constructor( * Returns the [scoped dependencies][ScopedDependency] of a Gradle project. */ fun Project.dependencies(): SortedSet { - val dependencies = mutableSetOf() + val dependencies = mutableSetOf() dependencies.addAll(this.depsFromAllConfigurations()) this.subprojects.forEach { subproject -> val subprojectDeps = subproject.depsFromAllConfigurations() dependencies.addAll(subprojectDeps) } - return dependencies.toSortedSet() + + val result = deduplicate(dependencies) + .map { it.scoped } + .toSortedSet() + return result } /** - * Returns the scoped dependencies of the project from all the project configurations. + * Returns the external dependencies of the project from all the project configurations. */ -private fun Project.depsFromAllConfigurations(): Set { - val result = mutableSetOf() +private fun Project.depsFromAllConfigurations(): Set { + val result = mutableSetOf() this.configurations.forEach { configuration -> if (configuration.isCanBeResolved) { // Force resolution of the configuration. configuration.resolvedConfiguration } - configuration.dependencies.forEach { - if (it.isExternal()) { - val dependency = ScopedDependency.of(it, configuration) - result.add(dependency) + configuration.dependencies.filter { it.isExternal() } + .forEach { dependency -> + val moduleDependency = ModuleDependency(project, configuration, dependency) + result.add(moduleDependency) } - } } return result } @@ -132,3 +139,47 @@ private fun Project.depsFromAllConfigurations(): Set { private fun Dependency.isExternal(): Boolean { return this.javaClass.kotlin.isSubclassOf(AbstractExternalModuleDependency::class) } + +/** + * Filters out duplicated dependencies by group and name. + * + * When there are several versions of the same dependency, the method will retain only + * the one with the newest version. + * + * Sometimes, a project uses several versions of the same dependency. This may happen + * when different modules of the project use different versions of the same dependency. + * But for our `pom.xml`, which has clearly representative character, a single version + * of a dependency is quite enough. + * + * The rejected duplicates are logged. + */ +private fun Project.deduplicate(dependencies: Set): List { + val groups = dependencies.distinctBy { it.gav } + .groupBy { it.run { "$group:$name" } } + + logDuplicates(groups) + + val filtered = groups.map { group -> + group.value.maxByOrNull { dep -> dep.version!! }!! + } + return filtered +} + +private fun Project.logDuplicates(dependencies: Map>) { + dependencies.filter { it.value.size > 1 } + .forEach { (dependency, versions) -> logDuplicate(dependency, versions) } +} + +private fun Project.logDuplicate(dependency: String, versions: List) { + logger.lifecycle("") + logger.lifecycle("The project uses several versions of `$dependency` dependency.") + + versions.forEach { + logger.lifecycle( + "module: {}, configuration: {}, version: {}", + it.module.name, + it.configuration.name, + it.version + ) + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ModuleDependency.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ModuleDependency.kt new file mode 100644 index 00000000..5a070837 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/report/pom/ModuleDependency.kt @@ -0,0 +1,92 @@ +/* + * 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.report.pom + +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.Dependency + +/** + * A module's dependency. + * + * Contains information about a module and configuration, from which + * the dependency comes. + */ +internal class ModuleDependency( + val module: Project, + val configuration: Configuration, + private val dependency: Dependency, + +) : Dependency by dependency, Comparable { + + companion object { + private val COMPARATOR = compareBy { it.module } + .thenBy { it.configuration.name } + .thenBy { it.group } + .thenBy { it.name } + .thenBy { it.version } + } + + /** + * A project dependency with its [scope][DependencyScope]. + * + * Doesn't contain any info about an origin module and configuration. + */ + val scoped = ScopedDependency.of(dependency, 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 + * configurations are getting resolved. This is why this property is calculated. + */ + val gav: String + get() = "$group:$name:$version" + + override fun compareTo(other: ModuleDependency): Int = COMPARATOR.compare(this, other) + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as ModuleDependency + + if (module != other.module) return false + if (configuration != other.configuration) return false + if (dependency != other.dependency) return false + + return true + } + + override fun hashCode(): Int { + var result = module.hashCode() + result = 31 * result + configuration.hashCode() + result = 31 * result + dependency.hashCode() + return result + } +} diff --git a/config b/config index 24f043a1..cebfd51c 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 24f043a14c41825645ebab94fcde97a01c444e69 +Subproject commit cebfd51c94121ff35699d17d7dc2e29dc87b7879 diff --git a/license-report.md b/license-report.md index ea3dd30e..6635f173 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:12:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 93f8397283d83f6969b9d864bebdd3bc9cbd8fb7 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 19:25:29 +0300 Subject: [PATCH 94/98] Improve documentation --- .../main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt index 0dff3f9e..46102cbb 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/MavenArtifact.kt @@ -27,7 +27,7 @@ package io.spine.tools.code.manifest /** - * A dependency on a software artifact. + * A dependency on a software artifact stored in a Maven repository. */ public data class MavenArtifact(val coordinates: String) : Dependency { From 993d01ad478eb5e1578201b52c739c97f5712abb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 20:00:44 +0300 Subject: [PATCH 95/98] Avoid redundant inheritance Also: * Test string form. --- .../io/spine/tools/code/manifest/KManifest.kt | 2 +- .../tools/code/manifest/KManifestTest.kt | 21 ++++++ .../tools/code/manifest/KManifestWriter.kt | 68 ------------------- 3 files changed, 22 insertions(+), 69 deletions(-) delete mode 100644 tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt diff --git a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt index 8ae3ab40..e6ac68e7 100644 --- a/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt +++ b/tool-base/src/main/kotlin/io/spine/tools/code/manifest/KManifest.kt @@ -45,7 +45,7 @@ import kotlin.text.Charsets.UTF_8 * Provides convenience access to standard and custom attributes of a JAR [Manifest] * used by the tools of the framework. */ -public open class KManifest(protected val impl: Manifest) { +public class KManifest(public val impl: Manifest) { public companion object { diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt index 1ae7703c..79dd0cbd 100644 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt +++ b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestTest.kt @@ -28,7 +28,12 @@ package io.spine.tools.code.manifest import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage +import java.nio.file.Files.createFile +import java.nio.file.Path +import kotlin.io.path.outputStream +import kotlin.io.path.readText import org.junit.jupiter.api.Test +import org.junit.jupiter.api.io.TempDir class `'KManifest' should` { @@ -50,4 +55,20 @@ class `'KManifest' should` { assertThat(manifest.implementationVersion) .isNotEmpty() } + + @Test + fun `print its content to string as if it were a resource file`(@TempDir tmpDir: Path) { + val cls = KManifest::class.java + val manifest = KManifest.load(cls) + + val tmpFile = tmpDir.resolve("MANIFEST.MF") + createFile(tmpFile) + val stream = tmpFile.outputStream() + stream.use { + manifest.impl.write(it) + } + + assertThat(manifest.toString()) + .isEqualTo(tmpFile.readText()) + } } diff --git a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt b/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt deleted file mode 100644 index 9f93c6dc..00000000 --- a/tool-base/src/test/kotlin/io/spine/tools/code/manifest/KManifestWriter.kt +++ /dev/null @@ -1,68 +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.tools.code.manifest - -import java.io.OutputStream -import java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION -import java.util.jar.Attributes.Name.MANIFEST_VERSION -import java.util.jar.Manifest - -/** - * Allows to configure and write a manifest file. - */ -class KManifestWriter(impl: Manifest) : KManifest(impl) { - - /** - * Creates a new instance of the writer with an empty manifest. - */ - constructor() : this(Manifest()) - - init { - // The `Manifest-Version` version attribute must be initialized. - // Otherwise, `java.util.jar.Attributes.writeMain()` skips writing its content. - if (mainAttributes[MANIFEST_VERSION] == null) { - mainAttributes[MANIFEST_VERSION] = "1.0" - } - } - - /** - * Sets the [`Implementation-Version`][IMPLEMENTATION_VERSION] attribute of the manifest. - * - * @param value a non-empty version string - */ - fun implementationVersion(value: String) { - require(value.isNotEmpty()) - mainAttributes[IMPLEMENTATION_VERSION] = value - } - - /** - * Writes the manifest to the given stream. - */ - fun write(stream: OutputStream) { - impl.write(stream) - } -} From 246406806b642d242c18d0437fcf0ad0e688471c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 6 May 2022 20:00:51 +0300 Subject: [PATCH 96/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index 6635f173..24cd537e 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 19:16:09 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 7e06988777296365f59a5364d21f73afdfb1add1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 7 May 2022 11:48:01 +0300 Subject: [PATCH 97/98] Fix typos --- buildSrc/src/main/kotlin/write-manifest.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/write-manifest.gradle.kts b/buildSrc/src/main/kotlin/write-manifest.gradle.kts index 38c3c566..d406ec06 100644 --- a/buildSrc/src/main/kotlin/write-manifest.gradle.kts +++ b/buildSrc/src/main/kotlin/write-manifest.gradle.kts @@ -40,7 +40,7 @@ plugins { } /** - * Obtains a string value of a [Sysmtem] property with the given key. + * Obtains a string value of a [System] property with the given key. */ fun prop(key: String): String = System.getProperties()[key].toString() @@ -66,7 +66,7 @@ val spinePublishing = rootProject.the() val artifactPrefix = spinePublishing.artifactPrefix /** - * Obtains the imlementation title for the project using project group, + * Obtains the implementation title for the project using project group, * artifact prefix from [SpinePublishing], and the name of the project to which * this script plugin is applied. */ @@ -153,7 +153,7 @@ tasks.jar { * Makes Gradle ignore the [BUILD_TIMESTAMP] attribute during normalization. * * See [Java META-INF normalization](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:meta_inf_normalization) - * sectio of the Gradle documentation for details. + * section of the Gradle documentation for details. */ normalization { runtimeClasspath { From 1416a6ffef12f31d8bcd07233ca48bd79f6f8391 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 7 May 2022 11:48:10 +0300 Subject: [PATCH 98/98] Update build time --- license-report.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/license-report.md b/license-report.md index 24cd537e..7c5cb7ca 100644 --- a/license-report.md +++ b/license-report.md @@ -453,7 +453,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat May 07 11:47:36 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -963,7 +963,7 @@ This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sat May 07 11:47:37 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1389,4 +1389,4 @@ This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri May 06 20:00:42 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sat May 07 11:47:37 EEST 2022** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file