nuget publish runner integration test added
[teamcity/dotNetPackagesSupport.git] / nuget-agent / src / jetbrains / buildServer / nuget / agent / commands / impl / CommandFactoryImpl.java
index af7920eefb71765a30fc29c0c0f987d1b47f549d..c2e537b62a3bd8ccc9d335d173f7fbe2a1a50643 100644 (file)
@@ -20,13 +20,11 @@ import jetbrains.buildServer.RunBuildException;
 import jetbrains.buildServer.nuget.agent.commands.CommandFactory;\r
 import jetbrains.buildServer.nuget.agent.parameters.*;\r
 import jetbrains.buildServer.util.FileUtil;\r
+import jetbrains.buildServer.util.StringUtil;\r
 import org.jetbrains.annotations.NotNull;\r
 \r
 import java.io.File;\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.Collection;\r
-import java.util.List;\r
+import java.util.*;\r
 \r
 /**\r
  * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
@@ -73,15 +71,19 @@ public class CommandFactoryImpl implements CommandFactory {
                           @NotNull final File packagePath,\r
                           @NotNull final Callback<T> factory) throws RunBuildException {\r
     final List<String> arguments = new ArrayList<String>();\r
+    arguments.add("push");\r
     arguments.add(packagePath.getPath());\r
     arguments.add(params.getApiKey());\r
     if (params.getCreateOnly()) {\r
       arguments.add("-CreateOnly");\r
     }\r
 \r
+    final String source = params.getPublishSource();\r
     return executeNuGet(\r
             params,\r
-            Arrays.asList(params.getPublishSource()),\r
+            StringUtil.isEmptyOrSpaces(source)\r
+                    ? Collections.<String>emptyList()\r
+                    : Arrays.asList(source),\r
             arguments,\r
             packagePath.getParentFile(),\r
             factory);\r