• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BuildTarget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jetbrains.jps.builders.BuildTarget的典型用法代码示例。如果您正苦于以下问题:Java BuildTarget类的具体用法?Java BuildTarget怎么用?Java BuildTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BuildTarget类属于org.jetbrains.jps.builders包,在下文中一共展示了BuildTarget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: markDirtyFiles

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
static void markDirtyFiles(CompileContext context,
                           BuildTarget<?> target,
                           final CompilationRound round,
                           Timestamps timestamps,
                           boolean forceMarkDirty,
                           @Nullable THashSet<File> currentFiles,
                           @Nullable FileFilter filter) throws IOException {
  if (filter == null && forceMarkDirty) {
    addCompletelyMarkedDirtyTarget(context, target);
  }

  for (BuildRootDescriptor rd : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
    if (!rd.getRootFile().exists() ||
        //temp roots are managed by compilers themselves
        (rd instanceof JavaSourceRootDescriptor && ((JavaSourceRootDescriptor)rd).isTemp)) {
      continue;
    }
    if (filter == null) {
      context.getProjectDescriptor().fsState.clearRecompile(rd);
    }
    final FSCache fsCache = rd.canUseFileCache() ? context.getProjectDescriptor().getFSCache() : FSCache.NO_CACHE;
    traverseRecursively(context, rd, round, rd.getRootFile(), timestamps, forceMarkDirty, currentFiles, filter, fsCache);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FSOperations.java


示例2: CompileScopeImpl

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public CompileScopeImpl(Collection<? extends BuildTargetType<?>> types,
                        Collection<? extends BuildTargetType<?>> typesToForceBuild,
                        Collection<BuildTarget<?>> targets,
                        @NotNull Map<BuildTarget<?>, Set<File>> files) {
  myTypes = types;
  myTypesToForceBuild = new HashSet<BuildTargetType<?>>();
  boolean forceBuildAllModuleBasedTargets = false;
  for (BuildTargetType<?> type : typesToForceBuild) {
    myTypesToForceBuild.add(type);
    forceBuildAllModuleBasedTargets |= type instanceof JavaModuleBuildTargetType;
  }
  if (forceBuildAllModuleBasedTargets) {
    for (BuildTargetType<?> targetType : TargetTypeRegistry.getInstance().getTargetTypes()) {
      if (targetType instanceof ModuleBasedBuildTargetType<?>) {
        myTypesToForceBuild.add(targetType);
      }
    }
  }
  myTargets = targets;
  myFiles = files;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:CompileScopeImpl.java


示例3: save

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public synchronized void save() {
  try {
    FileUtil.createParentDirs(myTargetsFile);
    DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(myTargetsFile)));
    try {
      output.writeInt(0);
      output.writeInt(myTargetIds.size());
      for (Map.Entry<BuildTarget<?>, Integer> entry : myTargetIds.entrySet()) {
        IOUtil.writeString(entry.getKey().getId(), output);
        output.writeInt(entry.getValue());
      }
    }
    finally {
      output.close();
    }
  }
  catch (IOException e) {
    LOG.info("Cannot save " + myTargetType.getTypeId() + " targets data: " + e.getMessage(), e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:BuildTargetTypeState.java


示例4: cleanTargetStorages

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public void cleanTargetStorages(BuildTarget<?> target) throws IOException {
  try {
    AtomicNotNullLazyValue<BuildTargetStorages> storages = myTargetStorages.remove(target);
    if (storages != null) {
      storages.getValue().close();
    }
  }
  finally {
    // delete all data except src-out mapping which is cleaned in a special way
    final File[] targetData = myDataPaths.getTargetDataRoot(target).listFiles();
    if (targetData != null) {
      final File srcOutputMapRoot = getSourceToOutputMapRoot(target);
      for (File dataFile : targetData) {
        if (!FileUtil.filesEqual(dataFile, srcOutputMapRoot)) {
          FileUtil.delete(dataFile);
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:BuildDataManager.java


示例5: removeStamp

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public void removeStamp(File file, BuildTarget<?> buildTarget) throws IOException {
  TimestampPerTarget[] state = getState(file);
  if (state != null) {
    int targetId = myTargetsState.getBuildTargetId(buildTarget);
    for (int i = 0; i < state.length; i++) {
      TimestampPerTarget timestampPerTarget = state[i];
      if (timestampPerTarget.targetId == targetId) {
        if (state.length == 1) {
          remove(file);
        }
        else {
          TimestampPerTarget[] newState = ArrayUtil.remove(state, i);
          update(file, newState);
          break;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TimestampStorage.java


示例6: accept

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@Override
public boolean accept(File file) {
  final JavaSourceRootDescriptor rd = myBuildRootIndex.findJavaRootDescriptor(myContext, file);
  if (rd == null) {
    return true;
  }
  final ModuleBuildTarget targetOfFile = rd.target;
  if (myChunkTargets.contains(targetOfFile)) {
    return true;
  }
  Set<BuildTarget<?>> targetOfFileWithDependencies = myCache.get(targetOfFile);
  if (targetOfFileWithDependencies == null) {
    targetOfFileWithDependencies = myBuildTargetIndex.getDependenciesRecursively(targetOfFile, myContext);
    myCache.put(targetOfFile, targetOfFileWithDependencies);
  }
  return ContainerUtil.intersects(targetOfFileWithDependencies, myChunkTargets);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaBuilderUtil.java


示例7: getTargetsByOutputFile

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@Override
public Collection<BuildTarget<?>> getTargetsByOutputFile(@NotNull File file) {
  File current = file;
  Collection<BuildTarget<?>> result = null;
  while (current != null) {
    List<BuildTarget<?>> targets = myOutputToTargets.get(current);
    if (targets != null) {
      if (result == null) {
        result = targets;
      }
      else {
        result = new ArrayList<BuildTarget<?>>(result);
        result.addAll(targets);
      }
    }
    current = FileUtilRt.getParentFile(current);
  }
  return result != null ? result : Collections.<BuildTarget<?>>emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TargetOutputIndexImpl.java


示例8: BuildTargetRegistryImpl

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public BuildTargetRegistryImpl(JpsModel model) {
  myTargets = new THashMap<BuildTargetType<?>, List<? extends BuildTarget<?>>>();
  myModuleBasedTargets = new THashMap<JpsModule, List<ModuleBasedTarget>>();
  List<List<? extends BuildTarget<?>>> targetsByType = new ArrayList<List<? extends BuildTarget<?>>>();
  for (BuildTargetType<?> type : TargetTypeRegistry.getInstance().getTargetTypes()) {
    List<? extends BuildTarget<?>> targets = type.computeAllTargets(model);
    myTargets.put(type, targets);
    targetsByType.add(targets);
    for (BuildTarget<?> target : targets) {
      if (target instanceof ModuleBasedTarget) {
        final ModuleBasedTarget t = (ModuleBasedTarget)target;
        final JpsModule module = t.getModule();
        List<ModuleBasedTarget> list = myModuleBasedTargets.get(module);
        if (list == null) {
          list = new ArrayList<ModuleBasedTarget>();
          myModuleBasedTargets.put(module, list);
        }
        list.add(t);
      }
    }
  }
  myAllTargets = Collections.unmodifiableList(ContainerUtil.concat(targetsByType));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:BuildTargetRegistryImpl.java


示例9: getAdditionalRoots

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@NotNull
@Override
public List<JavaSourceRootDescriptor> getAdditionalRoots(@NotNull BuildTarget<JavaSourceRootDescriptor> target, BuildDataPaths dataPaths) {
  ModuleBuildTarget buildTarget = (ModuleBuildTarget)target;
  final File generatedSourcesRoot = AndroidJpsUtil.getGeneratedSourcesStorage(buildTarget.getModule(), dataPaths);
  final List<JavaSourceRootDescriptor> result = new ArrayList<JavaSourceRootDescriptor>();

  addRoot(result, buildTarget, new File(generatedSourcesRoot, AndroidJpsUtil.AAPT_GENERATED_SOURCE_ROOT_NAME));
  addRoot(result, buildTarget, new File(generatedSourcesRoot, AndroidJpsUtil.AIDL_GENERATED_SOURCE_ROOT_NAME));
  addRoot(result, buildTarget, new File(generatedSourcesRoot, AndroidJpsUtil.RENDERSCRIPT_GENERATED_SOURCE_ROOT_NAME));
  addRoot(result, buildTarget, new File(generatedSourcesRoot, AndroidJpsUtil.BUILD_CONFIG_GENERATED_SOURCE_ROOT_NAME));

  addRoot(result, buildTarget, AndroidJpsUtil.getCopiedSourcesStorage(buildTarget.getModule(), dataPaths));

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidAdditionalRootProviderService.java


示例10: processFilesToRecompile

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public <R extends BuildRootDescriptor, T extends BuildTarget<R>> boolean processFilesToRecompile(CompileContext context, final T target, final FileProcessor<R, T> processor) throws IOException {
  final Map<BuildRootDescriptor, Set<File>> data = getSourcesToRecompile(context, target);
  final CompileScope scope = context.getScope();
  synchronized (data) {
    for (Map.Entry<BuildRootDescriptor, Set<File>> entry : data.entrySet()) {
      //noinspection unchecked
      R root = (R)entry.getKey();
      for (File file : entry.getValue()) {
        if (!scope.isAffected(target, file)) {
          continue;
        }
        if (!processor.apply(target, file, root)) {
          return false;
        }
      }
    }
  }
  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:BuildFSState.java


示例11: markDirtyFiles

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
static void markDirtyFiles(CompileContext context,
                           BuildTarget<?> target,
                           Timestamps timestamps,
                           boolean forceMarkDirty,
                           @Nullable THashSet<File> currentFiles,
                           @Nullable FileFilter filter) throws IOException {
  for (BuildRootDescriptor rd : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
    if (!rd.getRootFile().exists() ||
        //temp roots are managed by compilers themselves
        (rd instanceof JavaSourceRootDescriptor && ((JavaSourceRootDescriptor)rd).isTemp)) {
      continue;
    }
    if (filter == null) {
      context.getProjectDescriptor().fsState.clearRecompile(rd);
    }
    final FSCache fsCache = rd.canUseFileCache() ? context.getProjectDescriptor().getFSCache() : FSCache.NO_CACHE;
    traverseRecursively(context, rd, rd.getRootFile(), timestamps, forceMarkDirty, currentFiles, filter, fsCache);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FSOperations.java


示例12: createLoader

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@NotNull
@Override
public BuildTargetLoader createLoader(@NotNull JpsModel model) {
    return new BuildTargetLoader() {
        @Nullable
        @Override
        public BuildTarget<?> createTarget(@NotNull String targetId) {
            return null;
        }
    };
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:12,代码来源:BsbTargetType.java


示例13: getTargetCompiledClasses

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@Override
public Collection<CompiledClass> getTargetCompiledClasses(BuildTarget<?> target) {
  final Collection<CompiledClass> classes = myTargetToClassesMap.get(target);
  if (classes != null) {
    return Collections.unmodifiableCollection(classes);
  }
  return Collections.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChunkBuildOutputConsumerImpl.java


示例14: registerCompiledClass

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@Override
public void registerCompiledClass(BuildTarget<?> target, CompiledClass compiled) throws IOException {
  if (compiled.getClassName() != null) {
    myClasses.put(compiled.getClassName(), compiled);
    Collection<CompiledClass> classes = myTargetToClassesMap.get(target);
    if (classes == null) {
      classes = new ArrayList<CompiledClass>();
      myTargetToClassesMap.put(target, classes);
    }
    classes.add(compiled);
  }
  registerOutputFile(target, compiled.getOutputFile(), Collections.<String>singleton(compiled.getSourceFile().getPath()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ChunkBuildOutputConsumerImpl.java


示例15: registerOutputFile

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
@Override
public void registerOutputFile(BuildTarget<?> target, File outputFile, Collection<String> sourcePaths) throws IOException {
  BuildOutputConsumerImpl consumer = myTarget2Consumer.get(target);
  if (consumer == null) {
    consumer = new BuildOutputConsumerImpl(target, myContext);
    myTarget2Consumer.put(target, consumer);
  }
  consumer.registerOutputFile(outputFile, sourcePaths);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ChunkBuildOutputConsumerImpl.java


示例16: setCompilationStartStamp

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public void setCompilationStartStamp(Collection<BuildTarget<?>> targets, long stamp) {
  synchronized (myCompilationStartStamp) {
    for (BuildTarget<?> target : targets) {
      myCompilationStartStamp.put(target, stamp);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CompileContextImpl.java


示例17: load

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
  lockData();
  try {
    myDeletedPaths.clear();
    int deletedCount = in.readInt();
    while (deletedCount-- > 0) {
      myDeletedPaths.add(IOUtil.readString(in));
    }
    myFilesToRecompile.clear();
    int recompileCount = in.readInt();
    while (recompileCount-- > 0) {
      String rootId = IOUtil.readString(in);
      BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
      Set<File> files;
      if (descriptor != null) {
        files = myFilesToRecompile.get(descriptor);
        if (files == null) {
          files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
          myFilesToRecompile.put(descriptor, files);
        }
      }
      else {
        LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
        files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
      }
      int filesCount = in.readInt();
      while (filesCount-- > 0) {
        final File file = new File(IOUtil.readString(in));
        if (Utils.IS_TEST_MODE) {
          LOG.info("Loaded " + file.getPath());
        }
        files.add(file);
      }
    }
  }
  finally {
    unlockData();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:FilesDelta.java


示例18: composeMessageText

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
private static String composeMessageText(Collection<? extends BuildTarget<?>> targets, Event event) {
  String targetsString = StringUtil.join(targets, new NotNullFunction<BuildTarget<?>, String>() {
    @NotNull
    @Override
    public String fun(BuildTarget<?> dom) {
      return dom.getPresentableName();
    }
  }, ", ");
  return (event == Event.STARTED ? "Started" : "Finished") + " building " + targetsString;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:BuildingTargetProgressMessage.java


示例19: getDependencies

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public Collection<BuildTarget<?>> getDependencies(JpsPackagingElement element, TargetOutputIndex outputIndex) {
  LayoutElementBuilderService builder = getElementBuilder(element);
  if (builder != null) {
    //noinspection unchecked
    return builder.getDependencies(element, outputIndex);
  }
  return Collections.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LayoutElementBuildersRegistry.java


示例20: pruneEmptyDirs

import org.jetbrains.jps.builders.BuildTarget; //导入依赖的package包/类
public static void pruneEmptyDirs(CompileContext context, @Nullable final Set<File> dirsToDelete) {
  if (dirsToDelete == null || dirsToDelete.isEmpty()) return;

  Set<File> doNotDelete = ALL_OUTPUTS_KEY.get(context);
  if (doNotDelete == null) {
    doNotDelete = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
    for (BuildTarget<?> target : context.getProjectDescriptor().getBuildTargetIndex().getAllTargets()) {
      doNotDelete.addAll(target.getOutputRoots(context));
    }
    ALL_OUTPUTS_KEY.set(context, doNotDelete);
  }

  Set<File> additionalDirs = null;
  Set<File> toDelete = dirsToDelete;
  while (toDelete != null) {
    for (File file : toDelete) {
      // important: do not force deletion if the directory is not empty!
      final boolean deleted = !doNotDelete.contains(file) && file.delete();
      if (deleted) {
        final File parentFile = file.getParentFile();
        if (parentFile != null) {
          if (additionalDirs == null) {
            additionalDirs = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
          }
          additionalDirs.add(parentFile);
        }
      }
    }
    toDelete = additionalDirs;
    additionalDirs = null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FSOperations.java



注:本文中的org.jetbrains.jps.builders.BuildTarget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GeometryCollection类代码示例发布时间:2022-05-22
下一篇:
Java CacheEntry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap