mirror of
https://github.com/corda/corda.git
synced 2025-03-17 17:45:17 +00:00
fix build issue on windows
This commit is contained in:
parent
d33f31614c
commit
b2bc411321
196
node/dist/build.gradle
vendored
196
node/dist/build.gradle
vendored
@ -46,114 +46,112 @@ task copyLauncherLibs(type: Copy, dependsOn: [project(':launcher').jar]) {
|
||||
into "$buildDir/tmp/launcher-lib"
|
||||
}
|
||||
|
||||
// The launcher building is done as it depends on application-specific settings which
|
||||
// cannot be overridden later
|
||||
task buildLauncher(type: Exec, dependsOn: [copyLauncherLibs]) {
|
||||
description 'Build Launcher executable'
|
||||
def isLinux = System.properties['os.name'].toLowerCase().contains('linux')
|
||||
def isMac = System.properties['os.name'].toLowerCase().contains('mac')
|
||||
if (isLinux || isMac) {
|
||||
println("Detected *nix system, enabling distribution creation")
|
||||
task buildLauncher(type: Exec, dependsOn: [copyLauncherLibs]) {
|
||||
description 'Build Launcher executable'
|
||||
|
||||
def isLinux = System.properties['os.name'].toLowerCase().contains('linux')
|
||||
def isMac = System.properties['os.name'].toLowerCase().contains('mac')
|
||||
def relativeDir
|
||||
if (isLinux)
|
||||
relativeDir = "launcher"
|
||||
else
|
||||
relativeDir = "launcher.app/Contents"
|
||||
|
||||
if (!isLinux && !isMac)
|
||||
throw new GradleException("Preparing distribution package is currently only supported on Linux/Mac")
|
||||
def extraArgs = [
|
||||
"-BjvmOptions=-javaagent:../../lib/quasar-core-${quasar_version}-jdk8.jar=${project(':node:capsule').quasarExcludeExpression}",
|
||||
'-BuserJvmOptions=-Xmx=4g',
|
||||
'-BuserJvmOptions=-XX\\:=+UseG1GC',
|
||||
"-BjvmProperties=java.system.class.loader=${project(':launcher').loaderClassName}"
|
||||
]
|
||||
|
||||
def relativeDir
|
||||
if (isLinux)
|
||||
relativeDir = "launcher"
|
||||
else
|
||||
relativeDir = "launcher.app/Contents"
|
||||
ext {
|
||||
launcherBinDir = "${tmpDir}/bundles/$relativeDir"
|
||||
}
|
||||
|
||||
def extraArgs = [
|
||||
"-BjvmOptions=-javaagent:../../lib/quasar-core-${quasar_version}-jdk8.jar=${project(':node:capsule').quasarExcludeExpression}",
|
||||
'-BuserJvmOptions=-Xmx=4g',
|
||||
'-BuserJvmOptions=-XX\\:=+UseG1GC',
|
||||
"-BjvmProperties=java.system.class.loader=${project(':launcher').loaderClassName}"
|
||||
]
|
||||
workingDir project.projectDir
|
||||
|
||||
ext {
|
||||
launcherBinDir = "${tmpDir}/bundles/$relativeDir"
|
||||
doFirst {
|
||||
def launcherLib = copyLauncherLibs.destinationDir
|
||||
def srcfiles = []
|
||||
def launcherClasspath = []
|
||||
|
||||
fileTree(launcherLib).forEach({ file ->
|
||||
srcfiles.add("-srcfiles")
|
||||
srcfiles.add(file.name)
|
||||
launcherClasspath.add(file.name)
|
||||
})
|
||||
|
||||
commandLine = [
|
||||
'javapackager',
|
||||
'-deploy',
|
||||
'-nosign',
|
||||
'-native', 'image',
|
||||
'-outdir', "$tmpDir",
|
||||
'-outfile', 'launcher',
|
||||
'-name', 'launcher',
|
||||
"-BmainJar=${project(':launcher').jar.archiveName}",
|
||||
"-Bclasspath=${launcherClasspath.join(":")}",
|
||||
'-appclass', "${project(':launcher').launcherClassName}",
|
||||
'-srcdir', "$launcherLib"
|
||||
] + srcfiles + extraArgs
|
||||
}
|
||||
|
||||
// Add configuration for running Node application
|
||||
doLast {
|
||||
def nodeClasspath = []
|
||||
def libRelPath = "../lib/"
|
||||
|
||||
project(':node').configurations.runtime.forEach({ file ->
|
||||
nodeClasspath.add(file.getName())
|
||||
})
|
||||
|
||||
nodeClasspath.add(project(':node').jar.archivePath.getName())
|
||||
|
||||
new File("${launcherBinDir}/runtime.properties").text = [
|
||||
"libpath=${libRelPath}",
|
||||
"classpath=${nodeClasspath.join(':')}",
|
||||
"plugins=./drivers:./cordapps"].join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
workingDir project.projectDir
|
||||
task buildNode(type: Copy, dependsOn: [buildLauncher, project(':docs').tasks['makeDocs'], project(':node').tasks['jar']]) {
|
||||
description 'Build stand-alone Corda Node distribution'
|
||||
|
||||
doFirst {
|
||||
def launcherLib = copyLauncherLibs.destinationDir
|
||||
def srcfiles = []
|
||||
def launcherClasspath = []
|
||||
into(outputDir)
|
||||
|
||||
fileTree(launcherLib).forEach({ file ->
|
||||
srcfiles.add("-srcfiles")
|
||||
srcfiles.add(file.name)
|
||||
launcherClasspath.add(file.name)
|
||||
})
|
||||
from(buildLauncher.launcherBinDir) {
|
||||
into("launcher")
|
||||
}
|
||||
|
||||
commandLine = [
|
||||
'javapackager',
|
||||
'-deploy',
|
||||
'-nosign',
|
||||
'-native', 'image',
|
||||
'-outdir', "$tmpDir",
|
||||
'-outfile', 'launcher',
|
||||
'-name', 'launcher',
|
||||
"-BmainJar=${project(':launcher').jar.archiveName}",
|
||||
"-Bclasspath=${launcherClasspath.join(":")}",
|
||||
'-appclass', "${project(':launcher').launcherClassName}",
|
||||
'-srcdir', "$launcherLib"
|
||||
] + srcfiles + extraArgs
|
||||
}
|
||||
|
||||
// Add configuration for running Node application
|
||||
doLast {
|
||||
def nodeClasspath = []
|
||||
def libRelPath = "../lib/"
|
||||
|
||||
project(':node').configurations.runtime.forEach({ file ->
|
||||
nodeClasspath.add(file.getName())
|
||||
})
|
||||
|
||||
nodeClasspath.add(project(':node').jar.archivePath.getName())
|
||||
|
||||
new File("${launcherBinDir}/runtime.properties").text = [
|
||||
"libpath=${libRelPath}",
|
||||
"classpath=${nodeClasspath.join(':')}",
|
||||
"plugins=./drivers:./cordapps"].join("\n")
|
||||
from(project(':node').configurations.runtime) {
|
||||
into("lib")
|
||||
}
|
||||
|
||||
from(project(':node').jar.archivePath) {
|
||||
into("lib")
|
||||
}
|
||||
|
||||
from(sourceSets.binFiles.resources) {
|
||||
into("bin")
|
||||
}
|
||||
|
||||
from(sourceSets.readmeFiles.resources) {
|
||||
into(".")
|
||||
}
|
||||
|
||||
from(project(':docs').buildDir) {
|
||||
into("docs")
|
||||
}
|
||||
|
||||
doLast {
|
||||
new File("${outputDir}/cordapps").mkdirs()
|
||||
new File("${outputDir}/drivers").mkdirs()
|
||||
println("Stand-alone Corda Node application available at:")
|
||||
println("${outputDir}")
|
||||
}
|
||||
}
|
||||
}else{
|
||||
println("Not running on *nix, disabling distribution generation")
|
||||
}
|
||||
|
||||
task buildNode(type: Copy, dependsOn: [buildLauncher, project(':docs').tasks['makeDocs'], project(':node').tasks['jar']]) {
|
||||
description 'Build stand-alone Corda Node distribution'
|
||||
|
||||
into(outputDir)
|
||||
|
||||
from(buildLauncher.launcherBinDir) {
|
||||
into("launcher")
|
||||
}
|
||||
|
||||
from(project(':node').configurations.runtime) {
|
||||
into("lib")
|
||||
}
|
||||
|
||||
from(project(':node').jar.archivePath) {
|
||||
into("lib")
|
||||
}
|
||||
|
||||
from(sourceSets.binFiles.resources) {
|
||||
into("bin")
|
||||
}
|
||||
|
||||
from(sourceSets.readmeFiles.resources) {
|
||||
into(".")
|
||||
}
|
||||
|
||||
from(project(':docs').buildDir) {
|
||||
into("docs")
|
||||
}
|
||||
|
||||
doLast {
|
||||
new File("${outputDir}/cordapps").mkdirs()
|
||||
new File("${outputDir}/drivers").mkdirs()
|
||||
println ("Stand-alone Corda Node application available at:")
|
||||
println ("${outputDir}")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user