report used packages agent-side
[teamcity/dotNetPackagesSupport.git] / nuget-agent / src / jetbrains / buildServer / nuget / agent / install / PackagesInstallerRunner.java
index 8db97682d4116728d457632b0ae9825b402d3760..6c5c07a5d816304bbf3f60ab0effaaf944971583 100644 (file)
@@ -19,11 +19,13 @@ package jetbrains.buildServer.nuget.agent.install;
 import com.intellij.openapi.diagnostic.Logger;\r
 import jetbrains.buildServer.RunBuildException;\r
 import jetbrains.buildServer.agent.*;\r
+import jetbrains.buildServer.nuget.agent.install.impl.InstallStages;\r
+import jetbrains.buildServer.nuget.agent.install.impl.InstallStagesImpl;\r
+import jetbrains.buildServer.nuget.agent.install.impl.PackagesInstallerBuilder;\r
 import jetbrains.buildServer.nuget.agent.parameters.NuGetParameters;\r
 import jetbrains.buildServer.nuget.agent.parameters.PackagesInstallParameters;\r
 import jetbrains.buildServer.nuget.agent.parameters.PackagesParametersFactory;\r
 import jetbrains.buildServer.nuget.agent.parameters.PackagesUpdateParameters;\r
-import jetbrains.buildServer.nuget.agent.util.CompositeBuildProcess;\r
 import jetbrains.buildServer.nuget.agent.util.impl.CompositeBuildProcessImpl;\r
 import jetbrains.buildServer.nuget.common.DotNetConstants;\r
 import jetbrains.buildServer.nuget.common.PackagesConstants;\r
@@ -49,6 +51,13 @@ public class PackagesInstallerRunner implements AgentBuildRunner, AgentBuildRunn
   public BuildProcess createBuildProcess(@NotNull AgentRunningBuild runningBuild,\r
                                          @NotNull final BuildRunnerContext context) throws RunBuildException {\r
     CompositeBuildProcessImpl process = new CompositeBuildProcessImpl();\r
+    InstallStages stages = new InstallStagesImpl(process);\r
+    createStages(context, stages);\r
+    return process;\r
+  }\r
+\r
+  private void createStages(@NotNull final BuildRunnerContext context,\r
+                            @NotNull final InstallStages stages) throws RunBuildException {\r
     final NuGetParameters parameters = myParametersFactory.loadNuGetParameters(context);\r
     final PackagesInstallParameters installParameters = myParametersFactory.loadInstallPackagesParameters(context, parameters);\r
     final PackagesUpdateParameters updateParameters = myParametersFactory.loadUpdatePackagesParameters(context, parameters);\r
@@ -57,29 +66,18 @@ public class PackagesInstallerRunner implements AgentBuildRunner, AgentBuildRunn
       throw new RunBuildException("NuGet install packages must be enabled");\r
     }\r
 \r
-    final CompositeBuildProcess install = new CompositeBuildProcessImpl();\r
-    final CompositeBuildProcess update = new CompositeBuildProcessImpl();\r
-    final CompositeBuildProcess postUpdate = new CompositeBuildProcessImpl();\r
-\r
     final LocateNuGetConfigBuildProcess locate = new LocateNuGetConfigBuildProcess(\r
             parameters,\r
             context.getBuild().getBuildLogger(),\r
             new PackagesInstallerBuilder(\r
                     myNuGetActionFactory,\r
-                    install,\r
-                    update,\r
-                    postUpdate,\r
+                    stages,\r
                     context,\r
                     installParameters,\r
                     updateParameters\r
             ));\r
 \r
-    process.pushBuildProcess(locate);\r
-    process.pushBuildProcess(install);\r
-    process.pushBuildProcess(update);\r
-    process.pushBuildProcess(postUpdate);\r
-\r
-    return process;\r
+    stages.getLocateStage().pushBuildProcess(locate);\r
   }\r
 \r
   @NotNull\r