Skip to content
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
1 change: 1 addition & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
implementation(Jackson.DataFormat.yaml)
runtimeOnly(moduleKotlin)
}
implementation(Base.environment)

arrayOf(Base.lib, Validation.runtime)
.forEach {
Expand Down
3 changes: 3 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.spine.dependency.lib.AutoService
import io.spine.dependency.lib.Jackson
import io.spine.dependency.lib.Jackson.DataFormat
import io.spine.dependency.local.Base
import io.spine.dependency.local.CoreJava
import io.spine.dependency.local.ToolBase
import io.spine.dependency.test.JUnit
Expand All @@ -46,7 +47,9 @@ dependencies {
api(CoreJava.server)
api(ToolBase.lib)
api(project(":api"))

implementation(project(":params"))?.because("We need the `PipelineParameters` type.")
implementation(Base.environment)

api(platform(Jackson.bom))
with(Jackson) {
Expand Down
16 changes: 9 additions & 7 deletions buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ package io.spine.dependency.local
*/
@Suppress("ConstPropertyName", "unused")
object Base {
const val version = "2.0.0-SNAPSHOT.382"
const val versionForBuildScript = "2.0.0-SNAPSHOT.382"
const val version = "2.0.0-SNAPSHOT.383"
const val versionForBuildScript = "2.0.0-SNAPSHOT.383"
const val group = Spine.group
const val artifact = "spine-base"
const val lib = "$group:$artifact:$version"
const val format = "$group:spine-format:$version"
const val libForBuildScript = "$group:$artifact:$versionForBuildScript"
const val annotations = "$group:spine-annotations:$version"
private const val prefix = "spine"
const val libModule = "$prefix-base"
const val lib = "$group:$libModule:$version"
const val libForBuildScript = "$group:$libModule:$versionForBuildScript"
const val annotations = "$group:$prefix-annotations:$version"
const val environment = "$group:$prefix-environment:$version"
const val format = "$group:$prefix-format:$version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ object Compiler {
* The version of the Compiler dependencies.
*/
val version: String
private const val fallbackVersion = "2.0.0-SNAPSHOT.030"
private const val fallbackVersion = "2.0.0-SNAPSHOT.035"

/**
* The distinct version of the Compiler used by other build tools.
Expand All @@ -79,7 +79,7 @@ object Compiler {
* transitive dependencies, this is the version used to build the project itself.
*/
val dogfoodingVersion: String
private const val fallbackDfVersion = "2.0.0-SNAPSHOT.030"
private const val fallbackDfVersion = "2.0.0-SNAPSHOT.035"

/**
* The artifact for the Compiler Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typealias CoreJava = CoreJvm
@Suppress("ConstPropertyName", "unused")
object CoreJvm {
const val group = Spine.group
const val version = "2.0.0-SNAPSHOT.356"
const val version = "2.0.0-SNAPSHOT.358"

const val coreArtifact = "spine-core"
const val clientArtifact = "spine-client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ object CoreJvmCompiler {
/**
* The version used to in the build classpath.
*/
const val dogfoodingVersion = "2.0.0-SNAPSHOT.034"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.040"

/**
* The version to be used for integration tests.
*/
const val version = "2.0.0-SNAPSHOT.034"
const val version = "2.0.0-SNAPSHOT.040"

/**
* The ID of the Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
package io.spine.dependency.local

/**
* Dependencies on smaller Spine modules.
* Defines Maven groups for the Spine SDK artifacts.
*/
@Suppress("unused", "ConstPropertyName")
object Spine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ object Validation {
/**
* The version of the Validation library artifacts.
*/
const val version = "2.0.0-SNAPSHOT.354"
const val version = "2.0.0-SNAPSHOT.373"

/**
* The last version of Validation compatible with ProtoData.
*/
const val pdCompatibleVersion = "2.0.0-SNAPSHOT.342"

const val group = "io.spine.validation"
private const val prefix = "spine-validation"
const val group = Spine.toolsGroup
private const val prefix = "validation"

const val runtimeModule = "$group:$prefix-java-runtime"
const val runtimeModule = "${Spine.group}:spine-$prefix-jvm-runtime"
const val runtime = "$runtimeModule:$version"
const val javaModule = "$group:$prefix-java"
const val java = "$javaModule:$version"
Expand Down
23 changes: 12 additions & 11 deletions buildSrc/src/main/kotlin/io/spine/gradle/git/Repository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly
import io.spine.gradle.Cli
import io.spine.gradle.fs.LazyTempPath
import java.util.concurrent.TimeUnit.MILLISECONDS
import org.gradle.api.logging.Logger
import org.gradle.api.Project

/**
* Interacts with a real Git repository.
Expand All @@ -47,16 +47,17 @@ import org.gradle.api.logging.Logger
* release of resources please use the provided functionality inside a `use` block or
* call the `close` method manually.
*
* @property project The Gradle project in which context the repo operations are held.
* @property sshUrl The GitHub SSH URL to the underlying repository.
* @property user Current user configuration.
* This configuration determines what ends up in the `author` and `committer` fields of a commit.
* @property currentBranch The currently checked-out branch.
*/
class Repository private constructor(
private val project: Project,
private val sshUrl: String,
private var user: UserInfo,
private var currentBranch: String,
private val logger: Logger
) : AutoCloseable {

/**
Expand All @@ -75,10 +76,9 @@ class Repository private constructor(
* Executes a command in the [location].
*/
private fun repoExecute(vararg command: String): String {
if (logger.isErrorEnabled) {
val msg = "[Repository] Executing command: `${command.toList().joinToString(" ")}`."
logger.error(msg)
}
val cmd = command.toList().joinToString(" ")
val msg = "[Repo (${project.path})] Executing command: `$cmd`."
System.err.println(msg)
return Cli(location.toFile()).execute(*command)
}

Expand Down Expand Up @@ -159,14 +159,14 @@ class Repository private constructor(
* @throws IllegalArgumentException if SSH URL is an empty string.
*/
fun clone(
project: Project,
sshUrl: String,
user: UserInfo,
branch: String = Branch.master,
logger: Logger
): Repository {
require(sshUrl.isNotBlank()) { "SSH URL cannot be an empty string." }

val repo = Repository(sshUrl, user, branch, logger)
val repo = Repository(project, sshUrl, user, branch)
repo.clone()
repo.configureUser(user)

Expand Down Expand Up @@ -197,10 +197,11 @@ class Repository private constructor(
* @param block the operation to execute
* @return the result of the successful operation execution
*/
@Suppress("TooGenericExceptionCaught", "LongParameterList")
private fun <T> withRetries(
times: Int = 3,
initialDelay: Long = 100, // ms
maxDelay: Long = 2000, // ms
times: Int = 5,
initialDelay: Long = 2000, // ms
maxDelay: Long = 20000, // ms
factor: Double = 2.0,
description: String = "",
block: () -> T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import io.spine.gradle.git.Branch
import io.spine.gradle.git.Repository
import io.spine.gradle.git.UserInfo
import io.spine.gradle.repo.RepoSlug
import org.gradle.api.logging.Logger
import org.gradle.api.Project

/**
* Clones the current project repository with the branch dedicated to publishing
Expand All @@ -47,7 +47,7 @@ import org.gradle.api.logging.Logger
* @throws org.gradle.api.GradleException if any of the environment variables described above
* is not set.
*/
internal fun Repository.Factory.forPublishingDocumentation(logger: Logger): Repository {
internal fun Repository.Factory.forPublishingDocumentation(project: Project): Repository {
val host = RepoSlug.fromVar().gitHost()

val username = "UpdateGitHubPages Plugin"
Expand All @@ -56,5 +56,5 @@ internal fun Repository.Factory.forPublishingDocumentation(logger: Logger): Repo

val branch = Branch.documentation

return clone(host, user, branch, logger)
return clone(project, host, user, branch)
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fun Task.updateGhPages(project: Project) {

SshKey(plugin.rootFolder, logger).register()

val repository = Repository.forPublishingDocumentation(logger)
val repository = Repository.forPublishingDocumentation(project)

val updateJavadocFormat =
UpdateJavadocFormat(project, plugin.javadocOutputFolder, repository, logger)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private const val MAVEN_PUBLISH = "maven-publish"
* the [`spinePublishing`][io.spine.gradle.publish.SpinePublishing.destinations]
* extension applied to the subproject.
*/
internal sealed class PublicationHandler(
sealed class PublicationHandler(
protected val project: Project,
protected var destinations: Set<Repository>
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import org.gradle.kotlin.dsl.create
* The Maven Publish Plugin | Publications</a>
* @see CustomPublicationHandler
*/
internal class StandardJavaPublicationHandler private constructor(
class StandardJavaPublicationHandler private constructor(
project: Project,
private val jarFlags: JarFlags,
destinations: Set<Repository>,
Expand Down
12 changes: 9 additions & 3 deletions buildSrc/src/main/kotlin/io/spine/gradle/repo/Repositories.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ 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")
val RepositoryHandler.intellijDependencies: MavenArtifactRepository
get() = maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies") {
content {
includeGroupByRegex("com\\.jetbrains\\.intellij.*")
includeGroupByRegex("org\\.jetbrains\\.intellij.*")
includeGroupByRegex("com\\.intellij.*")
}
}

/**
* Applies repositories commonly used by Spine Event Engine projects.
Expand All @@ -123,7 +129,7 @@ fun RepositoryHandler.standardToSpineSdk() {
}

intellijReleases
jetBrainsCacheRedirector
intellijDependencies

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