BATM-410 - proper Gradle dependencies

This commit is contained in:
Radovan Panak 2018-01-10 13:11:55 +01:00
parent 45b4f4e4d6
commit ce3980ed4d
40 changed files with 436 additions and 335 deletions

View File

@ -1,27 +0,0 @@
#!/bin/bash
directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $directory
# API dependencies
./install-lib.sh api mail.jar javax.mail mail 1.4.7
./install-lib.sh api slf4j-api-1.7.5.jar org.slf4j slf4j-api 1.7.5
./install-lib.sh api slf4j-simple-1.7.5.jar org.slf4j slf4j-simple 1.7.5
# EXTRA dependencies
./install-lib.sh extra base64-2.3.8.jar net.iharder base64 2.3.8
./install-lib.sh extra bitcoin-json-rpc-client-1.0.jar com.azazar.bitcoin.jsonrpcclient bitcoin-json-rpc-client 1.0
./install-lib.sh extra commons-io-2.4.jar commons-io commons-io 2.4
./install-lib.sh extra guava-18.0.jar com.google.guava guava 18.0
./install-lib.sh extra jackson-annotations-2.4.0.jar com.fasterxml.jackson.core jackson-annotations 2.4.0
./install-lib.sh extra jackson-core-2.4.0.jar com.fasterxml.jackson.core jackson-core 2.4.0
./install-lib.sh extra jackson-databind-2.4.0.jar com.fasterxml.jackson.core jackson-databind 2.4.0
./install-lib.sh extra javax.ws.rs-api-2.0.1.jar javax.ws.rs javax.ws.rs-api 2.0.1
./install-lib.sh extra rescu-1.7.2-SNAPSHOT.jar com.github.mmazi rescu 1.7.2-SNAPSHOT
./install-lib.sh extra xchange-core-4.0.1-SNAPSHOT.jar org.knowm.xchange xchange-core 4.0.1-SNAPSHOT
./install-lib.sh extra xchange-bitfinex-4.0.1-SNAPSHOT.jar org.knowm.xchange xchange-bitfinex 4.0.1-SNAPSHOT
./install-lib.sh extra xchange-itbit-4.0.1-SNAPSHOT.jar org.knowm.xchange xchange-itbit 4.0.1-SNAPSHOT
./install-lib.sh extra xchange-bittrex-4.0.1-SNAPSHOT.jar org.knowm.xchange xchange-bittrex 4.0.1-SNAPSHOT
./install-lib.sh extra xchange-poloniex-4.0.1-SNAPSHOT.jar org.knowm.xchange xchange-poloniex 4.0.1-SNAPSHOT
# TEST dependencies
./install-lib.sh test jopt-simple-4.9.jar net.sf.jopt-simple jopt-simple 4.9

View File

@ -1,50 +0,0 @@
#!/bin/bash
project="$1"
file="$2"
groupId="$3"
artifactId="$4"
version="$5"
directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo directory: $directory
if [ -z "$5" ] ; then
echo 'This script is used to install dependencies to the local maven repository.'
echo 'usage: install-lib.sh project file groupId artifactId version'
echo ''
echo 'project is either api, extra, or test'
echo ''
echo 'example: install-lib.sh api mail-1.4.7.jar javax.mail mail 1.4.7'
echo ''
exit 1
fi
if [ "$1" == "api" ] || [ "$1" == "extra" ] || [ "$1" == "test" ] ; then
localRepositoryPath="../server_extensions_$1/.mvn-repo"
mkdir -p $localRepositoryPath
fileLocation="../server_extensions_$1/libs/$file"
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file \
-Dfile=$fileLocation \
-DgroupId=$groupId \
-DartifactId=$artifactId \
-Dversion=$version-BATM \
-Dpackaging=jar \
-DlocalRepositoryPath=$localRepositoryPath
echo ''
echo '...installed, you can use it by adding following to the pom.xml:'
echo ''
echo '<dependency>'
echo " <groupId>$groupId</groupId>"
echo " <artifactId>$artifactId</artifactId>"
echo " <version>$version-BATM</version>"
echo '</dependency>'
echo ''
else
echo 'project needs to be either api, extra, or test'
fi
exit 1

View File

@ -8,8 +8,17 @@ buildscript {
}
}
final File repoDir = project.file('libs')
allprojects {
repositories {
jcenter()
}
repositories {
//bitcoin-json-rpc-client-1.0.jar isn't part of any well known maven repo
//so we search the libs dir; gradle generates (guesses) metadata except dependencies.
//Artifacts from repos with real metadata take precedence.
flatDir {
dirs repoDir
}
}
}

View File

@ -0,0 +1,85 @@
package com.generalbytes.batm.gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.DependencyResolveDetails
import org.gradle.api.artifacts.UnknownConfigurationException
import org.slf4j.Logger
import org.slf4j.LoggerFactory
class DependencySubstitutionPlugin implements Plugin<Project> {
private DependencySubstitutionPluginExtension extension
private List<String> initialConfinedConfigurations = new LinkedList<>()
private Logger logger = LoggerFactory.getLogger('gb-gradle')
static void confine(Project project, String configurationName) {
confine(project.getConfigurations().getByName(configurationName))
}
static void confine(Configuration configuration) {
configuration.transitive = false
}
void apply(Project project) {
extension = project.extensions.create('dependencySubstitutions', DependencySubstitutionPluginExtension)
initialConfinedConfigurations.addAll([
'compile',
'compileOnly',
'compileClasspath',
'implementation',
'providedCompile',
'testCompile',
'testCompileOnly',
'testCompileClasspath',
'testImplementation'
])
project.afterEvaluate {
configure(project)
}
}
void configure(Project project) {
initialConfinedConfigurations.each {
try {
confine(project.configurations[it])
} catch (UnknownConfigurationException ignored) {
logger.info("Plugin-specified confined configuration $it not found, skipping...")
}
}
extension.confinedConfigurations.each {
switch (it) {
case String:
confine(project, (String) it)
break
case Configuration:
confine((Configuration) it)
break
default:
throw new IllegalStateException("Illegal specification for confined configuration: $it (${it.class})")
}
}
if (extension.conflictFail) {
project.configurations.all {
resolutionStrategy {
failOnVersionConflict()
}
}
}
project.configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
final SimpleModuleVersionIdentifier from = new SimpleModuleVersionIdentifier(details.requested.group, details.requested.name, details.requested.version)
final String toVersion = extension.substitutions.get(from)
if (toVersion != null && toVersion.length() > 0) {
details.useVersion(toVersion)
}
}
}
}
}
}

View File

@ -0,0 +1,57 @@
package com.generalbytes.batm.gradle
import org.gradle.api.artifacts.Configuration
import java.util.regex.Matcher
import java.util.regex.Pattern
class DependencySubstitutionPluginExtension {
List<Object> confinedConfigurations = new LinkedList<>()
Map<SimpleModuleVersionIdentifier, String> substitutions = new HashMap<>()
boolean conflictFail = true
void substitute(File file) {
final Pattern commentPattern = Pattern.compile('(?m)^\\p{Blank}*#.*$')
final Pattern substitutionPattern = Pattern.compile('(?m)^substitute\\p{Blank}*from\\p{Blank}*:\\p{Blank}*\\\'([^\\\']*)\\\'\\p{Blank}*,\\p{Blank}*toVersion\\p{Blank}*:\\p{Blank}*\\\'([^\\\']*)\\\'\\p{Blank}*$')
int lineNo = 0
file.eachLine { line ->
lineNo++
Matcher substitutionMatcher = substitutionPattern.matcher(line)
if (substitutionMatcher.matches()) {
final String from = substitutionMatcher.group(1)
final String toVersion = substitutionMatcher.group(2)
substitute(from, toVersion)
} else if (!line.matches(commentPattern)) {
def msg = "Error on line $lineNo of file ${file.canonicalPath}: illegal line format."
throw new IllegalStateException(msg)
}
}
}
void substitute(String from, String toVersion) {
substitutions.put(new SimpleModuleVersionIdentifier(from), toVersion)
}
void substitute(Map attrs) {
def from = attrs.from
def toVersion = attrs.toVersion
if (from == null) {
def msg = "Missing required argument: 'from'."
throw new IllegalArgumentException(msg)
}
if (toVersion == null) {
def msg = "Missing required argument: 'toVersion'."
throw new IllegalArgumentException(msg)
}
substitute(from, toVersion)
}
void confine(String cfgName) {
confinedConfigurations.add(cfgName)
}
void confine(Configuration cfg) {
confinedConfigurations.add(cfg)
}
}

View File

