本文整理汇总了Java中org.jetbrains.jps.builders.BuildTargetLoader类的典型用法代码示例。如果您正苦于以下问题:Java BuildTargetLoader类的具体用法?Java BuildTargetLoader怎么用?Java BuildTargetLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildTargetLoader类属于org.jetbrains.jps.builders包,在下文中一共展示了BuildTargetLoader类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLoader
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
@NotNull
@Override
public BuildTargetLoader<T> createLoader(@NotNull final JpsModel model) {
final HashMap<String, T> targetMap = new HashMap<String, T>();
for (T target : computeAllTargets(model)) {
targetMap.put(target.getId(), target);
}
return new BuildTargetLoader<T>() {
@Nullable
@Override
public T createTarget(@NotNull String targetId) {
return targetMap.get(targetId);
}
};
}
示例2: createLoader
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
/**
* Creates a build target loader, that creates a build target for a JPS module with a specified ID.
*
* @param model The JPS model.
* @return The build target loader.
*/
@Override
public final BuildTargetLoader<T> createLoader(final JpsModel model) {
// Default implementation.
return new BuildTargetLoader<T>() {
@Nullable
@Override
public T createTarget(final String targetId) {
for (final T target : computeAllTargets(model)) {
if (target.getId().equals(targetId))
return target;
}
return null;
}
};
}
示例3: createLoader
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
@NotNull
@Override
public BuildTargetLoader<HaskellTarget> createLoader(@NotNull final JpsModel jpsModel) {
return new BuildTargetLoader<HaskellTarget>() {
@Nullable
@Override
public HaskellTarget createTarget(@NotNull String targetId) {
for (JpsTypedModule<JpsDummyElement> module : jpsModel.getProject().getModules(JpsHaskellModuleType.INSTANCE)) {
if (module.getName().equals(targetId)) {
return new HaskellTarget(module, HaskellTargetType.this);
}
}
return null;
}
};
}
示例4: createLoader
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
@NotNull
@Override
public BuildTargetLoader createLoader(@NotNull JpsModel model) {
return new BuildTargetLoader() {
@Nullable
@Override
public BuildTarget<?> createTarget(@NotNull String targetId) {
return null;
}
};
}
示例5: load
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
private boolean load() {
if (!myTargetsFile.exists()) {
return false;
}
try {
DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(myTargetsFile)));
try {
input.readInt();//reserved for version
int size = input.readInt();
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);
if (target != null) {
myTargetIds.put(target, intId);
}
else {
LOG.info("Unknown " + myTargetType.getTypeId() + " target: " + stringId);
}
}
return true;
}
finally {
input.close();
}
}
catch (IOException e) {
LOG.info("Cannot load " + myTargetType.getTypeId() + " targets data: " + e.getMessage(), e);
return false;
}
}
示例6: createLoader
import org.jetbrains.jps.builders.BuildTargetLoader; //导入依赖的package包/类
@NotNull
@Override
public BuildTargetLoader<TeaVMBuildTarget> createLoader(@NotNull JpsModel model) {
return new Loader(model);
}