return extendedClasspath.toArray(new String[extendedClasspath.size()]);
}
public static List<String> getClassPath(IScriptProject project) throws CoreException {
RutaIdeUIPlugin d = RutaIdeUIPlugin.getDefault();
List<String> extendedClasspath = new ArrayList<String>();
// Normal mode, add the launcher plugin and uima runtime jar to the classpath
try {
if (!Platform.inDevelopmentMode()) {
// Add this plugin jar to the classpath
extendedClasspath.add(d.pluginIdToJarPath(RutaIdeUIPlugin.PLUGIN_ID));
} else {
extendedClasspath.add(d.pluginIdToJarPath(RutaIdeUIPlugin.PLUGIN_ID) + "target/classes");
}
// uima
Bundle bundle = RutaIdeUIPlugin.getDefault().getBundle("org.apache.uima.runtime");
if (bundle != null) {
Enumeration<?> jarEnum = bundle.findEntries("/", "uimaj-core*.jar",
Platform.inDevelopmentMode());
while (jarEnum != null && jarEnum.hasMoreElements()) {
URL element = (URL) jarEnum.nextElement();
extendedClasspath.add(FileLocator.toFileURL(element).getFile());
}
}
extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.runtime"));
// ruta
bundle = RutaIdeUIPlugin.getDefault().getBundle("org.apache.uima.ruta.engine");
if (bundle != null) {
Enumeration<?> jarEnum = bundle.findEntries("/", "*.jar", Platform.inDevelopmentMode());
while (jarEnum != null && jarEnum.hasMoreElements()) {
URL element = (URL) jarEnum.nextElement();
extendedClasspath.add(FileLocator.toFileURL(element).getFile());
}
}
extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.ruta.engine"));
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, RutaIdeUIPlugin.PLUGIN_ID, IStatus.OK,
"Failed to compose classpath!", e));
}