Skip to content

Commit

Permalink
settings.gradle: require Gradle 7.3 or later
Browse files Browse the repository at this point in the history
Two reasons for picking that particular version:
* it enables us to replace all previous Gradle-related conditionals in this file
* it's required for official support of Java 17
  • Loading branch information
schildbach committed Aug 27, 2024
1 parent 8873915 commit dc3897b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 32 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ jobs:
java: ['11', '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'
distribution: 'temurin'
gradle: '4.10.3'
fail-fast: false
name: JAVA ${{ matrix.distribution }} ${{ matrix.java }} OS ${{ matrix.os }} Gradle ${{ matrix.gradle }}
steps:
Expand Down
11 changes: 6 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ The bitcoinj library is a Java implementation of the Bitcoin protocol, which all

### Technologies

* Java 8+ (needs Java 8 API or Android 8.0 API, compiles to Java 8 bytecode) and Gradle 4.4+ for the `core` module
* Java 11+ and Gradle 4.4+ for `tools`, `wallettool` and `examples`
* Java 17+ and Gradle 7.3+ for the JavaFX-based `wallettemplate`
* https://gradle.org/[Gradle] - for building the project
* Java 8+ (needs Java 8 API or Android 8.0 API, compiles to Java 8 bytecode) for the `core` module
* Java 11+ for `tools`, `wallettool` and `examples`
* Java 17+ for the JavaFX-based `wallettemplate`
* https://gradle.org/[Gradle] 7.3+ for building the whole project or
* Debian Gradle 4.4 for just the `core`, `tools`, `wallettool` and `examples` modules (see "reference build" below)
* https://github.com/google/protobuf[Google Protocol Buffers] - for use with serialization and hardware communications
### Getting started
Expand All @@ -29,7 +30,7 @@ To perform a full build (_including_ JavaDocs, unit/integration _tests_, and `wa
```
gradle clean build
```
If you are using JDK 17+ and Gradle 7.3+, the build will automatically include the JavaFX-based `wallettemplate` module. The outputs are under the `build` directory.
If you are using JDK 17+, the build will automatically include the JavaFX-based `wallettemplate` module. The outputs are under the `build` directory.

To perform a full build _without_ unit/integration _tests_ use:
```
Expand Down
34 changes: 13 additions & 21 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
* Settings file for Gradle 7.3 or later.
* For building with Debian Gradle 4.4, use the settings-debian.gradle settings.
*/

import org.gradle.util.GradleVersion

// Minimum Gradle version for build
def minGradleVersion = GradleVersion.version("4.4")
// Minimum Gradle version for JUnit5
def minJunit5GradleVersion = GradleVersion.version("4.6")
// Minimum Gradle version for builds of JavaFX 17 module using JDK 17
def minFxGradleVersion = GradleVersion.version("7.3")
// Minimum Gradle version for kotlin
def minKotlinGradleVersion = GradleVersion.version("6.8.3")
def minGradleVersion = GradleVersion.version("7.3")

rootProject.name = 'bitcoinj-parent'

Expand All @@ -31,23 +30,16 @@ project(':wallettool').name = 'bitcoinj-wallettool'
include 'examples'
project(':examples').name = 'bitcoinj-examples'

if (GradleVersion.current().compareTo(minFxGradleVersion) > 0 && JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
System.err.println "Including wallettemplate because ${GradleVersion.current()}"
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
System.err.println "Including wallettemplate because ${JavaVersion.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 Java 17+, currently running Java ${JavaVersion.current()}"
}

if (GradleVersion.current().compareTo(minJunit5GradleVersion) >= 0) {
System.err.println "Including integration-test because ${GradleVersion.current()}"
include 'integration-test'
project(':integration-test').name = 'bitcoinj-integration-test'
} else {
System.err.println "Skipping integration-test, requires Gradle ${minJunit5GradleVersion}+, currently running: ${GradleVersion.current()}"
}
include 'integration-test'
project(':integration-test').name = 'bitcoinj-integration-test'

if (GradleVersion.current().compareTo(minKotlinGradleVersion) >= 0) {
include 'examples-kotlin'
project(':examples-kotlin').name = 'bitcoinj-examples-kotlin'
}
include 'examples-kotlin'
project(':examples-kotlin').name = 'bitcoinj-examples-kotlin'

0 comments on commit dc3897b

Please sign in to comment.