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
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 @@ -36,17 +36,17 @@ object Validation {
/**
* The version of the Validation library artifacts.
*/
const val version = "2.0.0-SNAPSHOT.370"
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
22 changes: 11 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 @@ -199,9 +199,9 @@ class Repository private constructor(
*/
@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
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