Search in sources :

Example 11 with TargetTypeBuildScope

use of org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope in project intellij-community by JetBrains.

the class Standalone method runBuild.

public static void runBuild(JpsModelLoader loader, final File dataStorageRoot, boolean forceBuild, Set<String> modulesSet, final boolean allModules, List<String> artifactsList, boolean allArtifacts, final boolean includeTests, final MessageHandler messageHandler) throws Exception {
    List<TargetTypeBuildScope> scopes = new ArrayList<>();
    for (JavaModuleBuildTargetType type : JavaModuleBuildTargetType.ALL_TYPES) {
        if (includeTests || !type.isTests()) {
            TargetTypeBuildScope.Builder builder = TargetTypeBuildScope.newBuilder().setTypeId(type.getTypeId()).setForceBuild(forceBuild);
            if (allModules) {
                scopes.add(builder.setAllTargets(true).build());
            } else if (!modulesSet.isEmpty()) {
                scopes.add(builder.addAllTargetId(modulesSet).build());
            }
        }
    }
    TargetTypeBuildScope.Builder builder = TargetTypeBuildScope.newBuilder().setTypeId(ArtifactBuildTargetType.INSTANCE.getTypeId()).setForceBuild(forceBuild);
    if (allArtifacts) {
        scopes.add(builder.setAllTargets(true).build());
    } else if (!artifactsList.isEmpty()) {
        scopes.add(builder.addAllTargetId(artifactsList).build());
    }
    runBuild(loader, dataStorageRoot, messageHandler, scopes, true);
}
Also used : JavaModuleBuildTargetType(org.jetbrains.jps.builders.java.JavaModuleBuildTargetType) TargetTypeBuildScope(org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope)

Aggregations

TargetTypeBuildScope (org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope)11 JavaModuleBuildTargetType (org.jetbrains.jps.builders.java.JavaModuleBuildTargetType)4 Module (com.intellij.openapi.module.Module)3 NotNull (org.jetbrains.annotations.NotNull)3 Project (com.intellij.openapi.project.Project)2 Artifact (com.intellij.packaging.artifacts.Artifact)2 THashSet (gnu.trove.THashSet)2 BuildSettings (com.android.tools.idea.gradle.project.BuildSettings)1 BuildMode (com.android.tools.idea.gradle.util.BuildMode)1 CompositeScope (com.intellij.compiler.impl.CompositeScope)1 ModuleCompileScope (com.intellij.compiler.impl.ModuleCompileScope)1 ProjectCompileScope (com.intellij.compiler.impl.ProjectCompileScope)1 BuildManager (com.intellij.compiler.server.BuildManager)1 DefaultMessageHandler (com.intellij.compiler.server.DefaultMessageHandler)1 ReadAction (com.intellij.openapi.application.ReadAction)1 Result (com.intellij.openapi.application.Result)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 MessageType (com.intellij.openapi.ui.MessageType)1 Key (com.intellij.openapi.util.Key)1 HashMap (com.intellij.util.containers.HashMap)1