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
28 changes: 23 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# Copyright 2022, TeamDev. All rights reserved.
# Copyright 2025, 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 All @@ -31,6 +31,15 @@
#
# Therefore, instructions below are superset of instructions required for all the projects.

# `jenv` local configuration.
.java-version

# Internal tool directories.
.fleet/

# Kotlin temp directories.
**/.kotlin/

# IntelliJ IDEA modules and interim config files.
*.iml
.idea/*.xml
Expand All @@ -49,8 +58,15 @@
# Gradle interim configs
**/.gradle/**

# Temp directory for Gradle TestKit runners
**/.gradle-test-kit/**

# Generated source code
**/generated/**
**/*.pb.dart
**/*.pbenum.dart
**/*.pbserver.dart
**/*.pbjson.dart

# Gradle build files
**/build/**
Expand All @@ -74,9 +90,6 @@ gradle-app.setting
# Spine internal directory for storing intermediate artifacts
**/.spine/**

# Spine model compiler auto-generated resources
/tools/gradle-plugins/model-compiler/src/main/resources/spine-protoc.gradle

# Login details to Maven repository.
# Each workstation should have developer's login defined in this file.
credentials.tar
Expand All @@ -100,3 +113,8 @@ hs_err_pid*

.packages
pubspec.lock

# Ignore the `tmp` directory used for building dependant repositories.
/tmp

.gradle-test-kit/
3 changes: 2 additions & 1 deletion .idea/codeStyles/Project.xml

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

3 changes: 2 additions & 1 deletion .idea/dictionaries/common.xml

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

36 changes: 14 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
@file:Suppress("RemoveRedundantQualifierName")

import io.spine.dependency.build.Dokka
import io.spine.dependency.lib.Jackson
import io.spine.dependency.kotlinx.Coroutines
import io.spine.dependency.lib.Grpc
import io.spine.dependency.lib.Kotlin
import io.spine.dependency.lib.KotlinPoet
import io.spine.dependency.lib.KotlinX
import io.spine.dependency.local.Base
import io.spine.dependency.local.Logging
import io.spine.dependency.local.ProtoData
import io.spine.dependency.local.Reflect
import io.spine.dependency.local.ToolBase
import io.spine.dependency.local.Validation
import io.spine.dependency.test.JUnit
import io.spine.gradle.publish.PublishingRepos
import io.spine.gradle.publish.spinePublishing
import io.spine.gradle.repo.standardToSpineSdk
import io.spine.gradle.report.coverage.JacocoConfig
import io.spine.gradle.report.license.LicenseReporter
import io.spine.gradle.report.pom.PomGenerator
import io.spine.gradle.standardToSpineSdk

buildscript {
standardSpineSdkRepositories()
Expand All @@ -58,23 +58,20 @@ buildscript {
exclude(group = "io.spine", module = "spine-logging-backend")

resolutionStrategy {
io.spine.dependency.kotlinx.Coroutines.forceArtifacts(
project, this@all, this@resolutionStrategy
)
io.spine.dependency.lib.Grpc.forceArtifacts(
project, this@all, this@resolutionStrategy
)
val validation = io.spine.dependency.local.Validation
val jackson = io.spine.dependency.lib.Jackson
val logging = io.spine.dependency.local.Logging
force(
io.spine.dependency.lib.KotlinX.Coroutines.bom,
io.spine.dependency.lib.KotlinX.Coroutines.core,
io.spine.dependency.lib.KotlinX.Coroutines.coreJvm,
io.spine.dependency.lib.KotlinX.Coroutines.jdk8,
io.spine.dependency.local.Base.lib,
io.spine.dependency.local.Reflect.lib,
logging.lib,
logging.middleware,
validation.runtime,
jackson.annotations,
jackson.bom,
jackson.databind,
jackson.moduleKotlin
)
}
}
Expand All @@ -87,6 +84,7 @@ repositories {
}

plugins {
id("org.jetbrains.kotlinx.kover")
idea
jacoco
`gradle-doctor`
Expand Down Expand Up @@ -125,15 +123,11 @@ allprojects {
exclude(group = "io.spine", module = "spine-validate")
exclude(group = "io.spine", module = "spine-flogger-api")
resolutionStrategy {
Coroutines.forceArtifacts(project, this@all, this@resolutionStrategy)
Grpc.forceArtifacts(project, this@all, this@resolutionStrategy)
force(
Kotlin.bom,
KotlinPoet.lib,
KotlinX.Coroutines.bom,
KotlinX.Coroutines.core,
KotlinX.Coroutines.coreJvm,
KotlinX.Coroutines.debug,
KotlinX.Coroutines.jdk8,
KotlinX.Coroutines.test,
KotlinX.Coroutines.testJvm,
Reflect.lib,
Base.lib,
ToolBase.lib,
Expand All @@ -142,8 +136,6 @@ allprojects {
ProtoData.api,
Validation.runtime,
Dokka.BasePlugin.lib,
Jackson.databind,
JUnit.runner,
)
}
}
Expand Down
33 changes: 17 additions & 16 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repositories {
* Please keep this value in sync with [io.spine.dependency.lib.Jackson.version].
* It is not a requirement but would be good in terms of consistency.
*/
val jacksonVersion = "2.15.3"
val jacksonVersion = "2.18.3"

/**
* The version of Google Artifact Registry used by `buildSrc`.
Expand All @@ -75,15 +75,15 @@ val grGitVersion = "4.1.1"
* This version may change from the [version of Kotlin][io.spine.dependency.lib.Kotlin.version]
* used by the project.
*/
val kotlinVersion = "2.1.20"
val kotlinEmbeddedVersion = "2.1.21"

/**
* The version of Guava used in `buildSrc`.
*
* Always use the same version as the one specified in [io.spine.dependency.lib.Guava].
* Otherwise, when testing Gradle plugins, clashes may occur.
*/
val guavaVersion = "32.1.3-jre"
val guavaVersion = "33.4.8-jre"

/**
* The version of ErrorProne Gradle plugin.
Expand All @@ -93,7 +93,7 @@ val guavaVersion = "32.1.3-jre"
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
* Error Prone Gradle Plugin Releases</a>
*/
val errorPronePluginVersion = "4.1.0"
val errorPronePluginVersion = "4.2.0"

/**
* The version of Protobuf Gradle Plugin.
Expand All @@ -103,7 +103,7 @@ val errorPronePluginVersion = "4.1.0"
* @see <a href="https://github.com/google/protobuf-gradle-plugin/releases">
* Protobuf Gradle Plugins Releases</a>
*/
val protobufPluginVersion = "0.9.4"
val protobufPluginVersion = "0.9.5"

/**
* The version of Dokka Gradle Plugins.
Expand All @@ -113,7 +113,7 @@ val protobufPluginVersion = "0.9.4"
* @see <a href="https://github.com/Kotlin/dokka/releases">
* Dokka Releases</a>
*/
val dokkaVersion = "1.9.20"
val dokkaVersion = "2.0.0"

/**
* The version of Detekt Gradle Plugin.
Expand All @@ -130,7 +130,7 @@ val kotestJvmPluginVersion = "0.4.10"
/**
* @see [io.spine.dependency.test.Kover]
*/
val koverVersion = "0.7.2"
val koverVersion = "0.9.1"

