mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Adding JUnit to projects created by GhidraDev.
This commit is contained in:
parent
70757b658e
commit
85e25af7e8
2 changed files with 11 additions and 0 deletions
|
@ -14,6 +14,7 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="3.5.200",
|
||||||
org.eclipse.jdt.core;bundle-version="3.16.0",
|
org.eclipse.jdt.core;bundle-version="3.16.0",
|
||||||
org.eclipse.jdt.core.manipulation;bundle-version="1.11.0",
|
org.eclipse.jdt.core.manipulation;bundle-version="1.11.0",
|
||||||
org.eclipse.jdt.debug.ui;bundle-version="3.10.100",
|
org.eclipse.jdt.debug.ui;bundle-version="3.10.100",
|
||||||
|
org.eclipse.jdt.junit.core;bundle-version="3.10.200",
|
||||||
org.eclipse.jdt.launching;bundle-version="3.12.0",
|
org.eclipse.jdt.launching;bundle-version="3.12.0",
|
||||||
org.eclipse.jdt.ui;bundle-version="3.16.0",
|
org.eclipse.jdt.ui;bundle-version="3.16.0",
|
||||||
org.eclipse.ltk.core.refactoring;bundle-version="3.9.200",
|
org.eclipse.ltk.core.refactoring;bundle-version="3.9.200",
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.core.runtime.*;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.jdt.core.*;
|
import org.eclipse.jdt.core.*;
|
||||||
import org.eclipse.jdt.internal.launching.StandardVMType;
|
import org.eclipse.jdt.internal.launching.StandardVMType;
|
||||||
|
import org.eclipse.jdt.junit.JUnitCore;
|
||||||
import org.eclipse.jdt.launching.*;
|
import org.eclipse.jdt.launching.*;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
|
@ -298,6 +299,10 @@ public class GhidraProjectUtils {
|
||||||
IFolder binFolder = project.getFolder("bin");
|
IFolder binFolder = project.getFolder("bin");
|
||||||
javaProject.setOutputLocation(binFolder.getFullPath(), monitor);
|
javaProject.setOutputLocation(binFolder.getFullPath(), monitor);
|
||||||
|
|
||||||
|
// Add Eclipse's built-in JUnit to classpath
|
||||||
|
addToClasspath(javaProject, JavaCore.newContainerEntry(JUnitCore.JUNIT4_CONTAINER_PATH),
|
||||||
|
monitor);
|
||||||
|
|
||||||
// Link in Ghidra to the project
|
// Link in Ghidra to the project
|
||||||
linkGhidraToProject(javaProject, ghidraLayout, javaConfig, jythonInterpreterName, monitor);
|
linkGhidraToProject(javaProject, ghidraLayout, javaConfig, jythonInterpreterName, monitor);
|
||||||
|
|
||||||
|
@ -370,6 +375,11 @@ public class GhidraProjectUtils {
|
||||||
vmEntryCandidate = entry;
|
vmEntryCandidate = entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER &&
|
||||||
|
entry.getPath().toString().startsWith(JUnitCore.JUNIT_CONTAINER_ID)) {
|
||||||
|
// Keep existing JUnit
|
||||||
|
classpathEntriesToKeep.add(entry);
|
||||||
|
}
|
||||||
else if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
|
else if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
|
||||||
// Keep all project dependencies
|
// Keep all project dependencies
|
||||||
classpathEntriesToKeep.add(entry);
|
classpathEntriesToKeep.add(entry);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue