本文整理匯總了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();
}