本文整理汇总了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;
}