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
8 changes: 2 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ buildscript {
// Make sure we have the right Protobuf Runtime.
io.spine.dependency.lib.Protobuf.javaLib,
io.spine.dependency.local.Logging.grpcContext,
"io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.360",
)
}
}
Expand Down Expand Up @@ -129,17 +130,12 @@ allprojects {
Time.javaExtensions,
ToolBase.lib,
ToolBase.pluginBase,
"io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.360",
)
}
}
}

subprojects {
apply {
plugin("module")
}
}

JacocoConfig.applyTo(project)
LicenseReporter.mergeAllReports(project)
PomGenerator.applyTo(project)
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ fun Project.configureTaskDependencies() {
"compileTestFixturesKotlin".dependOn("kspTestFixturesKotlin")
"javadocJar".dependOn(dokkaGeneratePublicationJavadoc)
"htmlDocsJar".dependOn(dokkaGenerate)

"kspTestKotlin".dependOn("launchTestSpineCompiler")
}
}

Expand Down
46 changes: 0 additions & 46 deletions buildSrc/src/main/kotlin/module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ plugins {
id("dokka-setup")
`maven-publish`
jacoco
idea
id("project-report")
id("pmd-settings")
}
Expand All @@ -77,7 +76,6 @@ JavadocConfig.applyTo(project)
project.run {
addDependencies()
forceConfigurations()
applyGeneratedDirectories("$projectDir/generated")

val javaVersion = BuildSettings.javaVersion
configureJava(javaVersion)
Expand Down Expand Up @@ -229,50 +227,6 @@ fun Module.configureKotlin(javaVersion: JavaLanguageVersion) {
}
}

/**
* Adds directories with the generated source code to source sets of the project and
* to IntelliJ IDEA module settings.
*
* @param generatedDir
* the name of the root directory with the generated code.
*/
fun Module.applyGeneratedDirectories(generatedDir: String) {
val generatedMain = "$generatedDir/main"
val generatedJava = "$generatedMain/java"
val generatedKotlin = "$generatedMain/kotlin"
val generatedGrpc = "$generatedMain/grpc"
val generatedSpine = "$generatedMain/spine"

val generatedTest = "$generatedDir/test"
val generatedTestJava = "$generatedTest/java"
val generatedTestKotlin = "$generatedTest/kotlin"
val generatedTestGrpc = "$generatedTest/grpc"
val generatedTestSpine = "$generatedTest/spine"

idea {
module {
generatedSourceDirs.addAll(files(
generatedJava,
generatedTestJava,
generatedKotlin,
generatedTestKotlin,
generatedGrpc,
generatedTestGrpc,
generatedSpine,
generatedTestSpine,
))
testSources.from(
generatedTestJava,
generatedTestKotlin,
generatedTestGrpc,
generatedTestSpine,
)
isDownloadJavadoc = true
isDownloadSources = true
}
}
}

