private void export(IJavaProject javaProject, GradleDistribution gradleDistribution,
			IProgressMonitor monitor)
			throws InvocationTargetException {
		try {
			IProject project = javaProject.getProject();
			info("Exporting " + project.getName());
			monitor.beginTask("Exporting " + project.getName(), 2);

			// Get path to Ghidra installation directory
			String ghidraInstallDirPath = project.getFolder(
				GhidraProjectUtils.GHIDRA_FOLDER_NAME).getLocation().toOSString();
			
			// Get project's java.  Gradle should use the same version.
			// TODO: It's more correct to get this from the project's classpath, since Ghidra's
			// saved Java home can change from launch to launch.  
			GhidraApplicationLayout ghidraLayout = new GhidraApplicationLayout(new File(ghidraInstallDirPath));
			File javaHomeDir = new AppConfig(
				ghidraLayout.getApplicationInstallationDir().getFile(false)).getSavedJavaHome();
			if(javaHomeDir == null) {
				throw new IOException("Failed to get the Java home associated with the project.  " +
					"Perform a \"Link Ghidra\" operation on the project and try again.");
			}

			// Setup the Gradle build attributes
			List<String> tasks = new ArrayList<>();
			String workingDir = project.getLocation().toOSString();
			String gradleDist = gradleDistribution.toString();
			String gradleUserHome = "";
			String javaHome = javaHomeDir.getAbsolutePath();
			List<String> jvmArgs = new ArrayList<>();
			List<String> gradleArgs =
				Arrays.asList(new String[] { "-PGHIDRA_INSTALL_DIR=" + ghidraInstallDirPath });
			boolean showExecutionView = false;
			boolean showConsoleView = true;
			boolean overrideWorkspaceSettings = true;
			boolean isOffline = true;
			boolean isBuildScansEnabled = false;
			GradleRunConfigurationAttributes gradleAttributes =
				new GradleRunConfigurationAttributes(tasks, workingDir, gradleDist, gradleUserHome,
					javaHome, jvmArgs, gradleArgs, showExecutionView, showConsoleView,
					overrideWorkspaceSettings, isOffline, isBuildScansEnabled);

			// Launch Gradle
			GradleLaunchConfigurationManager lm = CorePlugin.gradleLaunchConfigurationManager();
			ILaunchConfiguration lc = lm.getOrCreateRunConfiguration(gradleAttributes);
			lc.launch(ILaunchManager.RUN_MODE, monitor, true, true);
			lc.delete();

			monitor.worked(1);

			// Delete the build directory...we don't want Ghidra finding/using it in the module
			File buildDir = new File(workingDir, "build");
			FileUtilities.deleteDir(buildDir);

			// Refresh the project to make the new items visible
			project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
			monitor.worked(1);

			info("Finished exporting " + project.getName());
		}
		catch (IOException | ParseException | CoreException e) {
			throw new InvocationTargetException(e);
		}
		finally {
			monitor.done();
		}
	}
Exports the given Ghidra module project to an extension zip file.
 
@param javaProject The Ghidra module project to export.
@param gradleDistribution The Gradle distribution to use to export.
@param monitor The monitor to use during export.
@throws InvocationTargetException if an error occurred during export.
GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/wizards/ExportGhidraModuleWizard.java