use of lucee.runtime.component.ImportDefintion in project Lucee by lucee.
the class SourceLastModifiedClassAdapter method getImports.
private static void getImports(List<String> list, Body body) throws TransformerException {
if (ASMUtil.isEmpty(body))
return;
Statement stat;
List stats = body.getStatements();
int len = stats.size();
for (int i = 0; i < len; i++) {
stat = (Statement) stats.get(i);
// IFunction
if (stat instanceof TagImport && !StringUtil.isEmpty(((TagImport) stat).getPath(), true)) {
ImportDefintion id = ImportDefintionImpl.getInstance(((TagImport) stat).getPath(), null);
if (id != null && (!list.contains(id.toString()) && !list.contains(id.getPackage() + ".*"))) {
list.add(id.toString());
}
stats.remove(i);
len--;
i--;
} else if (stat instanceof HasBody)
getImports(list, ((HasBody) stat).getBody());
else if (stat instanceof HasBodies) {
Body[] bodies = ((HasBodies) stat).getBodies();
for (int y = 0; y < bodies.length; y++) {
getImports(list, bodies[y]);
}
}
}
}
use of lucee.runtime.component.ImportDefintion in project Lucee by lucee.
the class XMLConfigWebFactory method createContextFilesPost.
private static void createContextFilesPost(Resource configDir, ConfigImpl config, ServletConfig servletConfig, boolean isEventGatewayContext, boolean doNew) {
Resource contextDir = configDir.getRealResource("context");
if (!contextDir.exists())
contextDir.mkdirs();
Resource adminDir = contextDir.getRealResource("admin");
if (!adminDir.exists())
adminDir.mkdirs();
// Plugin
Resource pluginDir = adminDir.getRealResource("plugin");
if (!pluginDir.exists())
pluginDir.mkdirs();
// deploy org.lucee.cfml components
if (config instanceof ConfigWeb) {
ImportDefintion _import = config.getComponentDefaultImport();
String path = _import.getPackageAsPath();
Resource components = config.getConfigDir().getRealResource("components");
Resource dir = components.getRealResource(path);
dir.mkdirs();
// print.o(dir);
ComponentFactory.deploy(dir, doNew);
}
}
Aggregations