Skip to content

Commit e17ff5c

Browse files
committed
Enable gradle into the project
Signed-off-by: Victor <victor.cruz.isc@gmail.com>
1 parent e3bea1c commit e17ff5c

20 files changed

Lines changed: 399 additions & 100 deletions

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,17 @@ conf/*
66
.project
77
target/
88
pom.xml.versionsBackup
9-
.DS_Store
9+
.DS_Store
10+
11+
### Gradle ###
12+
.gradle
13+
/build/
14+
15+
# Ignore Gradle GUI config
16+
gradle-app.setting
17+
18+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
19+
!gradle-wrapper.jar
20+
21+
# Cache of project
22+
.gradletasknamecache

build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'java'
2+
apply plugin: 'maven'
3+
4+
group = 'com.bitso'
5+
version = '3.0.4-SNAPSHOT'
6+
7+
description = """bitso-java"""
8+
9+
sourceCompatibility = 1.5
10+
targetCompatibility = 1.5
11+
tasks.withType(JavaCompile) {
12+
options.encoding = 'UTF-8'
13+
}
14+
15+
16+
17+
repositories {
18+
19+
maven { url "http://repo.maven.apache.org/maven2" }
20+
}
21+
dependencies {
22+
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.3.6'
23+
compile group: 'org.json', name: 'json', version:'20140107'
24+
compile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
25+
compile group: 'io.netty', name: 'netty-all', version:'4.1.8.Final'
26+
testCompile group: 'junit', name: 'junit', version:'4.12'
27+
}

gradle/wrapper/gradle-wrapper.jar

53.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'bitso-java'

src/main/java/com/bitso/Bitso.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,15 @@ private String buildBitsoAuthHeader(String requestPath, String httpMethod, Strin
599599
String signature = String.format("%0" + (arrayOfByte.length << 1) + "x",
600600
new Object[] { bigInteger });
601601
return String.format("Bitso %s:%s:%s", apiKey, nonce, signature);
602-
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
602+
} catch (NoSuchAlgorithmException e){
603603
e.printStackTrace();
604604
throw new BitsoAPIException(e);
605605
} catch (IllegalArgumentException e) {
606606
e.printStackTrace();
607607
throw new BitsoAPIException(e);
608+
} catch (InvalidKeyException e) {
609+
e.printStackTrace();
610+
throw new BitsoAPIException(e);
608611
}
609612
}
610613

src/main/java/com/bitso/BitsoBalance.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BitsoBalance {
1212
private HashMap<String, Balance> mBalances;
1313

1414
public BitsoBalance(JSONObject o) {
15-
mBalances = new HashMap<>();
15+
mBalances = new HashMap<String, Balance>();
1616
JSONArray jsonBalances = o.getJSONArray("balances");
1717
int totalElements = jsonBalances.length();
1818
for (int i = 0; i < totalElements; i++) {

src/main/java/com/bitso/BitsoFee.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public BitsoFee(JSONObject o) {
2020
}
2121

2222
private void processTradeFees(JSONObject o) {
23-
mTradeFees = new HashMap<>();
23+
mTradeFees = new HashMap<String, Fee>();
2424
JSONArray jsonFees = o.getJSONArray("fees");
2525
int totalElements = jsonFees.length();
2626
for (int i = 0; i < totalElements; i++) {
@@ -33,7 +33,7 @@ private void processTradeFees(JSONObject o) {
3333
}
3434

3535
private void processWithdrawalFees(JSONObject o) {
36-
mWithdrawalFees = new HashMap<>();
36+
mWithdrawalFees = new HashMap<String, String>();
3737
JSONObject withdrawalFees = o.getJSONObject("withdrawal_fees");
3838
Iterator<String> it = withdrawalFees.keys();
3939
while (it.hasNext()) {

0 commit comments

Comments
 (0)