Skip to content

Commit

Permalink
settings.gradle: require JDK 17 for the build
Browse files Browse the repository at this point in the history
  • Loading branch information
schildbach committed Aug 23, 2024
1 parent a2642d8 commit 63a636c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macOS-12, windows-2022]
java: ['11', '17', '21']
java: ['17', '21']
distribution: ['temurin']
gradle: ['8.10']
include:
# Special case to test something close to Debian config with the oldest supported (standard) Gradle on Ubuntu
- os: ubuntu-22.04
java: '11'
java: '17'
distribution: 'temurin'
gradle: '4.10.3'
fail-fast: false
Expand Down
11 changes: 0 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ reference:
paths:
- build/**

bullseye-jdk11:
image: debian:bullseye-slim
before_script:
- apt-get update
- apt-get -y install openjdk-11-jdk-headless gradle
script:
- gradle build :bitcoinj-core:publishToMavenLocal :bitcoinj-wallettool:installDist --init-script build-scan-agree.gradle --scan --stacktrace
after_script:
- gradle --version
- sha256sum core/build/libs/*.jar wallettool/build/install/wallet-tool/bin/* wallettool/build/install/wallet-tool/lib/*.jar

bookworm-jdk17:
image: debian:bookworm-slim
before_script:
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To get started, it is best to have the latest JDK and Gradle installed. The HEAD

#### Building from the command line

Official builds are currently using JDK 17. Our GitHub Actions build and test with JDK 11, 17 and 21.
Official builds are currently using JDK 17. Our GitHub Actions build and test with JDK 17 and 21.

To perform a full build (_including_ JavaDocs, unit/integration _tests_, and `wallettemplate`) use JDK 17+.

Expand Down
11 changes: 6 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import org.gradle.util.GradleVersion

// Minimum Gradle version for build
def minGradleVersion = GradleVersion.version("4.4")
// Minimum Gradle version for checking for minimum Java version
def minJavaCheckGradleVersion = GradleVersion.version("6.3")
// Minimum Gradle version for JUnit5
def minJunit5GradleVersion = GradleVersion.version("4.6")
// Minimum Gradle version for builds of JavaFX 17 module using JDK 17
Expand All @@ -14,9 +16,8 @@ rootProject.name = 'bitcoinj-parent'
if (GradleVersion.current().compareTo(minGradleVersion) < 0) {
throw new GradleScriptException("bitcoinj build requires Gradle ${minGradleVersion} or later", null)
}

if (!JavaVersion.current().isJava11Compatible()) {
throw new GradleScriptException("bitcoinj build requires Java 11 or later", null)
if (GradleVersion.current().compareTo(minJavaCheckGradleVersion) >= 0 && !JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
throw new GradleScriptException("bitcoinj build requires Java 17 or later", null)
}

include 'core'
Expand All @@ -31,12 +32,12 @@ project(':wallettool').name = 'bitcoinj-wallettool'
include 'examples'
project(':examples').name = 'bitcoinj-examples'

if (GradleVersion.current().compareTo(minFxGradleVersion) > 0 && JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
if (GradleVersion.current().compareTo(minFxGradleVersion) > 0) {
System.err.println "Including wallettemplate because ${GradleVersion.current()}"
include 'wallettemplate'
project(':wallettemplate').name = 'bitcoinj-wallettemplate'
} else {
System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+ and Java 17+, currently running Gradle: ${GradleVersion.current()}, Java ${JavaVersion.current()}"
System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+, currently running: ${GradleVersion.current()}"
}

if (GradleVersion.current().compareTo(minJunit5GradleVersion) >= 0) {
Expand Down

0 comments on commit 63a636c

Please sign in to comment.