forked from ether-camp/solcJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
68 lines (56 loc) · 1.76 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.8.4'
id 'de.undercouch.download' version '3.4.3'
}
group 'org.ethereum'
version '0.5.7'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/openlawteam/solcJ")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
artifactId = "solcj-all"
from(components.java)
}
}
}
repositories {
jcenter()
}
dependencies {
testCompile "junit:junit:4.11"
}
test {
testLogging.showStandardStreams = true
afterTest { desc, result ->
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}
task downloadStaticLinuxFile(type: Download) {
src "https://github.com/ethereum/solidity/releases/download/v${version}/solc-static-linux"
dest "${projectDir}/src/main/resources/native/linux/solc/solc"
}
task downloadWindowsZipFile(type: Download) {
src "https://github.com/ethereum/solidity/releases/download/v${version}/solidity-windows.zip"
dest new File("${buildDir}/tmp", 'solidity-windows.zip')
}
task unzipFile(dependsOn: downloadWindowsZipFile, type: Copy) {
from zipTree(downloadWindowsZipFile.dest)
into "${projectDir}/src/main/resources/native/win/solc"
}
task cleanUpFiles(dependsOn: unzipFile, type: Delete) {
delete "${projectDir}/src/main/resources/native/win/solc/soltest.exe"
}
assemble.dependsOn downloadStaticLinuxFile
assemble.dependsOn cleanUpFiles