@ -0,0 +1,79 @@
package com.generalbytes.batm.gradle
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import javax.crypto.Cipher
import javax.crypto.CipherOutputStream
import javax.crypto.spec.SecretKeySpec
class EncryptFile extends DefaultTask {
public static final int REQUIRED_KEY_LENGTH = 32
private Object outputFile;
private Object inputFile;
private byte[] key = null;
@OutputFile
File getOutputFile() {
return getProject().file(outputFile);
}
void setOutputFile(Object outputFile) {
this.outputFile = outputFile;
}
@InputFile
File getInputFile() {
return getProject().file(inputFile)
}
void setInputFile(Object inputFile) {
this.inputFile = inputFile
}
@Input
byte[] getKey() {
return key
}
void setKey(byte[] key) {
if (key == null) {
throw new IllegalArgumentException("Key can't be null.")
}
if (key.length != REQUIRED_KEY_LENGTH) {
throw new IllegalArgumentException("Incorrect key length (${key.length}); should be ${REQUIRED_KEY_LENGTH}.")
}
this.key = key
}
@TaskAction
void encrypt() throws IOException {
if (key == null || key.length != REQUIRED_KEY_LENGTH) {
throw new IllegalStateException("Invalid key: ${key}")
}
// Length is 16 byte
final SecretKeySpec sks = new SecretKeySpec(key, "AES");
// Create cipher
final Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, sks);
getInputFile().withInputStream { is ->
getOutputFile().withOutputStream { os ->
// Wrap the output stream
new CipherOutputStream(os, cipher).withStream { cos ->
// Write bytes
int b;
byte[] d = new byte[8];
while((b = is.read(d)) != -1) {
cos.write(d, 0, b);
}
}
}
}
}
}

View File

@ -0,0 +1,5 @@
package com.generalbytes.batm.gradle;
public class HelperConstants {
public static final String ANDROID_ARTIFACT_EXPORTING_CONFIGURATION_NAME = "exportReleaseApk";
}

View File

@ -0,0 +1,17 @@
package com.generalbytes.batm.gradle
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
import org.gradle.api.artifacts.ModuleIdentifier
@EqualsAndHashCode
@ToString
class SimpleModuleIdentifier implements ModuleIdentifier{
final String group
final String name
SimpleModuleIdentifier(String group, String name) {
this.group = group
this.name = name
}
}

View File

@ -0,0 +1,44 @@
package com.generalbytes.batm.gradle
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
import org.gradle.api.artifacts.ModuleVersionIdentifier
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.regex.Matcher
import java.util.regex.Pattern
@EqualsAndHashCode
@ToString
class SimpleModuleVersionIdentifier implements ModuleVersionIdentifier {
private Logger logger = LoggerFactory.getLogger(DependencySubstitutionPluginExtension.class.simpleName)
final SimpleModuleIdentifier module
final String version
SimpleModuleVersionIdentifier(String id) {
final Matcher matcher = Pattern.compile('^([^:]*):([^:]*):([^:]*)$').matcher(id)
if (!matcher.matches()) {
def msg = "Module identifier '$id' has incorrect format."
// logger.error(msg)
throw new IllegalArgumentException(msg)
}
this.module = new SimpleModuleIdentifier(matcher.group(1), matcher.group(2))
this.version = matcher.group(3)
}
SimpleModuleVersionIdentifier(String group, String name, String version) {
this.version = version
this.module = new SimpleModuleIdentifier(group, name)
}
@Override
String getGroup() {
return module.group
}
@Override
String getName() {
return module.name
}
}

View File