fun Module.configureProtoc() {
protobuf {
protoc { artifact = Protobuf.compiler }
Expand Down
7 changes: 7 additions & 0 deletions context-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@
*/

import io.spine.dependency.artifact
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.Compiler
import io.spine.dependency.local.Logging
import io.spine.dependency.test.JUnit.Jupiter
import io.spine.gradle.report.license.LicenseReporter

plugins {
java
protobuf
`java-test-fixtures`
prototap
}
LicenseReporter.generateReportIn(project)

dependencies {
implementation(project(":context"))
Expand All @@ -47,3 +50,7 @@ dependencies {
testFixturesImplementation(Compiler.testlib)
testFixturesImplementation(Jupiter.artifact { params })
}

protobuf {
protoc { artifact = Protobuf.compiler }
}
4 changes: 4 additions & 0 deletions context/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ buildscript {
}
}

plugins {
module
}

apply(plugin = "io.spine.core-jvm")

dependencies {
Expand Down
7,990 changes: 1,669 additions & 6,321 deletions dependencies.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions java-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ import io.spine.dependency.local.Compiler
import io.spine.dependency.local.CoreJvm
import io.spine.dependency.local.Reflect
import io.spine.dependency.local.Time
import io.spine.gradle.report.license.LicenseReporter

plugins {
`fat-jar`
}
LicenseReporter.generateReportIn(project)

dependencies {

Expand Down
1 change: 1 addition & 0 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import io.spine.dependency.local.Compiler
*/

plugins {
module
`build-proto-model`
}

Expand Down
4 changes: 2 additions & 2 deletions jvm-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ buildscript {
}

plugins {
module
`build-proto-model`
id("io.spine.generated-sources")
id("io.spine.descriptor-set-file")
// We use it the KSP plugin via its ID because it's added to the build classpath
// in the root project.
id("com.google.devtools.ksp")
`build-proto-model`
module
id("maven-publish")
}

Expand Down
1 change: 1 addition & 0 deletions ksp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import io.spine.dependency.test.KotlinCompileTesting

plugins {
id("com.google.devtools.ksp")
module
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject.
-->
<groupId>io.spine.tools</groupId>
<artifactId>validation</artifactId>
<version>2.0.0-SNAPSHOT.382</version>
<version>2.0.0-SNAPSHOT.383</version>

<inceptionYear>2015</inceptionYear>

Expand Down Expand Up @@ -356,7 +356,7 @@ all modules and does not describe the project structure per-subproject.
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-build-tools-impl</artifactId>
<version>2.2.21</version>
<version>null</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
9 changes: 7 additions & 2 deletions tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ import io.spine.dependency.local.CoreJvmCompiler
import io.spine.dependency.local.ToolBase
import io.spine.dependency.local.Validation.javaBundleModule
import io.spine.dependency.local.Validation.runtimeModule
import io.spine.gradle.report.license.LicenseReporter

buildscript {
forceCodegenPlugins()
}

plugins {
java
kotlin("jvm")
}
LicenseReporter.generateReportIn(project)

allprojects {
// No need to generate documentation for these test environments.
Expand Down Expand Up @@ -73,7 +76,7 @@ allprojects {
*
* Subprojects of `java-tests` which are not listed here will get Compiler Gradle Plugin applied.
*/
val applyMcJava = setOf(
val applyCoreJvmCompiler = setOf(
"extensions",
"consumer-dependency",
"runtime",
Expand All @@ -92,7 +95,9 @@ subprojects {
}

fun Project.applyPlugins() {
if (project.name in applyMcJava) {
apply(plugin = "java")
apply(plugin = "com.google.protobuf")
if (project.name in applyCoreJvmCompiler) {
apply(plugin = CoreJvmCompiler.pluginId)
} else {
apply(plugin = Compiler.pluginId)
Expand Down
7 changes: 7 additions & 0 deletions tests/consumer-dependency/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import io.spine.gradle.report.license.LicenseReporter

/*
* Copyright 2024, TeamDev. All rights reserved.
*
Expand Down Expand Up @@ -36,6 +38,11 @@ buildscript {
}
}

plugins {
kotlin("jvm")
}
LicenseReporter.generateReportIn(project)

afterEvaluate {
val kspKotlin by tasks.getting
val launchSpineCompiler by tasks.getting
Expand Down
5 changes: 5 additions & 0 deletions tests/consumer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.dependency.boms.BomsPlugin
import io.spine.dependency.local.TestLib
import io.spine.dependency.local.Time
import io.spine.gradle.report.license.LicenseReporter
import io.spine.tools.compiler.gradle.plugin.LaunchSpineCompiler

apply<BomsPlugin>()
LicenseReporter.generateReportIn(project)

spine {
compiler {
plugins(
Expand Down
7 changes: 5 additions & 2 deletions tests/extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
import io.spine.dependency.build.Ksp
import io.spine.dependency.lib.AutoServiceKsp
import io.spine.dependency.local.CoreJvmCompiler
import io.spine.gradle.report.license.LicenseReporter

apply {
plugin(Ksp.id)
plugins {
kotlin("jvm")
id("com.google.devtools.ksp")
}
LicenseReporter.generateReportIn(project)

dependencies {
implementation(project(":java"))
Expand Down
13 changes: 13 additions & 0 deletions tests/runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.dependency.boms.BomsPlugin
import io.spine.dependency.local.Logging
import io.spine.dependency.local.TestLib
import io.spine.gradle.report.license.LicenseReporter

plugins {
java
`java-library`
kotlin("jvm")
id("module-testing")
}
apply<BomsPlugin>()
LicenseReporter.generateReportIn(project)

dependencies {
testImplementation(Logging.lib)
testImplementation(TestLib.lib)
}

configureTaskDependencies()
8 changes: 8 additions & 0 deletions tests/validating/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ import io.spine.dependency.test.JUnit
import io.spine.dependency.test.JUnit.Jupiter
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.Truth
import io.spine.gradle.report.license.LicenseReporter

plugins {
`java-test-fixtures`
kotlin("jvm")
id("module-testing")
}
LicenseReporter.generateReportIn(project)

dependencies {
testFixturesAnnotationProcessor(AutoService.processor)
Expand Down Expand Up @@ -76,3 +80,7 @@ afterEvaluate {
mustRunAfter("launchTestFixturesSpineCompiler")
}
}

val testFixturesJar by tasks.getting(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
34 changes: 34 additions & 0 deletions tests/validator-dependency/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import io.spine.gradle.report.license.LicenseReporter

/*
* 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
*
* 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
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

plugins {
`java-library`
kotlin("jvm")
id("com.google.protobuf")
}
LicenseReporter.generateReportIn(project)
7 changes: 7 additions & 0 deletions tests/validator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import io.spine.gradle.report.license.LicenseReporter

/*
* Copyright 2025, TeamDev. All rights reserved.
*
Expand Down Expand Up @@ -29,8 +31,13 @@ buildscript {
}

plugins {
java
id("com.google.protobuf")
kotlin("jvm")
id("com.google.devtools.ksp")
id("module-testing")
}
LicenseReporter.generateReportIn(project)

dependencies {
ksp(project(":ksp"))
Expand Down
Loading
Loading