本文整理汇总了Java中org.jetbrains.jps.ModuleChunk.getTargets方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleChunk.getTargets方法的具体用法?Java ModuleChunk.getTargets怎么用?Java ModuleChunk.getTargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.jps.ModuleChunk
的用法示例。
在下文中一共展示了ModuleChunk.getTargets方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildClassToSourceMap
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static Map<String, String> buildClassToSourceMap(ModuleChunk chunk, CompileContext context, Set<String> toCompilePaths, Map<ModuleBuildTarget, String> finalOutputs) throws IOException {
final Map<String, String> class2Src = new HashMap<String, String>();
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
context.getProjectDescriptor().getProject());
for (ModuleBuildTarget target : chunk.getTargets()) {
String moduleOutputPath = finalOutputs.get(target);
final SourceToOutputMapping srcToOut = context.getProjectDescriptor().dataManager.getSourceToOutputMap(target);
for (String src : srcToOut.getSources()) {
if (!toCompilePaths.contains(src) && isGroovyFile(src) &&
!configuration.getCompilerExcludes().isExcluded(new File(src))) {
final Collection<String> outs = srcToOut.getOutputs(src);
if (outs != null) {
for (String out : outs) {
if (out.endsWith(".class") && out.startsWith(moduleOutputPath)) {
final String className = out.substring(moduleOutputPath.length(), out.length() - ".class".length()).replace('/', '.');
class2Src.put(className, src);
}
}
}
}
}
}
return class2Src;
}
示例2: buildOutputDirectoriesMap
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static Map<File, Set<File>> buildOutputDirectoriesMap(CompileContext context, ModuleChunk chunk) {
final Map<File, Set<File>> map = new THashMap<File, Set<File>>(FileUtil.FILE_HASHING_STRATEGY);
for (ModuleBuildTarget target : chunk.getTargets()) {
final File outputDir = target.getOutputDir();
if (outputDir == null) {
continue;
}
final Set<File> roots = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
for (JavaSourceRootDescriptor descriptor : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
roots.add(descriptor.root);
}
map.put(outputDir, roots);
}
return map;
}
示例3: shouldDifferentiate
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@Override
public boolean shouldDifferentiate(ModuleChunk chunk) {
if (myNonIncrementalModules.isEmpty()) {
return true;
}
for (ModuleBuildTarget target : chunk.getTargets()) {
if (myNonIncrementalModules.contains(target)) {
return false;
}
}
return true;
}
示例4: beforeNextRoundStart
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
public void beforeNextRoundStart(@NotNull CompileContext context, ModuleChunk chunk) {
FilesDelta currentDelta = getRoundDelta(NEXT_ROUND_DELTA_KEY, context);
if (currentDelta == null) {
// this is the initial round.
// Need to make a snapshot of the FS state so that all builders in the chain see the same picture
final List<FilesDelta> deltas = new SmartList<FilesDelta>();
for (ModuleBuildTarget target : chunk.getTargets()) {
deltas.add(getDelta(target));
}
currentDelta = new FilesDelta(deltas);
}
setRoundDelta(CURRENT_ROUND_DELTA_KEY, context, currentDelta);
setRoundDelta(NEXT_ROUND_DELTA_KEY, context, new FilesDelta());
}
示例5: performBuild
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@Override
protected ExitCode performBuild(CompileContext context, ModuleChunk chunk, InstrumentationClassFinder finder, OutputConsumer outputConsumer) {
ExitCode exitCode = ExitCode.NOTHING_DONE;
if (!outputConsumer.getCompiledClasses().isEmpty()) {
final Map<ModuleBuildTarget, Collection<ClassItem>> remoteClasses = new THashMap<ModuleBuildTarget, Collection<ClassItem>>();
for (ModuleBuildTarget target : chunk.getTargets()) {
for (CompiledClass compiledClass : outputConsumer.getTargetCompiledClasses(target)) {
try {
if (isRemote(compiledClass, finder)) {
Collection<ClassItem> list = remoteClasses.get(target);
if (list == null) {
list = new ArrayList<ClassItem>();
remoteClasses.put(target, list);
}
list.add(new ClassItem(compiledClass));
}
}
catch (IOException e) {
context.processMessage(new CompilerMessage(getPresentableName(), e));
}
}
}
if (!remoteClasses.isEmpty()) {
exitCode = generateRmiStubs(context, remoteClasses, chunk, outputConsumer);
}
}
return exitCode;
}
示例6: getRemovedPaths
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static Set<String> getRemovedPaths(ModuleChunk chunk, DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder) {
if (!dirtyFilesHolder.hasRemovedFiles()) {
return Collections.emptySet();
}
final Set<String> removed = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
for (ModuleBuildTarget target : chunk.getTargets()) {
removed.addAll(dirtyFilesHolder.getRemovedFiles(target));
}
return removed;
}
示例7: getStubGenerationOutputs
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static Map<ModuleBuildTarget, String> getStubGenerationOutputs(ModuleChunk chunk, CompileContext context) throws IOException {
Map<ModuleBuildTarget, String> generationOutputs = new HashMap<ModuleBuildTarget, String>();
File commonRoot = getStubRoot(context);
for (ModuleBuildTarget target : chunk.getTargets()) {
File targetRoot = new File(commonRoot, target.getModule().getName() + File.separator + target.getTargetType().getTypeId());
if (targetRoot.exists() && !FileUtil.deleteWithRenaming(targetRoot)) {
throw new IOException("External make cannot clean " + targetRoot.getPath());
}
if (!targetRoot.mkdirs()) {
throw new IOException("External make cannot create " + targetRoot.getPath());
}
generationOutputs.put(target, targetRoot.getPath());
}
return generationOutputs;
}
示例8: getStubGenerationOutputs
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static Map<ModuleBuildTarget, String> getStubGenerationOutputs(ModuleChunk chunk, CompileContext context) throws IOException {
Map<ModuleBuildTarget, String> generationOutputs = new HashMap<ModuleBuildTarget, String>();
File commonRoot = new File(context.getProjectDescriptor().dataManager.getDataPaths().getDataStorageRoot(), "groovyStubs");
for (ModuleBuildTarget target : chunk.getTargets()) {
File targetRoot = new File(commonRoot, target.getModule().getName() + File.separator + target.getTargetType().getTypeId());
if (!FileUtil.delete(targetRoot)) {
throw new IOException("External make cannot clean " + targetRoot.getPath());
}
if (!targetRoot.mkdirs()) {
throw new IOException("External make cannot create " + targetRoot.getPath());
}
generationOutputs.put(target, targetRoot.getPath());
}
return generationOutputs;
}
示例9: markDirty
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
public static void markDirty(CompileContext context, final CompilationRound round, final ModuleChunk chunk, @Nullable FileFilter filter) throws IOException {
final ProjectDescriptor pd = context.getProjectDescriptor();
for (ModuleBuildTarget target : chunk.getTargets()) {
markDirtyFiles(context, target, round, pd.timestamps.getStorage(), true, null, filter);
}
}
示例10: processFilesToRecompile
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
public static void processFilesToRecompile(CompileContext context, ModuleChunk chunk, FileProcessor<JavaSourceRootDescriptor, ModuleBuildTarget> processor) throws IOException {
for (ModuleBuildTarget target : chunk.getTargets()) {
processFilesToRecompile(context, target, processor);
}
}
示例11: ModulesBasedFileFilter
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private ModulesBasedFileFilter(CompileContext context, ModuleChunk chunk) {
myContext = context;
myChunkTargets = chunk.getTargets();
myBuildRootIndex = context.getProjectDescriptor().getBuildRootIndex();
myBuildTargetIndex = context.getProjectDescriptor().getBuildTargetIndex();
}
示例12: markDirty
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
public static void markDirty(CompileContext context, final ModuleChunk chunk, @Nullable FileFilter filter) throws IOException {
final ProjectDescriptor pd = context.getProjectDescriptor();
for (ModuleBuildTarget target : chunk.getTargets()) {
markDirtyFiles(context, target, pd.timestamps.getStorage(), true, null, filter);
}
}
示例13: ModulesBasedFileFilter
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private ModulesBasedFileFilter(CompileContext context, ModuleChunk chunk) {
myContext = context;
myChunkModules = chunk.getModules();
myChunkTargets = chunk.getTargets();
myBuildRootIndex = context.getProjectDescriptor().getBuildRootIndex();
}