mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
automagically detect java_home in gradle
This commit is contained in:
parent
282ebf9d84
commit
978f86b25c
@ -38,6 +38,13 @@ ext {
|
|||||||
platform = project.hasProperty('platform') ? platform : currentPlatform
|
platform = project.hasProperty('platform') ? platform : currentPlatform
|
||||||
arch = project.hasProperty('arch') ? arch : currentArch
|
arch = project.hasProperty('arch') ? arch : currentArch
|
||||||
platformArch = "${platform}-${arch}"
|
platformArch = "${platform}-${arch}"
|
||||||
|
|
||||||
|
java_home = System.properties.'java.home'
|
||||||
|
if(java_home.endsWith("/jre")) {
|
||||||
|
java_home = java_home.substring(0, java_home.length() - "/jre".length())
|
||||||
|
}
|
||||||
|
java_home = java_home
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model {
|
model {
|
||||||
@ -60,7 +67,7 @@ model {
|
|||||||
executable "make"
|
executable "make"
|
||||||
args "platform=${platform.operatingSystem.name}",
|
args "platform=${platform.operatingSystem.name}",
|
||||||
"arch=${platform.architecture.name}"
|
"arch=${platform.architecture.name}"
|
||||||
environment JAVA_HOME: "/usr/local/java"
|
environment JAVA_HOME: java_home
|
||||||
}
|
}
|
||||||
|
|
||||||
assemble {
|
assemble {
|
||||||
|
Loading…
Reference in New Issue
Block a user