Merge remote-tracking branch 'origin/GP-6839_ryanmkurtz_build'

This commit is contained in:
Ryan Kurtz
2026-06-01 11:33:15 -04:00
60 changed files with 74 additions and 123 deletions

View File

@@ -157,11 +157,11 @@ public class GhidraGo implements GhidraLaunchable {
if (SystemUtilities.isInDevelopmentMode()) {
if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) {
ghidraRunPath = Path.of(file.getAbsolutePath(),
"/RuntimeScripts/Windows/ghidraRun.bat");
"/RuntimeScripts/ghidraRun.bat");
}
else {
ghidraRunPath = Path.of(file.getAbsolutePath(),
"/RuntimeScripts/Linux/ghidraRun");
"/RuntimeScripts/ghidraRun");
}
}
else {

View File

@@ -500,7 +500,7 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan
}
ResourceFile serverRoot = new ResourceFile(Application.getInstallationDirectory(),
SystemUtilities.isInDevelopmentMode() ? "ghidra/Ghidra/RuntimeScripts/Common/server"
SystemUtilities.isInDevelopmentMode() ? "ghidra/Ghidra/RuntimeScripts/server"
: "server");
if (serverRoot.getFile(false) == null) {
System.err.println(

View File

@@ -225,7 +225,7 @@ class PyGhidraLauncher:
def _setup_dev_classpath(self, utility_dir: Path):
"""
Sets up the classpath for dev mode as seen in
Ghidra/RuntimeScripts/Linux/support/launch.sh
Ghidra/RuntimeScripts/support/launch.sh
"""
bin_dir = Path("bin") / "main"
build_dir = Path("build") / "libs"
@@ -274,7 +274,7 @@ class PyGhidraLauncher:
root = self._install_dir
if self._dev_mode:
root = root / "Ghidra" / "RuntimeScripts" / "Common"
root = root / "Ghidra" / "RuntimeScripts"
launch_properties = root / "support" / "launch.properties"

View File

@@ -38,7 +38,7 @@ def get_application_properties(install_dir: Path) -> Dict[str, str]:
def get_launch_properties(install_dir: Path, dev: bool) -> List[str]:
if dev:
launch_properties_path: Path = install_dir / 'Ghidra' / 'RuntimeScripts' / 'Common' / 'support' / 'launch.properties'
launch_properties_path: Path = install_dir / 'Ghidra' / 'RuntimeScripts' / 'support' / 'launch.properties'
else:
launch_properties_path: Path = install_dir / 'support' / 'launch.properties'
props: List[str] = []

View File

@@ -19,58 +19,33 @@ eclipse.project.name = '_Runtime Scripts'
rootProject.assembleDistribution {
from (this.project.file("Common/support")) {
from (this.project.file("support")) {
into "support"
}
from (this.project.file("Common/server")) {
from (this.project.file("server")) {
into "server"
}
from (this.project.file("ghidraRun"))
from (this.project.file("ghidraRun.bat"))
from (rootProject.projectDir) {
include "gradlew"
include "gradlew.bat"
into "support/gradle"
}
}
rootProject.assembleMarkdownToHtml {
from (this.project.file("Common/support")) {
from (this.project.file("support")) {
include "*.md"
into "support"
}
from (this.project.file("Common/server")) {
from (this.project.file("server")) {
include "*.md"
into "server"
}
}
rootProject.PLATFORMS.each { platform ->
rootProject.tasks.matching {it.name == "assembleDistribution_${platform.name}"}.each { t ->
def p = this.project
if (isLinux(platform.name) || isMac(platform.name)) {
t.from ("${p.projectDir}/Linux/support") {
into "support"
}
t.from ("${p.projectDir}/Linux/server") {
into "server"
}
t.from ("${rootProject.projectDir}") {
include "gradlew"
into "support/gradle"
}
t.from (p.file("Linux/ghidraRun"))
}
if (isWindows(platform.name)) {
t.from ("${p.projectDir}/Windows/support") {
into "support"
}
t.from ("${p.projectDir}/Windows/server") {
into "server"
}
t.from ("${rootProject.projectDir}") {
include "gradlew.bat"
into "support/gradle"
}
t.from (p.file("Windows/ghidraRun.bat"))
}
}
}

View File

@@ -2,31 +2,31 @@
##MODULE IP: Apache License 2.0
##MODULE IP: Copyright Distribution Permitted
##MODULE IP: Public Domain
Common/server/jaas.conf||GHIDRA||||END|
Common/server/server.conf||GHIDRA||||END|
Common/server/svrREADME.md||GHIDRA||||END|
Common/support/GhidraGo/ghidraGoREADME.html||GHIDRA||||END|
Common/support/analyzeHeadlessREADME.md||GHIDRA||||END|
Common/support/buildGhidraJarREADME.txt||GHIDRA||||END|
Common/support/debug.log4j.xml||GHIDRA||||END|
Common/support/gradle/gradle-wrapper.jar||Apache License 2.0||||END|
Common/support/gradle/gradle-wrapper.properties||Apache License 2.0||||END|
Common/support/launch.properties||GHIDRA||||END|
Linux/ghidraRun||GHIDRA||||END|
Linux/server/ghidraSvr||GHIDRA||||END|
Linux/server/svrAdmin||GHIDRA||||END|
Linux/server/svrInstall||GHIDRA||||END|
Linux/server/svrUninstall||GHIDRA||||END|
Linux/support/GhidraGo/ghidraGo||GHIDRA||||END|
Linux/support/analyzeHeadless||GHIDRA||||END|
Linux/support/bsim||GHIDRA||||END|
Linux/support/bsim_ctl||GHIDRA||||END|
Linux/support/buildGhidraJar||GHIDRA||||END|
Linux/support/convertStorage||GHIDRA||||END|
Linux/support/ghidraClean||GHIDRA||||END|
Linux/support/ghidraDebug||GHIDRA||||END|
Linux/support/jshellRun||GHIDRA||||END|
Linux/support/pyghidraRun||GHIDRA||||END|
Linux/support/sleigh||GHIDRA||||END|
Windows/support/README_createPdbXmlFiles.txt||GHIDRA||||END|
Windows/support/ghidra.ico||GHIDRA||||END|
ghidraRun||GHIDRA||||END|
server/ghidraSvr||GHIDRA||||END|
server/jaas.conf||GHIDRA||||END|
server/server.conf||GHIDRA||||END|
server/svrAdmin||GHIDRA||||END|
server/svrInstall||GHIDRA||||END|
server/svrREADME.md||GHIDRA||||END|
server/svrUninstall||GHIDRA||||END|
support/GhidraGo/ghidraGo||GHIDRA||||END|
support/GhidraGo/ghidraGoREADME.html||GHIDRA||||END|
support/README_createPdbXmlFiles.txt||GHIDRA||||END|
support/analyzeHeadless||GHIDRA||||END|
support/analyzeHeadlessREADME.md||GHIDRA||||END|
support/bsim||GHIDRA||||END|
support/bsim_ctl||GHIDRA||||END|
support/buildGhidraJar||GHIDRA||||END|
support/buildGhidraJarREADME.txt||GHIDRA||||END|
support/convertStorage||GHIDRA||||END|
support/debug.log4j.xml||GHIDRA||||END|
support/ghidra.ico||GHIDRA||||END|
support/ghidraClean||GHIDRA||||END|
support/ghidraDebug||GHIDRA||||END|
support/gradle/gradle-wrapper.jar||Apache License 2.0||||END|
support/gradle/gradle-wrapper.properties||Apache License 2.0||||END|
support/jshellRun||GHIDRA||||END|
support/launch.properties||GHIDRA||||END|
support/pyghidraRun||GHIDRA||||END|
support/sleigh||GHIDRA||||END|

View File

@@ -93,7 +93,7 @@ else
OS_DIRNAME="linux64"
fi
if [ -d "${SCRIPT_DIR}/../Ghidra" ]; then
if [ -f "${SCRIPT_DIR}/../Ghidra/application.properties" ]; then
# Production Environment
GHIDRA_HOME="${SCRIPT_DIR}/.."
@@ -105,8 +105,8 @@ if [ -d "${SCRIPT_DIR}/../Ghidra" ]; then
else
# Development Environment (Eclipse classes or "gradle jar")
GHIDRA_HOME="${SCRIPT_DIR}/../../../.."
WRAPPER_CONF="${SCRIPT_DIR}/../../Common/server/server.conf"
GHIDRA_HOME="${SCRIPT_DIR}/../../.."
WRAPPER_CONF="${SCRIPT_DIR}/server.conf"
DATA_DIR="${GHIDRA_HOME}/${MODULE_DIR}/build/data"
OS_DIR="${GHIDRA_HOME}/${MODULE_DIR}/os/${OS_DIRNAME}"
CLASSPATH_FRAG="${GHIDRA_HOME}/${MODULE_DIR}/build/dev-meta/classpath.frag"

View File

@@ -93,8 +93,8 @@ if exist "%SERVER_DIR%\..\Ghidra\" goto normal
:: NOTE: Variables that get accessed in server.conf must be lowercase
:: Development Environment (Eclipse classes or "gradle jar")
set "GHIDRA_HOME=%SERVER_DIR%\..\..\..\.."
set "WRAPPER_CONF=%SERVER_DIR%\..\..\Common\server\server.conf"
set "GHIDRA_HOME=%SERVER_DIR%\..\..\.."
set "WRAPPER_CONF=%SERVER_DIR%\server.conf"
set "DATA_DIR=%GHIDRA_HOME%\%MODULE_DIR%\build\data"
set "CLASSPATH_FRAG=%GHIDRA_HOME%\%MODULE_DIR%\build\dev-meta\classpath.frag"
set "LS_CPATH=%GHIDRA_HOME%\GhidraBuild\LaunchSupport\bin\main"

View File

@@ -103,7 +103,8 @@ wrapper.java.additional.11=-Ddb.buffers.DataBuffer.compressedOutput=true
# this mode of operation the wrapper.fork_hack option must be enabled and the wrapper.posix_spawn
# option explicitly disabled. The ghidraSvr script will attempt to make these changes automatically
# for Mac OS X.
#wrapper.fork_hack=true
wrapper.fork_hack=true
wrapper.posix_spawn=false
# Pipe server output to console/log
#wrapper.console.pipestreams=true

View File

@@ -32,13 +32,7 @@ MAXMEM=128M
# fallback, which doesn't attempt to do anything with links.
SCRIPT_FILE="$(readlink -f "$0" 2>/dev/null || readlink "$0" 2>/dev/null || echo "$0")"
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
if [ -d "${SCRIPT_DIR}/../Ghidra" ]; then
# Production Environment
CONFIG="${SCRIPT_DIR}/server.conf"
else
# Development Environment
CONFIG="${SCRIPT_DIR}/../../Common/server/server.conf"
fi
CONFIG="${SCRIPT_DIR}/server.conf"
# Identify server process owner if set within server.conf
OWNER="$(grep '^wrapper.app.account=' "${CONFIG}" | cut -d '=' -f 2)"

View File

@@ -47,17 +47,8 @@ set MAXMEM=128M
:: 'd' - drive
:: 'p' - path (without filename)
set "SCRIPT_DIR=%~dp0"
:: Production Environment
set "CONFIG=%SCRIPT_DIR%.\server.conf"
if exist "%CONFIG%" goto continue
:: Development Environment
set "CONFIG=%SCRIPT_DIR%..\..\Common\server\server.conf"
:continue
set VMARGS=-DUserAdmin.invocation=%~n0
call "%~dp0\..\support\launch.bat" fg jre svrAdmin "%MAXMEM%" "%VMARGS%" ghidra.server.ServerAdmin "%CONFIG%" %*

View File

@@ -35,7 +35,7 @@ REM Production Environment
if exist "%GHIDRA_DIR%" goto continue
REM Development Environment
set "GHIDRA_DIR=%SCRIPT_DIR%..\..\.."
set "GHIDRA_DIR=%SCRIPT_DIR%..\.."
set OS_DIR=build\os
:continue

View File

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View File

@@ -104,12 +104,12 @@ set "CPATH=%INSTALL_DIR%\Ghidra\Framework\Utility\lib\Utility.jar"
set "LS_CPATH=%SUPPORT_DIR%\LaunchSupport.jar"
set "DEBUG_LOG4J=%SUPPORT_DIR%\debug.log4j.xml"
if exist "%INSTALL_DIR%\Ghidra" goto continue2
if exist "%INSTALL_DIR%\Ghidra\application.properties" goto continue2
::
:: Development Environment (Eclipse classes or "gradle jar")
::
set "INSTALL_DIR=%INSTALL_DIR%\..\..\.."
set "INSTALL_DIR=%INSTALL_DIR%\..\.."
set "CPATH=%INSTALL_DIR%\Ghidra\Framework\Utility\bin\main"
set "LS_CPATH=%INSTALL_DIR%\GhidraBuild\LaunchSupport\bin\main"
if not exist "%LS_CPATH%" (
@@ -121,7 +121,7 @@ if not exist "%LS_CPATH%" (
set ERRORLEVEL=1
goto exit1
)
set "DEBUG_LOG4J=%INSTALL_DIR%\Ghidra\RuntimeScripts\Common\support\debug.log4j.xml"
set "DEBUG_LOG4J=%INSTALL_DIR%\Ghidra\RuntimeScripts\support\debug.log4j.xml"
:continue2

View File

@@ -100,7 +100,7 @@ if [[ "${SUPPORT_DIR}" = *"!"* ]]; then
exit 1
fi
if [ -f "${SUPPORT_DIR}/launch.properties" ]; then
if [ -f "${SUPPORT_DIR}/../Ghidra/application.properties" ]; then
# Production Environment
export INSTALL_DIR="${SUPPORT_DIR}/.."
@@ -110,7 +110,7 @@ if [ -f "${SUPPORT_DIR}/launch.properties" ]; then
else
# Development Environment (Eclipse classes or "gradle jar")
export INSTALL_DIR="${SUPPORT_DIR}/../../../.."
export INSTALL_DIR="${SUPPORT_DIR}/../../.."
CPATH="${INSTALL_DIR}/Ghidra/Framework/Utility/bin/main"
LS_CPATH="${INSTALL_DIR}/GhidraBuild/LaunchSupport/bin/main"
if ! [ -d "${LS_CPATH}" ]; then
@@ -121,7 +121,7 @@ else
exit 1
fi
fi
DEBUG_LOG4J="${INSTALL_DIR}/Ghidra/RuntimeScripts/Common/support/debug.log4j.xml"
DEBUG_LOG4J="${INSTALL_DIR}/Ghidra/RuntimeScripts/support/debug.log4j.xml"
fi
# Identify java command from either JAVA_HOME or PATH, try PATH first

View File

@@ -27,7 +27,7 @@ DEV_ARG=
INSTALL_DIR="${SCRIPT_DIR}/.."
if [ ! -d "${INSTALL_DIR}/Ghidra" ]; then
DEV_ARG="--dev"
INSTALL_DIR="${SCRIPT_DIR}/../../../.."
INSTALL_DIR="${SCRIPT_DIR}/../../.."
fi
PYGHIDRA_LAUNCHER="${INSTALL_DIR}/Ghidra/Features/PyGhidra/support/pyghidra_launcher.py"

View File

@@ -47,7 +47,7 @@ set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
set "INSTALL_DIR=%SCRIPT_DIR%\.."
if not exist "%INSTALL_DIR%\Ghidra" (
set DEV_ARG="--dev"
set "INSTALL_DIR=%SCRIPT_DIR%\..\..\..\.."
set "INSTALL_DIR=%SCRIPT_DIR%\..\..\.."
)
set "PYGHIDRA_LAUNCHER=%INSTALL_DIR%\Ghidra\Features\PyGhidra\support\pyghidra_launcher.py

View File

@@ -373,7 +373,7 @@ public class AppConfig {
// Get the required launch properties file
File launchPropertiesFile = new File(installDir,
(isDev ? "Ghidra/RuntimeScripts/Common/" : "") + "support/" + LAUNCH_PROPERTIES_NAME);
(isDev ? "Ghidra/RuntimeScripts/" : "") + "support/" + LAUNCH_PROPERTIES_NAME);
if (!launchPropertiesFile.isFile()) {
throw new FileNotFoundException(
"Launch properties file does not exist: " + launchPropertiesFile);

View File

@@ -19,8 +19,8 @@ import org.apache.tools.ant.filters.*
* distribution.gradle
*
* This contains gradle tasks for packaging Ghidra artifacts for distribution. To
* run a full distribution, execute the buildGhidra task. This will build for the
* current platform only. Add -PallPlatforms to build a multiplatform build.
* run a full distribution, execute the buildGhidra task. This will build native
* components for the current platform only.
*
*********************************************************************************/
@@ -645,13 +645,10 @@ task assembleAll() {
dependsOn assembleDistribution
dependsOn assembleSource
dependsOn assembleMarkdownToHtml
dependsOn "assembleDistribution_$currentPlatform"
if (project.hasProperty("allPlatforms")) {
project.PLATFORMS.each { platform ->
dependsOn ":assembleDistribution_${platform.name}"
}
}
doFirst {
// We always want the extensions directory to exist in the zip, even if there's nothing
@@ -681,12 +678,8 @@ task createInstallationZip(type: Zip) { t ->
dependsOn assembleAll
if (project.hasProperty("allPlatforms")) {
archiveFileName = "${ZIP_NAME_PREFIX}.zip"
}
else {
archiveFileName = "${ZIP_NAME_PREFIX}_${currentPlatform}.zip"
}
destinationDirectory = DISTRIBUTION_DIR
// Make sure that we don't try to copy the same file with the same path.

View File

@@ -37,9 +37,6 @@ Primary gradle tasks for Ghidra
eclipse Create eclipse projects [root/eclipse.gradle]
buildHelp Builds help [root/buildHelp.gradle]
buildGhidra Builds Ghidra for the current platform [root/distribution.gradle]
buildGhidra -PallPlatforms Builds Ghidra for all platforms (assumes natives [root/distribution.gradle]
for other platforms are already built into
appropriate os dirs)
Task rules:
buildNatives[_platform] Builds the native executables and libraries for the [GPL/nativeBuildProperties.gradle]

2
gradlew vendored
View File

@@ -121,7 +121,7 @@ if [ -f "${APP_HOME}/gradle-wrapper.jar" ]; then
GHIDRA_HOME="${APP_HOME}/../.."
else
# Development Environment (Eclipse classes or "gradle jar")
CLASSPATH="${APP_HOME}/Ghidra/RuntimeScripts/Common/support/gradle/gradle-wrapper.jar"
CLASSPATH="${APP_HOME}/Ghidra/RuntimeScripts/support/gradle/gradle-wrapper.jar"
GHIDRA_HOME="${APP_HOME}"
fi

2
gradlew.bat vendored
View File

@@ -80,7 +80,7 @@ if exist "%APP_HOME%\gradle-wrapper.jar" (
set "GHIDRA_HOME=%APP_HOME%..\..\"
) else (
@rem Development Environment (Eclipse classes or "gradle jar")
set "CLASSPATH=%APP_HOME%Ghidra\RuntimeScripts\Common\support\gradle\gradle-wrapper.jar"
set "CLASSPATH=%APP_HOME%Ghidra\RuntimeScripts\support\gradle\gradle-wrapper.jar"
set "GHIDRA_HOME=%APP_HOME%"
)