Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yevsyukov committed Oct 5, 2023
1 parent 746c3ef commit 96e2b42
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 15 deletions.
104 changes: 97 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,17 +29,107 @@ 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
* registry, set the `PROTODATA_VERSION` and/or the `PROTODATA_DF_VERSION` environment variables
* and stop the Gradle daemons so that Gradle observes the env change:
* ```
* export PROTODATA_VERSION=0.43.0-local
* export PROTODATA_DF_VERSION=0.41.0
*
* ./gradle --stop
* ./gradle build # Conduct the intended checks.
* ```
*
* Then, in order to reset the console to run the usual versions again, remove the values of
* the environment variables and stop the daemon:
* ```
* export PROTODATA_VERSION=""
* export PROTODATA_DF_VERSION=""
*
* ./gradle --stop
* ```
*
* See [`SpineEventEngine/ProtoData`](https://github.com/SpineEventEngine/ProtoData/).
*/
@Suppress("unused", "ConstPropertyName")
@Suppress(
"unused" /* Some subprojects do not use ProtoData directly. */,
"ConstPropertyName" /* We use custom convention for artifact properties. */,
"MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */,
"KDocUnresolvedReference" /* Referencing private properties in constructor KDoc. */
)
object ProtoData {
const val version = "0.11.4"
const val dogfoodingVersion = "0.11.0"
const val group = "io.spine.protodata"
const val compiler = "$group:protodata-compiler:$version"
const val pluginId = "io.spine.protodata"

const val codegenJava = "io.spine.protodata:protodata-codegen-java:$version"
/**
* The version of ProtoData dependencies.
*/
val version: String
private const val fallbackVersion = "0.12.0"

const val pluginId = "io.spine.protodata"
const val pluginLib = "${Spine.group}:protodata:$version"
/**
* The distinct version of ProtoData used by other build tools.
*
* When ProtoData is used both for building the project and as a part of the Project's
* transitional dependencies, this is the version used to build the project itself.
*/
val dogfoodingVersion: String
private const val fallbackDfVersion = "0.9.11"

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

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

/**
* An env variable storing a custom [version].
*/
private const val VERSION_ENV = "PROTODATA_VERSION"

/**
* An env variable storing a custom [dogfoodingVersion].
*/
private const val DF_VERSION_ENV = "PROTODATA_DF_VERSION"

/**
* Sets up the versions and artifacts for the build to use.
*
* If either [VERSION_ENV] or [DF_VERSION_ENV] is set, those versions are used instead of
* the hardcoded ones. Also, in this mode, the [pluginLib] coordinates are changed so that
* it points at a locally published artifact. Otherwise, it points at an artifact that would be
* published to a public plugin registry.
*/
init {
val experimentVersion = System.getenv(VERSION_ENV)
val experimentDfVersion = System.getenv(DF_VERSION_ENV)
if (experimentVersion?.isNotBlank() == true || experimentDfVersion?.isNotBlank() == true) {
version = experimentVersion ?: fallbackVersion
dogfoodingVersion = experimentDfVersion ?: fallbackDfVersion

pluginLib = "${group}:gradle-plugin:$version"
println("""
❗ Running an experiment with ProtoData. ❗
-----------------------------------------
Regular version = v$version
Dogfooding version = v$dogfoodingVersion
ProtoData Gradle plugin can now be loaded from Maven Local.
To reset the versions, erase the `$$VERSION_ENV` and `$$DF_VERSION_ENV` environment variables.
""".trimIndent())
} else {
version = fallbackVersion
dogfoodingVersion = fallbackDfVersion
pluginLib = "${Spine.group}:protodata:$version"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ package io.spine.internal.dependency
@Suppress("unused", "ConstPropertyName")
object Roaster {

/**
* This is the last version build with Java 11.
*
* Starting from version
* [2.29.0.Final](https://github.com/forge/roaster/releases/tag/2.29.0.Final),
* Roaster requires Java 17.
*/
private const val version = "2.28.0.Final"

const val api = "org.jboss.forge.roaster:roaster-api:${version}"
Expand Down
22 changes: 17 additions & 5 deletions buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/logging">spine-logging</a>
*/
const val logging = "2.0.0-SNAPSHOT.210"
const val logging = "2.0.0-SNAPSHOT.226"

/**
* The version of [Spine.testlib].
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.157"
const val core = "2.0.0-SNAPSHOT.159"

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

/**
* The version of [Spine.baseTypes].
Expand All @@ -103,7 +103,7 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/time">spine-time</a>
*/
const val time = "2.0.0-SNAPSHOT.133"
const val time = "2.0.0-SNAPSHOT.134"

/**
* The version of [Spine.change].
Expand All @@ -124,7 +124,7 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/tool-base">spine-tool-base</a>
*/
const val toolBase = "2.0.0-SNAPSHOT.183"
const val toolBase = "2.0.0-SNAPSHOT.186"

/**
* The version of [Spine.javadocTools].
Expand Down Expand Up @@ -165,8 +165,20 @@ object Spine {
const val version = ArtifactVersion.logging
const val lib = "$group:spine-logging:$version"
const val backend = "$group:spine-logging-backend:$version"
const val log4j2Backend = "$group:spine-logging-log4j2-backend:$version"
const val context = "$group:spine-logging-context:$version"
const val grpcContext = "$group:spine-logging-grpc-context:$version"

@Deprecated(
message = "Please use `Logging.lib` instead.",
replaceWith = ReplaceWith("lib")
)
const val floggerApi = "$group:spine-flogger-api:$version"

@Deprecated(
message = "Please use `grpcContext` instead.",
replaceWith = ReplaceWith("grpcContext")
)
const val floggerGrpcContext = "$group:spine-flogger-grpc-context:$version"
const val smokeTest = "$group:spine-logging-smoke-test:$version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package io.spine.internal.dependency
*/
@Suppress("unused", "ConstPropertyName")
object Validation {
const val version = "2.0.0-SNAPSHOT.103"
const val version = "2.0.0-SNAPSHOT.104"
const val group = "io.spine.validation"
const val runtime = "$group:spine-validation-java-runtime:$version"
const val java = "$group:spine-validation-java:$version"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 96e2b42

Please sign in to comment.