mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
external compiler: generification
This commit is contained in:
@@ -54,7 +54,7 @@ public class CmdlineProtoUtil {
|
||||
);
|
||||
}
|
||||
|
||||
public static TargetTypeBuildScope createAllTargetsScope(BuildTargetType type) {
|
||||
public static TargetTypeBuildScope createAllTargetsScope(BuildTargetType<?> type) {
|
||||
return TargetTypeBuildScope.newBuilder()
|
||||
.setTypeId(type.getTypeId())
|
||||
.setAllTargets(true)
|
||||
|
||||
@@ -11,13 +11,13 @@ import java.util.List;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class AdditionalRootsProviderService<R extends BuildRootDescriptor> {
|
||||
private Collection<? extends BuildTargetType> myTargetTypes;
|
||||
private Collection<? extends BuildTargetType<? extends BuildTarget<R>>> myTargetTypes;
|
||||
|
||||
protected AdditionalRootsProviderService(Collection<? extends BuildTargetType> targetTypes) {
|
||||
protected AdditionalRootsProviderService(Collection<? extends BuildTargetType<? extends BuildTarget<R>>> targetTypes) {
|
||||
myTargetTypes = targetTypes;
|
||||
}
|
||||
|
||||
public Collection<? extends BuildTargetType> getTargetTypes() {
|
||||
public Collection<? extends BuildTargetType<? extends BuildTarget<R>>> getTargetTypes() {
|
||||
return myTargetTypes;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@ public abstract class BuildRootDescriptor {
|
||||
|
||||
public abstract File getRootFile();
|
||||
|
||||
public abstract BuildTarget getTarget();
|
||||
public abstract BuildTarget<?> getTarget();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface BuildRootIndex {
|
||||
<R extends BuildRootDescriptor> List<R> getTempTargetRoots(@NotNull BuildTarget<R> target, @NotNull CompileContext context);
|
||||
|
||||
@NotNull
|
||||
<R extends BuildRootDescriptor> List<R> getRootDescriptors(@NotNull File root, @NotNull Collection<? extends BuildTargetType> types,
|
||||
<R extends BuildRootDescriptor> List<R> getRootDescriptors(@NotNull File root, @NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context);
|
||||
|
||||
<R extends BuildRootDescriptor> void associateTempRoot(@NotNull CompileContext context, @NotNull BuildTarget<R> target, @NotNull R root);
|
||||
@@ -30,12 +30,12 @@ public interface BuildRootIndex {
|
||||
Collection<? extends BuildRootDescriptor> clearTempRoots(@NotNull CompileContext context);
|
||||
|
||||
@Nullable
|
||||
<R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType> types,
|
||||
<R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context);
|
||||
|
||||
@NotNull
|
||||
<R extends BuildRootDescriptor> Collection<R> findAllParentDescriptors(@NotNull File file,
|
||||
@NotNull Collection<? extends BuildTargetType> types,
|
||||
@NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context);
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -13,19 +13,19 @@ import java.util.List;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class BuildTarget<R extends BuildRootDescriptor> {
|
||||
private final BuildTargetType myTargetType;
|
||||
private final BuildTargetType<?> myTargetType;
|
||||
|
||||
protected BuildTarget(BuildTargetType targetType) {
|
||||
protected BuildTarget(BuildTargetType<?> targetType) {
|
||||
myTargetType = targetType;
|
||||
}
|
||||
|
||||
public abstract String getId();
|
||||
|
||||
public final BuildTargetType getTargetType() {
|
||||
public final BuildTargetType<?> getTargetType() {
|
||||
return myTargetType;
|
||||
}
|
||||
|
||||
public abstract Collection<? extends BuildTarget> computeDependencies();
|
||||
public abstract Collection<? extends BuildTarget<?>> computeDependencies();
|
||||
|
||||
public void writeConfiguration(PrintWriter out, BuildRootIndex buildRootIndex) {
|
||||
}
|
||||
|
||||
@@ -9,5 +9,6 @@ import java.util.Collection;
|
||||
*/
|
||||
public interface BuildTargetIndex {
|
||||
@NotNull
|
||||
Collection<BuildTarget<?>> getAllTargets(@NotNull BuildTargetType type);
|
||||
<T extends BuildTarget<?>>
|
||||
Collection<T> getAllTargets(@NotNull BuildTargetType<T> type);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class BuildTargetLoader {
|
||||
public abstract class BuildTargetLoader<T extends BuildTarget<?>> {
|
||||
@Nullable
|
||||
public abstract BuildTarget createTarget(@NotNull String targetId);
|
||||
public abstract T createTarget(@NotNull String targetId);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Collection;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class BuildTargetType {
|
||||
public abstract class BuildTargetType<T extends BuildTarget<?>> {
|
||||
private final String myTypeId;
|
||||
|
||||
protected BuildTargetType(String typeId) {
|
||||
@@ -20,8 +20,8 @@ public abstract class BuildTargetType {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract Collection<BuildTarget<?>> computeAllTargets(@NotNull JpsModel model);
|
||||
public abstract Collection<T> computeAllTargets(@NotNull JpsModel model);
|
||||
|
||||
@NotNull
|
||||
public abstract BuildTargetLoader createLoader(@NotNull JpsModel model);
|
||||
public abstract BuildTargetLoader<T> createLoader(@NotNull JpsModel model);
|
||||
}
|
||||
|
||||
@@ -31,15 +31,14 @@ public class BuildRootIndexImpl implements BuildRootIndex {
|
||||
myRootsByTarget = new HashMap<BuildTarget<?>, List<? extends BuildRootDescriptor>>();
|
||||
myRootToDescriptor = new THashMap<File, List<BuildRootDescriptor>>(FileUtil.FILE_HASHING_STRATEGY);
|
||||
final Iterable<AdditionalRootsProviderService> rootsProviders = JpsServiceManager.getInstance().getExtensions(AdditionalRootsProviderService.class);
|
||||
for (BuildTargetType targetType : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
Collection<BuildTarget<?>> targets = targetIndex.getAllTargets(targetType);
|
||||
for (BuildTarget<?> target : targets) {
|
||||
for (BuildTargetType<?> targetType : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
for (BuildTarget<?> target : targetIndex.getAllTargets(targetType)) {
|
||||
addRoots(dataStorageRoot, rootsProviders, targetType, target, model, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private <R extends BuildRootDescriptor> void addRoots(File dataStorageRoot, Iterable<AdditionalRootsProviderService> rootsProviders, BuildTargetType targetType,
|
||||
private <R extends BuildRootDescriptor> void addRoots(File dataStorageRoot, Iterable<AdditionalRootsProviderService> rootsProviders, BuildTargetType<?> targetType,
|
||||
BuildTarget<R> target, JpsModel model, ModuleRootsIndex index) {
|
||||
List<R> descriptors = target.computeRootDescriptors(model, index);
|
||||
for (AdditionalRootsProviderService<?> provider : rootsProviders) {
|
||||
@@ -67,7 +66,7 @@ public class BuildRootIndexImpl implements BuildRootIndex {
|
||||
@NotNull
|
||||
@Override
|
||||
public <R extends BuildRootDescriptor> List<R> getRootDescriptors(@NotNull File root,
|
||||
@NotNull Collection<? extends BuildTargetType> types,
|
||||
@NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context) {
|
||||
List<BuildRootDescriptor> descriptors = myRootToDescriptor.get(root);
|
||||
List<R> result = new SmartList<R>();
|
||||
@@ -153,7 +152,7 @@ public class BuildRootIndexImpl implements BuildRootIndex {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public <R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType> types,
|
||||
public <R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context) {
|
||||
File current = file;
|
||||
while (current != null) {
|
||||
@@ -169,7 +168,7 @@ public class BuildRootIndexImpl implements BuildRootIndex {
|
||||
@Override
|
||||
@NotNull
|
||||
public <R extends BuildRootDescriptor> Collection<R> findAllParentDescriptors(@NotNull File file,
|
||||
@NotNull Collection<? extends BuildTargetType> types,
|
||||
@NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
|
||||
@Nullable CompileContext context) {
|
||||
File current = file;
|
||||
Collection<R> result = null;
|
||||
|
||||
@@ -15,18 +15,19 @@ import java.util.Map;
|
||||
* @author nik
|
||||
*/
|
||||
public class BuildTargetIndexImpl implements BuildTargetIndex {
|
||||
private Map<BuildTargetType, Collection<BuildTarget<?>>> myTargets;
|
||||
private Map<BuildTargetType<?>, Collection<? extends BuildTarget<?>>> myTargets;
|
||||
|
||||
public BuildTargetIndexImpl(@NotNull JpsModel model) {
|
||||
myTargets = new HashMap<BuildTargetType, Collection<BuildTarget<?>>>();
|
||||
for (BuildTargetType type : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
myTargets = new HashMap<BuildTargetType<?>, Collection<? extends BuildTarget<?>>>();
|
||||
for (BuildTargetType<?> type : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
myTargets.put(type, type.computeAllTargets(model));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> getAllTargets(@NotNull BuildTargetType type) {
|
||||
return myTargets.get(type);
|
||||
public <T extends BuildTarget<?>> Collection<T> getAllTargets(@NotNull BuildTargetType<T> type) {
|
||||
//noinspection unchecked
|
||||
return (Collection<T>)myTargets.get(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.jetbrains.jps.builders.java;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetLoader;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.incremental.ModuleBuildTarget;
|
||||
@@ -14,7 +13,7 @@ import java.util.*;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class JavaModuleBuildTargetType extends BuildTargetType {
|
||||
public class JavaModuleBuildTargetType extends BuildTargetType<ModuleBuildTarget> {
|
||||
public static final JavaModuleBuildTargetType PRODUCTION = new JavaModuleBuildTargetType("java-production", false);
|
||||
public static final JavaModuleBuildTargetType TEST = new JavaModuleBuildTargetType("java-test", true);
|
||||
public static final List<JavaModuleBuildTargetType> ALL_TYPES = Arrays.asList(PRODUCTION, TEST);
|
||||
@@ -28,9 +27,9 @@ public class JavaModuleBuildTargetType extends BuildTargetType {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> computeAllTargets(@NotNull JpsModel model) {
|
||||
public Collection<ModuleBuildTarget> computeAllTargets(@NotNull JpsModel model) {
|
||||
List<JpsModule> modules = model.getProject().getModules();
|
||||
List<BuildTarget<?>> targets = new ArrayList<BuildTarget<?>>(modules.size());
|
||||
List<ModuleBuildTarget> targets = new ArrayList<ModuleBuildTarget>(modules.size());
|
||||
for (JpsModule module : modules) {
|
||||
targets.add(new ModuleBuildTarget(module, this));
|
||||
}
|
||||
@@ -39,7 +38,7 @@ public class JavaModuleBuildTargetType extends BuildTargetType {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public BuildTargetLoader createLoader(@NotNull JpsModel model) {
|
||||
public Loader createLoader(@NotNull JpsModel model) {
|
||||
return new Loader(model);
|
||||
}
|
||||
|
||||
@@ -51,7 +50,7 @@ public class JavaModuleBuildTargetType extends BuildTargetType {
|
||||
return tests ? TEST : PRODUCTION;
|
||||
}
|
||||
|
||||
private class Loader extends BuildTargetLoader {
|
||||
private class Loader extends BuildTargetLoader<ModuleBuildTarget> {
|
||||
private final Map<String, JpsModule> myModules;
|
||||
|
||||
public Loader(JpsModel model) {
|
||||
@@ -63,7 +62,7 @@ public class JavaModuleBuildTargetType extends BuildTargetType {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BuildTarget createTarget(@NotNull String targetId) {
|
||||
public ModuleBuildTarget createTarget(@NotNull String targetId) {
|
||||
JpsModule module = myModules.get(targetId);
|
||||
return module != null ? new ModuleBuildTarget(module, JavaModuleBuildTargetType.this) : null;
|
||||
}
|
||||
|
||||
@@ -135,12 +135,12 @@ public class BuildRunner {
|
||||
|
||||
private static CompileScope createCompilationScope(BuildType buildType, ProjectDescriptor pd, List<TargetTypeBuildScope> scopes,
|
||||
Collection<String> paths) throws Exception {
|
||||
Set<BuildTargetType> targetTypes = new HashSet<BuildTargetType>();
|
||||
Set<BuildTarget> targets = new HashSet<BuildTarget>();
|
||||
Map<BuildTarget, Set<File>> files;
|
||||
Set<BuildTargetType<?>> targetTypes = new HashSet<BuildTargetType<?>>();
|
||||
Set<BuildTarget<?>> targets = new HashSet<BuildTarget<?>>();
|
||||
Map<BuildTarget<?>, Set<File>> files;
|
||||
|
||||
for (TargetTypeBuildScope scope : scopes) {
|
||||
BuildTargetType targetType = BuilderRegistry.getInstance().getTargetType(scope.getTypeId());
|
||||
BuildTargetType<?> targetType = BuilderRegistry.getInstance().getTargetType(scope.getTypeId());
|
||||
if (targetType == null) {
|
||||
LOG.info("Unknown target type: " + scope.getTypeId());
|
||||
continue;
|
||||
@@ -149,9 +149,9 @@ public class BuildRunner {
|
||||
targetTypes.add(targetType);
|
||||
}
|
||||
else {
|
||||
BuildTargetLoader loader = targetType.createLoader(pd.jpsModel);
|
||||
BuildTargetLoader<?> loader = targetType.createLoader(pd.jpsModel);
|
||||
for (String targetId : scope.getTargetIdList()) {
|
||||
BuildTarget target = loader.createTarget(targetId);
|
||||
BuildTarget<?> target = loader.createTarget(targetId);
|
||||
if (target != null) {
|
||||
targets.add(target);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class BuildRunner {
|
||||
|
||||
final Timestamps timestamps = pd.timestamps.getStorage();
|
||||
if (!paths.isEmpty()) {
|
||||
files = new HashMap<BuildTarget, Set<File>>();
|
||||
files = new HashMap<BuildTarget<?>, Set<File>>();
|
||||
for (String path : paths) {
|
||||
final File file = new File(path);
|
||||
final RootDescriptor rd = pd.getBuildRootIndex().getModuleAndRoot(null, file);
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.jetbrains.jps.incremental;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.service.JpsServiceManager;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class BuilderRegistry {
|
||||
}
|
||||
private final Map<BuilderCategory, List<ModuleLevelBuilder>> myModuleLevelBuilders = new HashMap<BuilderCategory, List<ModuleLevelBuilder>>();
|
||||
private final List<ProjectLevelBuilder> myProjectLevelBuilders = new ArrayList<ProjectLevelBuilder>();
|
||||
private final Map<String, BuildTargetType> myTargetTypes = new LinkedHashMap<String, BuildTargetType>();
|
||||
private final Map<String, BuildTargetType<?>> myTargetTypes = new LinkedHashMap<String, BuildTargetType<?>>();
|
||||
|
||||
public static BuilderRegistry getInstance() {
|
||||
return Holder.ourInstance;
|
||||
@@ -35,9 +36,9 @@ public class BuilderRegistry {
|
||||
for (ModuleLevelBuilder builder : moduleLevelBuilders) {
|
||||
myModuleLevelBuilders.get(builder.getCategory()).add(builder);
|
||||
}
|
||||
for (BuildTargetType type : service.getTargetTypes()) {
|
||||
for (BuildTargetType<?> type : service.getTargetTypes()) {
|
||||
String id = type.getTypeId();
|
||||
BuildTargetType old = myTargetTypes.put(id, type);
|
||||
BuildTargetType<?> old = myTargetTypes.put(id, type);
|
||||
if (old != null) {
|
||||
LOG.error("Two build target types (" + type + ", " + old + ") use same id (" + id + ")");
|
||||
}
|
||||
@@ -45,11 +46,12 @@ public class BuilderRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public BuildTargetType getTargetType(String typeId) {
|
||||
@Nullable
|
||||
public BuildTargetType<?> getTargetType(String typeId) {
|
||||
return myTargetTypes.get(typeId);
|
||||
}
|
||||
|
||||
public Collection<BuildTargetType> getTargetTypes() {
|
||||
public Collection<BuildTargetType<?>> getTargetTypes() {
|
||||
return myTargetTypes.values();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class BuilderService {
|
||||
public List<? extends BuildTargetType> getTargetTypes() {
|
||||
public List<? extends BuildTargetType<?>> getTargetTypes() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.io.File;
|
||||
* Date: 1/15/12
|
||||
*/
|
||||
public abstract class CompileScope {
|
||||
public abstract boolean isAffected(BuildTarget target, @NotNull File file);
|
||||
public abstract boolean isAffected(BuildTarget<?> target, @NotNull File file);
|
||||
|
||||
public abstract boolean isAffected(@NotNull BuildTarget target);
|
||||
public abstract boolean isAffected(@NotNull BuildTarget<?> target);
|
||||
|
||||
public abstract boolean isRecompilationForced(@NotNull BuildTarget target);
|
||||
public abstract boolean isRecompilationForced(@NotNull BuildTarget<?> target);
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@ import java.util.*;
|
||||
*/
|
||||
public class CompileScopeImpl extends CompileScope {
|
||||
protected final boolean myForcedCompilation;
|
||||
private final Collection<? extends BuildTargetType> myTypes;
|
||||
private final Collection<BuildTarget> myTargets;
|
||||
private final Map<BuildTarget, Set<File>> myFiles;
|
||||
private final Collection<? extends BuildTargetType<?>> myTypes;
|
||||
private final Collection<BuildTarget<?>> myTargets;
|
||||
private final Map<BuildTarget<?>, Set<File>> myFiles;
|
||||
|
||||
public CompileScopeImpl(boolean forcedCompilation, Collection<? extends BuildTargetType> types, Collection<BuildTarget> targets,
|
||||
Map<BuildTarget, Set<File>> files) {
|
||||
public CompileScopeImpl(boolean forcedCompilation, Collection<? extends BuildTargetType<?>> types, Collection<BuildTarget<?>> targets,
|
||||
Map<BuildTarget<?>, Set<File>> files) {
|
||||
myForcedCompilation = forcedCompilation;
|
||||
myTypes = types;
|
||||
myTargets = targets;
|
||||
@@ -25,17 +25,17 @@ public class CompileScopeImpl extends CompileScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAffected(@NotNull BuildTarget target) {
|
||||
public boolean isAffected(@NotNull BuildTarget<?> target) {
|
||||
return myTypes.contains(target.getTargetType()) || myTargets.contains(target) || myFiles.containsKey(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecompilationForced(@NotNull BuildTarget target) {
|
||||
public boolean isRecompilationForced(@NotNull BuildTarget<?> target) {
|
||||
return myForcedCompilation && (myTypes.contains(target.getTargetType()) || myTargets.contains(target));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAffected(BuildTarget target, @NotNull File file) {
|
||||
public boolean isAffected(BuildTarget<?> target, @NotNull File file) {
|
||||
if (myFiles.isEmpty()) {//optimization
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ public class IncProjectBuilder {
|
||||
myProjectDescriptor.fsState.clearAll();
|
||||
}
|
||||
|
||||
public static void clearOutputFiles(CompileContext context, BuildTarget target) throws IOException {
|
||||
public static void clearOutputFiles(CompileContext context, BuildTarget<?> target) throws IOException {
|
||||
final SourceToOutputMapping map = context.getProjectDescriptor().dataManager.getSourceToOutputMap(target);
|
||||
for (String srcPath : map.getKeys()) {
|
||||
final Collection<String> outs = map.getState(srcPath);
|
||||
@@ -341,7 +341,7 @@ public class IncProjectBuilder {
|
||||
}
|
||||
|
||||
ProjectDescriptor projectDescriptor = context.getProjectDescriptor();
|
||||
for (BuildTargetType type : JavaModuleBuildTargetType.ALL_TYPES) {
|
||||
for (BuildTargetType<?> type : JavaModuleBuildTargetType.ALL_TYPES) {
|
||||
for (BuildTarget<?> target : projectDescriptor.getBuildTargetIndex().getAllTargets(type)) {
|
||||
for (BuildRootDescriptor descriptor : projectDescriptor.getBuildRootIndex().getTargetRoots(target, context)) {
|
||||
allSourceRoots.add(descriptor.getRootFile());
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.JpsPathUtil;
|
||||
import org.jetbrains.jps.builders.BuildRootIndex;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.jps.incremental.fs.RootDescriptor;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
@@ -90,7 +89,7 @@ public class ModuleBuildTarget extends BuildTarget<RootDescriptor> {
|
||||
|
||||
@Override
|
||||
public RootDescriptor findRootDescriptor(String rootId, BuildRootIndex rootIndex) {
|
||||
List<RootDescriptor> descriptors = rootIndex.getRootDescriptors(new File(rootId), Collections.<BuildTargetType>singletonList(myTargetType), null);
|
||||
List<RootDescriptor> descriptors = rootIndex.getRootDescriptors(new File(rootId), Collections.<JavaModuleBuildTargetType>singletonList(myTargetType), null);
|
||||
return ContainerUtil.getFirstItem(descriptors);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class ArtifactBuildTarget extends BuildTarget<ArtifactRootDescriptor> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends BuildTarget> computeDependencies() {
|
||||
public Collection<? extends BuildTarget<?>> computeDependencies() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -2,7 +2,6 @@ package org.jetbrains.jps.incremental.artifacts;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetLoader;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
@@ -14,7 +13,7 @@ import java.util.*;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class ArtifactBuildTargetType extends BuildTargetType {
|
||||
public class ArtifactBuildTargetType extends BuildTargetType<ArtifactBuildTarget> {
|
||||
public static final ArtifactBuildTargetType INSTANCE = new ArtifactBuildTargetType();
|
||||
|
||||
public ArtifactBuildTargetType() {
|
||||
@@ -23,9 +22,9 @@ public class ArtifactBuildTargetType extends BuildTargetType {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> computeAllTargets(@NotNull JpsModel model) {
|
||||
public Collection<ArtifactBuildTarget> computeAllTargets(@NotNull JpsModel model) {
|
||||
Collection<JpsArtifact> artifacts = JpsBuilderArtifactService.getInstance().getArtifacts(model, true);
|
||||
List<BuildTarget<?>> targets = new ArrayList<BuildTarget<?>>(artifacts.size());
|
||||
List<ArtifactBuildTarget> targets = new ArrayList<ArtifactBuildTarget>(artifacts.size());
|
||||
for (JpsArtifact artifact : artifacts) {
|
||||
targets.add(new ArtifactBuildTarget(artifact));
|
||||
}
|
||||
@@ -34,11 +33,11 @@ public class ArtifactBuildTargetType extends BuildTargetType {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public BuildTargetLoader createLoader(@NotNull JpsModel model) {
|
||||
public Loader createLoader(@NotNull JpsModel model) {
|
||||
return new Loader(model);
|
||||
}
|
||||
|
||||
private static class Loader extends BuildTargetLoader {
|
||||
private static class Loader extends BuildTargetLoader<ArtifactBuildTarget> {
|
||||
private final Map<String, JpsArtifact> myArtifacts;
|
||||
|
||||
public Loader(JpsModel model) {
|
||||
@@ -50,7 +49,7 @@ public class ArtifactBuildTargetType extends BuildTargetType {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BuildTarget createTarget(@NotNull String targetId) {
|
||||
public ArtifactBuildTarget createTarget(@NotNull String targetId) {
|
||||
JpsArtifact artifact = myArtifacts.get(targetId);
|
||||
return artifact != null ? new ArtifactBuildTarget(artifact) : null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ArtifactBuilderService extends BuilderService {
|
||||
@Override
|
||||
public List<? extends BuildTargetType> getTargetTypes() {
|
||||
public List<? extends BuildTargetType<?>> getTargetTypes() {
|
||||
return Collections.singletonList(ArtifactBuildTargetType.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ public class BuildFSState extends FSState {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean markInitialScanPerformed(BuildTarget target) {
|
||||
public boolean markInitialScanPerformed(BuildTarget<?> target) {
|
||||
return myAlwaysScanFS || super.markInitialScanPerformed(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<BuildRootDescriptor, Set<File>> getSourcesToRecompile(@NotNull CompileContext context, BuildTarget target) {
|
||||
public Map<BuildRootDescriptor, Set<File>> getSourcesToRecompile(@NotNull CompileContext context, BuildTarget<?> target) {
|
||||
final FilesDelta lastRoundDelta = getRoundDelta(LAST_ROUND_DELTA_KEY, context);
|
||||
if (lastRoundDelta != null) {
|
||||
return lastRoundDelta.getSourcesToRecompile();
|
||||
|
||||
@@ -24,20 +24,20 @@ import java.util.*;
|
||||
public class FSState {
|
||||
public static final int VERSION = 3;
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.fs.FSState");
|
||||
private final Map<BuildTarget, FilesDelta> myDeltas = Collections.synchronizedMap(new HashMap<BuildTarget, FilesDelta>());
|
||||
protected final Set<BuildTarget> myInitialScanPerformed = Collections.synchronizedSet(new HashSet<BuildTarget>());
|
||||
private final Map<BuildTarget<?>, FilesDelta> myDeltas = Collections.synchronizedMap(new HashMap<BuildTarget<?>, FilesDelta>());
|
||||
protected final Set<BuildTarget<?>> myInitialScanPerformed = Collections.synchronizedSet(new HashSet<BuildTarget<?>>());
|
||||
|
||||
public void save(DataOutput out) throws IOException {
|
||||
MultiMap<BuildTargetType, BuildTarget> targetsByType = new MultiMap<BuildTargetType, BuildTarget>();
|
||||
for (BuildTarget target : myInitialScanPerformed) {
|
||||
MultiMap<BuildTargetType<?>, BuildTarget<?>> targetsByType = new MultiMap<BuildTargetType<?>, BuildTarget<?>>();
|
||||
for (BuildTarget<?> target : myInitialScanPerformed) {
|
||||
targetsByType.putValue(target.getTargetType(), target);
|
||||
}
|
||||
out.writeInt(targetsByType.size());
|
||||
for (BuildTargetType type : targetsByType.keySet()) {
|
||||
for (BuildTargetType<?> type : targetsByType.keySet()) {
|
||||
IOUtil.writeString(type.getTypeId(), out);
|
||||
Collection<BuildTarget> targets = targetsByType.get(type);
|
||||
Collection<BuildTarget<?>> targets = targetsByType.get(type);
|
||||
out.writeInt(targets.size());
|
||||
for (BuildTarget target : targets) {
|
||||
for (BuildTarget<?> target : targets) {
|
||||
IOUtil.writeString(target.getId(), out);
|
||||
getDelta(target).save(out);
|
||||
}
|
||||
@@ -50,13 +50,13 @@ public class FSState {
|
||||
while (typeCount-- > 0) {
|
||||
final String typeId = IOUtil.readString(in);
|
||||
int targetCount = in.readInt();
|
||||
BuildTargetType type = registry.getTargetType(typeId);
|
||||
BuildTargetLoader loader = type != null ? type.createLoader(model) : null;
|
||||
BuildTargetType<?> type = registry.getTargetType(typeId);
|
||||
BuildTargetLoader<?> loader = type != null ? type.createLoader(model) : null;
|
||||
while (targetCount-- > 0) {
|
||||
final String id = IOUtil.readString(in);
|
||||
boolean loaded = false;
|
||||
if (loader != null) {
|
||||
BuildTarget target = loader.createTarget(id);
|
||||
BuildTarget<?> target = loader.createTarget(id);
|
||||
if (target != null) {
|
||||
getDelta(target).load(in, target, buildRootIndex);
|
||||
myInitialScanPerformed.add(target);
|
||||
@@ -98,29 +98,29 @@ public class FSState {
|
||||
return marked;
|
||||
}
|
||||
|
||||
public void registerDeleted(BuildTarget target, final File file, @Nullable Timestamps tsStorage) throws IOException {
|
||||
public void registerDeleted(BuildTarget<?> target, final File file, @Nullable Timestamps tsStorage) throws IOException {
|
||||
registerDeleted(target, file);
|
||||
if (tsStorage != null) {
|
||||
tsStorage.removeStamp(file, target);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerDeleted(BuildTarget target, File file) {
|
||||
public void registerDeleted(BuildTarget<?> target, File file) {
|
||||
getDelta(target).addDeleted(file);
|
||||
}
|
||||
|
||||
public Map<BuildRootDescriptor, Set<File>> getSourcesToRecompile(@NotNull CompileContext context, BuildTarget target) {
|
||||
public Map<BuildRootDescriptor, Set<File>> getSourcesToRecompile(@NotNull CompileContext context, BuildTarget<?> target) {
|
||||
return getDelta(target).getSourcesToRecompile();
|
||||
}
|
||||
|
||||
public void clearDeletedPaths(BuildTarget target) {
|
||||
public void clearDeletedPaths(BuildTarget<?> target) {
|
||||
final FilesDelta delta = myDeltas.get(target);
|
||||
if (delta != null) {
|
||||
delta.clearDeletedPaths();
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<String> getAndClearDeletedPaths(BuildTarget target) {
|
||||
public Collection<String> getAndClearDeletedPaths(BuildTarget<?> target) {
|
||||
final FilesDelta delta = myDeltas.get(target);
|
||||
if (delta != null) {
|
||||
return delta.getAndClearDeletedPaths();
|
||||
@@ -129,7 +129,7 @@ public class FSState {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected final FilesDelta getDelta(BuildTarget buildTarget) {
|
||||
protected final FilesDelta getDelta(BuildTarget<?> buildTarget) {
|
||||
synchronized (myDeltas) {
|
||||
FilesDelta delta = myDeltas.get(buildTarget);
|
||||
if (delta == null) {
|
||||
@@ -140,13 +140,13 @@ public class FSState {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasWorkToDo(BuildTarget target) {
|
||||
public boolean hasWorkToDo(BuildTarget<?> target) {
|
||||
if (!myInitialScanPerformed.contains(target)) return true;
|
||||
FilesDelta delta = myDeltas.get(target);
|
||||
return delta != null && delta.hasChanges();
|
||||
}
|
||||
|
||||
public boolean markInitialScanPerformed(BuildTarget target) {
|
||||
public boolean markInitialScanPerformed(BuildTarget<?> target) {
|
||||
return myInitialScanPerformed.add(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ final class FilesDelta {
|
||||
}
|
||||
}
|
||||
|
||||
public void load(DataInput in, @NotNull BuildTarget target, BuildRootIndex buildRootIndex) throws IOException {
|
||||
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
|
||||
myDeletedPaths.clear();
|
||||
int deletedCount = in.readInt();
|
||||
while (deletedCount-- > 0) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class RootDescriptor extends BuildRootDescriptor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuildTarget getTarget() {
|
||||
public BuildTarget<?> getTarget() {
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class BuildDataManager implements StorageOwner {
|
||||
private static final String MAPPINGS_STORAGE = "mappings";
|
||||
|
||||
private final Object mySourceToOutputLock = new Object();
|
||||
private final Map<BuildTarget, SourceToOutputMapping> mySourceToOutputs = new HashMap<BuildTarget, SourceToOutputMapping>();
|
||||
private final Map<BuildTarget<?>, SourceToOutputMapping> mySourceToOutputs = new HashMap<BuildTarget<?>, SourceToOutputMapping>();
|
||||
|
||||
private final SourceToFormMapping mySrcToFormMap;
|
||||
private final ArtifactsBuildData myArtifactsBuildData;
|
||||
@@ -50,7 +50,7 @@ public class BuildDataManager implements StorageOwner {
|
||||
return new File(myDataStorageRoot, "output-roots");
|
||||
}
|
||||
|
||||
public SourceToOutputMapping getSourceToOutputMap(final BuildTarget target) throws IOException {
|
||||
public SourceToOutputMapping getSourceToOutputMap(final BuildTarget<?> target) throws IOException {
|
||||
SourceToOutputMapping mapping;
|
||||
synchronized (mySourceToOutputLock) {
|
||||
mapping = mySourceToOutputs.get(target);
|
||||
|
||||
+2
-2
@@ -11,11 +11,11 @@ import java.io.*;
|
||||
*/
|
||||
public class BuildTargetConfiguration {
|
||||
private static final Logger LOG = Logger.getInstance(BuildTargetConfiguration.class);
|
||||
private final BuildTarget myTarget;
|
||||
private final BuildTarget<?> myTarget;
|
||||
private final BuildTargetsState myTargetsState;
|
||||
private String myConfiguration;
|
||||
|
||||
public BuildTargetConfiguration(BuildTarget target, BuildTargetsState targetsState) {
|
||||
public BuildTargetConfiguration(BuildTarget<?> target, BuildTargetsState targetsState) {
|
||||
myTarget = target;
|
||||
myTargetsState = targetsState;
|
||||
myConfiguration = load();
|
||||
|
||||
+11
-10
@@ -18,17 +18,18 @@ import java.util.concurrent.ConcurrentMap;
|
||||
*/
|
||||
public class BuildTargetTypeState {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.storage.BuildTargetTypeState");
|
||||
private final Map<BuildTarget, Integer> myTargetIds;
|
||||
private final ConcurrentMap<BuildTarget, BuildTargetConfiguration> myConfigurations = new ConcurrentHashMap<BuildTarget, BuildTargetConfiguration>();
|
||||
private final BuildTargetType myTargetType;
|
||||
private final Map<BuildTarget<?>, Integer> myTargetIds;
|
||||
private final ConcurrentMap<BuildTarget<?>, BuildTargetConfiguration> myConfigurations;
|
||||
private final BuildTargetType<?> myTargetType;
|
||||
private final BuildTargetsState myTargetsState;
|
||||
private final File myTargetsFile;
|
||||
|
||||
public BuildTargetTypeState(BuildTargetType targetType, BuildTargetsState state) {
|
||||
public BuildTargetTypeState(BuildTargetType<?> targetType, BuildTargetsState state) {
|
||||
myTargetType = targetType;
|
||||
myTargetsState = state;
|
||||
myTargetsFile = new File(state.getTargetTypeDataRoot(targetType), "targets.dat");
|
||||
myTargetIds = new HashMap<BuildTarget, Integer>();
|
||||
myConfigurations = new ConcurrentHashMap<BuildTarget<?>, BuildTargetConfiguration>();
|
||||
myTargetIds = new HashMap<BuildTarget<?>, Integer>();
|
||||
load();
|
||||
}
|
||||
|
||||
@@ -42,12 +43,12 @@ public class BuildTargetTypeState {
|
||||
try {
|
||||
input.readInt();//reserved for version
|
||||
int size = input.readInt();
|
||||
BuildTargetLoader loader = myTargetType.createLoader(myTargetsState.getModel());
|
||||
BuildTargetLoader<?> loader = myTargetType.createLoader(myTargetsState.getModel());
|
||||
while (size-- > 0) {
|
||||
String stringId = IOUtil.readString(input);
|
||||
int intId = input.readInt();
|
||||
myTargetsState.markUsedId(intId);
|
||||
BuildTarget target = loader.createTarget(stringId);
|
||||
BuildTarget<?> target = loader.createTarget(stringId);
|
||||
if (target != null) {
|
||||
myTargetIds.put(target, intId);
|
||||
}
|
||||
@@ -74,7 +75,7 @@ public class BuildTargetTypeState {
|
||||
try {
|
||||
output.writeInt(0);
|
||||
output.writeInt(myTargetIds.size());
|
||||
for (Map.Entry<BuildTarget, Integer> entry : myTargetIds.entrySet()) {
|
||||
for (Map.Entry<BuildTarget<?>, Integer> entry : myTargetIds.entrySet()) {
|
||||
IOUtil.writeString(entry.getKey().getId(), output);
|
||||
output.writeInt(entry.getValue());
|
||||
}
|
||||
@@ -88,14 +89,14 @@ public class BuildTargetTypeState {
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized int getTargetId(BuildTarget target) {
|
||||
public synchronized int getTargetId(BuildTarget<?> target) {
|
||||
if (!myTargetIds.containsKey(target)) {
|
||||
myTargetIds.put(target, myTargetsState.getFreeId());
|
||||
}
|
||||
return myTargetIds.get(target);
|
||||
}
|
||||
|
||||
public BuildTargetConfiguration getConfiguration(BuildTarget target) {
|
||||
public BuildTargetConfiguration getConfiguration(BuildTarget<?> target) {
|
||||
BuildTargetConfiguration configuration = myConfigurations.get(target);
|
||||
if (configuration == null) {
|
||||
configuration = new BuildTargetConfiguration(target, myTargetsState);
|
||||
|
||||
@@ -22,7 +22,7 @@ public class BuildTargetsState {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.storage.BuildTargetsState");
|
||||
private final File myDataStorageRoot;
|
||||
private AtomicInteger myMaxTargetId = new AtomicInteger(0);
|
||||
private ConcurrentMap<BuildTargetType, BuildTargetTypeState> myTypeStates = new ConcurrentHashMap<BuildTargetType, BuildTargetTypeState>();
|
||||
private ConcurrentMap<BuildTargetType<?>, BuildTargetTypeState> myTypeStates = new ConcurrentHashMap<BuildTargetType<?>, BuildTargetTypeState>();
|
||||
private JpsModel myModel;
|
||||
private final BuildRootIndexImpl myBuildRootIndex;
|
||||
|
||||
@@ -43,13 +43,13 @@ public class BuildTargetsState {
|
||||
catch (IOException e) {
|
||||
LOG.debug("Cannot load " + targetTypesFile + ":" + e.getMessage(), e);
|
||||
LOG.debug("Loading all target types to calculate max target id");
|
||||
for (BuildTargetType type : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
for (BuildTargetType<?> type : BuilderRegistry.getInstance().getTargetTypes()) {
|
||||
getTypeState(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public File getTargetTypeDataRoot(BuildTargetType targetType) {
|
||||
public File getTargetTypeDataRoot(BuildTargetType<?> targetType) {
|
||||
return new File(getTargetsDataRoot(), targetType.getTypeId());
|
||||
}
|
||||
|
||||
@@ -81,15 +81,15 @@ public class BuildTargetsState {
|
||||
}
|
||||
}
|
||||
|
||||
public int getBuildTargetId(@NotNull BuildTarget target) {
|
||||
public int getBuildTargetId(@NotNull BuildTarget<?> target) {
|
||||
return getTypeState(target.getTargetType()).getTargetId(target);
|
||||
}
|
||||
|
||||
public BuildTargetConfiguration getTargetConfiguration(@NotNull BuildTarget target) {
|
||||
public BuildTargetConfiguration getTargetConfiguration(@NotNull BuildTarget<?> target) {
|
||||
return getTypeState(target.getTargetType()).getConfiguration(target);
|
||||
}
|
||||
|
||||
private BuildTargetTypeState getTypeState(BuildTargetType type) {
|
||||
private BuildTargetTypeState getTypeState(BuildTargetType<?> type) {
|
||||
BuildTargetTypeState state = myTypeStates.get(type);
|
||||
if (state == null) {
|
||||
state = new BuildTargetTypeState(type, this);
|
||||
@@ -113,7 +113,7 @@ public class BuildTargetsState {
|
||||
return myMaxTargetId.incrementAndGet();
|
||||
}
|
||||
|
||||
public File getTargetDataRoot(BuildTarget target) {
|
||||
public File getTargetDataRoot(BuildTarget<?> target) {
|
||||
return new File(getTargetTypeDataRoot(target.getTargetType()), PathUtilRt.suggestFileName(target.getId(), true, true));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TimestampStorage extends AbstractStateStorage<File, TimestampStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStamp(File file, BuildTarget target) throws IOException {
|
||||
public long getStamp(File file, BuildTarget<?> target) throws IOException {
|
||||
final TimestampPerTarget[] state = getState(file);
|
||||
if (state != null) {
|
||||
int targetId = myTargetsState.getBuildTargetId(target);
|
||||
@@ -47,7 +47,7 @@ public class TimestampStorage extends AbstractStateStorage<File, TimestampStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveStamp(File file, BuildTarget buildTarget, long timestamp) throws IOException {
|
||||
public void saveStamp(File file, BuildTarget<?> buildTarget, long timestamp) throws IOException {
|
||||
int targetId = myTargetsState.getBuildTargetId(buildTarget);
|
||||
update(file, updateTimestamp(getState(file), targetId, timestamp));
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class TimestampStorage extends AbstractStateStorage<File, TimestampStorag
|
||||
return ArrayUtil.append(oldState, newItem);
|
||||
}
|
||||
|
||||
public void removeStamp(File file, BuildTarget buildTarget) throws IOException {
|
||||
public void removeStamp(File file, BuildTarget<?> buildTarget) throws IOException {
|
||||
TimestampPerTarget[] state = getState(file);
|
||||
if (state != null) {
|
||||
int targetId = myTargetsState.getBuildTargetId(buildTarget);
|
||||
|
||||
@@ -12,11 +12,11 @@ import java.io.IOException;
|
||||
public interface Timestamps {
|
||||
void force();
|
||||
|
||||
void saveStamp(File file, BuildTarget buildTarget, long timestamp) throws IOException;
|
||||
void saveStamp(File file, BuildTarget<?> buildTarget, long timestamp) throws IOException;
|
||||
|
||||
void removeStamp(File file, BuildTarget buildTarget) throws IOException;
|
||||
void removeStamp(File file, BuildTarget<?> buildTarget) throws IOException;
|
||||
|
||||
void clean() throws IOException;
|
||||
|
||||
long getStamp(File file, BuildTarget target) throws IOException;
|
||||
long getStamp(File file, BuildTarget<?> target) throws IOException;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public abstract class IncrementalTestCase extends JpsBuildTestCase {
|
||||
}
|
||||
|
||||
private static CompileScope createAllModulesScope(final boolean forcedCompilation) {
|
||||
return new CompileScopeImpl(forcedCompilation, JavaModuleBuildTargetType.ALL_TYPES, Collections.<BuildTarget>emptySet(), Collections.<BuildTarget, Set<File>>emptyMap());
|
||||
return new CompileScopeImpl(forcedCompilation, JavaModuleBuildTargetType.ALL_TYPES, Collections.<BuildTarget<?>>emptySet(), Collections.<BuildTarget<?>, Set<File>>emptyMap());
|
||||
}
|
||||
|
||||
private JpsSdk<JpsDummyElement> getOrCreateJdk() {
|
||||
|
||||
+2
-2
@@ -154,12 +154,12 @@ public abstract class ArtifactBuilderTestCase extends JpsBuildTestCase {
|
||||
ProjectDescriptor descriptor = createProjectDescriptor(new BuildLoggingManager(myArtifactBuilderLogger, new JavaBuilderLoggerImpl()));
|
||||
try {
|
||||
myArtifactBuilderLogger.clear();
|
||||
List<BuildTarget> targets = new ArrayList<BuildTarget>();
|
||||
List<BuildTarget<?>> targets = new ArrayList<BuildTarget<?>>();
|
||||
for (JpsArtifact artifact : artifacts) {
|
||||
targets.add(new ArtifactBuildTarget(artifact));
|
||||
}
|
||||
final CompileScope scope = new CompileScopeImpl(force, JavaModuleBuildTargetType.ALL_TYPES, targets,
|
||||
Collections.<BuildTarget, Set<File>>emptyMap());
|
||||
Collections.<BuildTarget<?>, Set<File>>emptyMap());
|
||||
result = doBuild(descriptor, scope, !force, false, false);
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user