public Class<?> loadClass(ResourceFile sourceFile, PrintWriter writer) throws Exception {
		GhidraSourceBundle bundle = getBundleForSource(sourceFile);
		if (bundle == null) {
			throw new ClassNotFoundException(
				"Failed to find source bundle containing script: " + sourceFile.toString());
		}

		bundleHost.activateAll(Collections.singletonList(bundle), TaskMonitor.DUMMY, writer);
		String classname = bundle.classNameForScript(sourceFile);
		Bundle osgiBundle = bundle.getOSGiBundle();
		if (osgiBundle == null) {
			throw new ClassNotFoundException(
				"Failed to get OSGi bundle containing script: " + sourceFile.toString());
		}
		Class<?> clazz = osgiBundle.loadClass(classname); // throws ClassNotFoundException
		return clazz;
	}
Activate and build the {@link GhidraSourceBundle} containing {@code sourceFile} then load the
script's class from its class loader.

@param sourceFile the source file
@param writer the target for build messages
@return the loaded {@link Class} object
@throws Exception if build, activation, or class loading fail
Ghidra/Features/Base/src/main/java/ghidra/app/script/JavaScriptProvider.java