use of org.kie.workbench.common.services.backend.compiler.AFCompiler in project kie-wb-common by kiegroup.
the class DefaultLocalExecutor method internalBuild.
private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, String settingXML, boolean skipProjectDepCreation, String goal) {
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath);
AFCompiler compiler = getCompiler(projectPath);
CompilationRequest req;
if (settingXML != null) {
req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[] { MavenCLIArgs.ALTERNATE_USER_SETTINGS + settingXML, goal });
} else {
req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[] { goal });
}
return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req)), executor);
}
use of org.kie.workbench.common.services.backend.compiler.AFCompiler in project kie-wb-common by kiegroup.
the class ServerIPCImpl method build.
private static DefaultKieCompilationResponseOffProcess build(String prjPath, String mavenRepo, String alternateSettingsAbsPath, String uuid) {
final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.ENABLE_LOGGING, KieDecorator.STORE_KIE_OBJECTS));
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(Paths.get("file://" + prjPath));
CompilationRequest req;
if (StringUtils.isNotEmpty(alternateSettingsAbsPath)) {
req = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.DEPENDENCY_RESOLVE, MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE, uuid);
} else {
req = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.DEPENDENCY_RESOLVE, MavenCLIArgs.COMPILE }, Boolean.FALSE, uuid);
}
KieCompilationResponse res = (KieCompilationResponse) compiler.compile(req);
return new DefaultKieCompilationResponseOffProcess(res);
}
use of org.kie.workbench.common.services.backend.compiler.AFCompiler in project kie-wb-common by kiegroup.
the class BuildInMemoryClasspathMojoTest method getClassloaderFromAllDependenciesComplexTest.
@Test
public void getClassloaderFromAllDependenciesComplexTest() {
Path path = Paths.get(".").resolve("target/test-classes/dummy_deps_complex");
final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.STORE_BUILD_CLASSPATH));
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(path);
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[] { MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath, MavenConfig.DEPS_IN_MEMORY_BUILD_CLASSPATH }, Boolean.FALSE);
CompilationResponse res = compiler.compile(req);
assertThat(res.isSuccessful()).isTrue();
assertThat(res.getDependencies()).isNotEmpty();
assertThat(res.getDependencies()).hasSize(7);
}
use of org.kie.workbench.common.services.backend.compiler.AFCompiler in project kie-wb-common by kiegroup.
the class BuildInMemoryClasspathMojoTest method getClassloaderFromAllDependenciesSimpleTest.
@Test
public void getClassloaderFromAllDependenciesSimpleTest() {
Path path = Paths.get(".").resolve("target/test-classes/dummy_deps_simple");
final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.STORE_BUILD_CLASSPATH));
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(path);
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[] { MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath, MavenConfig.DEPS_IN_MEMORY_BUILD_CLASSPATH }, Boolean.FALSE);
CompilationResponse res = compiler.compile(req);
assertThat(res.isSuccessful()).isTrue();
assertThat(res.getDependencies()).isNotEmpty();
assertThat(res.getDependencies()).hasSize(4);
}
use of org.kie.workbench.common.services.backend.compiler.AFCompiler in project kie-wb-common by kiegroup.
the class DefaultLocalExecutor method internalBuild.
private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, boolean skipProjectDepCreation, String[] args) {
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath);
AFCompiler compiler = getCompiler(projectPath);
CompilationRequest req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, args);
return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req)), executor);
}
Aggregations