Search in sources :

Example 6 with KieAfterDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactoryTest method kieAndLogAfterDecoratorTest.

@Test
public void kieAndLogAfterDecoratorTest() {
    final AFCompiler kieAfterDecorator = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.STORE_KIE_OBJECTS, KieDecorator.ENABLE_LOGGING));
    assertThat(kieAfterDecorator).isInstanceOf(KieAfterDecorator.class);
    AFCompiler outputLofAfterDecorator = ((KieAfterDecorator) kieAfterDecorator).getCompiler();
    assertThat(outputLofAfterDecorator).isInstanceOf(OutputLogAfterDecorator.class);
    AFCompiler baseMavenCompiler = ((OutputLogAfterDecorator) outputLofAfterDecorator).getCompiler();
    assertThat(baseMavenCompiler).isInstanceOf(BaseMavenCompiler.class);
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler) Test(org.junit.Test)

Example 7 with KieAfterDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactory method createAndAddNewCompiler.

private static <T extends CompilationResponse> AFCompiler<T> createAndAddNewCompiler(Set<KieDecorator> decorators) {
    boolean enableIncremental = decorators.contains(KieDecorator.ENABLE_INCREMENTAL_BUILD);
    boolean enableLogging = decorators.contains(KieDecorator.ENABLE_LOGGING);
    // Order of the construction of the decorators matters, DO not change the order.
    AFCompiler compiler = new BaseMavenCompiler(enableIncremental, enableLogging);
    if (decorators.contains(KieDecorator.STORE_BUILD_CLASSPATH)) {
        compiler = new ClasspathDepsAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.ENABLE_LOGGING)) {
        compiler = new OutputLogAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.STORE_KIE_OBJECTS)) {
        compiler = new KieAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.UPDATE_JGIT_BEFORE_BUILD)) {
        compiler = new JGITCompilerBeforeDecorator(compiler);
    }
    return compiler;
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) ClasspathDepsAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator) JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) BaseMavenCompiler(org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler)

Example 8 with KieAfterDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator in project kie-wb-common by kiegroup.

the class DefaultRemoteExecutor method setupCompileInfo.

private CompilerAggregateEntryCache setupCompileInfo(String workingDir) {
    AFCompiler compiler = new KieAfterDecorator(new OutputLogAfterDecorator(new ClasspathDepsAfterDecorator(new BaseMavenCompiler(true, true))));
    WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(Paths.get(workingDir));
    return new CompilerAggregateEntryCache(compiler, info);
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) WorkspaceCompilationInfo(org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo) ClasspathDepsAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) BaseMavenCompiler(org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler)

Aggregations

AFCompiler (org.kie.workbench.common.services.backend.compiler.AFCompiler)8 KieAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator)8 Test (org.junit.Test)6 OutputLogAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator)6 ClasspathDepsAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator)5 JGITCompilerBeforeDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator)4 BaseMavenCompiler (org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler)2 WorkspaceCompilationInfo (org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo)1