本文整理汇总了Java中org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope类的典型用法代码示例。如果您正苦于以下问题:Java TargetTypeBuildScope类的具体用法?Java TargetTypeBuildScope怎么用?Java TargetTypeBuildScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TargetTypeBuildScope类属于org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage包,在下文中一共展示了TargetTypeBuildScope类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBuildTargetScopes
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
@NotNull
@Override
public List<TargetTypeBuildScope> getBuildTargetScopes(@NotNull CompileScope baseScope, @NotNull CompilerFilter filter,
@NotNull Project project, boolean forceBuild) {
List<String> pluginArtifactTargetIds = new ArrayList<String>();
for (Module module : baseScope.getAffectedModules()) {
if (PluginModuleType.isOfType(module)) {
pluginArtifactTargetIds.add(module.getName()+":plugin");
}
}
if (pluginArtifactTargetIds.isEmpty()) {
return Collections.emptyList();
}
return Collections.singletonList(CmdlineProtoUtil.createTargetsScope(ArtifactBuildTargetType.INSTANCE.getTypeId(), pluginArtifactTargetIds, forceBuild));
}
示例2: containsArtifacts
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
public static boolean containsArtifacts(List<TargetTypeBuildScope> scopes) {
for (TargetTypeBuildScope scope : scopes) {
if (ArtifactBuildTargetType.INSTANCE.getTypeId().equals(scope.getTypeId())) {
return true;
}
}
return false;
}
示例3: getBuildTargetScopes
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
@NotNull
@Override
public List<TargetTypeBuildScope> getBuildTargetScopes(@NotNull final CompileScope baseScope, @NotNull CompilerFilter filter,
@NotNull final Project project, final boolean forceBuild) {
final ArtifactsCompiler compiler = ArtifactsCompiler.getInstance(project);
if (compiler == null || !filter.acceptCompiler(compiler)) {
return Collections.emptyList();
}
final List<TargetTypeBuildScope> scopes = new ArrayList<TargetTypeBuildScope>();
new ReadAction() {
protected void run(@NotNull final Result result) {
final Set<Artifact> artifacts = ArtifactCompileScope.getArtifactsToBuild(project, baseScope, false);
if (ArtifactCompileScope.getArtifacts(baseScope) == null) {
Set<Module> modules = ArtifactUtil.getModulesIncludedInArtifacts(artifacts, project);
CompileScopeUtil.addScopesForModules(modules, scopes, forceBuild);
}
if (!artifacts.isEmpty()) {
TargetTypeBuildScope.Builder builder = TargetTypeBuildScope.newBuilder()
.setTypeId(ArtifactBuildTargetType.INSTANCE.getTypeId())
.setForceBuild(ArtifactCompileScope.isArtifactRebuildForced(baseScope));
for (Artifact artifact : artifacts) {
builder.addTargetId(artifact.getName());
}
scopes.add(builder.build());
}
}
}.execute();
return scopes;
}
示例4: addScopesForModules
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
public static void addScopesForModules(Collection<Module> modules, List<TargetTypeBuildScope> scopes, boolean forceBuild) {
if (!modules.isEmpty()) {
for (JavaModuleBuildTargetType type : JavaModuleBuildTargetType.ALL_TYPES) {
TargetTypeBuildScope.Builder builder = TargetTypeBuildScope.newBuilder().setTypeId(type.getTypeId()).setForceBuild(forceBuild);
for (Module module : modules) {
builder.addTargetId(module.getName());
}
scopes.add(builder.build());
}
}
}
示例5: mergeScopes
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
public static List<TargetTypeBuildScope> mergeScopes(List<TargetTypeBuildScope> scopes1, List<TargetTypeBuildScope> scopes2) {
if (scopes2.isEmpty()) return scopes1;
if (scopes1.isEmpty()) return scopes2;
Map<String, TargetTypeBuildScope> scopeById = new HashMap<String, TargetTypeBuildScope>();
mergeScopes(scopeById, scopes1);
mergeScopes(scopeById, scopes2);
return new ArrayList<TargetTypeBuildScope>(scopeById.values());
}
示例6: mergeScope
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
private static TargetTypeBuildScope mergeScope(TargetTypeBuildScope scope1, TargetTypeBuildScope scope2) {
String typeId = scope1.getTypeId();
if (scope1.getAllTargets()) {
return !scope1.getForceBuild() && scope2.getForceBuild() ? createAllTargetForcedBuildScope(typeId) : scope1;
}
if (scope2.getAllTargets()) {
return !scope2.getForceBuild() && scope1.getForceBuild() ? createAllTargetForcedBuildScope(typeId) : scope2;
}
return TargetTypeBuildScope.newBuilder()
.setTypeId(typeId)
.setForceBuild(scope1.getForceBuild() || scope2.getForceBuild())
.addAllTargetId(scope1.getTargetIdList())
.addAllTargetId(scope2.getTargetIdList())
.build();
}
示例7: getBuildTargetScopes
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<TargetTypeBuildScope> getBuildTargetScopes(
final CompileScope baseScope,
@SuppressWarnings("deprecation") final CompilerFilter filter,
final Project project,
final boolean forceBuild) {
// Does any of the modules in the project have the Metaborg facet?
if (!ProjectFacetManager.getInstance(project).hasFacets(MetaborgFacet.ID)) {
// No, therefore we will not mess with the build.
return Collections.emptyList();
}
// Gather the target IDs (module names) of the target modules.
final List<String> targetIds = new ArrayList<>();
for (final Module module : baseScope.getAffectedModules()) {
final MetaborgFacet facet = MetaborgFacet.getInstance(module);
if (facet == null) continue;
targetIds.add(module.getName());
}
// Create a new TargetTypeBuildScope that uses the specified target type to build the target modules.
return Collections.singletonList(
CmdlineProtoUtil.createTargetsScope(TargetTypeConstants.PostTargetType, targetIds, forceBuild)
);
}
示例8: getBuildTargetScopes
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
@NotNull
@Override
public List<TargetTypeBuildScope> getBuildTargetScopes(@NotNull final CompileScope baseScope, @NotNull CompilerFilter filter,
@NotNull final Project project, final boolean forceBuild) {
final ArtifactsCompiler compiler = ArtifactsCompiler.getInstance(project);
if (compiler == null || !filter.acceptCompiler(compiler)) {
return Collections.emptyList();
}
final List<TargetTypeBuildScope> scopes = new ArrayList<TargetTypeBuildScope>();
new ReadAction() {
protected void run(final Result result) {
final Set<Artifact> artifacts = ArtifactCompileScope.getArtifactsToBuild(project, baseScope, false);
if (ArtifactCompileScope.getArtifacts(baseScope) == null) {
Set<Module> modules = ArtifactUtil.getModulesIncludedInArtifacts(artifacts, project);
CompileScopeUtil.addScopesForModules(modules, scopes, forceBuild);
}
if (!artifacts.isEmpty()) {
TargetTypeBuildScope.Builder builder = TargetTypeBuildScope.newBuilder()
.setTypeId(ArtifactBuildTargetType.INSTANCE.getTypeId())
.setForceBuild(ArtifactCompileScope.isArtifactRebuildForced(baseScope));
for (Artifact artifact : artifacts) {
builder.addTargetId(artifact.getName());
}
scopes.add(builder.build());
}
}
}.execute();
return scopes;
}
示例9: setBaseScopeForExternalBuild
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
public static void setBaseScopeForExternalBuild(@NotNull CompileScope scope, @NotNull List<TargetTypeBuildScope> scopes) {
scope.putUserData(BASE_SCOPE_FOR_EXTERNAL_BUILD, scopes);
}
示例10: getBaseScopeForExternalBuild
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
public static List<TargetTypeBuildScope> getBaseScopeForExternalBuild(@NotNull CompileScope scope) {
return scope.getUserData(BASE_SCOPE_FOR_EXTERNAL_BUILD);
}
示例11: createAllTargetForcedBuildScope
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; //导入依赖的package包/类
private static TargetTypeBuildScope createAllTargetForcedBuildScope(final String typeId) {
return TargetTypeBuildScope.newBuilder().setTypeId(typeId).setForceBuild(true).setAllTargets(true).build();
}