当前位置: 首页>>代码示例>>Java>>正文


Java CompilerUtil.refreshIOFile方法代码示例

本文整理汇总了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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GroovycStubGenerator.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:AndroidAutogenerator.java

示例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;
}
 
开发者ID:jflex-de,项目名称:idea-jflex,代码行数:14,代码来源:JFlexSourceGeneratingCompiler.java

示例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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:RmicCompiler.java

示例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}));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:GroovyCompilerBase.java


注:本文中的com.intellij.compiler.impl.CompilerUtil.refreshIOFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。