add stub classes for agent runner
authorEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 11:19:49 +0000 (15:19 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 11:53:27 +0000 (15:53 +0400)
nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishCommandlineBuildServiceFactory.java [new file with mode: 0644]
nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishService.java [new file with mode: 0644]

diff --git a/nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishCommandlineBuildServiceFactory.java b/nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishCommandlineBuildServiceFactory.java
new file mode 100644 (file)
index 0000000..6809341
--- /dev/null
@@ -0,0 +1,62 @@
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.agent.publish;\r
+\r
+import com.intellij.openapi.diagnostic.Logger;\r
+import jetbrains.buildServer.agent.AgentBuildRunnerInfo;\r
+import jetbrains.buildServer.agent.BuildAgentConfiguration;\r
+import jetbrains.buildServer.agent.runner.CommandLineBuildService;\r
+import jetbrains.buildServer.agent.runner.CommandLineBuildServiceFactory;\r
+import jetbrains.buildServer.nuget.common.DotNetConstants;\r
+import jetbrains.buildServer.nuget.common.PackagesConstants;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 21.07.11 15:15\r
+ */\r
+public class PublishCommandlineBuildServiceFactory implements CommandLineBuildServiceFactory, AgentBuildRunnerInfo {\r
+  private static final Logger LOG = Logger.getInstance(PublishCommandlineBuildServiceFactory.class.getName());\r
+  @NotNull\r
+  public CommandLineBuildService createService() {\r
+    return null;\r
+  }\r
+\r
+  @NotNull\r
+  public AgentBuildRunnerInfo getBuildRunnerInfo() {\r
+    return this;\r
+  }\r
+\r
+  @NotNull\r
+  public String getType() {\r
+    return PackagesConstants.PUBLISH_RUN_TYPE;\r
+  }\r
+\r
+  public boolean canRun(@NotNull BuildAgentConfiguration agentConfiguration) {\r
+    if (!agentConfiguration.getSystemInfo().isWindows()) {\r
+      LOG.warn("NuGet packages installer available only under windows");\r
+      return false;\r
+    }\r
+\r
+    if (!agentConfiguration.getConfigurationParameters().containsKey(DotNetConstants.DOT_NET_FRAMEWORK_4_x86)) {\r
+      LOG.warn("NuGet requires .NET Framework 4.0 x86 installed");\r
+      return false;\r
+    }\r
+\r
+    return true;\r
+  }\r
+}
\ No newline at end of file
diff --git a/nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishService.java b/nuget-agent/src/jetbrains/buildServer/nuget/agent/publish/PublishService.java
new file mode 100644 (file)
index 0000000..7231d0a
--- /dev/null
@@ -0,0 +1,34 @@
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.agent.publish;\r
+\r
+import jetbrains.buildServer.RunBuildException;\r
+import jetbrains.buildServer.agent.runner.BuildServiceAdapter;\r
+import jetbrains.buildServer.agent.runner.ProgramCommandLine;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 21.07.11 15:17\r
+ */\r
+public class PublishService extends BuildServiceAdapter {\r
+  @NotNull\r
+  @Override\r
+  public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {\r
+    return null;\r
+  }\r
+}\r