Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update descriptor set generation #66

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ buildscript {
@Suppress("DEPRECATION")
force(
io.spine.internal.dependency.Spine.base,
io.spine.internal.dependency.Spine.reflect,
io.spine.internal.dependency.Spine.Logging.floggerApi,
io.spine.internal.dependency.Validation.java,
io.spine.internal.dependency.Protobuf.GradlePlugin.lib,
Expand Down
83 changes: 44 additions & 39 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -169,49 +169,54 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
}

dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")

@Suppress(
"VulnerableLibrariesLocal", "RedundantSuppression" /*
`artifactregistry-auth-common` has transitive dependency on Gson and Apache `commons-codec`.

Gson from version `2.8.6` until `2.8.9` is vulnerable to Deserialization of Untrusted Data
(https://devhub.checkmarx.com/cve-details/CVE-2022-25647/).

Apache `commons-codec` before 1.13 is vulnerable to information exposure
(https://devhub.checkmarx.com/cve-details/Cxeb68d52e-5509/).

We use Gson `2.10.1`and we force it in `forceProductionDependencies()`.
We use `commons-code` with version `1.16.0`, forcing it in `forceProductionDependencies()`.
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
dependOnAuthCommon()

listOf(
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion",
"com.github.jk1:gradle-license-report:$licenseReportVersion",
"com.google.guava:guava:$guavaVersion",
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
"gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}",
"io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion",
"io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion",
// https://github.com/srikanth-lingala/zip4j
"net.lingala.zip4j:zip4j:2.10.0",
"net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}",
"org.ajoberstar.grgit:grgit-core:${grGitVersion}",
"org.jetbrains.dokka:dokka-base:${dokkaVersion}",
"org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}",
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
"org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion"
).forEach {
implementation(it)
}
}

So, we should be safe with the current version `artifactregistry-auth-common` until
we migrate to a later version. */
)
/**
* Includes the `implementation` dependency on `artifactregistry-auth-common`,
* with the version defined in [googleAuthToolVersion].
*
* `artifactregistry-auth-common` has transitive dependency on Gson and Apache `commons-codec`.
* Gson from version `2.8.6` until `2.8.9` is vulnerable to Deserialization of Untrusted Data
* (https://devhub.checkmarx.com/cve-details/CVE-2022-25647/).
*
* Apache `commons-codec` before 1.13 is vulnerable to information exposure
* (https://devhub.checkmarx.com/cve-details/Cxeb68d52e-5509/).
*
* We use Gson `2.10.1` and we force it in `forceProductionDependencies()`.
* We use `commons-code` with version `1.16.0`, forcing it in `forceProductionDependencies()`.
*
* So, we should be safe with the current version `artifactregistry-auth-common` until
* we migrate to a later version.
*/
fun DependencyHandlerScope.dependOnAuthCommon() {
@Suppress("VulnerableLibrariesLocal", "RedundantSuppression")
implementation(
"com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion"
) {
exclude(group = "com.google.guava")
}

implementation("com.google.guava:guava:$guavaVersion")
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}")

// 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("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion")
implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}")
implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}")
implementation("gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}")

// https://github.com/srikanth-lingala/zip4j
implementation("net.lingala.zip4j:zip4j:2.10.0")

