Skip to content

Commit f9efd9f

Browse files
Update config
1 parent 688d387 commit f9efd9f

16 files changed

+121
-51
lines changed

buildSrc/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following
@@ -51,8 +51,8 @@ repositories {
5151
/**
5252
* The version of Jackson used by `buildSrc`.
5353
*
54-
* Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`.
55-
* It's not a requirement, but would be good in terms of consistency.
54+
* Please keep this value in sync with [io.spine.internal.dependency.Jackson.version].
55+
* It is not a requirement but would be good in terms of consistency.
5656
*/
5757
val jacksonVersion = "2.15.3"
5858

@@ -114,7 +114,7 @@ val protobufPluginVersion = "0.9.4"
114114
* @see <a href="https://github.com/Kotlin/dokka/releases">
115115
* Dokka Releases</a>
116116
*/
117-
val dokkaVersion = "1.9.10"
117+
val dokkaVersion = "1.9.20"
118118

119119
/**
120120
* The version of Detekt Gradle Plugin.

buildSrc/src/main/kotlin/BuildExtensions.kt

+41-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import io.spine.internal.dependency.Protobuf
3838
import io.spine.internal.gradle.standardToSpineSdk
3939
import org.gradle.api.Project
4040
import org.gradle.api.Task
41+
import org.gradle.api.tasks.JavaExec
4142
import org.gradle.kotlin.dsl.ScriptHandlerScope
4243
import org.gradle.plugin.use.PluginDependenciesSpec
4344
import org.gradle.plugin.use.PluginDependencySpec
@@ -87,7 +88,7 @@ val PluginDependenciesSpec.mcJava: McJava
8788
get() = McJava
8889

8990
/**
90-
* Shortcut to [ProtoData] dependency object for using under `buildScript`.
91+
* Shortcut to [ProtoData] dependency object for using under `buildscript`.
9192
*/
9293
val ScriptHandlerScope.protoData: ProtoData
9394
get() = ProtoData
@@ -205,3 +206,42 @@ fun Project.configureTaskDependencies() {
205206
*/
206207
val Project.productionModules: Iterable<Project>
207208
get() = rootProject.subprojects.filter { !it.name.contains("-tests") }
209+
210+
211+
/**
212+
* Sets the remote debug option for this task.
213+
*
214+
* The port number is [5566][BuildSettings.REMOTE_DEBUG_PORT].
215+
*
216+
* @param enabled If `true` the task will be suspended.
217+
*/
218+
fun Task.remoteDebug(enabled: Boolean = true) { this as JavaExec
219+
debugOptions {
220+
this@debugOptions.enabled.set(enabled)
221+
port.set(BuildSettings.REMOTE_DEBUG_PORT)
222+
server.set(true)
223+
suspend.set(true)
224+
}
225+
}
226+
227+
/**
228+
* Sets remote debug options for the `launchProtoData` task.
229+
*
230+
* @param enabled if `true` the task will be suspended.
231+
*
232+
* @see remoteDebug
233+
*/
234+
fun Project.protoDataRemoteDebug(enabled: Boolean = true) {
235+
tasks.findByName("launchProtoData")?.remoteDebug(enabled)
236+
}
237+
238+
/**
239+
* Sets remote debug options for the `launchTestProtoData` task.
240+
*
241+
* @param enabled if `true` the task will be suspended.
242+
*
243+
* @see remoteDebug
244+
*/
245+
fun Project.testProtoDataRemoteDebug(enabled: Boolean = true) {
246+
tasks.findByName("launchTestProtoData")?.remoteDebug(enabled)
247+
}

buildSrc/src/main/kotlin/BuildSettings.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
import org.gradle.jvm.toolchain.JavaLanguageVersion
2828

2929
/**
30-
* This object provides high-level constants, like version of JVM, to be used
30+
* This object provides high-level constants, like the version of JVM, to be used
3131
* throughout the project.
3232
*/
3333
object BuildSettings {
3434
private const val JVM_VERSION = 11
3535
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION)
36+
const val REMOTE_DEBUG_PORT = 5566
3637
}

buildSrc/src/main/kotlin/DependencyResolution.kt

+14
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,17 @@ fun Project.forceSpineBase() {
190190
}
191191
}
192192
}
193+
194+
/**
195+
* Forces configurations containing `"proto"` in their names (disregarding the case) to
196+
* use [Spine.baseForBuildScript].
197+
*/
198+
fun Project.forceBaseInProtoTasks() {
199+
configurations.configureEach {
200+
if (name.toLowerCase().contains("proto")) {
201+
resolutionStrategy {
202+
force(Spine.baseForBuildScript)
203+
}
204+
}
205+
}
206+
}

