diff --git a/bin/create-maven-repos.sh b/bin/create-maven-repos.sh deleted file mode 100755 index 3a8bd22..0000000 --- a/bin/create-maven-repos.sh +++ /dev/null @@ -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 diff --git a/bin/install-lib.sh b/bin/install-lib.sh deleted file mode 100755 index 3563830..0000000 --- a/bin/install-lib.sh +++ /dev/null @@ -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 '' - echo " $groupId" - echo " $artifactId" - echo " $version-BATM" - echo '' - echo '' - -else - echo 'project needs to be either api, extra, or test' -fi - -exit 1 - diff --git a/build.gradle b/build.gradle index 97e8b8e..134cee2 100644 --- a/build.gradle +++ b/build.gradle @@ -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 + } + } } diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPlugin.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPlugin.groovy new file mode 100644 index 0000000..c2c5b8d --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPlugin.groovy @@ -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 { + private DependencySubstitutionPluginExtension extension + private List 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) + } + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPluginExtension.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPluginExtension.groovy new file mode 100644 index 0000000..2e0a80b --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/DependencySubstitutionPluginExtension.groovy @@ -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 confinedConfigurations = new LinkedList<>() + Map 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) + } +} diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/EncryptFile.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/EncryptFile.groovy new file mode 100644 index 0000000..34dcf74 --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/EncryptFile.groovy @@ -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); + } + } + } + } + } +} diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/HelperConstants.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/HelperConstants.groovy new file mode 100644 index 0000000..7bae0cb --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/HelperConstants.groovy @@ -0,0 +1,5 @@ +package com.generalbytes.batm.gradle; + +public class HelperConstants { + public static final String ANDROID_ARTIFACT_EXPORTING_CONFIGURATION_NAME = "exportReleaseApk"; +} diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleIdentifier.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleIdentifier.groovy new file mode 100644 index 0000000..6a9bc4c --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleIdentifier.groovy @@ -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 + } +} diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleVersionIdentifier.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleVersionIdentifier.groovy new file mode 100644 index 0000000..40ad22a --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/SimpleModuleVersionIdentifier.groovy @@ -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 + } +} diff --git a/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/WriteLines.groovy b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/WriteLines.groovy new file mode 100644 index 0000000..ab6e15b --- /dev/null +++ b/buildSrc/src/main/groovy/com.generalbytes.batm.gradle/WriteLines.groovy @@ -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 lines = new LinkedList<>(); + private Object outputFile; + private String encoding = "UTF-8"; + + @Input + public List getLines() { + final List ret = new ArrayList<>(lines.size()); + for (Object line : lines) { + String printableLine; + if (line instanceof Callable) { + try { + printableLine = ((Callable) line).call(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } else { + printableLine = String.valueOf(line); + } + ret.add(printableLine); + } + return ret; + } + + public void setLines(List 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 lines) { + this.lines.addAll(lines); + } + + @TaskAction + public void writeFile() throws IOException { + getOutputFile().withWriter(getEncoding()) { + for (String line : getLines()) { + it.println(line) + } + } + } +} diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/dsub.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/dsub.properties new file mode 100644 index 0000000..79053ed --- /dev/null +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/dsub.properties @@ -0,0 +1 @@ +implementation-class=com.generalbytes.batm.gradle.DependencySubstitutionPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/gb-gradle.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/gb-gradle.properties new file mode 100644 index 0000000..c7f1eaa --- /dev/null +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/gb-gradle.properties @@ -0,0 +1,3 @@ +implementation-class=com.generalbytes.batm.gradle.DependencySubstitutionPlugin +version=1.0.0 +timestamp=2017-12-11T16:05Z \ No newline at end of file diff --git a/server_extensions_extra/libs/bitcoin-json-rpc-client-1.0.jar b/libs/bitcoin-json-rpc-client-1.0.jar similarity index 100% rename from server_extensions_extra/libs/bitcoin-json-rpc-client-1.0.jar rename to libs/bitcoin-json-rpc-client-1.0.jar diff --git a/server_extensions_api/build.gradle b/server_extensions_api/build.gradle index 16e8252..51d6946 100644 --- a/server_extensions_api/build.gradle +++ b/server_extensions_api/build.gradle @@ -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') } diff --git a/server_extensions_api/build.xml b/server_extensions_api/build.xml deleted file mode 100644 index 851940e..0000000 --- a/server_extensions_api/build.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - BATM server extensions API - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/server_extensions_api/libs/mail.jar b/server_extensions_api/libs/mail.jar deleted file mode 100644 index e4159c3..0000000 Binary files a/server_extensions_api/libs/mail.jar and /dev/null differ diff --git a/server_extensions_api/libs/slf4j-api-1.7.5.jar b/server_extensions_api/libs/slf4j-api-1.7.5.jar deleted file mode 100644 index 8f004d3..0000000 Binary files a/server_extensions_api/libs/slf4j-api-1.7.5.jar and /dev/null differ diff --git a/server_extensions_api/libs/slf4j-simple-1.7.5.jar b/server_extensions_api/libs/slf4j-simple-1.7.5.jar deleted file mode 100644 index 9dece31..0000000 Binary files a/server_extensions_api/libs/slf4j-simple-1.7.5.jar and /dev/null differ diff --git a/server_extensions_extra/build.gradle b/server_extensions_extra/build.gradle index 95c81c1..4554833 100644 --- a/server_extensions_extra/build.gradle +++ b/server_extensions_extra/build.gradle @@ -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']) } diff --git a/server_extensions_extra/build.xml b/server_extensions_extra/build.xml deleted file mode 100644 index c9896f3..0000000 --- a/server_extensions_extra/build.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - BATM server extra extensions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/server_extensions_extra/libs/base64-2.3.9.jar b/server_extensions_extra/libs/base64-2.3.9.jar deleted file mode 100644 index eaf2b83..0000000 Binary files a/server_extensions_extra/libs/base64-2.3.9.jar and /dev/null differ diff --git a/server_extensions_extra/libs/commons-io-2.4.jar b/server_extensions_extra/libs/commons-io-2.4.jar deleted file mode 100644 index 90035a4..0000000 Binary files a/server_extensions_extra/libs/commons-io-2.4.jar and /dev/null differ diff --git a/server_extensions_extra/libs/guava-18.0.jar b/server_extensions_extra/libs/guava-18.0.jar deleted file mode 100644 index 8f89e49..0000000 Binary files a/server_extensions_extra/libs/guava-18.0.jar and /dev/null differ diff --git a/server_extensions_extra/libs/jackson-annotations-2.4.0.jar b/server_extensions_extra/libs/jackson-annotations-2.4.0.jar deleted file mode 100644 index 0b55559..0000000 Binary files a/server_extensions_extra/libs/jackson-annotations-2.4.0.jar and /dev/null differ diff --git a/server_extensions_extra/libs/jackson-core-2.4.0.jar b/server_extensions_extra/libs/jackson-core-2.4.0.jar deleted file mode 100644 index b820c5f..0000000 Binary files a/server_extensions_extra/libs/jackson-core-2.4.0.jar and /dev/null differ diff --git a/server_extensions_extra/libs/jackson-databind-2.4.0.jar b/server_extensions_extra/libs/jackson-databind-2.4.0.jar deleted file mode 100644 index 1dfc861..0000000 Binary files a/server_extensions_extra/libs/jackson-databind-2.4.0.jar and /dev/null differ diff --git a/server_extensions_extra/libs/javax.ws.rs-api-2.0.1.jar b/server_extensions_extra/libs/javax.ws.rs-api-2.0.1.jar deleted file mode 100644 index 7eb68b4..0000000 Binary files a/server_extensions_extra/libs/javax.ws.rs-api-2.0.1.jar and /dev/null differ diff --git a/server_extensions_extra/libs/rescu-1.9.0.jar b/server_extensions_extra/libs/rescu-1.9.0.jar deleted file mode 100644 index 4a3f5ec..0000000 Binary files a/server_extensions_extra/libs/rescu-1.9.0.jar and /dev/null differ diff --git a/server_extensions_extra/libs/signpost-core-1.2.1.2.jar b/server_extensions_extra/libs/signpost-core-1.2.1.2.jar deleted file mode 100644 index 8871730..0000000 Binary files a/server_extensions_extra/libs/signpost-core-1.2.1.2.jar and /dev/null differ diff --git a/server_extensions_extra/libs/xchange-bitfinex-4.2.1-SNAPSHOT.jar b/server_extensions_extra/libs/xchange-bitfinex-4.2.1-SNAPSHOT.jar deleted file mode 100644 index 27a6cf3..0000000 Binary files a/server_extensions_extra/libs/xchange-bitfinex-4.2.1-SNAPSHOT.jar and /dev/null differ diff --git a/server_extensions_extra/libs/xchange-bittrex-4.2.1-SNAPSHOT.jar b/server_extensions_extra/libs/xchange-bittrex-4.2.1-SNAPSHOT.jar deleted file mode 100644 index 7bb0b01..0000000 Binary files a/server_extensions_extra/libs/xchange-bittrex-4.2.1-SNAPSHOT.jar and /dev/null differ diff --git a/server_extensions_extra/libs/xchange-core-4.2.1-SNAPSHOT.jar b/server_extensions_extra/libs/xchange-core-4.2.1-SNAPSHOT.jar deleted file mode 100644 index f11c702..0000000 Binary files a/server_extensions_extra/libs/xchange-core-4.2.1-SNAPSHOT.jar and /dev/null differ diff --git a/server_extensions_extra/libs/xchange-itbit-4.2.1-SNAPSHOT.jar b/server_extensions_extra/libs/xchange-itbit-4.2.1-SNAPSHOT.jar deleted file mode 100644 index 66a1153..0000000 Binary files a/server_extensions_extra/libs/xchange-itbit-4.2.1-SNAPSHOT.jar and /dev/null differ diff --git a/server_extensions_extra/libs/xchange-poloniex-4.2.1-SNAPSHOT.jar b/server_extensions_extra/libs/xchange-poloniex-4.2.1-SNAPSHOT.jar deleted file mode 100644 index 50445bc..0000000 Binary files a/server_extensions_extra/libs/xchange-poloniex-4.2.1-SNAPSHOT.jar and /dev/null differ diff --git a/server_extensions_extra/libs/zxing-core.jar b/server_extensions_extra/libs/zxing-core.jar deleted file mode 100644 index 4ab8cb7..0000000 Binary files a/server_extensions_extra/libs/zxing-core.jar and /dev/null differ diff --git a/server_extensions_test/build.gradle b/server_extensions_test/build.gradle index 3a9cfb5..2300e83 100644 --- a/server_extensions_test/build.gradle +++ b/server_extensions_test/build.gradle @@ -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) } diff --git a/server_extensions_test/build.xml b/server_extensions_test/build.xml deleted file mode 100644 index 575ba01..0000000 --- a/server_extensions_test/build.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - BATM server extra extensions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/server_extensions_test/libs/jopt-simple-4.9.jar b/server_extensions_test/libs/jopt-simple-4.9.jar deleted file mode 100644 index 7c580a9..0000000 Binary files a/server_extensions_test/libs/jopt-simple-4.9.jar and /dev/null differ diff --git a/server_extensions_test/src/main/resources/run-btc-tests.sh b/server_extensions_test/src/main/resources/run-btc-tests.sh deleted file mode 100644 index bad0375..0000000 --- a/server_extensions_test/src/main/resources/run-btc-tests.sh +++ /dev/null @@ -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 diff --git a/server_extensions_test/src/main/resources/tester.sh b/server_extensions_test/src/main/resources/tester.sh deleted file mode 100755 index 51f3b9c..0000000 --- a/server_extensions_test/src/main/resources/tester.sh +++ /dev/null @@ -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 $* \ No newline at end of file