+/*\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.util;\r
\r
import jetbrains.buildServer.RunBuildException;\r
import jetbrains.buildServer.agent.BuildProcess;\r
import jetbrains.buildServer.agent.BuildRunnerContext;\r
-import jetbrains.buildServer.agent.runner.ProgramCommandLine;\r
import org.jetbrains.annotations.NotNull;\r
\r
+import java.io.File;\r
+import java.util.Collection;\r
+\r
/**\r
* Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
* Date: 07.07.11 15:36\r
*/\r
public interface CommandlineBuildProcessFactory {\r
BuildProcess executeCommandLine(@NotNull BuildRunnerContext hostContext,\r
- @NotNull ProgramCommandLine cmd) throws RunBuildException;\r
+ @NotNull File program,\r
+ @NotNull Collection<String> argz,\r
+ @NotNull File workingDir) throws RunBuildException;\r
}\r
import jetbrains.buildServer.agent.BuildProcess;\r
import jetbrains.buildServer.agent.BuildProcessFacade;\r
import jetbrains.buildServer.agent.BuildRunnerContext;\r
-import jetbrains.buildServer.agent.runner.ProgramCommandLine;\r
import jetbrains.buildServer.nuget.agent.util.CommandlineBuildProcessFactory;\r
import jetbrains.buildServer.runner.SimpleRunnerConstants;\r
import org.jetbrains.annotations.NotNull;\r
\r
+import java.io.File;\r
import java.util.Collection;\r
-import java.util.Map;\r
\r
/**\r
* Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
myFacade = facade;\r
}\r
\r
- public BuildProcess executeCommandLine(@NotNull final BuildRunnerContext hostContext,\r
- @NotNull final ProgramCommandLine cmd) throws RunBuildException {\r
+ public BuildProcess executeCommandLine(@NotNull BuildRunnerContext hostContext,\r
+ @NotNull File program,\r
+ @NotNull Collection<String> argz,\r
+ @NotNull File workingDir) throws RunBuildException {\r
BuildRunnerContext context = myFacade.createBuildRunnerContext(\r
hostContext.getBuild(),\r
SimpleRunnerConstants.TYPE,\r
- cmd.getWorkingDirectory(),\r
+ workingDir.getPath(),\r
hostContext\r
);\r
\r
- context.addRunnerParameter(SimpleRunnerConstants.COMMAND_EXECUTABLE, cmd.getExecutablePath());\r
- context.addRunnerParameter(SimpleRunnerConstants.COMMAND_PARAMETERS, joinCommandLineArguments(cmd.getArguments()));\r
-\r
- for (Map.Entry<String, String> e : cmd.getEnvironment().entrySet()) {\r
- context.addEnvironmentVariable(e.getKey(), e.getValue());\r
- }\r
+ context.addRunnerParameter(SimpleRunnerConstants.COMMAND_EXECUTABLE, program.getPath());\r
+ context.addRunnerParameter(SimpleRunnerConstants.COMMAND_PARAMETERS, joinCommandLineArguments(argz));\r
\r
return myFacade.createExecutable(hostContext.getBuild(), context);\r
}\r