buildSrc/src/main/kotlin/DokkaExts.kt

+33-24
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope
4040
import org.jetbrains.dokka.DokkaConfiguration
4141
import org.jetbrains.dokka.base.DokkaBase
4242
import org.jetbrains.dokka.base.DokkaBaseConfiguration
43+
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
44+
import org.jetbrains.dokka.gradle.AbstractDokkaTask
4345
import org.jetbrains.dokka.gradle.DokkaTask
4446
import org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder
4547

@@ -56,7 +58,7 @@ fun DependencyHandlerScope.useDokkaForKotlinAsJava() {
5658

5759
/**
5860
* To exclude pieces of code annotated with `@Internal` from the documentation
59-
* a custom plugin is added to the Dokka's classpath.
61+
* a custom plugin is added to the Dokka classpath.
6062
*
6163
* @see <a href="https://github.com/SpineEventEngine/dokka-tools/tree/master/dokka-extensions">
6264
* Custom Dokka Plugins</a>
@@ -71,12 +73,35 @@ private fun DependencyHandler.dokkaPlugin(dependencyNotation: Any): Dependency?
7173
private fun Project.dokkaOutput(language: String): File =
7274
buildDir.resolve("docs/dokka${language.capitalized()}")
7375

74-
private fun Project.dokkaConfigFile(file: String): File {
76+
fun Project.dokkaConfigFile(file: String): File {
7577
val dokkaConfDir = project.rootDir.resolve("buildSrc/src/main/resources/dokka")
7678
return dokkaConfDir.resolve(file)
7779
}
7880

79-
private fun DokkaTask.configureFor(language: String) {
81+
/**
82+
* Configures the presentation style, logo, and footer message.
83+
*
84+
* Dokka Base plugin allows setting a few properties to customize the output:
85+
* - `customStyleSheets` property to which CSS files are passed overriding
86+
* styles generated by Dokka;
87+
* - `customAssets` property to provide resources. The image with the name
88+
* "logo-icon.svg" is passed to override the default logo used by Dokka;
89+
* - `separateInheritedMembers` when set to `true`, creates a separate tab in
90+
* type-documentation for inherited members.
91+
*
92+
* @see <a href="https://kotlin.github.io/dokka/1.8.10/user_guide/base-specific/frontend/#prerequisites">
93+
* Dokka modifying frontend assets</a>
94+
*/
95+
fun AbstractDokkaTask.configureStyle() {
96+
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
97+
customStyleSheets = listOf(project.dokkaConfigFile("styles/custom-styles.css"))
98+
customAssets = listOf(project.dokkaConfigFile("assets/logo-icon.svg"))
99+
separateInheritedMembers = true
100+
footerMessage = "Copyright ${LocalDate.now().year}, TeamDev"
101+
}
102+
}
103+
104+
private fun AbstractDokkaLeafTask.configureFor(language: String) {
80105
dokkaSourceSets.configureEach {
81106
/**
82107
* Configures links to the external Java documentation.
@@ -85,6 +110,8 @@ private fun DokkaTask.configureFor(language: String) {
85110

86111
skipEmptyPackages.set(true)
87112

113+
includeNonPublic.set(true)
114+
88115
documentedVisibilities.set(
89116
setOf(
90117
DokkaConfiguration.Visibility.PUBLIC,
@@ -95,38 +122,20 @@ private fun DokkaTask.configureFor(language: String) {
95122

96123
outputDirectory.set(project.dokkaOutput(language))
97124

98-
/**
99-
* Dokka Base plugin allows to set a few properties to customize the output:
100-
*
101-
* - `customStyleSheets` property to which CSS files are passed overriding
102-
* styles generated by Dokka;
103-
* - `customAssets` property to provide resources. The image with the name
104-
* "logo-icon.svg" is passed to override the default logo used by Dokka;
105-
* - `separateInheritedMembers` when set to `true`, creates a separate tab in
106-
* type-documentation for inherited members.
107-
*
108-
* @see <a href="https://kotlin.github.io/dokka/1.8.10/user_guide/base-specific/frontend/#prerequisites">
109-
* Dokka modifying frontend assets</a>
110-
*/
111-
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
112-
customStyleSheets = listOf(project.dokkaConfigFile("styles/custom-styles.css"))
113-
customAssets = listOf(project.dokkaConfigFile("assets/logo-icon.svg"))
114-
separateInheritedMembers = true
115-
footerMessage = "Copyright ${LocalDate.now().year}, TeamDev"
116-
}
125+
configureStyle()
117126
}
118127

