本文整理汇总了Java中com.intellij.compiler.impl.CompilerUtil.refreshIOFile方法的典型用法代码示例。如果您正苦于以下问题:Java CompilerUtil.refreshIOFile方法的具体用法?Java CompilerUtil.refreshIOFile怎么用?Java CompilerUtil.refreshIOFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.compiler.impl.CompilerUtil
的用法示例。
在下文中一共展示了CompilerUtil.refreshIOFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeStubs
import com.intellij.compiler.impl.CompilerUtil; //导入方法依赖的package包/类
private static List<VirtualFile> writeStubs(VirtualFile outputRootDirectory, Map<String, CharSequence> output, VirtualFile src) {
final ArrayList<VirtualFile> stubs = ContainerUtil.newArrayList();
for (String relativePath : output.keySet()) {
final File stubFile = new File(outputRootDirectory.getPath(), relativePath);
FileUtil.createIfDoesntExist(stubFile);
try {
FileUtil.writeToFile(stubFile, output.get(relativePath).toString().getBytes(src.getCharset()));
}
catch (IOException e) {
LOG.error(e);
}
CompilerUtil.refreshIOFile(stubFile);
ContainerUtil.addIfNotNull(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(stubFile), stubs);
}
return stubs;
}
示例2: run
import com.intellij.compiler.impl.CompilerUtil; //导入方法依赖的package包/类
public static void run(@NotNull AndroidAutogeneratorMode mode,
@NotNull AndroidFacet facet,
@NotNull CompileContext context,
boolean force) {
if (!toRun(mode, facet, force)) {
return;
}
final Set<String> obsoleteFiles = new HashSet<String>(facet.getAutogeneratedFiles(mode));
switch (mode) {
case AAPT:
runAapt(facet, context, force);
break;
case AIDL:
runAidl(facet, context);
break;
case RENDERSCRIPT:
runRenderscript(facet, context);
break;
case BUILDCONFIG:
runBuildConfigGenerator(facet, context);
break;
default:
LOG.error("Unknown mode" + mode);
}
obsoleteFiles.removeAll(facet.getAutogeneratedFiles(mode));
for (String path : obsoleteFiles) {
final File file = new File(path);
if (file.isFile()) {
FileUtil.delete(file);
CompilerUtil.refreshIOFile(file);
}
}
}
示例3: generate
import com.intellij.compiler.impl.CompilerUtil; //导入方法依赖的package包/类
public GenerationItem[] generate(CompileContext context, GenerationItem[] items, VirtualFile outputRootDirectory) {
if (JFlex.isCompilationEnabled()) {
if (items != null && items.length > 0) {
Application application = ApplicationManager.getApplication();
GenerationItem[] generationItems = application.runReadAction(new GenerateAction(context, items, outputRootDirectory, ProjectRootManager.getInstance(context.getProject()).getProjectSdk()));
for (GenerationItem item : generationItems) {
CompilerUtil.refreshIOFile(((JFlexGenerationItem) item).getGeneratedFile());
}
return generationItems;
}
}
return EMPTY_GENERATION_ITEM_ARRAY;
}
示例4: deleteGeneratedFiles
import com.intellij.compiler.impl.CompilerUtil; //导入方法依赖的package包/类
public void deleteGeneratedFiles() {
if (FileUtil.delete(myStub)) {
CompilerUtil.refreshIOFile(myStub);
}
if (FileUtil.delete(mySkel)) {
CompilerUtil.refreshIOFile(mySkel);
}
if (FileUtil.delete(myTie)) {
CompilerUtil.refreshIOFile(myTie);
}
}
示例5: addStubsToCompileScope
import com.intellij.compiler.impl.CompilerUtil; //导入方法依赖的package包/类
protected static void addStubsToCompileScope(List<String> outputPaths, CompileContext compileContext, Module module) {
List<VirtualFile> stubFiles = new ArrayList<VirtualFile>();
for (String outputPath : outputPaths) {
final File stub = new File(outputPath);
CompilerUtil.refreshIOFile(stub);
final VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(stub);
ContainerUtil.addIfNotNull(file, stubFiles);
}
((CompileContextEx)compileContext).addScope(new FileSetCompileScope(stubFiles, new Module[]{module}));
}