Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-0: Fixing Gradle deprecations

Ryan Kurtz764adb9c0f18
diff --git a/GPL/DMG/build.gradle b/GPL/DMG/build.gradle
index f06f6926b9..6f61c52d50 100644
--- a/GPL/DMG/build.gradle
+++ b/GPL/DMG/build.gradle
@@ -9,7 +9,7 @@ if (findProject(':Generic') != null) {
rootProject.assembleDistribution {
doLast {
// eliminate standard module lib directory
- def assemblePath = destinationDir.path + "/" + getZipPath(this.project)
+ def assemblePath = destinationDir.path + "/" + rootProject.getZipPath(this.project)
delete assemblePath + "/lib"
}
}
@@ -39,7 +39,10 @@ sourceSets {
}
repositories {
- flatDir name: "flat", dirs:["data/lib"]
+ flatDir {
+ name = "flat"
+ dirs "data/lib"
+ }
}
dependencies {
diff --git a/GPL/nativeBuildProperties.gradle b/GPL/nativeBuildProperties.gradle
index 5685ddc858..17ee3dfcb4 100644
--- a/GPL/nativeBuildProperties.gradle
+++ b/GPL/nativeBuildProperties.gradle
@@ -26,7 +26,7 @@ model {
// Use the PLATFORMS list to create the platforms that Ghidra supports.
platforms {
- project.PLATFORMS.each { platform ->
+ rootProject.PLATFORMS.each { platform ->
"${platform.name}" {
architecture platform.arch
operatingSystem platform.os
diff --git a/GPL/utils.gradle b/GPL/utils.gradle
index a510e921c5..a02738804c 100644
--- a/GPL/utils.gradle
+++ b/GPL/utils.gradle
@@ -8,7 +8,7 @@
******************************************************************************************/
ext.getProjectLocationInBinRepo = { p ->
String relativePath = getGhidraRelativePath(p)
- File binRepoRootProject = new File("${BIN_REPO}")
+ File binRepoRootProject = new File("${rootProject.BIN_REPO}")
return new File(binRepoRootProject, relativePath)
}
/****************************************************************************************
diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle b/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle
index 56cf406010..3a5f28b17c 100644
--- a/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle
+++ b/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle
@@ -29,8 +29,8 @@ dependencies {
}
def tlb = file("build/os/win_x86_64/dbgmodel.tlb")
-def depsFile = file("${DEPS_DIR}/Debugger-agent-dbgeng/dbgmodel.tlb")
-def binRepoFile = file("${BIN_REPO}/${getGhidraRelativePath(project)}/os/win_x86_64/dbgmodel.tlb")
+def depsFile = file("${rootProject.DEPS_DIR}/Debugger-agent-dbgeng/dbgmodel.tlb")
+def binRepoFile = file("${rootProject.BIN_REPO}/${rootProject.getGhidraRelativePath(project)}/os/win_x86_64/dbgmodel.tlb")
tasks.assemblePyPackage {
def prebuiltTlb = depsFile.exists() ? depsFile : (binRepoFile.exists() ? binRepoFile : null)
@@ -80,7 +80,7 @@ task prebuildTlb(type: Copy) {
into binRepoFile.parentFile
doFirst {
- assert file(BIN_REPO).exists() : "Bin repo doesn't exist"
+ assert file(rootProject.BIN_REPO).exists() : "Bin repo doesn't exist"
file(binRepoFile).parentFile.mkdirs()
}
}
diff --git a/Ghidra/Extensions/SymbolicSummaryZ3/build.gradle b/Ghidra/Extensions/SymbolicSummaryZ3/build.gradle
index fdc39296da..2c613f74ca 100644
--- a/Ghidra/Extensions/SymbolicSummaryZ3/build.gradle
+++ b/Ghidra/Extensions/SymbolicSummaryZ3/build.gradle
@@ -35,8 +35,8 @@ dependencies {
}
CopySpec z3LibsCopySpec = copySpec {
- File depsDir = file("${DEPS_DIR}/SymbolicSummaryZ3/os")
- File binRepoDir = file("${BIN_REPO}/Ghidra/Extensions/SymbolicSummaryZ3/os")
+ File depsDir = file("${rootProject.DEPS_DIR}/SymbolicSummaryZ3/os")
+ File binRepoDir = file("${rootProject.BIN_REPO}/Ghidra/Extensions/SymbolicSummaryZ3/os")
from(depsDir.exists() ? depsDir : binRepoDir) {
into("os")
}
@@ -48,7 +48,7 @@ task z3DevLibsCopy(type: Copy) {
onlyIf {
// Only need to do this if using dependencies directory
- file("${DEPS_DIR}/SymbolicSummaryZ3/os").exists()
+ file("${rootProject.DEPS_DIR}/SymbolicSummaryZ3/os").exists()
}
with z3LibsCopySpec
@@ -56,10 +56,10 @@ task z3DevLibsCopy(type: Copy) {
}
zipExtensions {
- into(getBaseProjectName(this.project)) {
+ into(rootProject.getBaseProjectName(this.project)) {
with z3LibsCopySpec
}
- into(getBaseProjectName(this.project)) {
+ into(rootProject.getBaseProjectName(this.project)) {
from(this.project.file(".")) {
include("README.md")
}
diff --git a/Ghidra/Features/BSim/build.gradle b/Ghidra/Features/BSim/build.gradle
index 15bd8ff811..b768b8afac 100755
--- a/Ghidra/Features/BSim/build.gradle
+++ b/Ghidra/Features/BSim/build.gradle
@@ -44,10 +44,10 @@ dependencies {
rootProject.assembleDistribution {
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
- String postgresqlDepsFile = "${DEPS_DIR}/BSim/${postgresql_distro}"
- String postgresqlBinRepoFile = "${BIN_REPO}/Ghidra/Features/BSim/${postgresql_distro}"
+ String postgresqlDepsFile = "${rootProject.DEPS_DIR}/BSim/${postgresql_distro}"
+ String postgresqlBinRepoFile = "${rootProject.BIN_REPO}/Ghidra/Features/BSim/${postgresql_distro}"
def postgresqlFile = file(postgresqlDepsFile).exists() ? postgresqlDepsFile : postgresqlBinRepoFile
diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradle
index 9c5671fa5b..4064cae0cd 100644
--- a/Ghidra/Features/Decompiler/build.gradle
+++ b/Ghidra/Features/Decompiler/build.gradle
@@ -38,7 +38,7 @@ dependencies {
rootProject.assembleDistribution {
from (this.project.projectDir.toString()) {
include "src/decompile/**"
- into { getZipPath(this.project) }
+ into { rootProject.getZipPath(this.project) }
}
}
@@ -239,7 +239,7 @@ task buildDecompilerHelpPdf(type: Exec) {
*/
task buildDecompilerDocumentationPdfs(type: Exec) {
// Check the OS before enabling task.
- if (!(isCurrentLinux() || isCurrentMac())) {
+ if (!(rootProject.isCurrentLinux() || rootProject.isCurrentMac())) {
it.enabled = false
}
diff --git a/Ghidra/Features/FileFormats/build.gradle b/Ghidra/Features/FileFormats/build.gradle
index 3ea87870da..c523ce42a2 100644
--- a/Ghidra/Features/FileFormats/build.gradle
+++ b/Ghidra/Features/FileFormats/build.gradle
@@ -62,7 +62,7 @@ dependencies {
rootProject.assembleDistribution {
from (this.project.projectDir.toString()) {
include "src/lzfse/**"
- into { getZipPath(this.project) }
+ into { rootProject.getZipPath(this.project) }
}
}
diff --git a/Ghidra/Features/FunctionID/build.gradle b/Ghidra/Features/FunctionID/build.gradle
index e10f30ca4d..a77e92751c 100644
--- a/Ghidra/Features/FunctionID/build.gradle
+++ b/Ghidra/Features/FunctionID/build.gradle
@@ -31,8 +31,8 @@ dependencies {
// All *.fidb files located in the dependencies/fid directory OR the
// BIN repo under src/main/fidb will be unpacked
-def depsDir = file("${DEPS_DIR}/fidb")
-def binRepoDir = "${getProjectLocationInBinRepo(project)}/src/main/fidb"
+def depsDir = file("${rootProject.DEPS_DIR}/fidb")
+def binRepoDir = "${rootProject.getProjectLocationInBinRepo(project)}/src/main/fidb"
def fidDbFiles = fileTree(depsDir.exists() ? depsDir : binRepoDir) {
include '**/*.fidb'
}
diff --git a/Ghidra/Features/GhidraServer/build.gradle b/Ghidra/Features/GhidraServer/build.gradle
index 81226d9628..3be550a4bb 100644
--- a/Ghidra/Features/GhidraServer/build.gradle
+++ b/Ghidra/Features/GhidraServer/build.gradle
@@ -32,12 +32,12 @@ dependencies {
api project(":DB")
api project(":Generic")
- runGhidraServer project
+ runGhidraServer project(":GhidraServer")
}
CopySpec yajswCopySpec = copySpec {
- File depsFile = file("${DEPS_DIR}/GhidraServer/${yajswRelease}.zip")
- File binRepoFile = file("${BIN_REPO}/Ghidra/Features/GhidraServer/${yajswRelease}.zip")
+ File depsFile = file("${rootProject.DEPS_DIR}/GhidraServer/${yajswRelease}.zip")
+ File binRepoFile = file("${rootProject.BIN_REPO}/Ghidra/Features/GhidraServer/${yajswRelease}.zip")
// First check if the file is in the dependencies repo. If not, check in the bin repo.
def yajswZipTree = depsFile.exists() ? zipTree(depsFile) : zipTree(binRepoFile)
@@ -114,11 +114,11 @@ task generateGhidraServerClasspath {
* GhidraServer.
*/
rootProject.assembleDistribution {
- into (getZipPath(this.project) + "/data") {
+ into (rootProject.getZipPath(this.project) + "/data") {
with yajswCopySpec
from generateGhidraServerClasspath
}
- into (getZipPath(this.project) + "/os") {
+ into (rootProject.getZipPath(this.project) + "/os") {
from (projectDir.toString() + "/os")
}
}
@@ -157,7 +157,7 @@ task generateDevGhidraServerClasspath {
// There might be dependencies in the gradle cache, which could be anywhere
// (including a different drive). We can only use relative paths if the jar is in
// the root project repo or bin repo.
- if (JAR_PATH.startsWith(rootProject.getProjectDir().absolutePath) || JAR_PATH.startsWith(BIN_REPO)) {
+ if (JAR_PATH.startsWith(rootProject.getProjectDir().absolutePath) || JAR_PATH.startsWith(rootProject.BIN_REPO)) {
JAR_PATH = "\${ghidra_home}/" + rootProject.relativePath(JAR_PATH)
}
JAR_PATH = JAR_PATH.replace('\\','/') // necessary for windows
diff --git a/Ghidra/Features/PDB/build.gradle b/Ghidra/Features/PDB/build.gradle
index b5f23c7a4b..d50365f1b8 100644
--- a/Ghidra/Features/PDB/build.gradle
+++ b/Ghidra/Features/PDB/build.gradle
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,6 +42,6 @@ dependencies {
rootProject.assembleDistribution {
from (this.project.projectDir.toString()) {
include "src/pdb/**"
- into { getZipPath(this.project) }
+ into { rootProject.getZipPath(this.project) }
}
-}
\ No newline at end of file
+}
diff --git a/Ghidra/Features/PDB/buildNatives.gradle b/Ghidra/Features/PDB/buildNatives.gradle
index 4637e6c61e..ef5984eb81 100644
--- a/Ghidra/Features/PDB/buildNatives.gradle
+++ b/Ghidra/Features/PDB/buildNatives.gradle
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,7 +22,7 @@ if (findProject(':Generic') == null) {
apply from: "../../../GPL/nativeBuildProperties.gradle"
}
-if ("win_x86_64".equals(getCurrentPlatformName())) {
+if ("win_x86_64".equals(rootProject.getCurrentPlatformName())) {
String makeName = "win_x86_64PDBMake"
task(type: Exec, makeName) {
diff --git a/Ghidra/Features/PyGhidra/build.gradle b/Ghidra/Features/PyGhidra/build.gradle
index 41dd72e2c0..57739c866a 100644
--- a/Ghidra/Features/PyGhidra/build.gradle
+++ b/Ghidra/Features/PyGhidra/build.gradle
@@ -64,8 +64,8 @@ distributePyDep("typing_extensions-4.16.0-py3-none-any.whl")
task installJPype(type: Exec) {
dependsOn(":createPythonVirtualEnvironment")
- File depsDir = file("${DEPS_DIR}/PyGhidra")
- File binRepoDir = file("${BIN_REPO}/ExternalPyWheels")
+ File depsDir = file("${rootProject.DEPS_DIR}/PyGhidra")
+ File binRepoDir = file("${rootProject.BIN_REPO}/ExternalPyWheels")
def dir = depsDir.exists() ? depsDir : binRepoDir
doFirst {
@@ -78,8 +78,8 @@ task installGhidraStubs(type: Exec) {
dependsOn(":createGhidraStubsWheel")
dependsOn(":createPythonVirtualEnvironment")
- File depsDir = file("${DEPS_DIR}/PyGhidra")
- File binRepoDir = file("${BIN_REPO}/ExternalPyWheels")
+ File depsDir = file("${rootProject.DEPS_DIR}/PyGhidra")
+ File binRepoDir = file("${rootProject.BIN_REPO}/ExternalPyWheels")
def dir = depsDir.exists() ? depsDir : binRepoDir
doFirst {
@@ -93,8 +93,8 @@ task prepPyGhidra(type: Exec) {
dependsOn("installJPype")
dependsOn("installGhidraStubs")
- File depsDir = file("${DEPS_DIR}/PyGhidra")
- File binRepoDir = file("${BIN_REPO}/ExternalPyWheels")
+ File depsDir = file("${rootProject.DEPS_DIR}/PyGhidra")
+ File binRepoDir = file("${rootProject.BIN_REPO}/ExternalPyWheels")
def dir = depsDir.exists() ? depsDir : binRepoDir
doFirst {
@@ -104,7 +104,7 @@ task prepPyGhidra(type: Exec) {
rootProject.assembleMarkdownToHtml {
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from ("${p.projectDir}/src/main/py/README.md") {
into { "${zipPath}/pypkg" }
diff --git a/Ghidra/Test/DebuggerIntegrationTest/build.gradle b/Ghidra/Test/DebuggerIntegrationTest/build.gradle
index 6fd01c1f4a..4dc68d4f4c 100644
--- a/Ghidra/Test/DebuggerIntegrationTest/build.gradle
+++ b/Ghidra/Test/DebuggerIntegrationTest/build.gradle
@@ -219,13 +219,13 @@ integrationTest {
dependsOn { project(':Debugger-agent-drgn').assemblePyPackage }
dependsOn { project(':Debugger-agent-x64dbg').assemblePyPackage }
- if ("linux_x86_64".equals(getCurrentPlatformName())) {
+ if ("linux_x86_64".equals(rootProject.getCurrentPlatformName())) {
dependsOn("testSpecimenLinux_x86_64")
}
- if ("mac_x86_64".equals(getCurrentPlatformName())) {
+ if ("mac_x86_64".equals(rootProject.getCurrentPlatformName())) {
dependsOn("testSpecimenMac_x86_64")
}
- if ("win_x86_64".equals(getCurrentPlatformName())) {
+ if ("win_x86_64".equals(rootProject.getCurrentPlatformName())) {
dependsOn("testSpecimenWin_x86_64")
}
}
diff --git a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/build.gradle b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/build.gradle
index 960fa77d3c..49087a4577 100644
--- a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/build.gradle
+++ b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/build.gradle
@@ -85,8 +85,8 @@ task pyDevUnpack(type:Copy) {
!pyDevDestDir.exists()
}
- File depsFile = file("${DEPS_DIR}/GhidraDev/PyDev 9.3.0.zip")
- File binRepoFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/PyDev 9.3.0.zip")
+ File depsFile = file("${rootProject.DEPS_DIR}/GhidraDev/PyDev 9.3.0.zip")
+ File binRepoFile = file("${rootProject.BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/PyDev 9.3.0.zip")
// First check if the file is in the dependencies repo. If not, check in the bin repo.
def pyDevZipTree = depsFile.exists() ? zipTree(depsFile) : zipTree(binRepoFile)
@@ -108,8 +108,8 @@ task cdtUnpack(type:Copy) {
!cdtDestDir.exists()
}
- File depsFile = file("${DEPS_DIR}/GhidraDev/cdt-8.6.0.zip")
- File binRepoFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/cdt-8.6.0.zip")
+ File depsFile = file("${rootProject.DEPS_DIR}/GhidraDev/cdt-8.6.0.zip")
+ File binRepoFile = file("${rootProject.BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/cdt-8.6.0.zip")
// First check if the file is in the dependencies repo. If not, check in the bin repo.
def cdtZipTree = depsFile.exists() ? zipTree(depsFile) : zipTree(binRepoFile)
@@ -129,7 +129,7 @@ task prepGhidraDev {
// We do not currently build GhidraDev plugin at Ghidra build time so we must
// copy the prebuilt zip file from the BIN_REPO
rootProject.assembleDistribution {
- from ("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev") {
+ from ("${rootProject.BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev") {
include 'GhidraDev*.zip'
into "Extensions/Eclipse/GhidraDev/"
}
diff --git a/GhidraBuild/EclipsePlugins/GhidraSleighEditor/ghidra.xtext.sleigh/build.gradle b/GhidraBuild/EclipsePlugins/GhidraSleighEditor/ghidra.xtext.sleigh/build.gradle
index 462eb1514b..8ea97c5d65 100644
--- a/GhidraBuild/EclipsePlugins/GhidraSleighEditor/ghidra.xtext.sleigh/build.gradle
+++ b/GhidraBuild/EclipsePlugins/GhidraSleighEditor/ghidra.xtext.sleigh/build.gradle
@@ -68,7 +68,7 @@ if (hasProperty("eclipseDSL")) {
// We do not currently build the SleighEditor plugin at Ghidra build time so we must
// copy the prebuilt zip file from the BIN_REPO
rootProject.assembleDistribution {
- from ("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraSleighEditor") {
+ from ("${rootProject.BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraSleighEditor") {
include 'GhidraSleighEditor*.zip'
into "Extensions/Eclipse/GhidraSleighEditor/"
}
diff --git a/build.gradle b/build.gradle
index 0bac820bc9..091d4934f1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -92,7 +92,10 @@ if (flatRepo.isDirectory()) {
repositories {
mavenLocal()
mavenCentral()
- flatDir name: "flat", dirs:["$flatRepo"]
+ flatDir {
+ name = "flat"
+ dirs flatRepo
+ }
}
}
}
diff --git a/docker/build.gradle b/docker/build.gradle
index 3803ba51a2..27a80615ed 100644
--- a/docker/build.gradle
+++ b/docker/build.gradle
@@ -15,7 +15,7 @@
*/
rootProject.assembleDistribution {
- from (ROOT_PROJECT_DIR + "/docker") {
+ from (rootProject.ROOT_PROJECT_DIR + "/docker") {
into "docker"
exclude "build.gradle"
}
diff --git a/gradle/distributableGPLExtension.gradle b/gradle/distributableGPLExtension.gradle
index 4f2f1ad92b..34a46633b1 100644
--- a/gradle/distributableGPLExtension.gradle
+++ b/gradle/distributableGPLExtension.gradle
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,6 +37,6 @@ zipExtensions {
exclude '.settings/**'
exclude 'bin/**'
- into { getBaseProjectName(p) }
+ into { rootProject.getBaseProjectName(p) }
}
}
diff --git a/gradle/distributableGPLModule.gradle b/gradle/distributableGPLModule.gradle
index a0d09be4ea..ff78e1738d 100644
--- a/gradle/distributableGPLModule.gradle
+++ b/gradle/distributableGPLModule.gradle
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,7 +18,7 @@ apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
rootProject.assembleDistribution {
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from (p.projectDir.toString()) {
exclude "bin"
diff --git a/gradle/distributableGhidraModule.gradle b/gradle/distributableGhidraModule.gradle
index 0638f1ec91..8e75b50aaa 100644
--- a/gradle/distributableGhidraModule.gradle
+++ b/gradle/distributableGhidraModule.gradle
@@ -28,7 +28,7 @@ apply from: "$rootProject.projectDir/gradle/support/distributionCommon.gradle"
rootProject.assembleDistribution {
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from ("${p.projectDir}/Module.manifest") {
into { zipPath }
@@ -44,7 +44,7 @@ rootProject.assembleDistribution {
exclude '**/*.sla.lock' // associated with language modules
}
- from ("${BIN_REPO}/${getGhidraRelativePath(p)}/data") {
+ from ("${rootProject.BIN_REPO}/${rootProject.getGhidraRelativePath(p)}/data") {
into { "${zipPath}/data" }
}
@@ -121,10 +121,10 @@ rootProject.PLATFORMS.each { platform ->
t.from (p.projectDir.toString() + "/build/os/${platform.name}") {
exclude '*.lib'
exclude '*.exp'
- into getZipPath(p) + "/os/${platform.name}"
+ into rootProject.getZipPath(p) + "/os/${platform.name}"
}
t.from (p.projectDir.toString() + "/os/${platform.name}") {
- into getZipPath(p) + "/os/${platform.name}"
+ into rootProject.getZipPath(p) + "/os/${platform.name}"
}
}
}
@@ -132,7 +132,7 @@ rootProject.PLATFORMS.each { platform ->
// For win_x86_64 build, we have to also include any win_x86_32 binaries in the final zip.
rootProject.assembleDistribution_win_x86_64 {
from (this.project.projectDir.toString() + "/build/os/win_x86_32") {
- into getZipPath(this.project) + "/os/win_x86_32"
+ into rootProject.getZipPath(this.project) + "/os/win_x86_32"
}
}
@@ -180,14 +180,14 @@ plugins.withType(JavaPlugin) {
rootProject.assembleSource {
from (this.project.zipSourceSubproject) {
- into rootProject.ext.ZIP_DIR_PREFIX + "/" + getZipPath(this.project) + "/lib"
+ into rootProject.ext.ZIP_DIR_PREFIX + "/" + rootProject.getZipPath(this.project) + "/lib"
}
}
rootProject.assembleDistribution {
dependsOn assemble
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from (p.jar) {
// use closures for getting zip path to delay evaluation. See note at top of file.
@@ -201,7 +201,7 @@ plugins.withType(JavaPlugin) {
// External Libraries
gradle.taskGraph.whenReady { taskGraph ->
- List<String> externalPaths = getExternalRuntimeDependencies(p)
+ List<String> externalPaths = rootProject.getExternalRuntimeDependencies(p)
externalPaths.each { path ->
from (path) {
into {zipPath + "/lib" }
@@ -213,7 +213,7 @@ plugins.withType(JavaPlugin) {
rootProject.assembleMarkdownToHtml {
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from ("${p.projectDir}/README.md") {
into { zipPath }
diff --git a/gradle/hasProtobuf.gradle b/gradle/hasProtobuf.gradle
index 537c51fb65..bc43484aa0 100644
--- a/gradle/hasProtobuf.gradle
+++ b/gradle/hasProtobuf.gradle
@@ -22,7 +22,7 @@ configurations {
protocArtifact
}
-def platform = getCurrentPlatformName()
+def platform = rootProject.getCurrentPlatformName()
def version = getProperty('ghidra.protobuf.java.version')
@@ -34,10 +34,10 @@ dependencies {
allProtocArtifacts "com.google.protobuf:protoc:${version}:osx-x86_64@exe"
allProtocArtifacts "com.google.protobuf:protoc:${version}:osx-aarch_64@exe"
- if (isCurrentWindows()) {
+ if (rootProject.isCurrentWindows()) {
protocArtifact "com.google.protobuf:protoc:${version}:windows-x86_64@exe"
}
- if (isCurrentLinux()) {
+ if (rootProject.isCurrentLinux()) {
if (platform.endsWith("x86_64")) {
protocArtifact "com.google.protobuf:protoc:${version}:linux-x86_64@exe"
}
@@ -45,7 +45,7 @@ dependencies {
protocArtifact "com.google.protobuf:protoc:${version}:linux-aarch_64@exe"
}
}
- if (isCurrentMac()) {
+ if (rootProject.isCurrentMac()) {
if (platform.endsWith("x86_64")) {
protocArtifact "com.google.protobuf:protoc:${version}:osx-x86_64@exe"
}
@@ -53,7 +53,7 @@ dependencies {
protocArtifact "com.google.protobuf:protoc:${version}:osx-aarch_64@exe"
}
}
- if (isCurrentOpenBSD()) {
+ if (rootProject.isCurrentOpenBSD()) {
protocArtifact files('/usr/local/bin/protoc')
}
}
diff --git a/gradle/hasPythonPackage.gradle b/gradle/hasPythonPackage.gradle
index 68aead7f6c..9fb497f43f 100644
--- a/gradle/hasPythonPackage.gradle
+++ b/gradle/hasPythonPackage.gradle
@@ -19,13 +19,13 @@
*/
// Enable the Python Nature in the Eclipse project
-eclipse.project {
+rootProject.eclipse.project {
natures 'org.python.pydev.pythonNature'
}
ext.findPyDep = { name ->
- File inDeps = file("${DEPS_DIR}/${project.name}/${name}")
- File inRepo = file("${BIN_REPO}/ExternalPyWheels/${name}")
+ File inDeps = file("${rootProject.DEPS_DIR}/${project.name}/${name}")
+ File inRepo = file("${rootProject.BIN_REPO}/ExternalPyWheels/${name}")
if (inDeps.exists()) {
return inDeps
}
@@ -97,7 +97,7 @@ task buildPyPackage {
rootProject.assembleDistribution {
dependsOn(buildPyPackage)
def p = this.project
- def zipPath = getZipPath(p)
+ def zipPath = rootProject.getZipPath(p)
from (p.assemblePyPackage) {
exclude '**/*.pyc'
exclude '**/*.pyo'
@@ -110,14 +110,14 @@ rootProject.assembleDistribution {
}
ext.distributePyDep = { name ->
- Set<File> wheelFiles = PYTHON_DEPS.get(project)
+ Set<File> wheelFiles = rootProject.PYTHON_DEPS.get(project)
if (wheelFiles == null) {
wheelFiles = new HashSet<>()
- PYTHON_DEPS.put(project, wheelFiles)
+ rootProject.PYTHON_DEPS.put(project, wheelFiles)
}
File dep = findPyDep(name)
wheelFiles.add(dep)
- def zipPath = getZipPath(project)
+ def zipPath = rootProject.getZipPath(project)
rootProject.assembleDistribution {
into ("${zipPath}/pypkg/dist") {
from dep
diff --git a/gradle/javaTestProject.gradle b/gradle/javaTestProject.gradle
index 423bd232f8..341a826222 100644
--- a/gradle/javaTestProject.gradle
+++ b/gradle/javaTestProject.gradle
@@ -142,8 +142,8 @@ rootProject.combinedTestReport {
*********************************************************************************/
def initTestJVM(Task task, String rootDirName) {
- def testTempDir = file(rootTestDir).getAbsolutePath()
- def testReportDir = file(reportDir).getAbsolutePath()
+ def testTempDir = file(rootProject.rootTestDir).getAbsolutePath()
+ def testReportDir = file(rootProject.reportDir).getAbsolutePath()
task.doFirst {
println "Test Machine Name: " + machineName
@@ -172,8 +172,8 @@ def initTestJVM(Task task, String rootDirName) {
task.testLogging.showStandardStreams = true
// Min/Max heap size. These are passed in.
- task.minHeapSize = xms
- task.maxHeapSize = xmx
+ task.minHeapSize = rootProject.xms
+ task.maxHeapSize = rootProject.xmx
task.doFirst {
diff --git a/gradle/nativeProject.gradle b/gradle/nativeProject.gradle
index a2bf7f49a2..7caf98f44e 100644
--- a/gradle/nativeProject.gradle
+++ b/gradle/nativeProject.gradle
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,7 +41,7 @@ rootProject.assembleDistribution {
include "buildNatives.gradle"
rename "buildNatives.gradle", "build.gradle"
}
- into { getZipPath(p) }
+ into { rootProject.getZipPath(p) }
}
}
diff --git a/gradle/processorProject.gradle b/gradle/processorProject.gradle
index 578e17b11d..7dba0efce3 100644
--- a/gradle/processorProject.gradle
+++ b/gradle/processorProject.gradle
@@ -149,7 +149,7 @@ rootProject.prepDev.dependsOn(writeSleighDevBuild)
*
*****************************************************************************************/
rootProject.assembleDistribution {
- into (getZipPath(this.project) + "/data") {
+ into (rootProject.getZipPath(this.project) + "/data") {
from (rootProject.projectDir.toString() + "/GhidraBuild/BuildFiles/sleighDistBuild.template") {
rename { "build.xml" }
}
@@ -272,7 +272,7 @@ def resolveSleighArg(String arg, boolean useDevPath) {
}
else {
// first path element is the Ghidra directory
- modulePath = getZipPath(moduleProject)
+ modulePath = rootProject.getZipPath(moduleProject)
}
newArg += modulePath
newArg += tail
diff --git a/gradle/root/svg.gradle b/gradle/root/svg.gradle
index e561a1683c..49c74a03d7 100644
--- a/gradle/root/svg.gradle
+++ b/gradle/root/svg.gradle
@@ -43,8 +43,8 @@ task rasterizeSvg(type: JavaExec) {
// added these in the individual projects which use this task (eg: to the 'compile'
// configuration) but since this is the only task which requires them, it seemed
// appropriate to just add them here.
- classpath = files ( BIN_REPO + "/ExternalLibraries/libsforBuild/batik-all-1.7.jar",
- BIN_REPO + "/ExternalLibraries/libsforBuild/xml-apis-ext.jar")
+ classpath = files ( rootProject.BIN_REPO + "/ExternalLibraries/libsforBuild/batik-all-1.7.jar",
+ rootProject.BIN_REPO + "/ExternalLibraries/libsforBuild/xml-apis-ext.jar")
// Now build a list of all SVG files in the project. We have to do the isEmpty() check
// afterwards since Batik will choke if we don't pass it a valid input list.
diff --git a/gradle/support/extensionCommon.gradle b/gradle/support/extensionCommon.gradle
index e355a64841..94e1d0d4d3 100644
--- a/gradle/support/extensionCommon.gradle
+++ b/gradle/support/extensionCommon.gradle
@@ -39,7 +39,7 @@ task zipExtensions (type: Zip) {
from (propFile) {
String version = "${rootProject.RELEASE_VERSION}"
filter (ReplaceTokens, tokens: [extversion: version])
- into { getBaseProjectName(p) }
+ into { rootProject.getBaseProjectName(p) }
}
@@ -65,11 +65,11 @@ task zipExtensions (type: Zip) {
// included in standard zip
exclude 'contribZipExclude/**'
- into { getBaseProjectName(p) }
+ into { rootProject.getBaseProjectName(p) }
}
from (p.file('build/os')) {
- into { getBaseProjectName(p) + "/os" }
+ into { rootProject.getBaseProjectName(p) + "/os" }
exclude "**/*.exp"
exclude "**/*.lib"
}
@@ -79,10 +79,10 @@ task zipExtensions (type: Zip) {
/////////////////
gradle.taskGraph.whenReady { taskGraph ->
if (project.plugins.withType(JavaPlugin)) {
- List<String> externalPaths = getExternalRuntimeDependencies(p)
+ List<String> externalPaths = rootProject.getExternalRuntimeDependencies(p)
externalPaths.each { path ->
from (path) {
- into { getBaseProjectName(p) + "/lib" }
+ into { rootProject.getBaseProjectName(p) + "/lib" }
}
}
}
@@ -111,19 +111,19 @@ task zipExtensions (type: Zip) {
// handle special case where modules build data artifacts into the build dir
from (p.projectDir.toString() + "/build/data") {
- into { getBaseProjectName(p) + "/data" }
+ into { rootProject.getBaseProjectName(p) + "/data" }
}
from (p.projectDir.toString() + "/build/LICENSE.txt") {
- into { getBaseProjectName(p) }
+ into { rootProject.getBaseProjectName(p) }
}
/////////////////
// NATIVES
/////////////////
- project.PLATFORMS.each { platform ->
+ rootProject.PLATFORMS.each { platform ->
from (p.projectDir.toString() + "/os/${platform.name}") {
- into { getBaseProjectName(p) + "/os/${platform.name}" }
+ into { rootProject.getBaseProjectName(p) + "/os/${platform.name}" }
}
}
}
@@ -133,10 +133,10 @@ plugins.withType(JavaPlugin) {
def p = this.project
from (p.jar) {
// use closures for getting zip path to delay evaluation. See note at top of file.
- into { getBaseProjectName(p) + "/lib" }
+ into { rootProject.getBaseProjectName(p) + "/lib" }
}
from (p.tasks["zipSourceSubproject"]) {
- into { getBaseProjectName(p) + "/lib" }
+ into { rootProject.getBaseProjectName(p) + "/lib" }
}
}
}
diff --git a/gradle/support/ip.gradle b/gradle/support/ip.gradle
index ff5a990ea2..db3390049e 100644
--- a/gradle/support/ip.gradle
+++ b/gradle/support/ip.gradle
@@ -101,7 +101,7 @@ def Map<String, String> getModuleManifestIp(Project project) {
*********************************************************************************/
def checkExternalLibsInMap(Map<String, String> map, Project project) {
if (project.plugins.withType(JavaPlugin)) {
- List<String> libs = getExternalRuntimeDependencies(project)
+ List<String> libs = rootProject.getExternalRuntimeDependencies(project)
libs.each { lib ->
String libName = new File(lib).getName() // get just the filename without the path
String relativePath = "lib/"+libName;
diff --git a/gradle/support/loadApplicationProperties.gradle b/gradle/support/loadApplicationProperties.gradle
index d502d24a79..e289e3430a 100644
--- a/gradle/support/loadApplicationProperties.gradle
+++ b/gradle/support/loadApplicationProperties.gradle
@@ -39,8 +39,8 @@ file("Ghidra/application.properties").withReader { reader ->
project.ext.BUILD_DATE_SHORT = ghidraProps.getProperty('application.build.date.short')
project.ext.BUILD_DATES_NEEDED = false
if (BUILD_DATE == null) {
- project.ext.BUILD_DATE = getCurrentDateTimeLong()
- project.ext.BUILD_DATE_SHORT = getCurrentDate()
+ project.ext.BUILD_DATE = rootProject.getCurrentDateTimeLong()
+ project.ext.BUILD_DATE_SHORT = rootProject.getCurrentDate()
project.ext.BUILD_DATES_NEEDED = true
}