119128
/**
120129
* Configures this [DokkaTask] to accept only Kotlin files.
121130
*/
122-
fun DokkaTask.configureForKotlin() {
131+
fun AbstractDokkaLeafTask.configureForKotlin() {
123132
configureFor("kotlin")
124133
}
125134

126135
/**
127136
* Configures this [DokkaTask] to accept only Java files.
128137
*/
129-
fun DokkaTask.configureForJava() {
138+
fun AbstractDokkaLeafTask.configureForJava() {
130139
configureFor("java")
131140
}
132141

buildSrc/src/main/kotlin/io/spine/internal/dependency/Caffeine.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following

buildSrc/src/main/kotlin/io/spine/internal/dependency/Dokka.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2023, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following
@@ -35,7 +35,7 @@ object Dokka {
3535
* When changing the version, also change the version used in the
3636
* `buildSrc/build.gradle.kts`.
3737
*/
38-
const val version = "1.9.10"
38+
const val version = "1.9.20"
3939

4040
object GradlePlugin {
4141
const val id = "org.jetbrains.dokka"

buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,20 @@ object McJava {
3939
const val group = Spine.toolsGroup
4040

4141
/** The version used to in the build classpath. */
42-
const val dogfoodingVersion = "2.0.0-SNAPSHOT.221"
42+
const val dogfoodingVersion = "2.0.0-SNAPSHOT.243"
4343

4444
/** The version to be used for integration tests. */
45-
const val version = "2.0.0-SNAPSHOT.230"
45+
const val version = "2.0.0-SNAPSHOT.243"
4646

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

4949
val pluginLib = pluginLib(dogfoodingVersion)
5050
fun pluginLib(version: String): String = "$group:spine-mc-java-plugins:$version:all"
5151

5252
/** The artifact reference for forcing in configurations. */
53+
@Suppress("unused")
5354
const val pluginsArtifact: String = "$group:spine-mc-java-plugins:$version"
55+
56+
val base = base(version)
57+
fun base(version: String): String = "$group:spine-mc-java-base:$version"
5458
}

buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object ProtoData {
7373
* The version of ProtoData dependencies.
7474
*/
7575
val version: String
76-
private const val fallbackVersion = "0.61.2"
76+
private const val fallbackVersion = "0.61.4"
7777

7878
/**
7979
* The distinct version of ProtoData used by other build tools.
@@ -82,7 +82,7 @@ object ProtoData {
8282
* transitional dependencies, this is the version used to build the project itself.
8383
*/
8484
val dogfoodingVersion: String
85-
private const val fallbackDfVersion = "0.60.4"
85+
private const val fallbackDfVersion = "0.61.4"
8686

8787
/**
8888
* The artifact for the ProtoData Gradle plugin.

buildSrc/src/main/kotlin/io/spine/internal/dependency/Roaster.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2023, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following

buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ object Spine {
4545
*
4646
* @see <a href="https://github.com/SpineEventEngine/base">spine-base</a>
4747
*/
48-
const val base = "2.0.0-SNAPSHOT.208"
48+
const val base = "2.0.0-SNAPSHOT.212"
49+
const val baseForBuildScript = "2.0.0-SNAPSHOT.212"
4950

5051
/**
5152
* The version of [Spine.reflect].
@@ -117,7 +118,7 @@ object Spine {
117118
*
118119
* @see <a href="https://github.com/SpineEventEngine/tool-base">spine-tool-base</a>
119120
*/
120-
const val toolBase = "2.0.0-SNAPSHOT.224"
121+
const val toolBase = "2.0.0-SNAPSHOT.226"
121122

122123
/**
123124
* The version of [Spine.javadocFilter].
@@ -128,6 +129,7 @@ object Spine {
128129
}
129130

130131
const val base = "$group:spine-base:${ArtifactVersion.base}"
132+
const val baseForBuildScript = "$group:spine-base:${ArtifactVersion.baseForBuildScript}"
131133

132134
const val reflect = "$group:spine-reflect:${ArtifactVersion.reflect}"
133135
const val baseTypes = "$group:spine-base-types:${ArtifactVersion.baseTypes}"

buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following
@@ -36,7 +36,7 @@ object Validation {
3636
/**
3737
* The version of the Validation library artifacts.
3838
*/
39-
const val version = "2.0.0-SNAPSHOT.154"
39+
const val version = "2.0.0-SNAPSHOT.160"
4040

4141
const val group = "io.spine.validation"
4242
private const val prefix = "spine-validation"

buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/DokkaExtensions.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2022, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following

buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka/TaskContainerExtensions.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2022, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following

0 commit comments

Comments
 (0)