Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ghidra version from gradle include #78

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,6 @@ OperatingSystem os = org.gradle.nativeplatform.platform.internal.DefaultNativePl
// change this to set the version of Z3 we're using
String z3Version = "4.12.1"

def ghidraVersion;
def minor;
String[] str;
str = ghidraInstallDir.split('_');
for( String values : str )
if (values =~ '[0-9]{1,}\\.[0-9]{1,}(\\.[0-9]{1,})?') {
ghidraVersion = values;
String[] substr = values.split('\\.');
minor = substr[1] as int;
};
if (minor && minor < 2) {
// we target Java 11 LTS for old Ghidra
sourceCompatibility = 1.11
targetCompatibility = 1.11
} else {
// we target Java 17 LTS for Ghidra 10.2+
sourceCompatibility = 1.17
targetCompatibility = 1.17
}

def autocatsDir
if (System.env.KAIJU_AUTOCATS_DIR) {
autocatsDir = System.env.KAIJU_AUTOCATS_DIR
Expand All @@ -123,6 +103,7 @@ if (VersionNumber.parse( gradle.gradleVersion ) <= VersionNumber.parse ("6.8.0")
}

// Export GHIDRA_10_4 and _11_1 for conditional compilation
def ghidraVersion = project.ext.ghidra_version;
compileJava {
options.compilerArgs << '-AGHIDRA_10_4=' + (VersionNumber.parse( ghidraVersion ) >= VersionNumber.parse("10.4")) \
<< '-AGHIDRA_11_1=' + (VersionNumber.parse( ghidraVersion ) >= VersionNumber.parse("11.1"))
Expand Down
Loading