本文整理汇总了Java中com.intellij.openapi.compiler.CompileStatusNotification类的典型用法代码示例。如果您正苦于以下问题:Java CompileStatusNotification类的具体用法?Java CompileStatusNotification怎么用?Java CompileStatusNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompileStatusNotification类属于com.intellij.openapi.compiler包,在下文中一共展示了CompileStatusNotification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: compileAndAnalyze
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndAnalyze(final Project project, final AnalysisScope scope) {
if (project.isDisposed()) {
return;
}
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(project), new CompileStatusNotification() {
@Override
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
doAnalyze(project, scope);
}
});
}});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:BaseClassesAnalysisAction.java
示例2: buildAndSignIntellijProject
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void buildAndSignIntellijProject() {
CompilerManager.getInstance(myProject).make(myCompileScope, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (aborted || errors != 0) {
return;
}
final String title = AndroidBundle.message("android.extract.package.task.title");
ProgressManager.getInstance().run(new Task.Backgroundable(myProject, title, true, null) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
createAndAlignApk(myApkPath);
}
});
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ExportSignedPackageWizard.java
示例3: compileAndUpload
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndUpload() {
final Runnable startUploading = new Runnable() {
public void run() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
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(new Runnable() {
public void run() {
compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (!aborted && errors == 0) {
startUploading.run();
}
}
});
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:AppEngineUploader.java
示例4: actionPerformed
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final PsiClass psiClass = getPsiClass(e);
if (psiClass == null) return;
final VirtualFile virtualFile = psiClass.getContainingFile().getVirtualFile();
final Module module = ModuleUtilCore.findModuleForPsiElement(psiClass);
if (module == null || virtualFile == null) return;
final String className = ClassUtil.getJVMClassName(psiClass);
final Project project = getEventProject(e);
CompilerManager.getInstance(project).make(new FileSetCompileScope(Collections.singletonList(virtualFile), new Module[]{module}), new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (aborted || errors > 0) return;
generateAndShowXml(module, className);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ShowSerializedXmlAction.java
示例5: actionPerformed
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
final CreateIpaDialog dialog = new CreateIpaDialog(e.getProject());
dialog.show();
if(dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
// create IPA
IpaConfig ipaConfig = dialog.getIpaConfig();
CompileScope scope = CompilerManager.getInstance(e.getProject()).createModuleCompileScope(ipaConfig.module, true);
scope.putUserData(IPA_CONFIG_KEY, ipaConfig);
CompilerManager.getInstance(e.getProject()).compile(scope, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
RoboVmPlugin.logInfo(e.getProject(), "IPA creation complete, %d errors, %d warnings", errors, warnings);
}
});
}
}
开发者ID:robovm,项目名称:robovm-idea,代码行数:17,代码来源:CreateIpaAction.java
示例6: compileAndUpload
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndUpload() {
final Runnable startUploading = new Runnable() {
public void run() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
startUploadingProcess();
}
});
}
};
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
final CompileScope moduleScope = compilerManager.createModuleCompileScope(myAppEngineFacet.getModule(), true);
final CompileScope compileScope = ArtifactCompileScope.createScopeWithArtifacts(moduleScope, Collections.singletonList(myArtifact), true);
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (!aborted && errors == 0) {
startUploading.run();
}
}
});
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:AppEngineUploader.java
示例7: actionPerformed
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final PsiClass psiClass = getPsiClass(e);
if (psiClass == null) return;
final VirtualFile virtualFile = psiClass.getContainingFile().getVirtualFile();
final Module module = ModuleUtilCore.findModuleForPsiElement(psiClass);
if (module == null || virtualFile == null) return;
final String className = ClassUtil.getJVMClassName(psiClass);
final Project project = getEventProject(e);
CompilerManager.getInstance(project).make(new FileSetCompileScope(Arrays.asList(virtualFile), new Module[]{module}), new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (aborted || errors > 0) return;
generateAndShowXml(module, className);
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ShowSerializedXmlAction.java
示例8: compileAndHotReloadNextModule
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndHotReloadNextModule() {
if (moduleIndex >= hotReloadableModules.size()) {
triggerHotReload();
return;
}
currentModule = hotReloadableModules.get(moduleIndex);
CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.compile(currentModule, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings,
CompileContext compileContext) {
onCompilationFinished(aborted, errors, compileContext);
}
});
}
开发者ID:troger,项目名称:nuxeo-intellij,代码行数:17,代码来源:NuxeoHotReloader.java
示例9: doAction
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
protected void doAction(DataContext dataContext, final Project project) {
CompilerManager.getInstance(project).rebuild(new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
if (aborted || project.isDisposed()) {
return;
}
String text = getTemplatePresentation().getText();
LocalHistory.getInstance().putSystemLabel(project, errors == 0
? CompilerBundle.message("rebuild.lvcs.label.no.errors", text)
: CompilerBundle.message("rebuild.lvcs.label.with.errors", text));
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:CompileProjectAction.java
示例10: actionPerformed
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
if (ExecutionManager.getInstance(myProject).getContentManager().removeRunContent(myExecutor, myContentDescriptor)) {
CompilerManager.getInstance(myProject).compile(myModule, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (!myModule.isDisposed()) {
myRestarter.consume(myModule);
}
}
});
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BuildAndRestartConsoleAction.java
示例11: recompileProjectAndRerunAction
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public boolean recompileProjectAndRerunAction(@NotNull final Module module, @NotNull final CoverageSuitesBundle suite,
@NotNull final Runnable chooseSuiteAction) {
final VirtualFile outputpath = CompilerModuleExtension.getInstance(module).getCompilerOutputPath();
final VirtualFile testOutputpath = CompilerModuleExtension.getInstance(module).getCompilerOutputPathForTests();
if ((outputpath == null && isModuleOutputNeeded(module, JavaSourceRootType.SOURCE))
|| (suite.isTrackTestFolders() && testOutputpath == null && isModuleOutputNeeded(module, JavaSourceRootType.TEST_SOURCE))) {
final Project project = module.getProject();
if (suite.isModuleChecked(module)) return false;
suite.checkModule(module);
final Runnable runnable = new Runnable() {
public void run() {
if (Messages.showOkCancelDialog(
"Project class files are out of date. Would you like to recompile? The refusal to do it will result in incomplete coverage information",
"Project is out of date", Messages.getWarningIcon()) == Messages.OK) {
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(project), new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
if (project.isDisposed()) return;
CoverageDataManager.getInstance(project).chooseSuitesBundle(suite);
}
});
}
});
} else if (!project.isDisposed()) {
CoverageDataManager.getInstance(project).chooseSuitesBundle(null);
}
}
};
ApplicationManager.getApplication().invokeLater(runnable);
return true;
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:JavaCoverageEngine.java
示例12: run
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public void run() {
compilerManager.make(
moduleScope,
new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
getResponse().set(!aborted && errors == 0);
}
}
);
}
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:12,代码来源:ServerConnectionManager.java
示例13: compileAndAnalyze
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndAnalyze(final Project project, final AnalysisScope scope) {
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(project), new CompileStatusNotification() {
@Override
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
doAnalyze(project, scope);
}
});
}});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:BaseClassesAnalysisAction.java
示例14: doAction
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
protected void doAction(DataContext dataContext, final Project project) {
CompilerManager.getInstance(project).rebuild(new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
if (aborted) return;
String text = getTemplatePresentation().getText();
LocalHistory.getInstance().putSystemLabel(project, errors == 0
? CompilerBundle.message("rebuild.lvcs.label.no.errors", text)
: CompilerBundle.message("rebuild.lvcs.label.with.errors", text));
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:CompileProjectAction.java
示例15: doAction
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@RequiredDispatchThread
@Override
protected void doAction(DataContext dataContext, final Project project) {
CompilerManager.getInstance(project).rebuild(new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
if (aborted) return;
String text = getTemplatePresentation().getText();
LocalHistory.getInstance().putSystemLabel(project, errors == 0
? CompilerBundle.message("rebuild.lvcs.label.no.errors", text)
: CompilerBundle.message("rebuild.lvcs.label.with.errors", text));
}
});
}
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:CompileProjectAction.java
示例16: recompileProjectAndRerunAction
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
@Override
public boolean recompileProjectAndRerunAction(@NotNull final Module module, @NotNull final CoverageSuitesBundle suite,
@NotNull final Runnable chooseSuiteAction) {
final VirtualFile outputpath = ModuleCompilerPathsManager.getInstance(module).getCompilerOutput(ProductionContentFolderTypeProvider.getInstance
());
final VirtualFile testOutputpath = ModuleCompilerPathsManager.getInstance(module).getCompilerOutput(TestContentFolderTypeProvider.getInstance());
if ((outputpath == null && isModuleOutputNeeded(module, ProductionContentFolderTypeProvider.getInstance()))
|| (suite.isTrackTestFolders() && testOutputpath == null && isModuleOutputNeeded(module, TestContentFolderTypeProvider.getInstance()))) {
final Project project = module.getProject();
if (suite.isModuleChecked(module)) return false;
suite.checkModule(module);
final Runnable runnable = new Runnable() {
public void run() {
if (Messages.showOkCancelDialog(
"Project class files are out of date. Would you like to recompile? The refusal to do it will result in incomplete coverage information",
"Project is out of date", Messages.getWarningIcon()) == Messages.OK) {
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(), new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
if (project.isDisposed()) return;
CoverageDataManager.getInstance(project).chooseSuitesBundle(suite);
}
});
}
});
} else if (!project.isDisposed()) {
CoverageDataManager.getInstance(project).chooseSuitesBundle(null);
}
}
};
ApplicationManager.getApplication().invokeLater(runnable);
return true;
}
return false;
}
开发者ID:consulo,项目名称:consulo-java,代码行数:40,代码来源:JavaCoverageEngine.java
示例17: compileAndAnalyze
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void compileAndAnalyze(final Project project, final AnalysisScope scope) {
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(), new CompileStatusNotification() {
@Override
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
doAnalyze(project, scope);
}
});
}});
}
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:BaseClassesAnalysisAction.java
示例18: doMake
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
static boolean doMake(final Project myProject, final RunConfiguration configuration, final ExecutionEnvironment env, final boolean ignoreErrors, final boolean forceMakeProject) {
if (!(configuration instanceof RunProfileWithCompileBeforeLaunchOption)) {
return true;
}
if (configuration instanceof RunConfigurationBase && ((RunConfigurationBase)configuration).excludeCompileBeforeLaunchOption()) {
return true;
}
final RunProfileWithCompileBeforeLaunchOption runConfiguration = (RunProfileWithCompileBeforeLaunchOption)configuration;
final Ref<Boolean> result = new Ref<Boolean>(Boolean.FALSE);
try {
final Semaphore done = new Semaphore();
done.down();
final CompileStatusNotification callback = new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, CompileContext compileContext) {
if ((errors == 0 || ignoreErrors) && !aborted) {
result.set(Boolean.TRUE);
}
done.up();
}
};
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
CompileScope scope;
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
if (forceMakeProject) {
// user explicitly requested whole-project make
scope = compilerManager.createProjectCompileScope(myProject);
}
else {
final Module[] modules = runConfiguration.getModules();
if (modules.length > 0) {
for (Module module : modules) {
if (module == null) {
LOG.error("RunConfiguration should not return null modules. Configuration=" + runConfiguration.getName() + "; class=" +
runConfiguration.getClass().getName());
}
}
scope = compilerManager.createModulesCompileScope(modules, true, true);
}
else {
scope = compilerManager.createProjectCompileScope(myProject);
}
}
if (!myProject.isDisposed()) {
scope.putUserData(RUN_CONFIGURATION, configuration);
scope.putUserData(RUN_CONFIGURATION_TYPE_ID, configuration.getType().getId());
ExecutionManagerImpl.EXECUTION_SESSION_ID_KEY.set(scope, ExecutionManagerImpl.EXECUTION_SESSION_ID_KEY.get(env));
compilerManager.make(scope, callback);
}
else {
done.up();
}
}
});
done.waitFor();
}
catch (Exception e) {
return false;
}
return result.get();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:68,代码来源:CompileStepBeforeRun.java
示例19: executeMakeInUIThread
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
private void executeMakeInUIThread(final VirtualFileEvent event) {
if(project.isInitialized() && !project.isDisposed() && project.isOpen()) {
final CompilerManager compilerManager = CompilerManager.getInstance(project);
if(!compilerManager.isCompilationActive() &&
!compilerManager.isExcludedFromCompilation(event.getFile()) // &&
) {
// Check first if there are no errors in the code
CodeSmellDetector codeSmellDetector = CodeSmellDetector.getInstance(project);
boolean isOk = true;
if(codeSmellDetector != null) {
List<CodeSmellInfo> codeSmellInfoList = codeSmellDetector.findCodeSmells(Arrays.asList(event.getFile()));
for(CodeSmellInfo codeSmellInfo: codeSmellInfoList) {
if(codeSmellInfo.getSeverity() == HighlightSeverity.ERROR) {
isOk = false;
break;
}
}
}
if(isOk) {
// Changed file found in module. Make it.
final ToolWindow tw = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
final boolean isShown = tw != null && tw.isVisible();
compilerManager.compile(
new VirtualFile[]{event.getFile()},
new CompileStatusNotification() {
@Override
public void finished(boolean b, int i, int i1, CompileContext compileContext) {
if (tw != null && tw.isVisible()) {
// Close / Hide the Build Message Window after we did the build if it wasn't shown
if(!isShown) {
tw.hide(null);
}
}
}
}
);
} else {
MessageManager messageManager = ComponentProvider.getComponent(project, MessageManager.class);
if(messageManager != null) {
messageManager.sendErrorNotification(
"server.update.file.change.with.error",
event.getFile()
);
}
}
}
}
}
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:49,代码来源:ContentResourceChangeListener.java
示例20: doMake
import com.intellij.openapi.compiler.CompileStatusNotification; //导入依赖的package包/类
static boolean doMake(final Project myProject, final RunConfiguration configuration, final ExecutionEnvironment env, final boolean ignoreErrors) {
if (!(configuration instanceof RunProfileWithCompileBeforeLaunchOption)) {
return true;
}
if (configuration instanceof RunConfigurationBase && ((RunConfigurationBase)configuration).excludeCompileBeforeLaunchOption()) {
return true;
}
final RunProfileWithCompileBeforeLaunchOption runConfiguration = (RunProfileWithCompileBeforeLaunchOption)configuration;
final Ref<Boolean> result = new Ref<Boolean>(Boolean.FALSE);
try {
final Semaphore done = new Semaphore();
done.down();
final CompileStatusNotification callback = new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, CompileContext compileContext) {
if ((errors == 0 || ignoreErrors) && !aborted) {
result.set(Boolean.TRUE);
}
done.up();
}
};
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
CompileScope scope;
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
if (Boolean.valueOf(System.getProperty(MAKE_PROJECT_ON_RUN_KEY, Boolean.FALSE.toString())).booleanValue()) {
// user explicitly requested whole-project make
scope = compilerManager.createProjectCompileScope(myProject);
}
else {
final Module[] modules = runConfiguration.getModules();
if (modules.length > 0) {
for (Module module : modules) {
if (module == null) {
LOG.error("RunConfiguration should not return null modules. Configuration=" + runConfiguration.getName() + "; class=" +
runConfiguration.getClass().getName());
}
}
scope = compilerManager.createModulesCompileScope(modules, true);
}
else {
scope = compilerManager.createProjectCompileScope(myProject);
}
}
if (!myProject.isDisposed()) {
scope.putUserData(RUN_CONFIGURATION, configuration);
scope.putUserData(RUN_CONFIGURATION_TYPE_ID, configuration.getType().getId());
compilerManager.make(scope, callback);
}
else {
done.up();
}
}
});
done.waitFor();
}
catch (Exception e) {
return false;
}
return result.get();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:67,代码来源:CompileStepBeforeRun.java
注:本文中的com.intellij.openapi.compiler.CompileStatusNotification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论