/**
* The version of the Shadow Plugin.
Expand All @@ -148,9 +148,9 @@ configurations.all {
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",

// Force Kotlin lib versions avoiding using those bundled with Gradle.
"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
"org.jetbrains.kotlin:kotlin-stdlib:$kotlinEmbeddedVersion",
"org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinEmbeddedVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinEmbeddedVersion"
)
}
}
Expand All @@ -167,6 +167,7 @@ kotlin {

dependencies {
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
api(platform("org.jetbrains.kotlin:kotlin-bom:$kotlinEmbeddedVersion"))
dependOnAuthCommon()

listOf(
Expand All @@ -175,17 +176,17 @@ dependencies {
"com.github.jk1:gradle-license-report:$licenseReportVersion",
"com.google.guava:guava:$guavaVersion",
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
"gradle.plugin.com.github.johnrengelman:shadow:${shadowVersion}",
"gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion",
"io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion",
"io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion",
// https://github.com/srikanth-lingala/zip4j
"net.lingala.zip4j:zip4j:2.10.0",
"net.ltgt.gradle:gradle-errorprone-plugin:${errorPronePluginVersion}",
"org.ajoberstar.grgit:grgit-core:${grGitVersion}",
"org.jetbrains.dokka:dokka-base:${dokkaVersion}",
"net.ltgt.gradle:gradle-errorprone-plugin:$errorPronePluginVersion",
"org.ajoberstar.grgit:grgit-core:$grGitVersion",
"org.jetbrains.dokka:dokka-base:$dokkaVersion",
"org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}",
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinEmbeddedVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinEmbeddedVersion",
"org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion"
).forEach {
implementation(it)
Expand Down
32 changes: 29 additions & 3 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
import io.spine.dependency.build.ErrorProne
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.ProtoData
import io.spine.dependency.local.ProtoTap
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.Kover
import io.spine.gradle.standardToSpineSdk
import io.spine.gradle.repo.standardToSpineSdk
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.JavaExec
Expand Down Expand Up @@ -66,7 +67,7 @@ import org.gradle.plugin.use.PluginDependencySpec
private const val ABOUT_DEPENDENCY_EXTENSIONS = ""

/**
* Applies [standard][standardToSpineSdk] repositories to this `buildscript`.
* Applies [standard][io.spine.gradle.repo.standardToSpineSdk] repositories to this `buildscript`.
*/
fun ScriptHandlerScope.standardSpineSdkRepositories() {
repositories.standardToSpineSdk()
Expand Down Expand Up @@ -150,6 +151,9 @@ val PluginDependenciesSpec.kover: PluginDependencySpec
val PluginDependenciesSpec.ksp: PluginDependencySpec
get() = id(Ksp.id).version(Ksp.version)

val PluginDependenciesSpec.`plugin-publish`: PluginDependencySpec
get() = id(PluginPublishPlugin.id).version(PluginPublishPlugin.version)

/**
* Configures the dependencies between third-party Gradle tasks
* and those defined via ProtoData and Spine Model Compiler.
Expand Down Expand Up @@ -226,7 +230,29 @@ fun Project.configureTaskDependencies() {
* By convention, such modules are for integration tests and should be treated differently.
*/
val Project.productionModules: Iterable<Project>
get() = rootProject.subprojects.filter { !it.name.contains("-tests") }
get() = rootProject.subprojects.filterNot { subproject ->
subproject.name.run {
contains("-tests")
|| contains("test-fixtures")
|| contains("integration-tests")
}
}

/**
* Obtains the names of the [productionModules].
*
* The extension could be useful for excluding modules from standard publishing:
* ```kotlin
* spinePublishing {
* val customModule = "my-custom-module"
* modules = productionModuleNames.toSet().minus(customModule)
* modulesWithCustomPublishing = setOf(customModule)
* //...
* }
* ```
*/
val Project.productionModuleNames: List<String>
get() = productionModules.map { it.name }

/**
* Sets the remote debug option for this [JavaExec] task.
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/BuildSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
object BuildSettings {
private const val JVM_VERSION = 17
val javaVersion: JavaLanguageVersion = JavaLanguageVersion.of(JVM_VERSION)
@Suppress("unused")
val javaVersionCompat = JavaVersion.toVersion(JVM_VERSION)
val jvmTarget = JvmTarget.JVM_17
const val REMOTE_DEBUG_PORT = 5566
Expand Down
Loading
Loading