add nuget screenshots and sources
authorEugene.Petrenko <eugene.petrenko@gmail.com>
Wed, 6 Jul 2011 08:46:46 +0000 (12:46 +0400)
committerEugene.Petrenko <eugene.petrenko@gmail.com>
Wed, 6 Jul 2011 08:46:46 +0000 (12:46 +0400)
nuget-server/resources/NuGetBuild.jsp [new file with mode: 0644]
nuget-server/resources/NuGetFetch.jsp [new file with mode: 0644]
nuget-server/resources/NuGetTrigger.jsp [new file with mode: 0644]
nuget-server/resources/editNuGet.jsp [new file with mode: 0644]
nuget-server/src/META-INF/build-server-plugin-nuget.xml [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadFeature.java [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadedPackagesTab.java [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/NuGetPublishRunType.java [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/NuGetTrigger.java [new file with mode: 0644]

diff --git a/nuget-server/resources/NuGetBuild.jsp b/nuget-server/resources/NuGetBuild.jsp
new file mode 100644 (file)
index 0000000..786c614
--- /dev/null
@@ -0,0 +1,20 @@
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+<jsp:useBean id="nugetPackages" scope="request" type="java.util.Map<java.lang.String, java.lang.String>"/>\r
+\r
+This is the list of all NuGet packages that were downloaded for the build.\r
+\r
+<table class="runnerFormTable" style="width:40em">\r
+  <thead>\r
+    <th>Package Name</th>\r
+    <th>Package Version</th>\r
+  </thead>\r
+<c:forEach var="it" items="${nugetPackages}">\r
+  <tr>\r
+    <td><a href="http://somewhere">${it.key}</a></td>\r
+    <td>${it.value}</td>\r
+  </tr>\r
+</c:forEach>\r
+</table>
\ No newline at end of file
diff --git a/nuget-server/resources/NuGetFetch.jsp b/nuget-server/resources/NuGetFetch.jsp
new file mode 100644 (file)
index 0000000..537c732
--- /dev/null
@@ -0,0 +1,34 @@
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+\r
+<%--\r
+<l:settingsGroup title="Install packages">\r
+<tr>\r
+  <th>Install packages:</th>\r
+  <td>\r
+    <props:multilineProperty name="nuget.packages" linkTitle="Expand" cols="70" rows="5"/>\r
+    <span class="smallNote">Specify packages to install before the build</span>\r
+  </td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>Destination Path:</th>\r
+  <td>\r
+    <props:textProperty name="nuget.destination.path" className="longField"/>\r
+    <span class="smallNote">Specify folder where to install NuGet packages</span>\r
+  </td>\r
+</tr>\r
+</l:settingsGroup>\r
+--%>\r
+\r
+<l:settingsGroup title="Update packages">\r
+<tr>\r
+  <th>Packages repository path:</th>\r
+  <td>\r
+    <props:textProperty name="nuget.repositofies.config" className="longField"/>\r
+    <span class="smallNote">Specify path to NuGet repositories.config file under solution</span>\r
+  </td>\r
+</tr>\r
+</l:settingsGroup>
\ No newline at end of file
diff --git a/nuget-server/resources/NuGetTrigger.jsp b/nuget-server/resources/NuGetTrigger.jsp
new file mode 100644 (file)
index 0000000..a069af9
--- /dev/null
@@ -0,0 +1,13 @@
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+\r
+\r
+<tr>\r
+  <th>Packages repository path:</th>\r
+  <td>\r
+    <props:textProperty name="nuget.repositofies.config" className="longField"/>\r
+    <span class="smallNote">Specify path to repositories.config to list packages to monitor</span>\r
+  </td>\r
+</tr>\r
diff --git a/nuget-server/resources/editNuGet.jsp b/nuget-server/resources/editNuGet.jsp
new file mode 100644 (file)
index 0000000..54c0df6
--- /dev/null
@@ -0,0 +1,25 @@
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+\r
+<tr>\r
+  <th>NuGet .nuspec path:</th>\r
+  <td><props:textProperty name="nuget.package.spec.path" className="longField"/>\r
+    <span class="smallNote">Specify path to NuGet specifications file (.nuspec)</span>\r
+  </td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>Upload:</th>\r
+  <td>\r
+    <props:selectProperty name="nuget.upload.mode">\r
+      <props:option value="">No Upload</props:option>\r
+      <props:option value="artifact">Publish as build artifact</props:option>\r
+      <props:option value="local">Publish to local package repository</props:option>\r
+      <props:option value="nuget.org">Upload to NuGet.org</props:option>\r
+      <props:option value="nuget.org">Upload to custom server</props:option>\r
+    </props:selectProperty>\r
+    <span class="smallNote">Specify way to publish NuGet package</span>\r
+  </td>\r
+</tr>\r
diff --git a/nuget-server/src/META-INF/build-server-plugin-nuget.xml b/nuget-server/src/META-INF/build-server-plugin-nuget.xml
new file mode 100644 (file)
index 0000000..d2be1be
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       default-autowire="constructor">\r
+\r
+  <bean class="jetbrains.buildServer.nuget.server.NuGetPublishRunType"/>\r
+  <bean class="jetbrains.buildServer.nuget.server.NuGetDownloadedPackagesTab"/>\r
+  <bean class="jetbrains.buildServer.nuget.server.NuGetDownloadFeature"/>\r
+  <bean class="jetbrains.buildServer.nuget.server.NuGetTrigger"/>\r
+\r
+</beans>
\ No newline at end of file
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadFeature.java b/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadFeature.java
new file mode 100644 (file)
index 0000000..bfdca86
--- /dev/null
@@ -0,0 +1,34 @@
+package jetbrains.buildServer.nuget.server;\r
+\r
+import jetbrains.buildServer.serverSide.BuildFeature;\r
+import jetbrains.buildServer.web.openapi.PluginDescriptor;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+/**\r
+ * Created Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * date: 28.04.11\r
+ */\r
+public class NuGetDownloadFeature extends BuildFeature {\r
+  private final PluginDescriptor myDescriptor;\r
+\r
+  public NuGetDownloadFeature(final PluginDescriptor descriptor) {\r
+    myDescriptor = descriptor;\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String getType() {\r
+    return "NuGet.Download";\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String getDisplayName() {\r
+    return "NuGet Dependency Download";\r
+  }\r
+\r
+  @Override\r
+  public String getEditParametersUrl() {\r
+    return myDescriptor.getPluginResourcesPath("NuGetFetch.jsp");\r
+  }\r
+}\r
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadedPackagesTab.java b/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetDownloadedPackagesTab.java
new file mode 100644 (file)
index 0000000..aed2548
--- /dev/null
@@ -0,0 +1,46 @@
+package jetbrains.buildServer.nuget.server;\r
+\r
+import java.util.Map;\r
+import java.util.TreeMap;\r
+import javax.servlet.http.HttpServletRequest;\r
+import jetbrains.buildServer.serverSide.SBuild;\r
+import jetbrains.buildServer.serverSide.SBuildServer;\r
+import jetbrains.buildServer.web.openapi.PagePlaces;\r
+import jetbrains.buildServer.web.openapi.PluginDescriptor;\r
+import jetbrains.buildServer.web.openapi.ViewLogTab;\r
+import org.jetbrains.annotations.NotNull;\r
+import org.jetbrains.annotations.Nullable;\r
+\r
+/**\r
+ * Created Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * date: 28.04.11\r
+ */\r
+public class NuGetDownloadedPackagesTab extends ViewLogTab {\r
+  public NuGetDownloadedPackagesTab(@NotNull final PagePlaces pagePlaces,\r
+                                    @NotNull final SBuildServer server,\r
+                                    @NotNull final PluginDescriptor descriptor) {\r
+    super("NuGet Packages", "xxx", pagePlaces, server);\r
+    setIncludeUrl(descriptor.getPluginResourcesPath("NuGetBuild.jsp"));\r
+    register();\r
+  }\r
+\r
+  @Override\r
+  public boolean isAvailable(@NotNull final HttpServletRequest request) {\r
+    final SBuild build = getBuild(request);\r
+    return super.isAvailable(request) && build != null && build.getParametersProvider().get("nuget.packages") != null;\r
+  }\r
+\r
+  @Override\r
+  protected void fillModel(final Map model, final HttpServletRequest request, @Nullable final SBuild build) {\r
+    final Map<String, String> packages = new TreeMap<String, String>();\r
+    packages.put("ELMAH", "1.2.0");\r
+    packages.put("Antlr", "4.0.0");\r
+    packages.put("EasyHTTP", "1.1");\r
+    packages.put("JsonFX", "2.0");\r
+    packages.put("structuremap", "2.6.2");\r
+    packages.put("Awsome", "1.5.0");\r
+\r
+    //noinspection unchecked\r
+    model.put("nugetPackages", packages);\r
+  }\r
+}\r
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetPublishRunType.java b/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetPublishRunType.java
new file mode 100644 (file)
index 0000000..5d9dabd
--- /dev/null
@@ -0,0 +1,58 @@
+package jetbrains.buildServer.nuget.server;\r
+\r
+import java.util.Map;\r
+import jetbrains.buildServer.serverSide.PropertiesProcessor;\r
+import jetbrains.buildServer.serverSide.RunType;\r
+import jetbrains.buildServer.serverSide.RunTypeRegistry;\r
+import jetbrains.buildServer.web.openapi.PluginDescriptor;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+/**\r
+ * Created Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * date: 28.04.11\r
+ */\r
+public class NuGetPublishRunType extends RunType {\r
+  private final PluginDescriptor myPluginDescriptor;\r
+\r
+  public NuGetPublishRunType(@NotNull final PluginDescriptor pluginDescriptor,\r
+                             @NotNull final RunTypeRegistry registry) {\r
+    myPluginDescriptor = pluginDescriptor;\r
+    registry.registerRunType(this);\r
+  }\r
+\r
+  @Override\r
+  public String getEditRunnerParamsJspFilePath() {\r
+    return myPluginDescriptor.getPluginResourcesPath("editNuGet.jsp");\r
+  }\r
+\r
+  @Override\r
+  public String getViewRunnerParamsJspFilePath() {\r
+    return null;\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String getType() {\r
+    return "NuGet";\r
+  }\r
+\r
+  @Override\r
+  public String getDisplayName() {\r
+    return "NuGet Package";\r
+  }\r
+\r
+  @Override\r
+  public String getDescription() {\r
+    return "Generates NuGet package from a given package specification (.nuspec) file";\r
+  }\r
+\r
+  @Override\r
+  public PropertiesProcessor getRunnerPropertiesProcessor() {\r
+    return null;\r
+  }\r
+\r
+  @Override\r
+  public Map<String, String> getDefaultRunnerProperties() {\r
+    return null;\r
+  }\r
+}\r
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetTrigger.java b/nuget-server/src/jetbrains/buildServer/nuget/server/NuGetTrigger.java
new file mode 100644 (file)
index 0000000..4eb6ceb
--- /dev/null
@@ -0,0 +1,50 @@
+package jetbrains.buildServer.nuget.server;\r
+\r
+import jetbrains.buildServer.buildTriggers.*;\r
+import jetbrains.buildServer.web.openapi.PluginDescriptor;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+/**\r
+ * @author Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ *         Date: 03.05.11 15:25\r
+ */\r
+public class NuGetTrigger extends BuildTriggerService {\r
+  private final PluginDescriptor myDescriptor;\r
+\r
+  public NuGetTrigger(final PluginDescriptor descriptor) {\r
+    myDescriptor = descriptor;\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String getName() {\r
+    return "NuGet";\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String getDisplayName() {\r
+    return "NuGet Dependency Trigger";\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public String describeTrigger(@NotNull final BuildTriggerDescriptor trigger) {\r
+    return "Trigger build on NuGet dependency change";\r
+  }\r
+\r
+  @NotNull\r
+  @Override\r
+  public BuildTriggeringPolicy getBuildTriggeringPolicy() {\r
+    return new PolledBuildTrigger() {\r
+      @Override\r
+      public void triggerBuild(@NotNull final PolledTriggerContext context) throws BuildTriggerException {\r
+      }\r
+    };\r
+  }\r
+\r
+  @Override\r
+  public String getEditParametersUrl() {\r
+    return myDescriptor.getPluginResourcesPath("NuGetTrigger.jsp");\r
+  }\r
+}\r