Skip to content

Commit feb4647

Browse files
Update config
1 parent a24f337 commit feb4647

31 files changed

+476
-5377
lines changed

.github/workflows/ensure-reports-updated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
# Check out the `config` submodule to fetch the required script file.
2121
submodules: true
2222

23-
- name: Check that `pom.xml` and `license-report.md` are modified
23+
- name: Check that both `pom.xml` and license report files are modified
2424
shell: bash
2525
run: chmod +x ./config/scripts/ensure-reports-updated.sh && ./config/scripts/ensure-reports-updated.sh

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ buildscript {
6969
spine.base,
7070
spine.toolBase,
7171
spine.server,
72+
spine.reflect,
7273
io.spine.internal.dependency.Spine.Logging.lib,
7374
io.spine.internal.dependency.Spine.Logging.middleware,
7475
io.spine.internal.dependency.Spine.Logging.floggerApi,
@@ -352,6 +353,7 @@ fun Subproject.forceConfigurations() {
352353
Spine.Logging.floggerApi,
353354
Spine.baseTypes,
354355
Spine.change,
356+
Spine.reflect,
355357
Spine.testlib,
356358
Spine.toolBase,
357359
Spine.pluginBase,

buildSrc/build.gradle.kts

Lines changed: 75 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -133,6 +133,15 @@ val kotestJvmPluginVersion = "0.4.10"
133133
*/
134134
val koverVersion = "0.7.2"
135135

136+
/**
137+
* The version of the Shadow Plugin.
138+
*
139+
* `7.1.2` is the last version compatible with Gradle 7.x. Newer versions require Gradle v8.x.
140+
*
141+
* @see <a href="https://github.com/johnrengelman/shadow/releases">Shadow Plugin releases</a>
142+
*/
143+
val shadowVersion = "7.1.2"
144+
136145
configurations.all {
137146
resolutionStrategy {
138147
force(
@@ -160,30 +169,74 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
160169
}
161170

162171
dependencies {
163-
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
164-
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
172+
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
173+
dependOnAuthCommon()
174+
175+
listOf(
176+
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
177+
"com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion",
178+
"com.github.jk1:gradle-license-report:$licenseReportVersion",
179+
"com.google.guava:guava:$guavaVersion",
180+
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
181+
"gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}",
182+
"io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion",
183+
"io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion",
184+
// https://github.com/srikanth-lingala/zip4j
185+
"net.lingala.zip4j:zip4j:2.10.0",
186+
"net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}",
187+
"org.ajoberstar.grgit:grgit-core:${grGitVersion}",
188+
"org.jetbrains.dokka:dokka-base:${dokkaVersion}",
189+
"org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}",
190+
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
191+
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
192+
"org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion"
193+
).forEach {
194+
implementation(it)
195+
}
196+
}
197+
198+
dependOnBuildSrcJar()
199+
200+
/**
201+
* Adds a dependency on a `buildSrc.jar`, iff:
202+
* 1) the `src` folder is missing, and
203+
* 2) `buildSrc.jar` is present in `buildSrc/` folder instead.
204+
*
205+
* This approach is used in the scope of integration testing.
206+
*/
207+
fun Project.dependOnBuildSrcJar() {
208+
val srcFolder = this.rootDir.resolve("src")
209+
val buildSrcJar = rootDir.resolve("buildSrc.jar")
210+
if (!srcFolder.exists() && buildSrcJar.exists()) {
211+
logger.info("Adding the pre-compiled 'buildSrc.jar' to 'implementation' dependencies.")
212+
dependencies {
213+
implementation(files("buildSrc.jar"))
214+
}
215+
}
216+
}
217+
218+
/**
219+
* Includes the `implementation` dependency on `artifactregistry-auth-common`,
220+
* with the version defined in [googleAuthToolVersion].
221+
*
222+
* `artifactregistry-auth-common` has transitive dependency on Gson and Apache `commons-codec`.
223+
* Gson from version `2.8.6` until `2.8.9` is vulnerable to Deserialization of Untrusted Data
224+
* (https://devhub.checkmarx.com/cve-details/CVE-2022-25647/).
225+
*
226+
* Apache `commons-codec` before 1.13 is vulnerable to information exposure
227+
* (https://devhub.checkmarx.com/cve-details/Cxeb68d52e-5509/).
228+
*
229+
* We use Gson `2.10.1` and we force it in `forceProductionDependencies()`.
230+
* We use `commons-code` with version `1.16.0`, forcing it in `forceProductionDependencies()`.
231+
*
232+
* So, we should be safe with the current version `artifactregistry-auth-common` until
233+
* we migrate to a later version.
234+
*/
235+
fun DependencyHandlerScope.dependOnAuthCommon() {
236+
@Suppress("VulnerableLibrariesLocal", "RedundantSuppression")
165237
implementation(
166238
"com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion"
167239
) {
168240
exclude(group = "com.google.guava")
169241
}
170-
implementation("com.google.guava:guava:$guavaVersion")
171-
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
172-
implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}")
173-
implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}")
174-
175-
// Add explicit dependency to avoid warning on different Kotlin runtime versions.
176-
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
177-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
178-
179-
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion")
180-
implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion")
181-
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}")
182-
implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}")
183-
184-
// https://github.com/srikanth-lingala/zip4j
185-
implementation("net.lingala.zip4j:zip4j:2.10.0")
186-
187-
implementation("io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion")
188-
implementation("org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion")
189242
}

