Skip to content

Commit c7ca28d

Browse files
authored
Merge pull request #165 from gocardless/template-changes
Changes from gocardless/client-library-templates
2 parents 00876d0 + ffc17b0 commit c7ca28d

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
jdk-version: [ 8, 11 ]
15+
jdk-version: [25, 21, 17, 11, 8]
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-java@v2
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-java@v5
1919
with:
2020
java-version: "${{ matrix.jdk-version }}"
21-
distribution: adopt
21+
distribution: temurin
2222
- name: Verify java installed properly
2323
run: java -version
2424
- name: Grant execute permission for gradlew
@@ -36,7 +36,7 @@ jobs:
3636
run: |-
3737
mkdir -p ~/junit
3838
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
39-
- uses: actions/upload-artifact@v4
39+
- uses: actions/upload-artifact@v6
4040
if: always()
4141
with:
4242
name: test_library_jdk${{ matrix.jdk-version }}_junit

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java Client for GoCardless Pro API
1+
# Java Client for GoCardless API
22

33
This library provides a simple wrapper around the [GoCardless API](http://developer.gocardless.com/api-reference).
44

build.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ buildscript {
1111

1212
dependencies {
1313
classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.2.1'
14+
// Only add Spotless if running on Java 11+
15+
// TODO: Remove this when we drop support for Java 8
16+
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
17+
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
18+
}
1419
}
1520
}
1621

@@ -19,7 +24,6 @@ plugins {
1924
id "signing"
2025
id "maven-publish"
2126
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
22-
id "com.diffplug.spotless" version "5.12.5"
2327
}
2428

2529
sourceCompatibility = 1.8
@@ -29,6 +33,13 @@ version = '7.6.0'
2933

3034
apply plugin: 'ch.raffael.pegdown-doclet'
3135

36+
// TODO: Remove this when we drop support for Java 8
37+
// Conditionally apply Spotless plugin only on Java 11+
38+
// (required because Spotless 6.x needs Java 11+ to load)
39+
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
40+
apply plugin: 'com.diffplug.spotless'
41+
}
42+
3243
repositories {
3344
mavenCentral()
3445
maven { url 'https://plugins.gradle.org/m2/' }
@@ -66,12 +77,12 @@ javadoc {
6677

6778
task javadocJar(type: Jar, dependsOn: javadoc) {
6879
from tasks.javadoc.destinationDir
69-
classifier = 'javadoc'
80+
archiveClassifier = 'javadoc'
7081
}
7182

7283
task sourcesJar(type: Jar) {
7384
from sourceSets.main.allSource
74-
classifier = 'sources'
85+
archiveClassifier = 'sources'
7586
}
7687

7788
publishing {
@@ -147,10 +158,13 @@ nexusPublishing {
147158
}
148159
}
149160

150-
spotless {
151-
java {
152-
importOrder()
153-
removeUnusedImports()
154-
eclipse().configFile("format.xml")
161+
// Only configure Spotless if it was applied (Java 11+)
162+
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
163+
spotless {
164+
java {
165+
importOrder()
166+
removeUnusedImports()
167+
eclipse().configFile("format.xml")
168+
}
155169
}
156170
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip

0 commit comments

Comments
 (0)