forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
49 lines (41 loc) · 1010 Bytes
/
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
repositories {
maven {
url "$artifactory_contextUrl/corda-dependencies"
}
}
ext {
jdk_home = "$projectDir/jdk".toString()
rt_jar = "$jdk_home/jre/lib/rt.jar".toString()
}
configurations {
jdk
}
dependencies {
jdk "net.corda:deterministic-rt:$deterministic_rt_version:api"
}
def copyJdk = tasks.register('copyJdk', Copy) {
outputs.dir jdk_home
from(configurations.jdk) {
rename 'deterministic-rt-(.*).jar', 'rt.jar'
}
into "$jdk_home/jre/lib"
doLast {
def eol = System.lineSeparator()
file("$jdk_home/release").write "JAVA_VERSION=\"1.8.0_172\"$eol"
mkdir "$jdk_home/bin"
file("$jdk_home/bin/javac").with {
write "#!/bin/sh\necho \"javac 1.8.0_172\"\n"
setExecutable true, false
return
}
}
}
tasks.named('assemble') {
dependsOn copyJdk
}
tasks.named('jar', Jar) {
enabled = false
}
artifacts {
jdk file: file(rt_jar), type: 'jar', builtBy: copyJdk
}