Search in sources :

Example 1 with SkipCompilationException

use of com.dexels.navajo.mapping.compiler.SkipCompilationException in project navajo by Dexels.

the class BundleCreatorComponent method compileAndCreateBundle.

private void compileAndCreateBundle(String script, File scriptPath, final String scriptTenant, boolean hasTenantSpecificFile, boolean forceTenant, boolean keepIntermediate, List<String> success, List<String> skipped, List<String> failures) throws CompilationException {
    String myScript = script;
    if (forceTenant) {
        myScript = script + "_" + scriptTenant;
    }
    try {
        getScriptCompiler(scriptPath).compile(scriptPath, scriptTenant, hasTenantSpecificFile, forceTenant);
        if (getScriptCompiler(scriptPath).scriptNeedsCompilation()) {
            javaCompiler.compileJava(myScript);
        }
        javaCompiler.compileJava(myScript + "Factory");
        createBundleJar(myScript, scriptPath, scriptTenant, keepIntermediate, hasTenantSpecificFile);
        success.add(myScript);
    } catch (SkipCompilationException e) {
        logger.debug("Script fragment: {} ", script);
        skipped.add(script);
        return;
    } catch (Exception e) {
        failures.add(script);
        throw new CompilationException("Error compiling script", e);
    }
    if (forceTenant) {
        logger.info("Finished compiling and bundling {} for {}", script, scriptTenant);
    } else {
        logger.info("Finished compiling and bundling {}", script);
    }
}
Also used : SkipCompilationException(com.dexels.navajo.mapping.compiler.SkipCompilationException) CompilationException(com.dexels.navajo.script.api.CompilationException) SkipCompilationException(com.dexels.navajo.mapping.compiler.SkipCompilationException) BundleException(org.osgi.framework.BundleException) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) SkipCompilationException(com.dexels.navajo.mapping.compiler.SkipCompilationException) CompilationException(com.dexels.navajo.script.api.CompilationException)

Aggregations

SkipCompilationException (com.dexels.navajo.mapping.compiler.SkipCompilationException)1 CompilationException (com.dexels.navajo.script.api.CompilationException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 BundleException (org.osgi.framework.BundleException)1 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)1