2 * Copyright 2000-2011 JetBrains s.r.o.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package jetbrains.buildServer.nuget.server.pack;
\r
19 import jetbrains.buildServer.agent.ServerProvidedProperties;
\r
20 import jetbrains.buildServer.nuget.common.PackagesConstants;
\r
21 import jetbrains.buildServer.serverSide.InvalidProperty;
\r
22 import jetbrains.buildServer.serverSide.PropertiesProcessor;
\r
23 import jetbrains.buildServer.serverSide.RunType;
\r
24 import jetbrains.buildServer.web.openapi.PluginDescriptor;
\r
25 import org.jetbrains.annotations.NotNull;
\r
27 import java.util.ArrayList;
\r
28 import java.util.Collection;
\r
29 import java.util.HashMap;
\r
30 import java.util.Map;
\r
33 * @author Eugene Petrenko (eugene.petrenko@gmail.com)
\r
34 * Date: 22.08.11 21:05
\r
36 public class PackRunType extends RunType {
\r
37 private final PluginDescriptor myDescriptor;
\r
39 public PackRunType(@NotNull final PluginDescriptor descriptor) {
\r
40 myDescriptor = descriptor;
\r
45 public String getType() {
\r
46 return PackagesConstants.PACK_RUN_TYPE;
\r
50 public String getDisplayName() {
\r
51 return "NuGet Packages Pack";
\r
55 public String getDescription() {
\r
56 return "Creates NuGet package from a given spec file";
\r
60 public PropertiesProcessor getRunnerPropertiesProcessor() {
\r
61 return new PropertiesProcessor() {
\r
62 public Collection<InvalidProperty> process(Map<String, String> properties) {
\r
63 final ArrayList<InvalidProperty> result = new ArrayList<InvalidProperty>();
\r
70 public String getEditRunnerParamsJspFilePath() {
\r
71 return myDescriptor.getPluginResourcesPath("pack/editPack.jsp");
\r
75 public String getViewRunnerParamsJspFilePath() {
\r
76 return myDescriptor.getPluginResourcesPath("pack/viewPack.jsp");
\r
80 public Map<String, String> getDefaultRunnerProperties() {
\r
81 return new HashMap<String, String>(){{
\r
82 put(PackagesConstants.NUGET_PACK_VERSION, "%" + ServerProvidedProperties.BUILD_NUMBER_PROP + "%");
\r