本文整理汇总了Java中com.intellij.openapi.compiler.CompileContext.getProgressIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java CompileContext.getProgressIndicator方法的具体用法?Java CompileContext.getProgressIndicator怎么用?Java CompileContext.getProgressIndicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.compiler.CompileContext
的用法示例。
在下文中一共展示了CompileContext.getProgressIndicator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProcessingItems
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
@NotNull
public ProcessingItem[] getProcessingItems(@NotNull final CompileContext context) {
final ProgressIndicator progressIndicator = context.getProgressIndicator();
progressIndicator.setIndeterminate(true);
progressIndicator.setText("Preparing files for linking...");
final OCamlCompileContext ocamlContext = OCamlCompileContext.createOn(context);
if (!ocamlContext.isStandaloneCompile()) {
return new ProcessingItem[] { createProcessingItem(context, ocamlContext, getMainOCamlModule(ocamlContext)) };
}
final ArrayList<ProcessingItem> items = new ArrayList<ProcessingItem>();
final RunConfiguration[] configurations = RunManager.getInstance(context.getProject()).getAllConfigurations();
for (final RunConfiguration configuration : configurations) {
if (!(configuration instanceof OCamlRunConfiguration)) continue;
final OCamlModule ocamlModule = ((OCamlRunConfiguration) configuration).getMainOCamlModule();
if (ocamlModule == null) continue;
items.add(createProcessingItem(context, ocamlContext, ocamlModule));
}
return items.toArray(new ProcessingItem[items.size()]);
}
示例2: generateItems
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
public static Collection<VirtualFile> generateItems(final GroovyToJavaGenerator generator,
final VirtualFile item,
final VirtualFile outputRootDirectory,
CompileContext context,
final Project project) {
ProgressIndicator indicator = context.getProgressIndicator();
indicator.setText("Generating stubs for " + item.getName() + "...");
if (LOG.isDebugEnabled()) {
LOG.debug("Generating stubs for " + item.getName() + "...");
}
final Map<String, CharSequence> output;
AccessToken accessToken = ApplicationManager.getApplication().acquireReadActionLock();
try {
output = generator.generateStubs((GroovyFile)PsiManager.getInstance(project).findFile(item));
}
finally {
accessToken.finish();
}
return writeStubs(outputRootDirectory, output, item);
}
示例3: getProcessingItems
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
@NotNull
public ProcessingItem[] getProcessingItems(@NotNull final CompileContext context) {
final ProgressIndicator progressIndicator = context.getProgressIndicator();
progressIndicator.setIndeterminate(true);
progressIndicator.setText("Preparing files for compiling...");
final ArrayList<ProcessingItem> items = new ArrayList<ProcessingItem>();
final ArrayList<OCamlModule> ocamlModules = new ArrayList<OCamlModule>();
final OCamlCompileContext ocamlContext = OCamlCompileContext.createOn(context);
final boolean isDebugMode = ocamlContext.isDebugMode();
try {
if (ocamlContext.isStandaloneCompile()) {
ocamlModules.addAll(collectItemsForStandaloneCompile(context, items));
}
else {
final OCamlModule mainOCamlModule = getMainOCamlModule(ocamlContext);
ocamlModules.add(mainOCamlModule);
ocamlModules.addAll(mainOCamlModule.collectAllDependencies());
Collections.reverse(ocamlModules);
}
}
catch (final CyclicDependencyException e) {
context.addMessage(ERROR, e.getMessage(), null, -1, -1);
return new ProcessingItem[0];
}
final boolean isRebuild = context.isRebuild();
final LocalFileSystem fileSystem = LocalFileSystem.getInstance();
for (final OCamlModule ocamlModule : ocamlModules) {
processFile(fileSystem.findFileByIoFile(ocamlModule.getInterfaceFile()), ocamlModule.getCompiledInterfaceFile(), items, isDebugMode, isRebuild);
processFile(fileSystem.findFileByIoFile(ocamlModule.getImplementationFile()), ocamlModule.getCompiledImplementationFile(), items, isDebugMode, isRebuild);
}
return items.toArray(new ProcessingItem[items.size()]);
}
示例4: process
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
@NotNull
public ProcessingItem[] process(@NotNull final CompileContext context, @NotNull final ProcessingItem[] items) {
final ProgressIndicator progressIndicator = context.getProgressIndicator();
progressIndicator.setIndeterminate(false);
progressIndicator.setText("Linking...");
final double allCount = items.length;
int processedCount = -1;
final ArrayList<ProcessingItem> processedItems = new ArrayList<ProcessingItem>();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex();
final OCamlCompileContext ocamlContext = OCamlCompileContext.createOn(context);
for (final ProcessingItem item : items) {
progressIndicator.setText2("");
processedCount++;
progressIndicator.setFraction(processedCount / allCount);
if (!(item instanceof OCamlLinkerProcessingItem)) continue;
final OCamlModule mainOCamlModule = ((OCamlLinkerProcessingItem) item).getOCamlModule();
if (mainOCamlModule == null) continue;
final String exeFilePath = mainOCamlModule.getCompiledExecutableFile().getAbsolutePath();
progressIndicator.setText2(exeFilePath);
try {
link(mainOCamlModule, fileIndex, context, ocamlContext);
} catch (final CyclicDependencyException e) {
context.addMessage(ERROR, e.getMessage(), null, -1, -1);
continue;
}
processedItems.add(item);
}
return processedItems.toArray(new ProcessingItem[processedItems.size()]);
}
示例5: getBatchRequestor
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
private ICompilerRequestor getBatchRequestor(final CompileContext compileContext) {
return new ICompilerRequestor() {
public void acceptResult(CompilationResult compilationResult) {
ProgressIndicator progress = compileContext.getProgressIndicator();
if (progress != null) {
progress.checkCanceled();
}
myCompilationResults.offer(compilationResult);
}
};
}
示例6: compileForIpa
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
private boolean compileForIpa(CompileContext context, final CreateIpaAction.IpaConfig ipaConfig) {
try {
ProgressIndicator progress = context.getProgressIndicator();
context.getProgressIndicator().pushState();
RoboVmPlugin.focusToolWindow(context.getProject());
progress.setText("Creating IPA");
RoboVmPlugin.logInfo(context.getProject(), "Creating package in " + ipaConfig.getDestinationDir().getAbsolutePath() + " ...");
Config.Builder builder = new Config.Builder();
builder.logger(RoboVmPlugin.getLogger(context.getProject()));
File moduleBaseDir = new File(ModuleRootManager.getInstance(ipaConfig.getModule()).getContentRoots()[0].getPath());
// load the robovm.xml file
loadConfig(context.getProject(), builder, moduleBaseDir, false);
builder.os(OS.ios);
builder.archs(ipaConfig.getArchs());
builder.installDir(ipaConfig.getDestinationDir());
builder.iosSignIdentity(SigningIdentity.find(SigningIdentity.list(), ipaConfig.getSigningIdentity()));
if (ipaConfig.getProvisioningProfile() != null) {
builder.iosProvisioningProfile(ProvisioningProfile.find(ProvisioningProfile.list(), ipaConfig.getProvisioningProfile()));
}
configureClassAndSourcepaths(context, builder, ipaConfig.getModule());
builder.home(RoboVmPlugin.getRoboVmHome());
Config config = builder.build();
progress.setFraction(0.5);
AppCompiler compiler = new AppCompiler(config);
RoboVmCompilerThread thread = new RoboVmCompilerThread(compiler, progress) {
protected void doCompile() throws Exception {
compiler.build();
compiler.archive();
}
};
thread.compile();
if(progress.isCanceled()) {
RoboVmPlugin.logInfo(context.getProject(), "Build canceled");
return false;
}
progress.setFraction(1);
RoboVmPlugin.logInfo(context.getProject(), "Package successfully created in " + ipaConfig.getDestinationDir().getAbsolutePath());
} catch(Throwable t) {
RoboVmPlugin.logErrorThrowable(context.getProject(), "Couldn't create IPA", t, false);
return false;
} finally {
context.getProgressIndicator().popState();
}
return true;
}
示例7: process
import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
@NotNull
public ProcessingItem[] process(@NotNull final CompileContext context, @NotNull final ProcessingItem[] items) {
final ProgressIndicator progressIndicator = context.getProgressIndicator();
progressIndicator.setIndeterminate(false);
progressIndicator.setText("Compiling...");
final double allCount = items.length;
int processedCount = -1;
final ArrayList<ProcessingItem> processedItems = new ArrayList<ProcessingItem>();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex();
final OCamlCompileContext ocamlContext = OCamlCompileContext.createOn(context);
for (final ProcessingItem item : items) {
processedCount++;
progressIndicator.setFraction(processedCount / allCount);
final VirtualFile file = item.getFile();
progressIndicator.setText2(OCamlFileUtil.getPathToDisplay(file));
final VirtualFile destDir = getDestination(file, fileIndex);
if (destDir == null) {
context.addMessage(ERROR, "Cannot determine destination directory for \"" + OCamlFileUtil.getPathToDisplay(file) + "\" file.", file.getUrl(), -1, -1);
continue;
}
if (OCamlFileUtil.isOCamlSourceFile(file)) {
context.putUserData(THERE_WAS_RECOMPILATION, true);
if (!compile(file, fileIndex, context, ocamlContext, destDir)) continue;
}
else {
try {
file.copy(this, destDir, file.getName());
} catch (final IOException e) {
context.addMessage(ERROR, "Cannot copy \"" + OCamlFileUtil.getPathToDisplay(file) + "\" file to \"" + OCamlFileUtil.getPathToDisplay(destDir) + "\" directory: " + e.getLocalizedMessage(), file.getUrl(), -1, -1);
continue;
}
}
processedItems.add(item);
}
progressIndicator.setFraction(1.0);
progressIndicator.setText2("");
return processedItems.toArray(new ProcessingItem[processedItems.size()]);
}