12
|
1 /*
|
|
2 * Copyright 2000-2013 JetBrains s.r.o.
|
|
3 *
|
|
4 * Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 * you may not use this file except in compliance with the License.
|
|
6 * You may obtain a copy of the License at
|
|
7 *
|
|
8 * http://www.apache.org/licenses/LICENSE-2.0
|
|
9 *
|
|
10 * Unless required by applicable law or agreed to in writing, software
|
|
11 * distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 * See the License for the specific language governing permissions and
|
|
14 * limitations under the License.
|
|
15 */
|
|
16
|
|
17 package jetbrains.buildServer.symbols;
|
|
18
|
|
19 import com.intellij.execution.configurations.GeneralCommandLine;
|
|
20 import jetbrains.buildServer.ExecResult;
|
|
21 import jetbrains.buildServer.SimpleCommandLineProcessRunner;
|
|
22
|
|
23 import java.io.File;
|
|
24
|
|
25 /**
|
|
26 * @author Evgeniy.Koshkin
|
|
27 */
|
|
28 public class PdbStrExe {
|
|
29
|
|
30 public static final String SRCSRV_STREAM_NAME = "srcsrv";
|
|
31
|
|
32 private static final String STREAM_NAME_SWITCH = "-s";
|
|
33 private static final String PATH_TO_PDB_FILE_SWITCH = "-p";
|
|
34 private static final String PATH_TO_INPUT_FILE_SWITCH = "-i";
|
|
35
|
|
36 private final File myPath = new File("c:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x64\\srcsrv\\pdbstr.exe");
|
|
37
|
|
38 public ExecResult doCommand(final PdbStrExeCommand cmd, final File pdbFile, final File inputStreamFile, final String streamName){
|
|
39 final GeneralCommandLine commandLine = new GeneralCommandLine();
|
|
40 commandLine.setWorkDirectory(myPath.getParent());
|
|
41 commandLine.setExePath(myPath.getPath());
|
|
42 commandLine.addParameter(cmd.getCmdSwitch());
|
|
43 commandLine.addParameter(String.format("%s:%s", PATH_TO_PDB_FILE_SWITCH, pdbFile.getAbsolutePath()));
|
|
44 commandLine.addParameter(String.format("%s:%s", PATH_TO_INPUT_FILE_SWITCH, inputStreamFile.getAbsolutePath()));
|
|
45 commandLine.addParameter(STREAM_NAME_SWITCH + ":" + streamName);
|
|
46 return SimpleCommandLineProcessRunner.runCommand(commandLine, null);
|
|
47 }
|
|
48 }
|