@ -0,0 +1,78 @@
package com.generalbytes.batm.gradle;
import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;
import java.io.*;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
class WriteLines extends DefaultTask {
private final List<Object> lines = new LinkedList<>();
private Object outputFile;
private String encoding = "UTF-8";
@Input
public List<String> getLines() {
final List<String> ret = new ArrayList<>(lines.size());
for (Object line : lines) {
String printableLine;
if (line instanceof Callable) {
try {
printableLine = ((Callable<String>) line).call();
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
printableLine = String.valueOf(line);
}
ret.add(printableLine);
}
return ret;
}
public void setLines(List<Object> lines) {
this.lines.clear();
lines(lines);
}
@OutputFile
public File getOutputFile() {
return getProject().file(outputFile);
}
public void setOutputFile(Object outputFile) {
this.outputFile = outputFile;
}
@Input
public String getEncoding() {
return encoding;
}
public void setEncoding(String encoding) {
this.encoding = encoding;
}
public void line(final Object value) {
lines.add(value);
}
public void lines(List<Object> lines) {
this.lines.addAll(lines);
}
@TaskAction
public void writeFile() throws IOException {
getOutputFile().withWriter(getEncoding()) {
for (String line : getLines()) {
it.println(line)
}
}
}
}

View File

@ -0,0 +1 @@
implementation-class=com.generalbytes.batm.gradle.DependencySubstitutionPlugin

View File

@ -0,0 +1,3 @@
implementation-class=com.generalbytes.batm.gradle.DependencySubstitutionPlugin
version=1.0.0
timestamp=2017-12-11T16:05Z

View File

@ -1,5 +1,6 @@
apply plugin: "java"
apply plugin: "distribution"
apply plugin: "gb-gradle"
jar {
baseName 'batm_server_extensions_api'
@ -10,20 +11,17 @@ dependencies {
sourceCompatibility = '1.7'
}
distributions {
main {
contents {
into ('lib') {
from jar
}
into ('lib') {
from 'libs'
}
main {
contents {
from jar
from configurations.runtime
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.20')
compile(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.20')
compile(group: 'com.sun.mail', name: 'javax.mail', version: '1.4.7')
}

View File

@ -1,58 +0,0 @@
<!--
*************************************************************************************
* Copyright (C) 2014-2016 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information:
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************
-->
<project name="batm_server_extensions_api" default="dist" basedir=".">
<description>
BATM server extensions API
</description>
<!-- set global properties for this build -->
<property name="src" location="src/main/java"/>
<property name="res" location="src/main/resources"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="libs" location="libs"/>
<target name="init">
<tstamp/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
</target>
<path id="classpath">
<fileset dir="${libs}" includes="**/*.jar"/>
</path>
<target name="compile" depends="init" description="compile the source ">
<javac source="1.7" target="1.7" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg line="-Xlint:deprecation -Xlint:unchecked"/>
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/${ant.project.name}.jar" basedir="${build}"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>

Binary file not shown.

View File

@ -1,30 +1,56 @@
apply plugin: "java"
apply plugin: "distribution"
apply plugin: "gb-gradle"
jar {
baseName 'batm_server_extensions_extra'
}
configurations {
artifactOnly
runtimeNoArtifact {
extendsFrom compile
}
}
artifacts {
artifactOnly jar
}
dependencies {
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
compile project(':server_extensions_api');
compile(group: 'com.azazar', name: 'bitcoin-json-rpc-client', version: '1.0')
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.20')
compile(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.20')
compile(group: 'com.github.mmazi', name: 'rescu', version: '1.9.0')
compile(group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0.1')
compile(group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.4.0')
compile(group: 'org.knowm.xchange', name: 'xchange-core', version: '4.2.1')
compile(group: 'com.google.guava', name: 'guava', version: '18.0')
compile(group: 'com.google.zxing', name: 'core', version: '2.3.0')
compile(group: 'org.knowm.xchange', name: 'xchange-bitfinex', version: '4.2.1')
compile(group: 'org.knowm.xchange', name: 'xchange-itbit', version: '4.2.1')
// compile(group: 'net.iharder', name: 'base64', version: '2.3.9')
// compile(group: 'commons-io', name: 'commons-io', version: '2.4')
// compile(group: 'org.knowm.xchange', name: 'xchange-bitrex', version: '4.2.1')
// compile(group: 'org.knowm.xchange', name: 'xchange-poloniex', version: '4.2.1')
// compile(group: 'oauth.signpost', name: 'signpost-core', version: '1.2.1.2')
// compile(group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.4.0')
// compile(group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.4.0')
}
dependencySubstitutions {
substitute file(BatmDependencySubstitutionConfig)
}
distributions {
main {
contents {
into ('lib') {
from jar
}
into ('lib') {
from configurations.runtime
}
main {
contents {
from jar
from configurations.runtime
}
}
}
}
dependencies {
compile project(':server_extensions_api');
compile fileTree(dir: 'libs', include: ['*.jar'])
}

View File

@ -1,66 +0,0 @@
<!--
*************************************************************************************
* Copyright (C) 2014-2016 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************
-->
<project name="batm_server_extensions_extra" default="dist" basedir=".">
<description>
BATM server extra extensions
</description>
<!-- set global properties for this build -->
<property name="src" location="src/main/java"/>
<property name="res" location="src/main/resources"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="libs" location="libs"/>
<target name="init">
<tstamp/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
</target>
<path id="classpath">
<fileset dir="${libs}" includes="**/*.jar"/>
<fileset dir="../server_extensions_api/libs" includes="**/*.jar"/>
<fileset dir="../server_extensions_api/dist" includes="**/*.jar"/>
</path>
<target name="compile" depends="init" description="compile the source ">
<javac source="1.7" target="1.7" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg line="-Xlint:deprecation -Xlint:unchecked"/>
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
<copy todir="${build}">
<fileset dir="${res}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/${ant.project.name}.jar" basedir="${build}"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>

View File

@ -1,5 +1,8 @@
apply plugin: "java"
apply plugin: "distribution"
apply plugin: "application"
apply plugin: "gb-gradle"
mainClassName = 'com.generalbytes.batm.server.extensions.test.Tester'
jar {
baseName 'batm_server_extensions_test'
@ -10,22 +13,12 @@ dependencies {
sourceCompatibility = '1.7'
}
distributions {
main {
contents {
into ('lib') {
from jar
}
into ('lib') {
from configurations.runtime
}
}
}
}
dependencies {
compile project(':server_extensions_api');
compile project(':server_extensions_extra');
compile fileTree(dir: 'libs', include: ['*.jar'])
compile group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '4.9'
}
dependencySubstitutions {
substitute file(BatmDependencySubstitutionConfig)
}

View File

@ -1,67 +0,0 @@
<!--
*************************************************************************************
* Copyright (C) 2015 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************
-->
<project name="batm_server_extensions_test" default="dist" basedir=".">
<description>
BATM server extra extensions
</description>
<!-- set global properties for this build -->
<property name="src" location="src/main/java"/>
<property name="res" location="src/main/resources"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="libs" location="libs"/>
<target name="init">
<tstamp/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
</target>
<path id="classpath">
<fileset dir="${libs}" includes="**/*.jar"/>
<fileset dir="../server_extensions_api/libs" includes="**/*.jar"/>
<fileset dir="../server_extensions_extra/libs" includes="**/*.jar"/>
<fileset dir="../server_extensions_api/dist" includes="**/*.jar"/>
<fileset dir="../server_extensions_extra/dist" includes="**/*.jar"/>
</path>
<target name="compile" depends="init" description="compile the source ">
<javac source="1.7" target="1.7" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg line="-Xlint:deprecation -Xlint:unchecked"/>
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/${ant.project.name}.jar" basedir="${build}"/>
<copy file="${res}/tester.sh" todir="${dist}"/>
<chmod file="${dist}/tester.sh" perm="ugo+x"/>
<copy file="${res}/run-btc-tests.sh" todir="${dist}"/>
<chmod file="${dist}/run-btc-tests.sh" perm="ugo+x"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>

View File

@ -1,12 +0,0 @@
#!/bin/bash
SERVER_EXTENSIONS=../../server_extensions_extra/dist/batm_server_extensions_extra.jar
./tester.sh -j $SERVER_EXTENSIONS -a list-ratesources
./tester.sh -j $SERVER_EXTENSIONS -a list-wallets
./tester.sh -j $SERVER_EXTENSIONS -a list-exchanges
./tester.sh -j $SERVER_EXTENSIONS -a list-paymentprocessors
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n bitcoinaverage -p USD
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n bitcoinaverage -p EUR
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n bitfinex -p USD
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n bitfinex -p EUR
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n itbit -p USD
./tester.sh -j $SERVER_EXTENSIONS -a get-rates -n itbit -p EUR

View File

@ -1,14 +0,0 @@
#!/bin/bash
#JAVA_HOME=
CLASSPATH=batm_server_extensions_test.jar
#CLASSPATH=$CLASSPATH:$(echo "../libs"/*.jar | tr ' ' ':')
#CLASSPATH=$CLASSPATH:$(echo "../../server_extensions_api/libs"/*.jar | tr ' ' ':')
#CLASSPATH=$CLASSPATH:$(echo "../../server_extensions_api/dist"/*.jar | tr ' ' ':')
#CLASSPATH=$CLASSPATH:$(echo "../../server_extensions_extra/libs"/*.jar | tr ' ' ':')
CLASSPATH=$CLASSPATH:$(find ../libs -name '*.jar' | xargs echo | tr ' ' ':')
CLASSPATH=$CLASSPATH:$(find ../../server_extensions_api/libs -name '*.jar' | xargs echo | tr ' ' ':')
CLASSPATH=$CLASSPATH:$(find ../../server_extensions_api/dist -name '*.jar' | xargs echo | tr ' ' ':')
CLASSPATH=$CLASSPATH:$(find ../../server_extensions_extra/libs -name '*.jar' | xargs echo | tr ' ' ':')
echo $CLASSPATH
export LD_LIBRARY_PATH=./lib
java -Djava.library.path=./lib -cp "$CLASSPATH" com.generalbytes.batm.server.extensions.test.Tester $*