Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 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
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import io.spine.dependency.lib.KotlinPoet
import io.spine.dependency.lib.Roaster
import io.spine.dependency.local.Base
import io.spine.dependency.local.CoreJava
import io.spine.dependency.local.Logging
import io.spine.dependency.local.Compiler
Expand Down Expand Up @@ -114,7 +115,7 @@ allprojects {
Compiler.pluginLib,
Compiler.backend,
Compiler.jvm,
Spine.base,
Base.lib,
Logging.lib,
CoreJava.client,
CoreJava.server,
Expand Down
25 changes: 16 additions & 9 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ import io.spine.dependency.build.GradleDoctor
import io.spine.dependency.build.Ksp
import io.spine.dependency.build.PluginPublishPlugin
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.McJava
import io.spine.dependency.local.CoreJvmCompiler
import io.spine.dependency.local.Compiler
import io.spine.dependency.local.McJava
import io.spine.dependency.local.ProtoTap
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.Kover
Expand Down Expand Up @@ -79,20 +80,26 @@ fun ScriptHandlerScope.standardSpineSdkRepositories() {
val ScriptHandlerScope.protobuf: Protobuf
get() = Protobuf

/**
* Shortcut to [CoreJvmCompiler] dependency object for using under `buildScript`.
*/
val ScriptHandlerScope.coreJvmCompiler: CoreJvmCompiler
get() = CoreJvmCompiler

/**
* Shortcut to [McJava] dependency object for using under `buildScript`.
*/
val ScriptHandlerScope.mcJava: McJava
get() = McJava

/**
* Shortcut to [McJava] dependency object.
* Shortcut to [CoreJvmCompiler] dependency object.
*
* This plugin is not published to Gradle Portal and cannot be applied directly to a project.
* Firstly, it should be put to buildscript's classpath and then applied by ID only.
*/
val PluginDependenciesSpec.mcJava: McJava
get() = McJava
val PluginDependenciesSpec.coreJvmCompiler: CoreJvmCompiler
get() = CoreJvmCompiler

/**
* Shortcut to [Compiler] dependency object for using under `buildscript`.
Expand Down Expand Up @@ -162,11 +169,11 @@ val PluginDependenciesSpec.`plugin-publish`: PluginDependencySpec

/**
* Configures the dependencies between third-party Gradle tasks
* and those defined via ProtoData and Spine Model Compiler.
* and those defined via the Spine Compiler and its plugins.
*
* It is required to avoid warnings in build logs, detecting the undeclared
* usage of Spine-specific task output by other tasks,
* e.g., the output of `launchProtoData` is used by `compileKotlin`.
* e.g., the output of `launchSpineCompiler` is used by `compileKotlin`.
*/
@Suppress("unused")
fun Project.configureTaskDependencies() {
Expand Down Expand Up @@ -297,7 +304,7 @@ fun Project.setRemoteDebug(taskName: String, enabled: Boolean = true) {
}

/**
* Sets remote debug options for the `launchProtoData` task.
* Sets remote debug options for the `launchSpineCompiler` task.
*
* @param enabled if `true` the task will be suspended.
*
Expand All @@ -307,7 +314,7 @@ fun Project.spineCompilerRemoteDebug(enabled: Boolean = true) =
setRemoteDebug("launchSpineCompiler", enabled)

/**
* Sets remote debug options for the `launchTestProtoData` task.
* Sets remote debug options for the `launchTestSpineCompiler` task.
*
* @param enabled if `true` the task will be suspended.
*
Expand All @@ -317,7 +324,7 @@ fun Project.testSpineCompilerRemoteDebug(enabled: Boolean = true) =
setRemoteDebug("launchTestSpineCompiler", enabled)

/**
* Sets remote debug options for the `launchTestFixturesProtoData` task.
* Sets remote debug options for the `launchTestFixturesSpineCompiler` task.
*
* @param enabled if `true` the task will be suspended.
*
Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/DokkaExts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,17 @@ fun DependencyHandlerScope.useDokkaWithSpineExtensions() {
private fun DependencyHandler.dokkaPlugin(dependencyNotation: Any): Dependency? =
add("dokkaPlugin", dependencyNotation)

/**
* Resolves the directory where Dokka outputs HTML documentation for the given language.
*/
internal fun Project.dokkaOutput(language: String): File {
val lng = language.titleCaseFirstChar()
return layout.buildDirectory.dir("docs/dokka$lng").get().asFile
}

/**
* Locates a Dokka configuration file under the `buildSrc` resources.
*/
fun Project.dokkaConfigFile(file: String): File {
val dokkaConfDir = project.rootDir.resolve("buildSrc/src/main/resources/dokka")
return dokkaConfDir.resolve(file)
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/ForcePlugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.dependency.local.CoreJvmCompiler
import org.gradle.kotlin.dsl.ScriptHandlerScope

/**
Expand All @@ -41,7 +42,7 @@ fun ScriptHandlerScope.forceCodegenPlugins() {
standardSpineSdkRepositories()

dependencies {
mcJava.run {
CoreJvmCompiler.run {
classpath(pluginLib(version))
}
spineCompiler.run {
Expand All @@ -58,7 +59,7 @@ fun ScriptHandlerScope.forceCodegenPlugins() {
spineCompiler.backend,
spineCompiler.protocPlugin,

mcJava.pluginsArtifact
CoreJvmCompiler.pluginsArtifact
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package io.spine.dependency.lib
// https://github.com/square/kotlinpoet
@Suppress("unused", "ConstPropertyName")
object KotlinPoet {
private const val version = "2.0.0"
private const val version = "2.2.0"
const val lib = "com.squareup:kotlinpoet:$version"
const val ksp = "com.squareup:kotlinpoet-ksp:$version"
}
137 changes: 0 additions & 137 deletions buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt

This file was deleted.

2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object Base {
const val group = Spine.group
const val artifact = "spine-base"
const val lib = "$group:$artifact:$version"
const val annotations = "$group:spine-annotations:$version"
const val format = "$group:spine-format:$version"
const val libForBuildScript = "$group:$artifact:$versionForBuildScript"
const val annotations = "$group:spine-annotations:$version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

package io.spine.dependency.local

import io.spine.dependency.local.ToolBase

/**
* Dependencies on `core-java` modules.
*
Expand All @@ -44,5 +46,5 @@ object CoreJava {
const val client = "$group:$clientArtifact:$version"
const val server = "$group:$serverArtifact:$version"

const val testUtilServer = "${Spine.toolsGroup}:spine-testutil-server:$version"
const val testUtilServer = "${ToolBase.group}:spine-testutil-server:$version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package io.spine.dependency.local
import io.spine.dependency.local.ToolBase

/**
* Dependencies on the CoreJvm Compiler artifacts.
* Dependencies on the CoreJvm Compiler artifacts.
*
* See [mc-java](https://github.com/SpineEventEngine/core-jvm-compiler).
*/
Expand All @@ -48,12 +48,12 @@ object CoreJvmCompiler {
/**
* The version used to in the build classpath.
*/
const val dogfoodingVersion = "2.0.0-SNAPSHOT.003"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.006"

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

/**
* The ID of the Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

package io.spine.dependency.local

import io.spine.dependency.local.ToolBase

/**
* Dependencies on the artifacts of the Spine Logging library.
*
Expand All @@ -46,7 +48,7 @@ object Logging {
const val grpcContext = "$group:spine-logging-grpc-context:$version"
const val smokeTest = "$group:spine-logging-smoke-test:$version"

const val testLib = "${Spine.toolsGroup}:spine-logging-testlib:$version"
const val testLib = "${ToolBase.group}:spine-logging-testlib:$version"

// Transitive dependencies.
// Make `public` and use them to force a version in a particular repository, if needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ package io.spine.dependency.local
"unused"
)
object McJava {
const val group = Spine.toolsGroup
const val group = ToolBase.group

/**
* The version used to in the build classpath.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

package io.spine.dependency.local

import io.spine.dependency.local.ToolBase

/**
* Spine Model Compiler Gradle API.
*
Expand All @@ -34,7 +36,7 @@ package io.spine.dependency.local
@Suppress("ConstPropertyName")
object ModelCompiler {
const val version = "2.0.0-SNAPSHOT.133"
const val group = Spine.toolsGroup
const val group = ToolBase.group
const val artifact = "spine-model-compiler"
const val lib = "$group:$artifact:$version"
}
Loading
Loading