Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into handle-comparable-option
Browse files Browse the repository at this point in the history
# Conflicts:
#	buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt
#	dependencies.md
#	version.gradle.kts
  • Loading branch information
yevhenii-nadtochii committed Oct 8, 2024
2 parents 486c13f + b4276ad commit 9297f6d
Show file tree
Hide file tree
Showing 27 changed files with 419 additions and 310 deletions.
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ buildscript {
resolutionStrategy {
force(
io.spine.internal.dependency.Grpc.api,
spine.base,
spine.baseForBuildScript,
spine.reflect,
spine.toolBase,
spine.server,
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* https://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
Expand Down Expand Up @@ -51,8 +51,8 @@ repositories {
/**
* The version of Jackson used by `buildSrc`.
*
* Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`.
* It's not a requirement, but would be good in terms of consistency.
* Please keep this value in sync with [io.spine.internal.dependency.Jackson.version].
* It is not a requirement but would be good in terms of consistency.
*/
val jacksonVersion = "2.15.3"

Expand Down Expand Up @@ -114,7 +114,7 @@ val protobufPluginVersion = "0.9.4"
* @see <a href="https://github.com/Kotlin/dokka/releases">
* Dokka Releases</a>
*/
val dokkaVersion = "1.9.10"
val dokkaVersion = "1.9.20"

/**
* The version of Detekt Gradle Plugin.
Expand Down
42 changes: 41 additions & 1 deletion buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.spine.internal.dependency.Protobuf
import io.spine.internal.gradle.standardToSpineSdk
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.ScriptHandlerScope
import org.gradle.plugin.use.PluginDependenciesSpec
import org.gradle.plugin.use.PluginDependencySpec
Expand Down Expand Up @@ -87,7 +88,7 @@ val PluginDependenciesSpec.mcJava: McJava
get() = McJava

/**
* Shortcut to [ProtoData] dependency object for using under `buildScript`.
* Shortcut to [ProtoData] dependency object for using under `buildscript`.
*/
val ScriptHandlerScope.protoData: ProtoData
get() = ProtoData
Expand Down Expand Up @@ -205,3 +206,42 @@ fun Project.configureTaskDependencies() {
*/
val Project.productionModules: Iterable<Project>
get() = rootProject.subprojects.filter { !it.name.contains("-tests") }


/**
* Sets the remote debug option for this task.
*
* The port number is [5566][BuildSettings.REMOTE_DEBUG_PORT].
*
* @param enabled If `true` the task will be suspended.
*/
fun Task.remoteDebug(enabled: Boolean = true) { this as JavaExec
debugOptions {
this@debugOptions.enabled.set(enabled)
port.set(BuildSettings.REMOTE_DEBUG_PORT)
server.set(true)
suspend.set(true)
}
}

/**
* Sets remote debug options for the `launchProtoData` task.
*
* @param enabled if `true` the task will be suspended.
*
* @see remoteDebug
*/
fun Project.protoDataRemoteDebug(enabled: Boolean = true) {
tasks.findByName("launchProtoData")?.remoteDebug(enabled)
}

/**
* Sets remote debug options for the `launchTestProtoData` task.
*
* @param enabled if `true` the task will be suspended.
*
* @see remoteDebug
*/
fun Project.testProtoDataRemoteDebug(enabled: Boolean = true) {
tasks.findByName("launchTestProtoData")?.remoteDebug(enabled)
}
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/BuildSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
import org.gradle.jvm.toolchain.JavaLanguageVersion

/**
* This object provides high-level constants, like version of JVM, to be used
* This object provides high-level constants, like the version of JVM, to be used
* throughout the project.
*/
object BuildSettings {
private const val JVM_VERSION = 11
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION)
const val REMOTE_DEBUG_PORT = 5566
}
14 changes: 14 additions & 0 deletions buildSrc/src/main/kotlin/DependencyResolution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,17 @@ fun Project.forceSpineBase() {
}
}
}

/**
* Forces configurations containing `"proto"` in their names (disregarding the case) to
* use [Spine.baseForBuildScript].
*/
fun Project.forceBaseInProtoTasks() {
configurations.configureEach {
if (name.toLowerCase().contains("proto")) {
resolutionStrategy {
force(Spine.baseForBuildScript)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object Dokka {
* When changing the version, also change the version used in the
* `buildSrc/build.gradle.kts`.
*/
const val version = "1.9.10"
const val version = "1.9.20"

object GradlePlugin {
const val id = "org.jetbrains.dokka"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ object McJava {
const val group = Spine.toolsGroup

/** The version used to in the build classpath. */
const val dogfoodingVersion = "2.0.0-SNAPSHOT.230"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.242"

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

const val pluginId = "io.spine.mc-java"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object ProtoData {
* The version of ProtoData dependencies.
*/
val version: String
private const val fallbackVersion = "0.61.2"
private const val fallbackVersion = "0.61.4"

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

/**
* The artifact for the ProtoData Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/base">spine-base</a>
*/
const val base = "2.0.0-SNAPSHOT.208"
const val base = "2.0.0-SNAPSHOT.212"
const val baseForBuildScript = "2.0.0-SNAPSHOT.212"

/**
* The version of [Spine.reflect].
Expand Down Expand Up @@ -117,7 +118,7 @@ object Spine {
*
* @see <a href="https://github.com/SpineEventEngine/tool-base">spine-tool-base</a>
*/
const val toolBase = "2.0.0-SNAPSHOT.224"
const val toolBase = "2.0.0-SNAPSHOT.226"

/**
* The version of [Spine.javadocFilter].
Expand All @@ -128,6 +129,7 @@ object Spine {
}

const val base = "$group:spine-base:${ArtifactVersion.base}"
const val baseForBuildScript = "$group:spine-base:${ArtifactVersion.baseForBuildScript}"

const val reflect = "$group:spine-reflect:${ArtifactVersion.reflect}"
const val baseTypes = "$group:spine-base-types:${ArtifactVersion.baseTypes}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2022, TeamDev. All rights reserved.
* Copyright 2024, 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
* https://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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2022, TeamDev. All rights reserved.
* Copyright 2024, 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
* https://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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2023, TeamDev. All rights reserved.
* Copyright 2024, 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
* https://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
Expand Down
Loading

0 comments on commit 9297f6d

Please sign in to comment.