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


Java BuildTarget类代码示例

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


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


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