--- build.gradle.orig 2019-10-23 20:54:54 UTC +++ build.gradle @@ -42,22 +42,28 @@ project.ext.BIN_REPO_PATH = BIN_REPO // TODO make path /********************************************************************************* * Prevent forked Java processes from stealing focus + * Prevent writing to the actual home directory *********************************************************************************/ +ext.DUMMY_HOME = file("${projectDir}/../dummy.home").absolutePath allprojects { tasks.withType(JavaForkOptions) { jvmArgs '-Djava.awt.headless=true' } + tasks.withType(JavaExec) { + jvmArgs "-Duser.home=${DUMMY_HOME}" + } } /********************************************************************************* * Use flat directory-style repository if flatRepo directory is present. *********************************************************************************/ -if (file("flatRepo").isDirectory()) { +ext.FLATREPO = file("${projectDir}/../flatrepo").absolutePath +if (file("${FLATREPO}").isDirectory()) { allprojects { repositories { mavenCentral() jcenter() - flatDir name: "flat", dirs:["$rootProject.projectDir/flatRepo"] + flatDir name: "flat", dirs:["${FLATREPO}"] } } } @@ -77,7 +83,7 @@ else { * project.OS_NAMES.each {...} ****************************************************************************/ -project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64"]) +project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64", "freebsd64"]) /**************************************************************************** * Establish Visual Studio configuration environment for Windows native builds @@ -137,6 +143,19 @@ def isWindows(String platformName) { return platformName.startsWith("win") } +/********************************************************************************* + * Returns true if the platform is a FreeBSD machine. + *********************************************************************************/ +def isFreeBSD(String platformName) { + + if (platformName.startsWith("freebsd")) { + return true + } + else { + return false + } +} + /****************************************************************************************** * Helper method that returns a file that is the same relative location in the bin repo * as the given project is in its repo. @@ -283,6 +302,11 @@ String getCurrentPlatformName() { return 'osx64' } } + else if (osName.startsWith("FreeBSD")) { + if (isX86_64) { + return 'freebsd64' + } + } throw new GradleException("Unrecognized current platform -> osName = $osName, archName = $archName") }