Skip to content
Open
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
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
apply plugin: 'dev.equo.ide'
plugins {
alias(libs.plugins.equo.ide)
alias(libs.plugins.test.logger) apply false
alias(libs.plugins.spotless.changelog) apply false
alias(libs.plugins.plugin.publish) apply false
alias(libs.plugins.version.compatibility) apply false
alias(libs.plugins.nexus.publish) apply false
alias(libs.plugins.errorprone) apply false
alias(libs.plugins.rewrite) apply false
alias(libs.plugins.maven.plugin.development) apply false
alias(libs.plugins.p2deps) apply false
}

equoIde {
branding().title('Spotless').icon(file('_images/spotless_logo.png'))
Expand Down
15 changes: 0 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,3 @@ artifactIdMaven=spotless-maven-plugin

artifactIdGradle=spotless-plugin-gradle

# Build requirements
VER_JAVA=17
VER_JSR_305=3.0.2

# Dependencies provided by Spotless plugin
VER_SLF4J=[1.6,2.0[

# Used in multiple places
VER_DURIAN=1.2.0
VER_JGIT=7.5.0.202512021534-r
VER_JUNIT=6.0.3
VER_ASSERTJ=3.27.7
VER_MOCKITO=5.22.0
VER_SELFIE=2.5.5
VER_SOLSTICE=1.8.1
2 changes: 1 addition & 1 deletion gradle/error-prone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ tasks.withType(JavaCompile).configureEach {
}

dependencies {
errorprone('com.google.errorprone:error_prone_core:2.42.0')
errorprone libs.errorprone.core
}
6 changes: 3 additions & 3 deletions gradle/java-setup.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
apply plugin: 'java'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = Integer.parseInt(VER_JAVA)
options.release = libs.versions.jdk.release.get().toInteger()
}

//////////////
Expand Down Expand Up @@ -37,7 +37,7 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask).configureEach {
}

dependencies {
compileOnly 'net.jcip:jcip-annotations:1.0'
compileOnly libs.jcip.annotations
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
compileOnly "com.google.code.findbugs:jsr305:${VER_JSR_305}"
compileOnly libs.jsr305
}
78 changes: 78 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[versions]
jdk-release = "17"
durian = "1.2.0"
selfie = "2.5.5"
jackson = "2.20.1"
maven-api = "3.0"
ktlint = "1.8.0"

[libraries]
durian-core = { module = "com.diffplug.durian:durian-core", version.ref = "durian" }
durian-io = { module = "com.diffplug.durian:durian-io", version.ref = "durian" }
durian-collect = { module = "com.diffplug.durian:durian-collect", version.ref = "durian" }
durian-testlib = { module = "com.diffplug.durian:durian-testlib", version.ref = "durian" }

selfie-lib = { module = "com.diffplug.selfie:selfie-lib", version.ref = "selfie" }
selfie-runner-junit5 = { module = "com.diffplug.selfie:selfie-runner-junit5", version.ref = "selfie" }

solstice = "dev.equo.ide:solstice:1.8.1"

jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" }

maven-plugin-api = { module = "org.apache.maven:maven-plugin-api", version.ref = "maven-api" }
maven-plugin-annotations = { module = "org.apache.maven.plugin-tools:maven-plugin-annotations", version.ref = "maven-api" }
maven-core = { module = "org.apache.maven:maven-core", version.ref = "maven-api" }

ktlint-rule-engine = { module = "com.pinterest.ktlint:ktlint-rule-engine", version.ref = "ktlint" }
ktlint-ruleset-standard = { module = "com.pinterest.ktlint:ktlint-ruleset-standard", version.ref = "ktlint" }

jgit = "org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r"
junit-jupiter = "org.junit.jupiter:junit-jupiter:6.0.3"
assertj-core = "org.assertj:assertj-core:3.27.7"
mockito-core = "org.mockito:mockito-core:5.22.0"
osgi = "org.eclipse.platform:org.eclipse.osgi:3.24.0"
slf4j-api = "org.slf4j:slf4j-api:2.0.17"
jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
jcip-annotations = "net.jcip:jcip-annotations:1.0"
jakarta-annotation-api = "jakarta.annotation:jakarta.annotation-api:3.0.0"
aether-api = "org.eclipse.aether:aether-api:1.1.0"
plexus-resources = "org.codehaus.plexus:plexus-resources:1.3.1"
plexus-build-api = "org.sonatype.plexus:plexus-build-api:0.0.7"
concurrent-trees = "com.googlecode.concurrent-trees:concurrent-trees:2.6.1"
owasp-encoder = "org.owasp.encoder:encoder:1.4.0"
mustache-compiler = "com.github.spullara.mustache.java:compiler:0.9.14"
cleanthat-java = "io.github.solven-eu.cleanthat:java:2.24"
diktat-rules = "org.cqfn.diktat:diktat-rules:1.2.5"
diktat-runner = "com.saveourtool.diktat:diktat-runner:2.0.0"
flexmark-all = "com.vladsch.flexmark:flexmark-all:0.64.8"
gherkin-utils = "io.cucumber:gherkin-utils:10.0.0"
google-java-format = "com.google.googlejavaformat:google-java-format:1.28.0"
gson = "com.google.code.gson:gson:2.13.2"
javaparser-symbol-solver-core = "com.github.javaparser:javaparser-symbol-solver-core:3.27.1"
ktfmt = "com.facebook:ktfmt:0.61"
palantir-java-format = "com.palantir.javaformat:palantir-java-format:1.1.0"
scalafmt-core = "org.scalameta:scalafmt-core_2.13:3.8.1"
sortpom-sorter = "com.github.ekryd.sortpom:sortpom-sorter:4.0.0"
tabletest-formatter-core = "org.tabletest:tabletest-formatter-core:1.0.1"
zjsonpatch = "com.flipkart.zjsonpatch:zjsonpatch:0.4.16"

rewrite-recipe-migrate-java = "org.openrewrite.recipe:rewrite-migrate-java:3.28.0"
rewrite-recipe-static-analysis = "org.openrewrite.recipe:rewrite-static-analysis:2.28.0"
rewrite-recipe-third-party = "org.openrewrite.recipe:rewrite-third-party:0.36.0"

errorprone-core = "com.google.errorprone:error_prone_core:2.42.0"

[plugins]
test-logger = "com.adarshr.test-logger:4.0.0"
spotless = "com.diffplug.spotless:8.3.0"
spotless-changelog = "com.diffplug.spotless-changelog:3.1.2"
spotbugs = "com.github.spotbugs:6.4.8"
plugin-publish = "com.gradle.plugin-publish:2.1.0"
equo-ide = "dev.equo.ide:1.7.8"
version-compatibility = "io.github.davidburstrom.version-compatibility:0.5.0"
p2deps = "dev.equo.p2deps:1.7.8"
nexus-publish = "io.github.gradle-nexus.publish-plugin:2.0.0"
errorprone = "net.ltgt.errorprone:5.1.0"
rewrite = "org.openrewrite.rewrite:7.25.0"
maven-plugin-development = "org.gradlex.maven-plugin-development:1.0.3"
6 changes: 3 additions & 3 deletions gradle/rewrite.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rewrite {
failOnDryRunResults = true
}
dependencies {
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.28.0')
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.28.0')
rewrite('org.openrewrite.recipe:rewrite-third-party:0.36.0')
rewrite libs.rewrite.recipe.migrate.java
rewrite libs.rewrite.recipe.static.analysis
rewrite libs.rewrite.recipe.third.party
}
27 changes: 14 additions & 13 deletions lib-extra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,31 @@ apply from: rootProject.file('gradle/java-publish.gradle')
dependencies {
api projects.lib
// misc useful utilities
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
implementation libs.durian.core
implementation libs.durian.collect
// needed by GitAttributesLineEndings
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
implementation "com.googlecode.concurrent-trees:concurrent-trees:2.6.1"
implementation libs.jgit
implementation libs.concurrent.trees
// for eclipse
implementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
implementation libs.solstice
// the osgi dep is included in solstice, but it has some CVE's against it.
// 3.18.500 is the oldest, most-compatible version with no CVE's
// https://central.sonatype.com/artifact/org.eclipse.platform/org.eclipse.osgi/versions
implementation "org.eclipse.platform:org.eclipse.osgi:3.24.0"
implementation libs.osgi

// testing
testImplementation projects.testlib
testImplementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
testImplementation "com.google.code.findbugs:jsr305:${VER_JSR_305}"
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation libs.durian.io
testImplementation libs.jsr305
testImplementation libs.junit.jupiter
testImplementation libs.assertj.core
testImplementation libs.durian.testlib
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}

spotless {
java {
replaceRegex 'enforceSolsticeVersion', '"dev.equo.ide:solstice:(.*)"', '"dev.equo.ide:solstice:' + VER_SOLSTICE + '"'
replaceRegex 'enforceSolsticeVersion', '"dev.equo.ide:solstice:(.*)"', "\"${libs.solstice.get().toString()}\""
}
}

Expand All @@ -56,7 +57,7 @@ for (needsP2 in NEEDS_P2_DEPS) {
java {}
}
dependencies {
add("${needsP2}CompileOnly", "dev.equo.ide:solstice:${VER_SOLSTICE}")
add("${needsP2}CompileOnly", libs.solstice)
}
}

