Skip to content

Commit

Permalink
Adopt latest spotless, and enable freshmark on all JRE versions thank…
Browse files Browse the repository at this point in the history
…s to #1304.
  • Loading branch information
nedtwigg committed Feb 5, 2023
1 parent 8d99d7d commit e19c156
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions gradle/spotless-freshmark.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@

import java.util.regex.Matcher
import java.util.regex.Pattern


def thisVm() {
String jre = System.getProperty("java.version")
if (jre.startsWith("1.8")) {
return 8
} else {
Matcher matcher = Pattern.compile("(\\d+)").matcher(jre)
if (!matcher.find()) {
throw new IllegalArgumentException("Expected " + jre + " to start with an integer")
}
int version = Integer.parseInt(matcher.group(1))
if (version <= 8) {
throw new IllegalArgumentException("Expected " + jre + " to start with an integer greater than 8")
}
return version
}
}

if (thisVm() >= 15) {
// freshmark doesn't run on JRE 15+
return
}

apply plugin: 'com.diffplug.spotless'

import com.diffplug.gradle.spotless.FreshMarkExtension
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
}

plugins {
id 'com.diffplug.spotless' version '6.14.0' apply false
id 'com.diffplug.spotless' version '6.14.1' apply false
// https://plugins.gradle.org/plugin/com.gradle.plugin-publish
id 'com.gradle.plugin-publish' version '1.1.0' apply false
// https://github.com/gradle-nexus/publish-plugin/releases
Expand Down

0 comments on commit e19c156

Please sign in to comment.