当前位置: 首页>>代码示例>>Java>>正文


Java TargetTypeBuildScope类代码示例

本文整理汇总了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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PluginModuleBuildScopeProvider.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ArtifactCompilerUtil.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ArtifactBuildTargetScopeProvider.java

示例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());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:CompileScopeUtil.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompileScopeUtil.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:CompileScopeUtil.java

示例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)
    );
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:31,代码来源:SpoofaxBuildTargetScopeProvider.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:ArtifactBuildTargetScopeProvider.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CompileScopeUtil.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CompileScopeUtil.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CompileScopeUtil.java


注:本文中的org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。