polish Publish RunType UI
authorEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 11:12:13 +0000 (15:12 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 11:53:26 +0000 (15:53 +0400)
nuget-server/src/jetbrains/buildServer/nuget/server/install/PackagesInstallerRunType.java
nuget-server/src/jetbrains/buildServer/nuget/server/publish/PublishRunType.java

index 872ee4820e4e2f4e92630512e0dd7aa1ff4dd69a..cb3e894c55c6d0728ded9dd9fe95cf527958b140 100644 (file)
@@ -83,7 +83,7 @@ public class PackagesInstallerRunType extends RunType {
   @NotNull\r
   @Override\r
   public String describeParameters(@NotNull Map<String, String> parameters) {\r
-    return getDescription() + "\nSolution: " + parameters.get(SLN_PATH);\r
+    return "Solution: " + parameters.get(SLN_PATH);\r
   }\r
 \r
   @Override\r
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