3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Make wallet tool compile to a minimized, bundled JAR so it can be used standalone, and change the wallet-tool script to use it that way. It makes running much faster.

This commit is contained in:
Mike Hearn 2012-04-02 16:13:45 +02:00
parent 628cbb6a1d
commit 0c90081c12
3 changed files with 66 additions and 20 deletions

View File

@ -32,22 +32,62 @@
<name>BitCoinJ Tools</name>
<description>A collection of useful tools that use the BitCoinJ library to perform wallet operations</description>
<dependencies>
<dependency>
<groupId>com.google</groupId>
<artifactId>bitcoinj</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<configuration>
<excludes>
<!-- bundle all JARs -->
</excludes>
<!-- Remove dead classes -->
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<!-- exclude signatures, the bundling process breaks them for some reason -->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.google.bitcoin.tools.WalletTool</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google</groupId>
<artifactId>bitcoinj</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.4</version>
</dependency>
</dependencies>
</project>

View File

@ -40,7 +40,6 @@ import java.util.logging.LogManager;
/**
* A command line tool for manipulating wallets and working with Bitcoin.<p>
*
*/
public class WalletTool {
private static final Logger log = LoggerFactory.getLogger(WalletTool.class);

View File

@ -1,2 +1,9 @@
#!/bin/sh
mvn -q exec:java -Dexec.mainClass=WalletTool -Dexec.args="$*"
#!/bin/bash
# Check if the jar has been built.
if [ ! -e target/bitcoinj-tools-*.jar ]; then
echo "Compiling WalletTool to a JAR"
mvn -q package -DskipTests
fi
java -jar target/bitcoinj-tools-*.jar $*