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
4 changes: 2 additions & 2 deletions .github/workflows/javaci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v7
- name: Set up openJDK 21
- name: Set up openJDK 25
uses: actions/setup-java@v5.6.0
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ test:
./gradlew test

lint:
./gradlew checkstyleMain checkstyleTest
./gradlew spotlessCheck

lint-fix:
./gradlew spotlessApply

report:
./gradlew jacocoTestReport
Expand Down
38 changes: 29 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,53 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
jacoco
id("checkstyle")
id("com.github.ben-manes.versions") version "0.56.0"
alias(libs.plugins.spotless)
alias(libs.plugins.versions)
alias(libs.plugins.version.catalog.update)
}

group = "io.hexlet"

version = "1.0-SNAPSHOT"

java {
toolchain { languageVersion = JavaLanguageVersion.of(25) }
}

repositories { mavenCentral() }

dependencies {
testImplementation(platform("org.junit:junit-bom:6.1.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.assertj:assertj-core:3.27.7")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation(platform(libs.junitBom))
testImplementation(libs.junitJupiter)
testImplementation(libs.assertjCore)
testRuntimeOnly(libs.junitPlatformLauncher)
}

tasks.test {
useJUnitPlatform()
// https://technology.lastminute.com/junit5-kotlin-and-gradle-dsl/
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = mutableSetOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
// showStackTraces = true
// showCauses = true
showStandardStreams = true
}
}

tasks.jacocoTestReport { reports { xml.required.set(true) } }

spotless {
java {
importOrder()
removeUnusedImports()
googleJavaFormat().aosp()
formatAnnotations()
leadingTabsToSpaces(4)
endWithNewline()
}
}

// versionCatalogUpdate пишет свежие версии прямо в gradle/libs.versions.toml,
// поэтому руками их сверять не нужно. Ключи не сортируются: порядок в каталоге
// смысловой, по группам зависимостей.
versionCatalogUpdate {
sortByKey = false
}
208 changes: 0 additions & 208 deletions config/checkstyle/checkstyle.xml

This file was deleted.

21 changes: 19 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless-plugin" }
versions = { id = "io.github.ben-manes.versions", version.ref = "versions-plugin" }
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "catalog-update-plugin" }

[versions]
spotless-plugin = "8.9.0"
versions-plugin = "0.61.0"
catalog-update-plugin = "1.1.1"
junit-bom = "6.1.3"
assertj = "3.27.7"

[libraries]
# JUnit
junitBom = { module = "org.junit:junit-bom", version.ref = "junit-bom" }
junitJupiter = { module = "org.junit.jupiter:junit-jupiter" }
junitPlatformLauncher = { module = "org.junit.platform:junit-platform-launcher" }
# Assertions
assertjCore = { module = "org.assertj:assertj-core", version.ref = "assertj" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
Expand Down
Loading
Loading