Expand Down
58 changes: 28 additions & 30 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,66 +73,64 @@ tasks.named("check").configure {
}

dependencies {
compileOnly 'org.slf4j:slf4j-api:2.0.17'
testCommonImplementation 'org.slf4j:slf4j-api:2.0.17'
compileOnly libs.slf4j.api
testCommonImplementation libs.slf4j.api

// zero runtime reqs is a hard requirements for spotless-lib
// if you need a dep, put it in lib-extra
testCommonImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
testCommonImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
testCommonImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"
testCommonImplementation libs.junit.jupiter
testCommonImplementation libs.assertj.core
testCommonImplementation libs.durian.testlib
testCommonImplementation projects.testlib
testCommonRuntimeOnly "org.junit.platform:junit-platform-launcher"

// GLUE CODE (alphabetic order please)
// cleanthat
String VER_CLEANTHAT='2.24'
cleanthatCompileOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
compatCleanthat2Dot1CompileAndTestOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
cleanthatCompileOnly libs.cleanthat.java
compatCleanthat2Dot1CompileAndTestOnly libs.cleanthat.java
// diktat old supported version 1.x
compatDiktat1Dot2Dot5CompileOnly "org.cqfn.diktat:diktat-rules:1.2.5"
compatDiktat1Dot2Dot5CompileOnly libs.diktat.rules
// diktat latest supported version 2.x
compatDiktat2Dot0Dot0CompileOnly "com.saveourtool.diktat:diktat-runner:2.0.0"
compatDiktat2Dot0Dot0CompileOnly libs.diktat.runner
// flexmark
flexmarkCompileOnly 'com.vladsch.flexmark:flexmark-all:0.64.8'
flexmarkCompileOnly libs.flexmark.all
// gherkin
gherkinCompileOnly 'io.cucumber:gherkin-utils:10.0.0'
gherkinCompileOnly 'org.slf4j:slf4j-api:2.0.17'
gherkinCompileOnly libs.gherkin.utils
gherkinCompileOnly libs.slf4j.api
// googleJavaFormat
googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.28.0'
googleJavaFormatCompileOnly libs.google.java.format
// gson
gsonCompileOnly 'com.google.code.gson:gson:2.13.2'
gsonCompileOnly libs.gson
// jackson
String VER_JACKSON='2.20.1'
jacksonCompileOnly "com.fasterxml.jackson.core:jackson-databind:$VER_JACKSON"
jacksonCompileOnly "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$VER_JACKSON"
jacksonCompileOnly libs.jackson.databind
jacksonCompileOnly libs.jackson.dataformat.yaml
// javaParser
javaParserCompileOnly "com.github.javaparser:javaparser-symbol-solver-core:3.27.1"
javaParserCompileOnly libs.javaparser.symbol.solver.core
// ktfmt
ktfmtCompileOnly "com.facebook:ktfmt:0.61"
ktfmtCompileOnly libs.ktfmt
ktfmtCompileOnly("com.google.googlejavaformat:google-java-format") {
version {
strictly '1.7' // for JDK 8 compatibility
}
}
ktfmtCompileOnly "com.google.code.findbugs:jsr305:${VER_JSR_305}"
ktfmtCompileOnly libs.jsr305
// ktlint latest supported version
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:1.8.0'
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:1.8.0'
compatKtLint1Dot0Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.17'
compatKtLint1Dot0Dot0CompileAndTestOnly libs.ktlint.rule.engine
compatKtLint1Dot0Dot0CompileAndTestOnly libs.ktlint.ruleset.standard
compatKtLint1Dot0Dot0CompileAndTestOnly libs.slf4j.api
// palantirJavaFormat
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
palantirJavaFormatCompileOnly libs.palantir.java.format // this version needs to stay compilable against Java 8 for CI Job testNpm
// scalafmt
scalafmtCompileOnly "org.scalameta:scalafmt-core_2.13:3.8.1"
scalafmtCompileOnly libs.scalafmt.core
// sortPom
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:4.0.0'
sortPomCompileOnly 'org.slf4j:slf4j-api:2.0.17'
sortPomCompileOnly libs.sortpom.sorter
sortPomCompileOnly libs.slf4j.api
// tableTestFormatter (Java 21+ only)
if (JavaVersion.current() >= JavaVersion.VERSION_21) {
tableTestFormatterCompileOnly 'org.tabletest:tabletest-formatter-core:1.0.1'
tableTestFormatterCompileOnly libs.tabletest.formatter.core
}
// zjsonPatch
zjsonPatchCompileOnly 'com.flipkart.zjsonpatch:zjsonpatch:0.4.16'
zjsonPatchCompileOnly libs.zjsonpatch
}

