use of com.intellij.openapi.compiler.CompileScope in project intellij-community by JetBrains.
the class InternalProjectTaskRunner method createScope.
private static CompileScope createScope(CompilerManager compilerManager, ProjectTaskContext context, Collection<Module> modules, boolean includeDependentModules, boolean includeRuntimeDependencies) {
CompileScope scope = compilerManager.createModulesCompileScope(modules.toArray(new Module[modules.size()]), includeDependentModules, includeRuntimeDependencies);
RunConfiguration configuration = context.getRunConfiguration();
if (configuration != null) {
scope.putUserData(CompilerManager.RUN_CONFIGURATION_KEY, configuration);
scope.putUserData(CompilerManager.RUN_CONFIGURATION_TYPE_ID_KEY, configuration.getType().getId());
}
ExecutionManagerImpl.EXECUTION_SESSION_ID_KEY.set(scope, context.getSessionId());
return scope;
}
use of com.intellij.openapi.compiler.CompileScope in project intellij-community by JetBrains.
the class AppEngineUploader method compileAndUpload.
private void compileAndUpload() {
final Runnable startUploading = () -> ApplicationManager.getApplication().invokeLater(() -> startUploadingProcess());
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
final CompileScope moduleScope = compilerManager.createModuleCompileScope(myAppEngineFacet.getModule(), true);
final CompileScope compileScope = ArtifactCompileScope.createScopeWithArtifacts(moduleScope, Collections.singletonList(myArtifact));
ApplicationManager.getApplication().invokeLater(() -> compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (!aborted && errors == 0) {
startUploading.run();
}
}
}));
}
use of com.intellij.openapi.compiler.CompileScope in project intellij-plugins by JetBrains.
the class AirPackageAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
final AirPackageDialog dialog = new AirPackageDialog(project);
if (!dialog.showAndGet()) {
return;
}
final Collection<Pair<Module, FlexBuildConfiguration>> modulesAndBCs = dialog.getSelectedBCs();
final Set<Module> modules = new THashSet<>();
for (Pair<Module, FlexBuildConfiguration> bc : modulesAndBCs) {
modules.add(bc.first);
}
final CompilerManager compilerManager = CompilerManager.getInstance(project);
final CompileScope compileScope = compilerManager.createModulesCompileScope(modules.toArray(new Module[modules.size()]), false);
FlexResourceBuildTargetScopeProvider.setBCsToCompileForPackaging(compileScope, modulesAndBCs);
compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (!aborted && errors == 0) {
createPackages(project, modulesAndBCs, dialog.getPasswords());
}
}
});
}
use of com.intellij.openapi.compiler.CompileScope in project intellij-community by JetBrains.
the class InternalProjectTaskRunner method runModulesBuildTasks.
private static void runModulesBuildTasks(@NotNull Project project, @NotNull ProjectTaskContext context, @Nullable CompileStatusNotification compileNotification, @NotNull Map<Class<? extends ProjectTask>, List<ProjectTask>> tasksMap) {
Collection<? extends ProjectTask> buildTasks = tasksMap.get(ModuleBuildTask.class);
if (ContainerUtil.isEmpty(buildTasks))
return;
ModulesBuildSettings modulesBuildSettings = assembleModulesBuildSettings(buildTasks);
CompilerManager compilerManager = CompilerManager.getInstance(project);
CompileScope scope = createScope(compilerManager, context, modulesBuildSettings.modules, modulesBuildSettings.includeDependentModules, modulesBuildSettings.includeRuntimeDependencies);
if (modulesBuildSettings.isIncrementalBuild) {
compilerManager.make(scope, compileNotification);
} else {
compilerManager.compile(scope, compileNotification);
}
}
use of com.intellij.openapi.compiler.CompileScope in project azure-tools-for-java by Microsoft.
the class IDEHelperImpl method buildArtifact.
private static ListenableFuture<Boolean> buildArtifact(@NotNull Project project, @NotNull final Artifact artifact, boolean rebuild) {
final SettableFuture<Boolean> future = SettableFuture.create();
Set<Artifact> artifacts = new LinkedHashSet<Artifact>(1);
artifacts.add(artifact);
CompileScope scope = ArtifactCompileScope.createArtifactsScope(project, artifacts, rebuild);
ArtifactsWorkspaceSettings.getInstance(project).setArtifactsToBuild(artifacts);
CompilerManager.getInstance(project).make(scope, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
future.set(!aborted && errors == 0);
}
});
return future;
}
Aggregations