polish Publish RunType UI
[teamcity/dotNetPackagesSupport.git] / nuget-server / src / jetbrains / buildServer / nuget / server / publish / PublishRunType.java
index 20d72ecc1d6b43bcc0b2ab8a095d158d6ea9f54d..42b15cc0507bd060f093d85fc6277a3f7e56de2c 100644 (file)
@@ -29,9 +29,7 @@ import org.jetbrains.annotations.NotNull;
 \r
 import java.util.*;\r
 \r
-import static jetbrains.buildServer.nuget.common.PackagesConstants.NUGET_API_KEY;\r
-import static jetbrains.buildServer.nuget.common.PackagesConstants.NUGET_PATH;\r
-import static jetbrains.buildServer.nuget.common.PackagesConstants.NUGET_PUBLISH_FILES;\r
+import static jetbrains.buildServer.nuget.common.PackagesConstants.*;\r
 \r
 /**\r
  * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
@@ -75,7 +73,7 @@ public class PublishRunType extends RunType {
         }\r
 \r
         if (StringUtil.isEmptyOrSpaces(properties.get(NUGET_PUBLISH_FILES))) {\r
-          checks.add(new InvalidProperty(NUGET_API_KEY, "Specify at least one package to pusblish"));\r
+          checks.add(new InvalidProperty(NUGET_PUBLISH_FILES, "Specify at least one package to pusblish"));\r
         }\r
 \r
         return checks;\r
@@ -105,4 +103,32 @@ public class PublishRunType extends RunType {
     return list;\r
   }\r
 \r
+  @NotNull\r
+  @Override\r
+  public String describeParameters(@NotNull Map<String, String> parameters) {\r
+    StringBuilder sb = new StringBuilder();\r
+    final String source = parameters.get(NUGET_PUBLISH_SOURCE);\r
+    if (!StringUtil.isEmptyOrSpaces(source)) {\r
+      sb.append("Publish to:").append(source).append("\n");\r
+    }\r
+\r
+    final String packages = parameters.get(NUGET_PUBLISH_FILES);\r
+    if (!StringUtil.isEmptyOrSpaces(packages)) {\r
+      sb.append("Packages: ");\r
+      boolean isFirst = true;\r
+      for (String split : packages.split("[\r\n]+")) {\r
+        if (!StringUtil.isEmptyOrSpaces(split)) {\r
+          if (!isFirst) {sb.append(", ");} else {isFirst = false; }\r
+          sb.append(StringUtil.truncateStringValueWithDotsAtCenter(split, 50));\r
+        }\r
+      }\r
+    }\r
+\r
+    final String doNotPublish = parameters.get(NUGET_PUBLISH_CREATE_ONLY);\r
+    if (!StringUtil.isEmptyOrSpaces(doNotPublish)) {\r
+      sb.append("\nDo not pusblish uploaded package");\r
+    }\r
+\r
+    return sb.toString();\r
+  }\r
 }\r