buildSrc/src/main/kotlin/DependencyResolution.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ import io.spine.internal.dependency.AutoService
3131
import io.spine.internal.dependency.AutoValue
3232
import io.spine.internal.dependency.CheckerFramework
3333
import io.spine.internal.dependency.CommonsCli
34+
import io.spine.internal.dependency.CommonsCodec
3435
import io.spine.internal.dependency.CommonsLogging
3536
import io.spine.internal.dependency.Dokka
3637
import io.spine.internal.dependency.ErrorProne
3738
import io.spine.internal.dependency.FindBugs
39+
import io.spine.internal.dependency.Grpc
3840
import io.spine.internal.dependency.Gson
3941
import io.spine.internal.dependency.Guava
4042
import io.spine.internal.dependency.Hamcrest
@@ -79,7 +81,7 @@ fun NamedDomainObjectContainer<Configuration>.forceVersions() {
7981
}
8082

8183
private fun ResolutionStrategy.forceProductionDependencies() {
82-
@Suppress("DEPRECATION") // Force SLF4J version.
84+
@Suppress("DEPRECATION") // Force versions of SLF4J and Kotlin libs.
8385
force(
8486
AnimalSniffer.lib,
8587
AutoCommon.lib,
@@ -89,10 +91,13 @@ private fun ResolutionStrategy.forceProductionDependencies() {
8991
ErrorProne.annotations,
9092
ErrorProne.core,
9193
FindBugs.annotations,
94+
Gson.lib,
9295
Guava.lib,
96+
Grpc.api,
9397
Kotlin.reflect,
9498
Kotlin.stdLib,
9599
Kotlin.stdLibCommon,
100+
Kotlin.stdLibJdk7,
96101
Kotlin.stdLibJdk8,
97102
Protobuf.GradlePlugin.lib,
98103
Protobuf.libs,
@@ -121,6 +126,7 @@ private fun ResolutionStrategy.forceTransitiveDependencies() {
121126
Asm.lib,
122127
AutoValue.annotations,
123128
CommonsCli.lib,
129+
CommonsCodec.lib,
124130
CommonsLogging.lib,
125131
Gson.lib,
126132
Hamcrest.core,

buildSrc/src/main/kotlin/DokkaExts.kt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -182,3 +182,21 @@ fun Project.dokkaJavaJar(): TaskProvider<Jar> = tasks.getOrCreate("dokkaJavaJar"
182182
this@getOrCreate.dependsOn(dokkaTask)
183183
}
184184
}
185+
186+
/**
187+
* Disables Dokka and Javadoc tasks in this `Project`.
188+
*
189+
* This function could be useful to improve build speed when building subprojects containing
190+
* test environments or integration test projects.
191+
*/
192+
@Suppress("unused")
193+
fun Project.disableDocumentationTasks() {
194+
gradle.taskGraph.whenReady {
195+
tasks.forEach { task ->
196+
val lowercaseName = task.name.toLowerCase()
197+
if (lowercaseName.contains("dokka") || lowercaseName.contains("javadoc")) {
198+
task.enabled = false
199+
}
200+
}
201+
}
202+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2024, TeamDev. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Redistribution and use in source and/or binary forms, with or without
11+
* modification, must retain the above copyright notice and the following
12+
* disclaimer.
13+
*
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
27+
package io.spine.internal.dependency
28+
29+
/**
30+
* Kotlin Coroutines.
31+
*
32+
* @see <a href="https://github.com/Kotlin/kotlinx.coroutines">GitHub projecet</a>
33+
*/
34+
@Suppress("unused")
35+
object Coroutines {
36+
const val version = "1.6.4"
37+
const val jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$version"
38+
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
39+
const val bom = "org.jetbrains.kotlinx:kotlinx-coroutines-bom:$version"
40+
const val coreJvm = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$version"
41+
}

buildSrc/src/main/kotlin/io/spine/internal/dependency/ErrorProne.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ object ErrorProne {
4848
const val id = "net.ltgt.errorprone"
4949
/**
5050
* The version of this plugin is already specified in `buildSrc/build.gradle.kts` file.
51-
* Thus, when applying the plugin in projects build files, only the [id] should be used.
51+
* Thus, when applying the plugin to projects build files, only the [id] should be used.
5252
*
53-
* When the plugin is used as a library (e.g. in tools), its version and the library
53+
* When the plugin is used as a library (e.g., in tools), its version and the library
5454
* artifacts are of importance.
5555
*/
5656
const val version = "3.1.0"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2024, TeamDev. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Redistribution and use in source and/or binary forms, with or without
11+
* modification, must retain the above copyright notice and the following
12+
* disclaimer.
13+
*
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
27+
package io.spine.internal.dependency
28+
29+
/**
30+
* gRPC-Kotlin/JVM.
31+
*
32+
* @see <a href="https://github.com/grpc/grpc-kotlin">GitHub project</a>
33+
*/
34+
@Suppress("unused")
35+
object GrpcKotlin {
36+
const val version = "1.3.0"
37+
const val stub = "io.grpc:grpc-kotlin-stub:$version"
38+
39+
object ProtocPlugin {
40+
const val id = "grpckt"
41+
const val artifact = "io.grpc:protoc-gen-grpc-kotlin:$version:jdk8@jar"
42+
}
43+
}

0 commit comments

Comments
 (0)