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
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: 'true'

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu

- uses: gradle/actions/setup-gradle@v6

- name: Substitute Gradle settings file
shell: bash
run: ./substitute-settings.py
env:
COMPILER_VERSION: "2.0.0-SNAPSHOT.024"
VALIDATION_VERSION: "2.0.0-SNAPSHOT.351"
CORE_JVM_VERSION: "2.0.0-SNAPSHOT.330"
CORE_JVM_COMPILER_VERSION: "2.0.0-SNAPSHOT.015"
COMPILER_VERSION: "2.0.0-SNAPSHOT.065"
VALIDATION_VERSION: "2.0.0-SNAPSHOT.462"
CORE_JVM_VERSION: "2.0.0-SNAPSHOT.522"
CORE_JVM_COMPILER_VERSION: "2.0.0-SNAPSHOT.080"

- name: Build project
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .idea/kotlinc.xml

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

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ To launch the build speed tests with Gradle, follow these steps.
```kotlin
val prepareBuildSpeedSettings by tasks.registering(Exec::class) {
environment(
"MC_JAVA_VERSION" to Spine.McJava.version,
"CORE_VERSION" to Spine.ArtifactVersion.core,
"PROTO_DATA_VERSION" to ProtoData.version,
"VALIDATION_VERSION" to Validation.version
"COMPILER_VERSION" to Compiler.version,
"VALIDATION_VERSION" to Validation.version,
"CORE_JVM_VERSION" to CoreJvm.version,
"CORE_JVM_COMPILER_VERSION" to coreJvmCompilerVersion,
)
workingDir = File(rootDir, "BuildSpeed")
commandLine("./substitute-settings.py")
Expand Down
23 changes: 17 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

import io.spine.gradle.UpdateJournal
import io.spine.gradle.repo.standardToSpineSdk
import io.spine.tools.gradle.lib.spineExtension
import io.spine.tools.validation.gradle.ValidationExtension
import java.util.function.Supplier
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17

buildscript {
standardSpineSdkRepositories()
Expand All @@ -37,24 +40,26 @@ buildscript {
}

group = "io.spine.tools.tests"
version = "1.0.0-SNAPSHOT"
version = "2.0.0-SNAPSHOT"

plugins {
java
kotlin("jvm")
id("com.google.protobuf")
kotlin("jvm") version "2.3.21"
id("com.google.protobuf") version "0.10.0"
id("com.osacky.doctor") version "0.12.0"
}

val targetJvmVersion = JVM_17

kotlin {
explicitApi()
compilerOptions {
jvmTarget.set(BuildSettings.jvmTarget)
jvmTarget.set(targetJvmVersion)
}
}

tasks.withType<JavaCompile>().configureEach {
val javaVer = BuildSettings.javaVersion.toString()
val javaVer = targetJvmVersion.target
sourceCompatibility = javaVer
targetCompatibility = javaVer
}
Expand All @@ -73,6 +78,11 @@ if (file(customConfigFile).exists()) {
apply(from = customConfigFile)
}

afterEvaluate {
val validationExtension = spineExtension<ValidationExtension>()
validationExtension.java.suppressWarnings.unsignedFields.set(true)
}

/**
* Set up the `recordExecTime` task that logs the execution time of the build.
*
Expand All @@ -89,7 +99,8 @@ afterEvaluate {
startTimeMillis = System.currentTimeMillis()
}

val recordExecTime by tasks.registering(UpdateJournal::class) {
val recordExecTime = tasks.register<UpdateJournal>("recordExecTime") {
description = "Records the execution time of the build in a journal file."
startTime = Supplier { startTimeMillis!! }
versions.set(
mapOf(
Expand Down
130 changes: 0 additions & 130 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,10 @@

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/**
* This script uses two declarations of the constant [licenseReportVersion] because
* currently there is no way to define a constant _before_ a build script of `buildSrc`.
* We cannot use imports or do something else before the `buildscript` or `plugin` clauses.
*/

plugins {
java
groovy
`kotlin-dsl`

// https://github.com/jk1/Gradle-License-Report/releases
id("com.github.jk1.dependency-license-report").version("2.7")
}

repositories {
Expand All @@ -47,14 +38,6 @@ repositories {
mavenCentral()
}

/**
* The version of Jackson used by `buildSrc`.
*
* 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.18.3"

/**
* The version of Google Artifact Registry used by `buildSrc`.
*
Expand All @@ -65,96 +48,6 @@ val jacksonVersion = "2.18.3"
*/
val googleAuthToolVersion = "2.1.5"

val licenseReportVersion = "2.7"

val grGitVersion = "4.1.1"

/**
* The version of the Kotlin Gradle plugin used by the build process.
*
* This version may change from the [version of Kotlin][io.spine.dependency.lib.Kotlin.version]
* used by the project.
*/
val kotlinVersion = "2.2.20"

/**
* 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 = "33.4.8-jre"

/**
* The version of ErrorProne Gradle plugin.
*
* Please keep in sync. with [io.spine.dependency.build.ErrorProne.GradlePlugin.version].
*
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
* Error Prone Gradle Plugin Releases</a>
*/
val errorPronePluginVersion = "4.2.0"

/**
* The version of Protobuf Gradle Plugin.
*
* Please keep in sync. with [io.spine.dependency.lib.Protobuf.GradlePlugin.version].
*
* @see <a href="https://github.com/google/protobuf-gradle-plugin/releases">
* Protobuf Gradle Plugins Releases</a>
*/
val protobufPluginVersion = "0.9.5"

/**
* The version of Dokka Gradle Plugins.
*
* Please keep in sync with [io.spine.dependency.build.Dokka.version].
*
* @see <a href="https://github.com/Kotlin/dokka/releases">
* Dokka Releases</a>
*/
val dokkaVersion = "2.0.0"

/**
* The version of Detekt Gradle Plugin.
*
* @see <a href="https://github.com/detekt/detekt/releases">Detekt Releases</a>
*/
val detektVersion = "1.23.8"

/**
* @see [io.spine.dependency.test.Kotest]
*/
val kotestJvmPluginVersion = "0.4.10"

/**
* @see [io.spine.dependency.test.Kover]
*/
val koverVersion = "0.7.2"

/**
* The version of the Shadow Plugin.
*
* `7.1.2` is the last version compatible with Gradle 7.x. Newer versions require Gradle v8.x.
*
* @see <a href="https://github.com/johnrengelman/shadow/releases">Shadow Plugin releases</a>
*/
val shadowVersion = "8.3.6"

configurations.all {
resolutionStrategy {
force(
"com.google.guava:guava:${guavaVersion}",
"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"
)
}
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
Expand All @@ -166,30 +59,7 @@ kotlin {
}

dependencies {
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
dependOnAuthCommon()

listOf(
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion",
"com.github.jk1:gradle-license-report:$licenseReportVersion",
"com.google.guava:guava:$guavaVersion",
"com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion",
"com.gradleup.shadow:shadow-gradle-plugin:$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}",
"org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}",
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
"org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion"
).forEach {
implementation(it)
}
}

dependOnBuildSrcJar()
Expand Down
Loading
Loading