use of org.jetbrains.jps.builders.ModuleBasedTarget in project intellij-community by JetBrains.
the class CompileScopeImpl method isAffectedByAssociatedModule.
private boolean isAffectedByAssociatedModule(BuildTarget<?> target) {
if (target instanceof ModuleBasedTarget) {
final JpsModule module = ((ModuleBasedTarget) target).getModule();
// this target is associated with module
JavaModuleBuildTargetType targetType = JavaModuleBuildTargetType.getInstance(((ModuleBasedTarget) target).isTests());
if (myTypes.contains(targetType) || myTargets.contains(new ModuleBuildTarget(module, targetType))) {
return true;
}
}
return false;
}
use of org.jetbrains.jps.builders.ModuleBasedTarget in project intellij-community by JetBrains.
the class BuildTargetRegistryImpl method getModuleBasedTargets.
@NotNull
@Override
public Collection<ModuleBasedTarget<?>> getModuleBasedTargets(@NotNull JpsModule module, @NotNull BuildTargetRegistry.ModuleTargetSelector selector) {
final List<ModuleBasedTarget> targets = myModuleBasedTargets.get(module);
if (targets == null || targets.isEmpty()) {
return Collections.emptyList();
}
final List<ModuleBasedTarget<?>> result = new SmartList<>();
for (ModuleBasedTarget target : targets) {
switch(selector) {
case ALL:
result.add(target);
break;
case PRODUCTION:
if (!target.isTests()) {
result.add(target);
}
break;
case TEST:
if (target.isTests()) {
result.add(target);
}
}
}
return result;
}
Aggregations