implementation("io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion")
implementation("org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ package io.spine.internal.dependency
* Make sure to add the `intellijReleases` and `jetBrainsCacheRedirector`
* repositories to your project. See `kotlin/Repositories.kt` for details.
*/
@Suppress("unused")
object IntelliJ {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ 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.9.20"
@Suppress("MemberVisibilityCanBePrivate") // used directly from the outside.
const val version = "1.9.22"

/**
* The version of the JetBrains annotations library, which is a transitive
Expand Down
41 changes: 41 additions & 0 deletions buildSrc/src/main/kotlin/io/spine/internal/dependency/KotlinX.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2023, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.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

@Suppress("unused", "ConstPropertyName")
object KotlinX {

const val group = "org.jetbrains.kotlinx"

object Coroutines {

// https://github.com/Kotlin/kotlinx.coroutines
const val version = "1.7.3"
const val core = "$group:kotlinx-coroutines-core:$version"
const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version"
}
}
34 changes: 27 additions & 7 deletions buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package io.spine.internal.dependency
/**
* Dependencies on ProtoData modules.
*
* In order to use locally published ProtoData version instead of the version from a public plugin
* To use a locally published ProtoData version instead of the version from a public plugin
* registry, set the `PROTODATA_VERSION` and/or the `PROTODATA_DF_VERSION` environment variables
* and stop the Gradle daemons so that Gradle observes the env change:
* ```
Expand All @@ -40,7 +40,7 @@ package io.spine.internal.dependency
* ./gradle build # Conduct the intended checks.
* ```
*
* Then, in order to reset the console to run the usual versions again, remove the values of
* Then, to reset the console to run the usual versions again, remove the values of
* the environment variables and stop the daemon:
* ```
* export PROTODATA_VERSION=""
Expand All @@ -65,7 +65,7 @@ object ProtoData {
* The version of ProtoData dependencies.
*/
val version: String
private const val fallbackVersion = "0.14.2"
private const val fallbackVersion = "0.16.0"

/**
* The distinct version of ProtoData used by other build tools.
Expand All @@ -74,19 +74,39 @@ object ProtoData {
* transitional dependencies, this is the version used to build the project itself.
*/
val dogfoodingVersion: String
private const val fallbackDfVersion = "0.14.2"
private const val fallbackDfVersion = "0.16.0"

/**
* The artifact for the ProtoData Gradle plugin.
*/
val pluginLib: String

fun pluginLib(version: String): String =
"$group:gradle-plugin:$version"

fun api(version: String): String =
"$group:protodata-api:$version"

val api
get() = "$group:protodata-api:$version"
get() = api(version)

val compiler
get() = "$group:protodata-compiler:$version"

val gradleApi
get() = "$group:protodata-gradle-api:$version"

val cliApi
get() = "$group:protodata-cli-api:$version"

fun codegenJava(version: String): String =
"$group:protodata-codegen-java:$version"

val codegenJava
get() = "$group:protodata-codegen-java:$version"
get() = codegenJava(version)

val fatCli
get() = "$group:protodata-fat-cli:$version"

/**
* An env variable storing a custom [version].
Expand All @@ -113,7 +133,7 @@ object ProtoData {
version = experimentVersion ?: fallbackVersion
dogfoodingVersion = experimentDfVersion ?: fallbackDfVersion

pluginLib = "${group}:gradle-plugin:$version"
pluginLib = pluginLib(version)
println("""

❗ Running an experiment with ProtoData. ❗
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package io.spine.internal.dependency
)
object Protobuf {
private const val group = "com.google.protobuf"
const val version = "3.25.0"
const val version = "3.25.1"
/**
* The Java library containing proto definitions of Google Protobuf.
*/
Expand Down
14 changes: 7 additions & 7 deletions buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/base">spine-base</a>
*/
const val base = "2.0.0-SNAPSHOT.192"
const val base = "2.0.0-SNAPSHOT.195"

/**
* The version of [Spine.reflect].
*
* @see <a href="https://github.com/SpineEventEngine/reflect">spine-reflect</a>
*/
const val reflect = "2.0.0-SNAPSHOT.182"
const val reflect = "2.0.0-SNAPSHOT.183"

/**
* The version of [Spine.logging].
Expand All @@ -75,7 +75,7 @@ object Spine {
* @see [Spine.CoreJava.server]
* @see <a href="https://github.com/SpineEventEngine/core-java">core-java</a>
*/
const val core = "2.0.0-SNAPSHOT.173"
const val core = "2.0.0-SNAPSHOT.175"

/**
* The version of [Spine.modelCompiler].
Expand All @@ -89,14 +89,14 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/mc-java">spine-mc-java</a>
*/
const val mcJava = "2.0.0-SNAPSHOT.172"
const val mcJava = "2.0.0-SNAPSHOT.175"

/**
* The version of [Spine.baseTypes].
*
* @see <a href="https://github.com/SpineEventEngine/base-types">spine-base-types</a>
*/
const val baseTypes = "2.0.0-SNAPSHOT.125"
const val baseTypes = "2.0.0-SNAPSHOT.126"

/**
* The version of [Spine.time].
Expand All @@ -117,14 +117,14 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/text">spine-text</a>
*/
const val text = "2.0.0-SNAPSHOT.5"
const val text = "2.0.0-SNAPSHOT.6"

/**
* The version of [Spine.toolBase].
*
* @see <a href="https://github.com/SpineEventEngine/tool-base">spine-tool-base</a>
*/
const val toolBase = "2.0.0-SNAPSHOT.186"
const val toolBase = "2.0.0-SNAPSHOT.191"

/**
* The version of [Spine.javadocTools].
Expand Down
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import org.gradle.kotlin.dsl.ScriptHandlerScope
import org.gradle.kotlin.dsl.maven

/**
* Applies [standard][doApplyStandard] repositories to this [ScriptHandlerScope]
Expand Down Expand Up @@ -214,6 +215,12 @@ fun RepositoryHandler.spineArtifacts(): MavenArtifactRepository = maven {
}
}

val RepositoryHandler.intellijReleases: MavenArtifactRepository
get() = maven("https://www.jetbrains.com/intellij-repository/releases")

val RepositoryHandler.jetBrainsCacheRedirector: MavenArtifactRepository
get() = maven("https://cache-redirector.jetbrains.com/intellij-dependencies")

/**
* Applies repositories commonly used by Spine Event Engine projects.
*/
Expand All @@ -236,6 +243,9 @@ fun RepositoryHandler.standardToSpineSdk() {
}
}

intellijReleases
jetBrainsCacheRedirector

maven {
url = URI(Repos.sonatypeSnapshots)
}
Expand Down
Loading
Loading