use of Utils.LARASystem in project lara-framework by specs-feup.
the class ImportProcessor method importAndInitialize.
/**
*/
public void importAndInitialize() {
for (Class<?> importingClass : LaraApis.getImportableClasses()) {
importClassWithSimpleName(importingClass);
}
for (Class<?> importingClass : WeaverApis.getImportableClasses()) {
importClassWithSimpleName(importingClass);
}
for (Class<?> importingClass : CLASSES_TO_IMPORT) {
importClassWithSimpleName(importingClass);
}
final File jarDir = new File(LaraIUtils.getJarFoldername());
final String laraPath = "var " + LARASystem.LARAPATH + " = '" + jarDir.getAbsolutePath().replace('\\', '/') + "';\n";
final String attribute = "var " + Interpreter.ATTRIBUTES + " = { set: function(newReport){ mergeObjects(this,newReport);}};\n";
interpreter.evaluate(laraPath, "import_and_initialize");
interpreter.evaluate(attribute, "import_and_initialize");
LaraI laraI = interpreter.getLaraI();
if (laraI.getOptions().useStackTrace()) {
interpreter.put(CallStackTrace.STACKTRACE_NAME, interpreter.getStackStrace());
}
interpreter.put(MasterWeaver.WEAVER_NAME, laraI.getWeaver());
interpreter.put(LARASystem.LARA_SYSTEM_NAME, new LARASystem(laraI));
WeaverEngine engine = laraI.getWeaver().getEngine();
LanguageSpecificationV2 ls = engine.getLanguageSpecificationV2();
interpreter.put(MasterWeaver.LANGUAGE_SPECIFICATION_NAME, WeaverSpecification.newInstance(ls, engine.getScriptEngine()));
}
Aggregations