summaryrefslogtreecommitdiff
path: root/devel/ghidra/files/patch-build.gradle
blob: df81e7b86dc993dadd761a7aa55c9505b51cf275 (plain) (blame)
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
68
69
70
71
72
73
74
--- 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")
 }