Skip to content

Commit

Permalink
settings-debian.gradle: separate out settings for builds on Debian Gr…
Browse files Browse the repository at this point in the history
…adle 4.4

This is meant to prepare for improvements to the regular `settings.gradle` file.
  • Loading branch information
schildbach committed Aug 27, 2024
1 parent a2642d8 commit 8873915
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bullseye-jdk11:
- 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
- gradle --settings-file settings-debian.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
Expand All @@ -32,7 +32,7 @@ bookworm-jdk17:
- apt-get update
- apt-get -y install openjdk-17-jdk-headless gradle
script:
- gradle build :bitcoinj-core:publishToMavenLocal :bitcoinj-wallettool:installDist --init-script build-scan-agree.gradle --scan --stacktrace
- gradle --settings-file settings-debian.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
Expand Down
7 changes: 7 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ Our reference build (which is also used for our releases) is running within a co
Buildah 1.26+, Podman 4.1+ and Docker (with BuildKit) are supported. We tested various combinations of host OSes
(Debian, Ubuntu, macOS, Windows+WSL) and architectures (amd64, arm64). For usage instructions see `build.Containerfile`.

This uses Debian Gradle with the `settings-debian.gradle` settings. If you happen to use Debian and have Gradle
installed from the Debian repository, you can invoke these settings directly:

```
gradle --settings-file settings-debian.gradle clean build
```

### Example applications

These are found in the `examples` module.
Expand Down
1 change: 1 addition & 0 deletions build.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ COPY --chown=builder / project/
# build project
RUN /usr/bin/gradle --project-dir project/ \
--no-build-cache --no-daemon --no-parallel \
--settings-file=settings-debian.gradle \
-Dmaven.repo.local=repo \
clean ${ADDITIONAL_GRADLE_TASK} :bitcoinj-core:publishToMavenLocal :bitcoinj-wallettool:installDist

Expand Down
31 changes: 31 additions & 0 deletions settings-debian.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Setting file only for Debian Gradle 4.4.1.
* Usage: gradle --settings-file=settings-debian.gradle build
*/

import org.gradle.util.GradleVersion

// required Gradle version for build
def gradleVersion = GradleVersion.version("4.4.1")

if (GradleVersion.current().compareTo(gradleVersion) != 0) {
throw new GradleScriptException("bitcoinj build requires Debian Gradle ${gradleVersion}", null)
}

if (!JavaVersion.current().isJava11Compatible()) {
throw new GradleScriptException("bitcoinj build requires Java 11 or later", null)
}

rootProject.name = 'bitcoinj-parent'

include 'core'
project(':core').name = 'bitcoinj-core'

include 'tools'
project(':tools').name = 'bitcoinj-tools'

include 'wallettool'
project(':wallettool').name = 'bitcoinj-wallettool'

include 'examples'
project(':examples').name = 'bitcoinj-examples'

0 comments on commit 8873915

Please sign in to comment.