diff --git a/.gitignore b/.gitignore
index 7a2b0042e..70b610855 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
target
+build
+.gradle
.project
.classpath
.settings
diff --git a/.travis.yml b/.travis.yml
index 176714d34..12c269325 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,16 +3,15 @@ sudo: false
dist: trusty
language: java
jdk: oraclejdk8
-install: true # remove default
+install:
+# before_install:
+ - sudo apt-get -qq update
+ - sudo apt-get install -y protobuf-compiler
script:
- - mvn -q clean install -Pno-network
+ - gradle -q clean install
- jdk_switcher use openjdk7
- cd core
- - mvn -q clean package -Pno-network
-
-after_success:
- - cd ../core
- - mvn jacoco:report coveralls:report
+ - gradle -q clean build
notifications:
irc:
diff --git a/README.md b/README.md
index 022ca4c69..daff77139 100644
--- a/README.md
+++ b/README.md
@@ -9,30 +9,30 @@ The bitcoinj library is a Java implementation of the Bitcoin protocol, which all
### Technologies
* Java 7 for the core modules, Java 8 for everything else
-* [Maven 3+](http://maven.apache.org) - for building the project
+* [Gradle 3.4+](https://gradle.org/) - for building the project
* [Google Protocol Buffers](https://github.com/google/protobuf) - for use with serialization and hardware communications
### Getting started
-To get started, it is best to have the latest JDK and Maven installed. The HEAD of the `master` branch contains the latest development code and various production releases are provided on feature branches.
+To get started, it is best to have the latest JDK and Gradle installed. The HEAD of the `master` branch contains the latest development code and various production releases are provided on feature branches.
#### Building from the command line
To perform a full build use
```
-mvn clean package
+gradle clean build
```
You can also run
```
-mvn site:site
+gradle javadoc
```
-to generate a website with useful information like JavaDocs.
+to generate the JavaDocs.
-The outputs are under the `target` directory.
+The outputs are under the `build` directory.
#### Building from an IDE
-Alternatively, just import the project using your IDE. [IntelliJ](http://www.jetbrains.com/idea/download/) has Maven integration built-in and has a free Community Edition. Simply use `File | Import Project` and locate the `pom.xml` in the root of the cloned project source tree.
+Alternatively, just import the project using your IDE. [IntelliJ](http://www.jetbrains.com/idea/download/) has Gradle integration built-in and has a free Community Edition. Simply use `File | New | Project from Existing Sources` and locate the `build.gradle` in the root of the cloned project source tree.
### Example applications
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 000000000..6fa85dd6d
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,17 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+
+ dependencies {
+ classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.4'
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+
+ group = 'org.bitcoinj'
+}
diff --git a/core/build.gradle b/core/build.gradle
new file mode 100644
index 000000000..0aadf5695
--- /dev/null
+++ b/core/build.gradle
@@ -0,0 +1,48 @@
+apply plugin: 'java'
+apply plugin: 'com.google.protobuf'
+apply plugin: 'maven'
+
+version = '0.15-SNAPSHOT'
+archivesBaseName = 'bitcoinj-core'
+
+dependencies {
+ compile 'com.madgag.spongycastle:core:1.58.0.0'
+ implementation 'com.lambdaworks:scrypt:1.4.0'
+ implementation 'com.google.guava:guava:24.0-android'
+ compile 'com.google.protobuf:protobuf-java:3.5.1'
+ implementation 'com.squareup.okhttp3:okhttp:3.9.1'
+ implementation 'org.slf4j:slf4j-api:1.7.25'
+ implementation 'net.jcip:jcip-annotations:1.0'
+ compileOnly 'org.fusesource.leveldbjni:leveldbjni-all:1.8'
+ testImplementation 'junit:junit:4.12'
+ testImplementation 'org.easymock:easymock:3.2'
+ testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.5.2'
+ testImplementation 'org.slf4j:slf4j-jdk14:1.7.25'
+ testImplementation 'com.h2database:h2:1.3.167'
+ testImplementation 'org.fusesource.leveldbjni:leveldbjni-all:1.8'
+}
+
+sourceCompatibility = 1.7
+
+protobuf {
+ generatedFilesBaseDir = new File(projectDir, '/src') // workaround for '$projectDir/src'
+}
+
+test {
+ exclude 'org/bitcoinj/net/NetworkAbstractionTests*'
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+artifacts {
+ archives sourcesJar
+ archives javadocJar
+}
diff --git a/core/pom.xml b/core/pom.xml
deleted file mode 100644
index cc5425786..000000000
--- a/core/pom.xml
+++ /dev/null
@@ -1,451 +0,0 @@
-
-
-
-
- 4.0.0
-
- org.bitcoinj
- bitcoinj-parent
- 0.15-SNAPSHOT
-
-
- bitcoinj-core
-
- bitcoinj
- A Java Bitcoin library
-
- jar
-
- https://bitcoinj.github.io
-
-
-
- The Apache Software License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
-
-
-
- The bitcoinj team
- bitcoinj@googlegroups.com
-
-
-
-
-
- update-protobuf
-
-
- updateProtobuf
- true
-
-
-
-
-
- maven-antrun-plugin
-
-
- compile-protoc
- generate-sources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- run
-
-
-
-
-
-
-
-
- no-network
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- **/core/PeerTest.java
- **/core/TransactionBroadcastTest.java
- **/net/NetworkAbstractionTests.java
- **/protocols/channels/ChannelConnectionTest
-
-
-
-
-
-
-
-
-
-
-
- maven-compiler-plugin
-
-
- 1.7
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- attach-sources
- verify
-
- jar-no-fork
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
-
- https://google.github.io/guava/releases/22.0/api/docs/
-
-
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
-
-
- enforce
- verify
-
- enforce
-
-
-
-
-
-
-
- true
-
-
-
-
-
- cglib:cglib-nodep:2.2:jar:null:test:59afed7ab65e7ec6585d5bc60556c3cbd203532b
- com.fasterxml.jackson.core:jackson-annotations:2.5.0:jar:null:test:a2a55a3375bc1cef830ca426d68d2ea22961190e
- com.fasterxml.jackson.core:jackson-core:2.5.1:jar:null:test:e2a00ad1d7e540ec395e9296a34da484c8888d4d
- com.fasterxml.jackson.core:jackson-databind:2.5.2:jar:null:test:2b4dd13fbe6f8c6b146d4c3b7fd70862f136802d
- com.google.code.findbugs:jsr305:2.0.1:jar:null:compile:516c03b21d50a644d538de0f0369c620989cd8f0
- com.google.guava:guava:24.0-android:jar:null:compile:bfc941bd9285e7534ebde47236f14e5c7396a90c
- org.checkerframework:checker-compat-qual:2.0.0:jar:null:compile:fc89b03860d11d6213d0154a62bcd1c2f69b9efa
- com.google.errorprone:error_prone_annotations:2.1.3:jar:null:compile:39b109f2cd352b2d71b52a3b5a1a9850e1dc304b
- com.google.j2objc:j2objc-annotations:1.1:jar:null:compile:ed28ded51a8b1c6b112568def5f4b455e6809019
- org.codehaus.mojo:animal-sniffer-annotations:1.14:jar:null:compile:775b7e22fb10026eed3f86e8dc556dfafe35f2d5
- com.google.protobuf:protobuf-java:3.5.1:jar:null:compile:8c3492f7662fa1cbf8ca76a0f5eb1146f7725acd
- com.h2database:h2:1.3.167:jar:null:compile:d3867d586f087e53eb12fc65e5693d8ee9a5da17
- com.lambdaworks:scrypt:1.4.0:jar:null:compile:906506b74f30c8c20bccd9ed4a11112d8941fe87
- com.madgag.spongycastle:core:1.58.0.0:jar:null:compile:e08789f8f1e74f155db8b69c3575b5cb213c156c
- junit:junit:4.12:jar:null:test:2973d150c0dc1fefe998f834810d68f278ea58ec
- mysql:mysql-connector-java:5.1.33:jar:null:compile:8af455a9a3267e6664cafc87ace71a4e4ef02837
- net.jcip:jcip-annotations:1.0:jar:null:compile:afba4942caaeaf46aab0b976afd57cc7c181467e
- org.apache.maven.plugins:maven-clean-plugin:3.0.0:maven-plugin:null:runtime:6653cb054e6b81705e383fbcced26c92802e40ae
- org.apache.maven.plugins:maven-compiler-plugin:3.7.0:maven-plugin:null:runtime:a3229c9aae47047e3a177ecfd4afa10fb5512d4e
- org.apache.maven.plugins:maven-dependency-plugin:3.0.2:maven-plugin:null:runtime:a372cf5cac374be969fa8d32e585b99ba1f36f7b
- org.apache.maven.plugins:maven-deploy-plugin:2.8.2:maven-plugin:null:runtime:3c2d83ecd387e9843142ae92a0439792c1500319
- org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:maven-plugin:null:runtime:02b46cf923a7f5c75ffae61cedff103e0def3560
- org.apache.maven.plugins:maven-install-plugin:2.5.2:maven-plugin:null:runtime:8a67631619fc3c1d1f036e59362ddce71e1e496f
- org.apache.maven.plugins:maven-jar-plugin:3.0.2:maven-plugin:null:runtime:5518cc6a2ed1b1ec52419fa0e18f7e42b6279cb9
- org.apache.maven.plugins:maven-javadoc-plugin:3.0.0:maven-plugin:null:runtime:3de9fd76fb00eef0161e8c0881e933b27bafc724
- org.apache.maven.plugins:maven-resources-plugin:3.0.2:maven-plugin:null:runtime:fd30499fd734ca2c34375955973556388e4aa0ed
- org.apache.maven.plugins:maven-shade-plugin:3.1.0:maven-plugin:null:runtime:c08cd5163a49e31f6e28d6f8bb153013a2a2de79
- org.apache.maven.plugins:maven-site-plugin:3.7:maven-plugin:null:runtime:708c6a0fb4d8bf479c100b1283931989c3fdc6a2
- org.apache.maven.plugins:maven-source-plugin:3.0.1:maven-plugin:null:runtime:8693776363c0717712013747a13d087361ce4fb5
- org.apache.maven.plugins:maven-surefire-plugin:2.20.1:maven-plugin:null:runtime:5f3f8f23a8c3525e64b06310b54a2f080690eb59
- org.easymock:easymock:3.2:jar:null:test:00c82f7fa3ef377d8954b1db25123944b5af2ba4
- org.eluder.coveralls:coveralls-maven-plugin:3.1.0:maven-plugin:null:runtime:ca9d2915e2b1e99f15c9f54ad653eda893d42a69
- org.fusesource.leveldbjni:leveldbjni-all:1.8:jar:null:compile:707350a2eeb1fa2ed77a32ddb3893ed308e941db
- org.hamcrest:hamcrest-core:1.3:jar:null:test:42a25dc3219429f0e5d060061f71acb49bf010a0
- org.jacoco:jacoco-maven-plugin:0.7.5.201505241946:maven-plugin:null:runtime:0a5e4dbbcd9b00e5ee42d928e10ab84f6f0b0835
- org.objenesis:objenesis:1.2:jar:null:test:bfcb0539a071a4c5a30690388903ac48c0667f2a
- com.squareup.okhttp3:okhttp:3.9.1:jar:null:runtime:84b4b7d1c4a238e7899972b7446c250691e65f1f
- com.squareup.okio:okio:1.13.0:jar:null:runtime:a9283170b7305c8d92d25aff02a6ab7e45d06cbe
- org.slf4j:slf4j-api:1.7.25:jar:null:compile:da76ca59f6a57ee3102f8f9bd9cee742973efa8a
- org.slf4j:slf4j-jdk14:1.7.25:jar:null:test:bccda40ebc8067491b32a88f49615a747d20082d
- org.sonatype.plugins:nexus-staging-maven-plugin:1.6.5:maven-plugin:null:runtime:455ca2aa8cd14a06608f1538bd6a1efd09561563
- postgresql:postgresql:9.1-901.jdbc4:jar:null:compile:153f2f92a786f12fc111d0111f709012df87c808
-
- uk.co.froot.maven.enforcer:digest-enforcer-rules:0.0.1:jar:null:runtime:16a9e04f3fe4bb143c42782d07d5faf65b32106f
-
-
-
-
-
-
-
-
-
-
- uk.co.froot.maven.enforcer
- digest-enforcer-rules
- 0.0.1
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
-
-
-
- package
-
- shade
-
-
- false
-
-
-
- *:*
-
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
- true
- bundled
-
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.7.5.201505241946
-
-
- **/Protos*.class
- org/bitcoinj/jni/*
- org/bitcoin/*
-
-
-
-
- pre-unit-test
-
- prepare-agent
-
-
- ${project.build.directory}/coverage-reports/jacoco.exec
- surefireArgLine
-
-
-
- post-unit-test
- test
-
- report
-
-
- ${project.build.directory}/coverage-reports/jacoco.exec
- ${project.reporting.outputDirectory}/jacoco
-
-
-
- default-report
- prepare-package
-
- report
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- -Xmx1024m -XX:-OmitStackTraceInFastThrow ${surefireArgLine}
- alphabetical
-
-
- java.util.logging.config.file
- src/test/resources/logging.properties
-
-
-
-
-
-
-
- org.eluder.coveralls
- coveralls-maven-plugin
- 3.1.0
-
-
-
-
-
-
- junit
- junit
- 4.12
- test
-
-
- org.easymock
- easymock
- 3.2
- test
-
-
-
- org.slf4j
- slf4j-jdk14
- 1.7.25
- test
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.5.2
- test
-
-
- com.h2database
- h2
- 1.3.167
- true
-
-
- com.madgag.spongycastle
- core
- 1.58.0.0
-
-
- com.google.protobuf
- protobuf-java
- 3.5.1
-
-
- com.google.guava
- guava
- 24.0-android
-
-
- com.google.code.findbugs
- jsr305
-
-
-
-
- com.google.code.findbugs
- jsr305
- 2.0.1
-
-
- net.jcip
- jcip-annotations
- 1.0
-
-
- com.lambdaworks
- scrypt
- 1.4.0
-
-
-
-
- postgresql
- postgresql
- 9.1-901.jdbc4
- true
-
-
-
-
- mysql
- mysql-connector-java
- 5.1.33
- true
-
-
- org.fusesource.leveldbjni
- leveldbjni-all
- 1.8
- true
-
-
- com.squareup.okhttp3
- okhttp
- 3.9.1
-
-
-
-
diff --git a/core/src/main/proto/paymentchannel.proto b/core/src/main/proto/paymentchannel.proto
index 9dc6e1a78..ddea1a2a3 100644
--- a/core/src/main/proto/paymentchannel.proto
+++ b/core/src/main/proto/paymentchannel.proto
@@ -19,7 +19,7 @@
/* Notes:
* - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian
- * - To regenerate after editing, run mvn clean package -DupdateProtobuf
+ * - To regenerate after editing, run gradle generateProto
*/
syntax = "proto2";
diff --git a/core/src/main/proto/paymentrequest.proto b/core/src/main/proto/paymentrequest.proto
index 9230b4e42..c980f7b86 100644
--- a/core/src/main/proto/paymentrequest.proto
+++ b/core/src/main/proto/paymentrequest.proto
@@ -19,7 +19,7 @@
/* Notes:
* - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian
- * - To regenerate after editing, run mvn clean package -DupdateProtobuf
+ * - To regenerate after editing, run gradle generateProto
*/
//
diff --git a/core/src/main/proto/storedclientpaymentchannel.proto b/core/src/main/proto/storedclientpaymentchannel.proto
index 60ecdbefd..3ba91932f 100644
--- a/core/src/main/proto/storedclientpaymentchannel.proto
+++ b/core/src/main/proto/storedclientpaymentchannel.proto
@@ -19,7 +19,7 @@
/* Notes:
* - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian
- * - To regenerate after editing, run mvn clean package -DupdateProtobuf
+ * - To regenerate after editing, run gradle generateProto
*/
syntax = "proto2";
diff --git a/core/src/main/proto/storedserverpaymentchannel.proto b/core/src/main/proto/storedserverpaymentchannel.proto
index 2dc85b89f..4eb809ea7 100644
--- a/core/src/main/proto/storedserverpaymentchannel.proto
+++ b/core/src/main/proto/storedserverpaymentchannel.proto
@@ -19,7 +19,7 @@
/* Notes:
* - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian
- * - To regenerate after editing, run mvn clean package -DupdateProtobuf
+ * - To regenerate after editing, run gradle generateProto
*/
syntax = "proto2";
diff --git a/core/src/main/proto/wallet.proto b/core/src/main/proto/wallet.proto
index b1108ab9c..c3495b5e8 100644
--- a/core/src/main/proto/wallet.proto
+++ b/core/src/main/proto/wallet.proto
@@ -20,7 +20,7 @@
/* Notes:
* - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian
- * - To regenerate after editing, run: mvn generate-sources -DupdateProtobuf
+ * - To regenerate after editing, run: gradle generateProto
*/
syntax = "proto2";
diff --git a/examples/build.gradle b/examples/build.gradle
new file mode 100644
index 000000000..d35e498b9
--- /dev/null
+++ b/examples/build.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'java'
+
+dependencies {
+ implementation project(':core')
+ implementation 'com.google.guava:guava:24.0-android'
+ implementation 'net.sf.jopt-simple:jopt-simple:4.3'
+ implementation 'org.slf4j:slf4j-jdk14:1.7.25'
+ implementation 'org.fusesource.leveldbjni:leveldbjni-all:1.8'
+}
+
+sourceCompatibility = 1.8
diff --git a/examples/pom.xml b/examples/pom.xml
deleted file mode 100644
index 0ec581eec..000000000
--- a/examples/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- org.bitcoinj
- bitcoinj-parent
- 0.15-SNAPSHOT
-
- 4.0.0
-
- bitcoinj-examples
-
- bitcoinj Examples
- A collection of examples using the bitcoinj library
-
-
-
- org.bitcoinj
- bitcoinj-core
- ${project.parent.version}
-
-
- net.sf.jopt-simple
- jopt-simple
- 4.3
-
-
- org.slf4j
- slf4j-jdk14
- 1.7.25
-
-
- com.h2database
- h2
- 1.3.167
-
-
- org.fusesource.leveldbjni
- leveldbjni-all
- 1.8
- true
-
-
-
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 7ba509663..000000000
--- a/pom.xml
+++ /dev/null
@@ -1,283 +0,0 @@
-
-
-
-
- 4.0.0
-
- org.bitcoinj
- bitcoinj-parent
- 0.15-SNAPSHOT
- pom
-
-
- core
- examples
- tools
- wallettemplate
-
-
-
- org.sonatype.oss
- oss-parent
- 7
-
-
-
- scm:git:https://github.com/bitcoinj/bitcoinj
- scm:git:https://github.com/bitcoinj/bitcoinj
- scm:git:https://github.com/bitcoinj/bitcoinj
-
-
- bitcoinj Parent
- Provides the common configuration for the BitCoinJ modules
- http://www.bitcoinj.org/
-
-
-
- Apache 2
- http://www.apache.org/licenses/LICENSE-2.0
- repo
- A business-friendly OSS license
-
-
-
-
- GitHub
- https://github.com/bitcoinj/bitcoinj/issues
-
-
-
-
- bitcoinj Google Group
- https://groups.google.com/forum/#!forum/bitcoinj
-
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- 1.8
- true
- true
-
-
-
-
- maven-jar-plugin
-
-
- false
-
-
-
-
-
- maven-javadoc-plugin
-
- true
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.5
- true
-
- ossrh
- https://oss.sonatype.org/
- false
-
-
-
-
-
-
- maven-clean-plugin
- 3.0.0
-
-
- maven-compiler-plugin
- 3.7.0
-
-
- maven-dependency-plugin
- 3.0.2
-
-
- maven-deploy-plugin
- 2.8.2
-
-
- maven-enforcer-plugin
- 3.0.0-M1
-
-
- maven-install-plugin
- 2.5.2
-
-
- maven-jar-plugin
- 3.0.2
-
-
- maven-javadoc-plugin
- 3.0.0
-
-
- maven-resources-plugin
- 3.0.2
-
-
- maven-shade-plugin
- 3.1.0
-
-
- maven-site-plugin
- 3.7
-
-
- maven-source-plugin
- 3.0.1
-
-
- org.codehaus.mojo
- cobertura-maven-plugin
- 2.7
-
-
- maven-surefire-plugin
- 2.20.1
-
-
-
-
-
-
-
- org.slf4j
- slf4j-api
- 1.7.25
-
-
-
- org.slf4j
- slf4j-jdk14
- 1.7.25
- runtime
- true
-
-
-
-
- 3.0.4
-
-
-
- UTF-8
- gen
-
-
-
-
- doclint-java8-disable
-
- [1.8,)
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- -Xdoclint:none
-
-
-
-
-
-
-
- release
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- attach-sources
- verify
-
- jar-no-fork
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
-
-
-
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 000000000..e540a69a0
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,4 @@
+include 'core'
+include 'tools'
+include 'examples'
+include 'wallettemplate'
diff --git a/tools/build-checkpoints b/tools/build-checkpoints
index a417d0576..8e48ea070 100755
--- a/tools/build-checkpoints
+++ b/tools/build-checkpoints
@@ -15,13 +15,5 @@
# limitations under the License.
set -e
-
-# Check if the jar has been built.
-if [ ! -e target/build-checkpoints.jar ]; then
- echo "Compiling BuildCheckpoints to a JAR"
- cd ..
- mvn package -DskipTests
- cd tools
-fi
-
-java -jar target/build-checkpoints.jar "$@"
+args="$@"
+gradle -q build_checkpoints "-PappArgs=$args"
diff --git a/tools/build-checkpoints.cmd b/tools/build-checkpoints.cmd
deleted file mode 100644
index 91b616cc8..000000000
--- a/tools/build-checkpoints.cmd
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-
-rem Copyright by the original author or authors.
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem Check if the jar has been built.
-set TARGET_JAR=build-checkpoints.jar
-
-if not exist "target/%TARGET_JAR%" goto BUILD
-goto RUN
-
-:BUILD
-
-echo Compiling BuildCheckpoints to a JAR
-cd ..
-call mvn package -DskipTests
-cd tools
-
-:RUN
-
-for /R "target/" %%F in (%TARGET_JAR%) do set JAR_NAME=%%~nxF
-java -jar "target/%JAR_NAME%" %1 %2 %3 %4 %5 %6 %7 %8
\ No newline at end of file
diff --git a/tools/build.gradle b/tools/build.gradle
new file mode 100644
index 000000000..a14784908
--- /dev/null
+++ b/tools/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'java'
+
+dependencies {
+ implementation project(':core')
+ implementation 'com.google.guava:guava:24.0-android'
+ implementation 'net.sf.jopt-simple:jopt-simple:4.3'
+ implementation 'org.slf4j:slf4j-jdk14:1.7.25'
+}
+
+sourceCompatibility = 1.8
+
+task wallet_tool(type: JavaExec) {
+ description = 'Print and manipulate wallets.'
+ main = 'org.bitcoinj.tools.WalletTool'
+ if (project.hasProperty('appArgs') && appArgs.length() > 0)
+ args = Arrays.asList(appArgs.split("\\s+"))
+ classpath = sourceSets.main.runtimeClasspath
+}
+
+task build_checkpoints(type: JavaExec) {
+ description = 'Create checkpoint files to use with CheckpointManager.'
+ main = 'org.bitcoinj.tools.BuildCheckpoints'
+ if (project.hasProperty('appArgs') && appArgs.length() > 0)
+ args = Arrays.asList(appArgs.split("\\s+"))
+ classpath = sourceSets.main.runtimeClasspath
+}
diff --git a/tools/pom.xml b/tools/pom.xml
deleted file mode 100644
index fe62d0fd3..000000000
--- a/tools/pom.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
- org.bitcoinj
- bitcoinj-parent
- 0.15-SNAPSHOT
-
- 4.0.0
-
- bitcoinj-tools
-
- bitcoinj Tools
- A collection of useful tools that use the bitcoinj library to perform wallet operations
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
-
-
- true
-
-
-
- *:*
-
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
-
-
-
- shade-wallet-tool
- package
-
- shade
-
-
-
-
- org.bitcoinj.tools.WalletTool
-
-
- target/wallet-tool.jar
-
-
-
- shade-build-checkpoints
- package
-
- shade
-
-
-
-
- org.bitcoinj.tools.BuildCheckpoints
-
-
- target/build-checkpoints.jar
-
-
-
-
-
-
-
-
-
-
- org.bitcoinj
- bitcoinj-core
- ${project.parent.version}
-
-
- net.sf.jopt-simple
- jopt-simple
- 4.3
-
-
- org.slf4j
- slf4j-jdk14
- 1.7.25
-
-
- com.h2database
- h2
- 1.3.167
-
-
-
diff --git a/tools/wallet-tool b/tools/wallet-tool
index e591e3301..eee46597a 100755
--- a/tools/wallet-tool
+++ b/tools/wallet-tool
@@ -15,13 +15,5 @@
# limitations under the License.
set -e
-
-# Check if the jar has been built.
-if [ ! -e target/wallet-tool.jar ] || [[ "$ALWAYS_BUILD_WALLETTOOL" != "" ]]; then
- echo "Compiling WalletTool to a JAR"
- cd ..
- mvn package -DskipTests
- cd tools
-fi
-
-java -jar target/wallet-tool.jar "$@"
+args="$@"
+gradle -q wallet_tool "-PappArgs=$args"
diff --git a/tools/wallet-tool.cmd b/tools/wallet-tool.cmd
deleted file mode 100644
index 53eb7ac9c..000000000
--- a/tools/wallet-tool.cmd
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-
-rem Copyright by the original author or authors.
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem Check if the jar has been built.
-set TARGET_JAR=wallet-tool.jar
-
-if not exist "target/%TARGET_JAR%" goto BUILD
-if defined ALWAYS_BUILD_WALLETTOOL goto BUILD
-goto RUN
-
-:BUILD
-
-echo Compiling WalletTool to a JAR
-cd ..
-call mvn package -DskipTests
-cd tools
-
-:RUN
-
-for /R "target/" %%F in (%TARGET_JAR%) do set JAR_NAME=%%~nxF
-java -jar "target/%JAR_NAME%" %1 %2 %3 %4 %5 %6 %7 %8
\ No newline at end of file
diff --git a/wallettemplate/build.gradle b/wallettemplate/build.gradle
new file mode 100644
index 000000000..38413ead6
--- /dev/null
+++ b/wallettemplate/build.gradle
@@ -0,0 +1,17 @@
+apply plugin: 'java'
+
+dependencies {
+ implementation project(':core')
+ implementation 'com.google.guava:guava:24.0-android'
+ implementation 'org.fxmisc.easybind:easybind:1.0.2'
+ implementation 'de.jensd:fontawesomefx:8.0.0'
+ implementation 'net.glxn:qrgen:1.3'
+ implementation 'org.slf4j:slf4j-jdk14:1.7.25'
+}
+
+sourceCompatibility = 1.8
+
+task wallet_template(type: JavaExec) {
+ main = 'wallettemplate.Main'
+ classpath = sourceSets.main.runtimeClasspath
+}
diff --git a/wallettemplate/pom.xml b/wallettemplate/pom.xml
deleted file mode 100644
index 73c45d2ba..000000000
--- a/wallettemplate/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
- 4.0.0
-
- org.bitcoinj
- bitcoinj-parent
- 0.15-SNAPSHOT
-
-
- wallettemplate
-
- bitcoinj Wallet-Template
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
-
-
-
- package
-
- shade
-
-
- false
-
-
-
- *:*
-
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
- true
- bundled
-
-
- ${project.artifactId}.Main
-
-
- target/${project.artifactId}-shaded.jar
-
-
-
-
-
-
-
-
-
-
- org.bitcoinj
- bitcoinj-core
- ${project.parent.version}
-
-
- com.google.guava
- guava
- 24.0-android
-
-
-
- org.fxmisc.easybind
- easybind
- 1.0.2
-
-
- de.jensd
- fontawesomefx
- 8.0.0
-
-
- net.glxn
- qrgen
- 1.3
-
-
-