Skip to content

Commit

Permalink
Fix GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
marianobarrios committed May 11, 2024
1 parent d6e37c8 commit e87fee7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
${{ matrix.java-version }}
21
java-version: ${{ matrix.java-version }}
- run: ./gradlew assemble check --info
env:
JAVA_TOOLCHAIN: ${{ matrix.java-version }}
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ plugins {
id 'java'
id 'signing'
id 'maven-publish'
id "com.diffplug.spotless" version "6.25.0"
id "com.diffplug.spotless" version "6.25.0" apply false
id "com.github.spotbugs" version "6.0.14"
}

var javaToolchain = System.getenv('JAVA_TOOLCHAIN')
var javaToolchainStr = System.getenv('JAVA_TOOLCHAIN')
var javaToolchain = javaToolchainStr == null ? null : Integer.parseInt(javaToolchainStr)

java {
if (javaToolchain != null) {
toolchain {
languageVersion = JavaLanguageVersion.of(javaToolchain)
}
}
if (javaToolchain >= 21) {
apply plugin: 'com.diffplug.spotless'
}

compileJava {
Expand Down Expand Up @@ -49,10 +46,13 @@ dependencies {

}

spotless {
java {
// remove when spotless moved to this Palantir version
palantirJavaFormat("2.38.0")
if (javaToolchain >= 21) {
spotless {
java {
// remove when spotless moved to this Palantir version
//palantirJavaFormat("2.38.0")
palantirJavaFormat()
}
}
}

Expand Down

0 comments on commit e87fee7

Please sign in to comment.