本文整理匯總了Java中com.intellij.execution.configurations.GeneralCommandLine.setExePath方法的典型用法代碼示例。如果您正苦於以下問題:Java GeneralCommandLine.setExePath方法的具體用法?Java GeneralCommandLine.setExePath怎麽用?Java GeneralCommandLine.setExePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.execution.configurations.GeneralCommandLine
的用法示例。
在下文中一共展示了GeneralCommandLine.setExePath方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCommandLine
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
private GeneralCommandLine createCommandLine() throws Exception
{
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine
.withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
.withCharset(StandardCharsets.UTF_8)
.withWorkDirectory(project.getBasePath());
NodeJsLocalInterpreter interpreter = NodeJsLocalInterpreterManager
.getInstance()
.detectMostRelevant();
if (interpreter == null)
{
throw new Exception("Unable to create node-interpreter.");
}
// Move getSettings.js resource to .idea-folder within current project.
ensureJsFile();
commandLine.setExePath(interpreter.getInterpreterSystemDependentPath());
commandLine.addParameter(getJsFilePath());
commandLine.addParameter("roc-config");
return commandLine;
}
示例2: getProcessOutput
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
@NotNull
public static ProcessOutput getProcessOutput(final int timeout, @NotNull final String workDir,
@NotNull final String exePath,
@NotNull final String... arguments) throws ExecutionException {
if (!new File(workDir).isDirectory()
|| (!new File(exePath).canExecute()
&& !exePath.equals("java"))) {
return new ProcessOutput();
}
final GeneralCommandLine cmd = new GeneralCommandLine();
cmd.setWorkDirectory(workDir);
cmd.setExePath(exePath);
cmd.addParameters(arguments);
return execute(cmd, timeout);
}
示例3: generateCommandLine
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
protected GeneralCommandLine generateCommandLine() {
GeneralCommandLine commandLine = new GeneralCommandLine();
final LuaRunConfiguration cfg = (LuaRunConfiguration) runConfiguration;
if (cfg.isOverrideSDKInterpreter()) {
if (!StringUtil.isEmptyOrSpaces(cfg.getInterpreterPath()))
commandLine.setExePath(cfg.getInterpreterPath());
} else {
final Sdk sdk = cfg.getSdk();
if (sdk == null) {
fillInterpreterCommandLine(commandLine);
} else if (sdk.getSdkType() instanceof LuaSdkType) {
String sdkHomePath = StringUtil.notNullize(sdk.getHomePath());
String sdkInterpreter = getTopLevelExecutable(sdkHomePath).getAbsolutePath();
commandLine.setExePath(sdkInterpreter);
}
}
commandLine.getEnvironment().putAll(cfg.getEnvs());
commandLine.setPassParentEnvironment(cfg.isPassParentEnvs());
return configureCommandLine(commandLine);
}
示例4: dumpPdbGuidsToFile
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
public int dumpPdbGuidsToFile(Collection<File> files, File output, BuildProgressLogger buildLogger) throws IOException {
final GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(myExePath.getPath());
commandLine.addParameter(DUMP_SYMBOL_SIGN_CMD);
commandLine.addParameter(String.format("/o=%s", output.getPath()));
commandLine.addParameter(String.format("/i=%s", dumpPathsToFile(files).getPath()));
buildLogger.message(String.format("Running command %s", commandLine.getCommandLineString()));
final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
final String stdout = execResult.getStdout();
if(!stdout.isEmpty()){
buildLogger.message("Stdout: " + stdout);
}
final int exitCode = execResult.getExitCode();
if (exitCode != 0) {
buildLogger.warning(String.format("%s ends with non-zero exit code %s.", SYMBOLS_EXE, execResult));
buildLogger.warning("Stdout: " + stdout);
buildLogger.warning("Stderr: " + execResult.getStderr());
final Throwable exception = execResult.getException();
if(exception != null){
buildLogger.exception(exception);
}
}
return exitCode;
}
示例5: createRshCommand
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
private static GeneralCommandLine createRshCommand(String host, String userName, ExtConfiguration config) {
GeneralCommandLine command = new GeneralCommandLine();
command.setExePath(config.CVS_RSH);
command.addParameter(host);
command.addParameter("-l");
command.addParameter(userName);
if (!config.PRIVATE_KEY_FILE.isEmpty()) {
command.addParameter("-i");
command.addParameter(config.PRIVATE_KEY_FILE);
}
if (!config.ADDITIONAL_PARAMETERS.isEmpty()) {
StringTokenizer parameters = new StringTokenizer(config.ADDITIONAL_PARAMETERS, " ");
while (parameters.hasMoreTokens()) command.addParameter(parameters.nextToken());
}
return command;
}
示例6: doCheckExecutable
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
protected static boolean doCheckExecutable(@NotNull String executable, @NotNull List<String> processParameters) {
try {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(executable);
commandLine.addParameters(processParameters);
CapturingProcessHandler handler = new CapturingProcessHandler(commandLine.createProcess(), CharsetToolkit.getDefaultSystemCharset());
ProcessOutput result = handler.runProcess(TIMEOUT_MS);
boolean timeout = result.isTimeout();
int exitCode = result.getExitCode();
String stderr = result.getStderr();
if (timeout) {
LOG.warn("Validation of " + executable + " failed with a timeout");
}
if (exitCode != 0) {
LOG.warn("Validation of " + executable + " failed with a non-zero exit code: " + exitCode);
}
if (!stderr.isEmpty()) {
LOG.warn("Validation of " + executable + " failed with a non-empty error output: " + stderr);
}
return !timeout && exitCode == 0 && stderr.isEmpty();
}
catch (Throwable t) {
LOG.warn(t);
return false;
}
}
示例7: GitHandler
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
/**
* A constructor
*
* @param project a project
* @param directory a process directory
* @param command a command to execute (if empty string, the parameter is ignored)
*/
protected GitHandler(@NotNull Project project, @NotNull File directory, @NotNull GitCommand command) {
myProject = project;
myCommand = command;
myAppSettings = GitVcsApplicationSettings.getInstance();
myProjectSettings = GitVcsSettings.getInstance(myProject);
myEnv = new HashMap<String, String>(EnvironmentUtil.getEnvironmentMap());
myVcs = ObjectUtils.assertNotNull(GitVcs.getInstance(project));
myWorkingDirectory = directory;
myCommandLine = new GeneralCommandLine();
if (myAppSettings != null) {
myCommandLine.setExePath(myAppSettings.getPathToGit());
}
myCommandLine.setWorkDirectory(myWorkingDirectory);
if (GitVersionSpecialty.CAN_OVERRIDE_GIT_CONFIG_FOR_COMMAND.existsIn(myVcs.getVersion())) {
myCommandLine.addParameters("-c", "core.quotepath=false");
}
myCommandLine.addParameter(command.name());
myStdoutSuppressed = true;
mySilent = myCommand.lockingPolicy() == GitCommand.LockingPolicy.READ;
}
示例8: runGradleCI
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
public static void runGradleCI(Project project, String... params) {
String path = RNPathUtil.getRNProjectPath(project);
String gradleLocation = RNPathUtil.getAndroidProjectPath(path);
if (gradleLocation == null) {
NotificationUtils.gradleFileNotFound();
} else {
GeneralCommandLine commandLine = new GeneralCommandLine();
// ExecutionEnvironment environment = getEnvironment();
commandLine.setWorkDirectory(gradleLocation);
commandLine.setExePath("." + File.separator + "gradlew");
commandLine.addParameters(params);
// try {
//// Process process = commandLine.createProcess();
// OSProcessHandler processHandler = new KillableColoredProcessHandler(commandLine);
// RunnerUtil.showHelperProcessRunContent("Update AAR", processHandler, project, DefaultRunExecutor.getRunExecutorInstance());
// // Run
// processHandler.startNotify();
// } catch (ExecutionException e) {
// e.printStackTrace();
// NotificationUtils.errorNotification("Can't execute command: " + e.getMessage());
// }
// commands process
try {
processCommandline(project, commandLine);
} catch (ExecutionException e) {
e.printStackTrace();
}
}
}
示例9: build
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
public static void build(Project project) {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setWorkDirectory(project.getBasePath());
commandLine.setExePath("python");
commandLine.addParameter("freeline.py");
// debug
commandLine.addParameter("-d");
// commands process
try {
processCommandline(project, commandLine);
} catch (ExecutionException e) {
e.printStackTrace();
}
}
示例10: getProtractorRunCommand
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
private GeneralCommandLine getProtractorRunCommand(@NotNull Config config) {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(config.getProtractorCmdPath());
commandLine.setWorkDirectory(project.getBasePath());
commandLine.addParameter(config.getProtractorConfigJsPath());
StringBuilder specArg = new StringBuilder().append("--specs=").append(config.getFeaturesDirPath()).append("/").append(fileName);
if(icon == SCENARIO_ICON) {
specArg.append(":").append(line + 1);
}
commandLine.addParameter(specArg.toString());
return commandLine;
}
示例11: runDetectionScript
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
/**
* Runs detection script
*
* @param executablePath executable to run script with
* @param detectionScriptPath file containing detection script
* @return lines from stdout
* @throws ExecutionException if there was an error during execution
*/
List<String> runDetectionScript(@NotNull final String executablePath, @NotNull final String detectionScriptPath) throws ExecutionException {
final GeneralCommandLine cl = new GeneralCommandLine();
cl.setExePath(executablePath);
cl.addParameter("-NoProfile");
cl.addParameter("-File");
cl.addParameter(detectionScriptPath);
if (LOG.isDebugEnabled()) {
LOG.debug("Running detection script using command line: " + cl.getCommandLineString());
}
final ProcessOutput execResult = runProcess(cl);
return execResult.getStdoutLines();
}
示例12: enableExecution
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
private static void enableExecution(@NotNull final File filePath) {
final GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath("chmod");
commandLine.addParameter("+x");
commandLine.addParameter(filePath.getName());
commandLine.setWorkDirectory(filePath.getParent());
final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
if (execResult.getExitCode() != 0) {
LOG.warn("Failed to set executable attribute for " + filePath + ": chmod +x exit code is " + execResult.getExitCode());
}
}
示例13: isExistedTool
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
/**
* Returns True if Existed Tool myConfigName
* @return
*/
public boolean isExistedTool(){
final GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(myToolName);
commandLine.addParameter(myVersionArg);
final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, (byte[])null);
if (execResult.getExitCode() == 0){
myVersion = findVersion(stringArrayToString(execResult.getOutLines()));
}
return execResult.getExitCode() == 0;
}
示例14: enableExecution
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
/**
* Set executable attribute for file.
* @param filePath File to be setted executable attribute
* @param baseDir Directory to be setted Work Directory
*/
private static void enableExecution(@NotNull final String filePath, @NotNull final String baseDir) {
final GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath("chmod");
commandLine.addParameter("+x");
commandLine.addParameter(filePath);
commandLine.setWorkDirectory(baseDir);
final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
if(execResult.getExitCode() != 0) {
Loggers.AGENT.warn("Failed to set executable attribute for " + filePath + ": chmod +x exit code is " + execResult.getExitCode());
}
}
示例15: createCheckProcess
import com.intellij.execution.configurations.GeneralCommandLine; //導入方法依賴的package包/類
Process createCheckProcess(@NotNull final Project project, @NotNull final String executablePath) throws ExecutionException {
final Sdk sdk = PythonSdkType.findPythonSdk(ModuleManager.getInstance(project).getModules()[0]);
PyEduPluginConfigurator configurator = new PyEduPluginConfigurator();
String testsFileName = configurator.getTestFileName();
if (myTask instanceof TaskWithSubtasks) {
testsFileName = FileUtil.getNameWithoutExtension(testsFileName);
int index = ((TaskWithSubtasks)myTask).getActiveSubtaskIndex();
testsFileName += EduNames.SUBTASK_MARKER + index + "." + FileUtilRt.getExtension(configurator.getTestFileName());
}
final File testRunner = new File(myTaskDir.getPath(), testsFileName);
myCommandLine = new GeneralCommandLine();
myCommandLine.withWorkDirectory(myTaskDir.getPath());
final Map<String, String> env = myCommandLine.getEnvironment();
final VirtualFile courseDir = project.getBaseDir();
if (courseDir != null) {
env.put(PYTHONPATH, courseDir.getPath());
}
if (sdk != null) {
String pythonPath = sdk.getHomePath();
if (pythonPath != null) {
myCommandLine.setExePath(pythonPath);
myCommandLine.addParameter(testRunner.getPath());
myCommandLine.addParameter(FileUtil.toSystemDependentName(executablePath));
return myCommandLine.createProcess();
}
}
return null;
}