RutaModuleDeclaration tmmd = (RutaModuleDeclaration) moduleDeclaration;
DescriptorManager sm = tmmd.descriptorInfo;
IPath pathToModule = sourceModule.getResource().getLocation();
String elementName = RutaProjectUtils.getModuleName(pathToModule);
IScriptProject proj = sourceModule.getScriptProject();
// TODO: dont use desc path!
IPath descPath = RutaProjectUtils.getDescriptorRootPath(proj.getProject());
IPath scriptPath = RutaProjectUtils.getScriptRootPath(proj.getProject());
IPath descPackagePath = RutaProjectUtils.getDescriptorPackagePath(sourceModule.getResource()
.getLocation(), proj.getProject());
String typeSystem = descPackagePath.append(elementName + "TypeSystem.xml").toPortableString();
String engine = descPackagePath.append(elementName + "Engine.xml").toPortableString();
String basicTS = descPath.append("BasicTypeSystem.xml").toPortableString();
String basicE = descPath.append("BasicEngine.xml").toPortableString();
// TODO: may not work with other script folders
IPath relativeTo = pathToModule.makeAbsolute().makeRelativeTo(scriptPath);
List<String> scriptPathList = new ArrayList<String>();
List<String> descriptorPathList = new ArrayList<String>();
// add all folders
try {
List<IFolder> scriptFolders = RutaProjectUtils.getAllScriptFolders(proj);
scriptPathList.addAll(RutaProjectUtils.getFolderLocations(scriptFolders));
} catch (CoreException e) {
RutaIdeCorePlugin.error(e);
}
try {
List<IFolder> descriptorFolders = RutaProjectUtils.getAllDescriptorFolders(proj
.getProject());
descriptorPathList.addAll(RutaProjectUtils.getFolderLocations(descriptorFolders));
} catch (Exception e) {
RutaIdeCorePlugin.error(e);
}
String[] descriptorPaths = descriptorPathList.toArray(new String[0]);
String[] scriptPaths = scriptPathList.toArray(new String[0]);
String mainScript = relativeTo.toPortableString();
mainScript = mainScript.replaceAll("/", ".");
if (mainScript.endsWith(RutaEngine.SCRIPT_FILE_EXTENSION)) {
mainScript = mainScript.substring(0, mainScript.length() - 5);
}
Collection<String> dependencies = RutaProjectUtils.getClassPath(proj
.getProject());
URL[] urls = new URL[dependencies.size()];
int counter = 0;
for (String dep : dependencies) {
try {