mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-07-05 01:08:38 +00:00
Adding JUnit to projects created by GhidraDev.
This commit is contained in:
parent
70757b658e
commit
85e25af7e8
|
@ -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.manipulation;bundle-version="1.11.0",
|
||||
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.ui;bundle-version="3.16.0",
|
||||
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.jdt.core.*;
|
||||
import org.eclipse.jdt.internal.launching.StandardVMType;
|
||||
import org.eclipse.jdt.junit.JUnitCore;
|
||||
import org.eclipse.jdt.launching.*;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
@ -298,6 +299,10 @@ public class GhidraProjectUtils {
|
|||
IFolder binFolder = project.getFolder("bin");
|
||||
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
|
||||
linkGhidraToProject(javaProject, ghidraLayout, javaConfig, jythonInterpreterName, monitor);
|
||||
|
||||
|
@ -370,6 +375,11 @@ public class GhidraProjectUtils {
|
|||
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) {
|
||||
// Keep all project dependencies
|
||||
classpathEntriesToKeep.add(entry);
|
||||
|
|
Loading…
Reference in New Issue
Block a user