forked from hyperledger-web3j/web3j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (40 loc) · 1.5 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.text.SimpleDateFormat
description 'web3j is a lightweight Java library for integration with Ethereum clients'
dependencies {
compile project(':abi'),
project(':crypto'),
project(':tuples'),
"com.github.jnr:jnr-unixsocket:$jnr_unixsocketVersion",
"com.squareup.okhttp3:okhttp:$okhttpVersion",
"com.squareup.okhttp3:logging-interceptor:$okhttpVersion",
"io.reactivex:rxjava:$rxjavaVersion",
"org.java-websocket:Java-WebSocket:$javaWebSocketVersion"
testCompile project(path: ':crypto', configuration: 'testArtifacts'),
"nl.jqno.equalsverifier:equalsverifier:$equalsverifierVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
}
task createProperties(dependsOn: processResources) doLast {
// if resources dir is empty we need to create this ourselves
new File("$buildDir/resources/main/").mkdirs()
new File("$buildDir/resources/main/web3j-version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p['timestamp'] = getTimestamp()
p.store w, null
}
}
def getTimestamp() {
Date today = new Date()
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S z")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(today)
}
classes {
dependsOn createProperties
}
configurations {
testArtifacts.extendsFrom testRuntime
}
artifacts {
testArtifacts testJar
}