// we'll hold the core lib to a high standard
Expand Down
18 changes: 9 additions & 9 deletions plugin-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ dependencies {
api "com.diffplug.spotless:spotless-lib:${rootProject.spotlessChangelog.versionLast}"
api "com.diffplug.spotless:spotless-lib-extra:${rootProject.spotlessChangelog.versionLast}"
}
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
implementation libs.durian.core
implementation libs.durian.io
implementation libs.durian.collect
implementation libs.jgit

testImplementation projects.testlib
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation 'org.owasp.encoder:encoder:1.4.0'
testImplementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
testImplementation libs.junit.jupiter
testImplementation libs.assertj.core
testImplementation libs.durian.testlib
testImplementation libs.owasp.encoder
testImplementation libs.solstice
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}

Expand Down
47 changes: 22 additions & 25 deletions plugin-maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.gradlex.maven.plugin.development.task.GenerateMavenPluginDescriptorTa

plugins {
// https://github.com/gradlex-org/maven-plugin-development
id 'org.gradlex.maven-plugin-development' version '1.0.3'
alias libs.plugins.maven.plugin.development
}

apply from: rootProject.file('gradle/changelog.gradle')
Expand All @@ -19,38 +19,35 @@ mavenPlugin {
description = project.description
}

String VER_MAVEN_API = '3.0'
String VER_ECLIPSE_AETHER = '1.1.0'
String VER_PLEXUS_RESOURCES = '1.3.1'
dependencies {
implementation projects.lib
implementation projects.libExtra

compileOnly "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
compileOnly "org.apache.maven.plugin-tools:maven-plugin-annotations:${VER_MAVEN_API}"
compileOnly "org.apache.maven:maven-core:${VER_MAVEN_API}"
compileOnly "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
compileOnly libs.maven.plugin.api
compileOnly libs.maven.plugin.annotations
compileOnly libs.maven.core
compileOnly libs.aether.api

compileOnly "jakarta.annotation:jakarta.annotation-api:3.0.0"
compileOnly libs.jakarta.annotation.api

implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
implementation("org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}")
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
implementation 'org.sonatype.plexus:plexus-build-api:0.0.7'
implementation libs.durian.core
implementation libs.durian.io
implementation libs.durian.collect
implementation libs.plexus.resources
implementation libs.jgit
implementation libs.plexus.build.api

testImplementation project(":testlib")
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "org.mockito:mockito-core:${VER_MOCKITO}"
testImplementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
testImplementation 'com.github.spullara.mustache.java:compiler:0.9.14'
testImplementation 'org.owasp.encoder:encoder:1.4.0'
testImplementation "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
testImplementation "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
testImplementation "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}"
testImplementation "org.apache.maven:maven-core:${VER_MAVEN_API}"
testImplementation libs.junit.jupiter
testImplementation libs.assertj.core
testImplementation libs.mockito.core
testImplementation libs.durian.io
testImplementation libs.mustache.compiler
testImplementation libs.owasp.encoder
testImplementation libs.maven.plugin.api
testImplementation libs.aether.api
testImplementation libs.plexus.resources
testImplementation libs.maven.core
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}

Expand Down
Loading
Loading