public static IJavaProject createGhidraScriptProject(String projectName, File projectDir,
			boolean createRunConfig, String runConfigMemory, boolean linkUserScripts,
			boolean linkSystemScripts, GhidraApplicationLayout ghidraLayout,
			ProjectPythonInterpreter pythonInterpreter, IProgressMonitor monitor)
			throws IOException, ParseException, CoreException {

		List<IClasspathEntry> classpathEntries = new ArrayList<>();

		// Create empty Ghidra project
		IJavaProject javaProject = GhidraProjectUtils.createEmptyGhidraProject(projectName,
			projectDir, createRunConfig, runConfigMemory, ghidraLayout, pythonInterpreter, monitor);

		// Link each module's ghidra_scripts directory to the project
		if (linkSystemScripts) {
			for (GModule module : ghidraLayout.getModules().values()) {
				File moduleDir = module.getModuleRoot().getFile(false);
				File moduleScriptsDir = new File(moduleDir, "ghidra_scripts");
				if (!moduleScriptsDir.exists()) {
					continue;
				}

				IPath moduleScriptsDirPath = new Path(moduleScriptsDir.getAbsolutePath());
				String moduleName = moduleDir.getName();
				String scriptsDirName = "Ghidra " + moduleName + " scripts";

				IFolder link = javaProject.getProject().getFolder(scriptsDirName);
				link.createLink(moduleScriptsDirPath, IResource.NONE, monitor);

				classpathEntries.add(JavaCore.newSourceEntry(link.getFullPath()));
			}
		}

		// Link in the user's personal ghidra_scripts directory
		if (linkUserScripts) {
			if (!userScriptsDir.isDirectory()) {
				if (!userScriptsDir.mkdirs()) {
					throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
						IStatus.ERROR, "Failed to create " + userScriptsDir, null));
				}
			}
			IFolder link = javaProject.getProject().getFolder("Home scripts");
			link.createLink(new Path(userScriptsDir.getAbsolutePath()), IResource.NONE, monitor);
			classpathEntries.add(JavaCore.newSourceEntry(link.getFullPath()));
		}

		// Update the project's classpath
		GhidraProjectUtils.addToClasspath(javaProject, classpathEntries, monitor);

		return javaProject;
	}
Creates a new Ghidra script project with the given name.

@param projectName The name of the project to create.
@param projectDir The directory the project will be created in.
@param createRunConfig Whether or not to create a new run configuration for the project.
@param runConfigMemory The run configuration's desired memory.  Could be null.
@param linkUserScripts Whether or not to link in the user scripts directory.
@param linkSystemScripts Whether or not to link in the system scripts directories.
@param ghidraLayout The Ghidra layout to link the project to.
@param pythonInterpreter The Python interpreter to use.
@param monitor The progress monitor to use during project creation.
@return The created project.
@throws IOException If there was a file-related problem with creating the project.
@throws ParseException If there was a parse-related problem with creating the project.
@throws CoreException If there was an Eclipse-related problem with creating the project.
GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraScriptUtils.java