本文整理汇总了Java中com.intellij.execution.ExecutionException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionException.printStackTrace方法的具体用法?Java ExecutionException.printStackTrace怎么用?Java ExecutionException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ExecutionException
的用法示例。
在下文中一共展示了ExecutionException.printStackTrace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listDevices
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
@Test
public void listDevices() {
System.out.println(
System.getProperty("user.home"));
// System.getProperties().list(System.out);
GeneralCommandLine commandLine = RNPathUtil.cmdToGeneralCommandLine(IOSDevicesParser.LIST_Simulator_JSON);
try {
String json = ExecUtil.execAndGetOutput(commandLine).getStdout();
System.out.println("json=" + json);
Simulators result = new Gson().fromJson(json, Simulators.class);
System.out.println(result.devices.keySet());
System.out.println(result.devices.get("iOS 10.3")[0]);
} catch (ExecutionException e) {
e.printStackTrace();
NotificationUtils.errorNotification( "xcrun invocation failed. Please check that Xcode is installed." );
}
}
示例2: parseCurrentPathFromRNConsoleJsonFile
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
@Test
public void parseCurrentPathFromRNConsoleJsonFile() {
// System.out.println(
// System.getProperty("user.home"));
// System.getProperties().list(System.out);
GeneralCommandLine commandLine = RNPathUtil.cmdToGeneralCommandLine(IOSDevicesParser.LIST_DEVICES);
try {
String json = ExecUtil.execAndGetOutput(commandLine).getStdout();
System.out.println(json);
Arrays.asList(json.split("\n")).forEach(line -> {
System.out.println(line);
// Pattern pattern = Pattern
// .compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+$");
boolean device = line.matches("^(.*?) \\((.*?)\\)\\ \\[(.*?)\\]");
System.out.println("device=" + device);
// String noSimulator = line.match(/(.*?) \((.*?)\) \[(.*?)\] \((.*?)\)/);
});
} catch (ExecutionException e) {
e.printStackTrace();
NotificationUtils.errorNotification( "xcrun invocation failed. Please check that Xcode is installed." );
return;
}
}
示例3: runGradleCI
import com.intellij.execution.ExecutionException; //导入方法依赖的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();
}
}
}
示例4: build
import com.intellij.execution.ExecutionException; //导入方法依赖的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();
}
}
示例5: testVersion
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
@Test
public void testVersion() {
SassLintRunner.SassLintSettings settings = createSettings();
try {
String out = SassLintRunner.runVersion(settings);
assertEquals("version should be", "1.4.0", out);
} catch (ExecutionException e) {
e.printStackTrace();
}
}
示例6: getAllIOSDevicesList
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
/**
* All devices include simulator.
* @param noSimulator 是否不包含模拟器
* @return
*/
public static List<IOSDeviceInfo> getAllIOSDevicesList(boolean noSimulator) {
List<IOSDeviceInfo> deviceInfos = new ArrayList<>();
GeneralCommandLine commandLine = RNPathUtil.createFullPathCommandLine(IOSDevicesParser.LIST_DEVICES, null);
try {
String json = ExecUtil.execAndGetOutput(commandLine).getStdout();
String regex = "/(.*?) \\((.*?)\\) \\[(.*?)\\]/";
String simulatorRegex = "/(.*?) \\((.*?)\\) \\[(.*?)\\] \\((.*?)\\)/";
Arrays.asList(json.split("\n")).forEach(line -> {
// System.out.println("parsing " + line);
String[] device = JSExec.jsMatchExpr(line, regex);
String[] noSimulatorDevice = null;
if(device != null) {
// System.out.println("result = " + device[1]);
IOSDeviceInfo deviceInfo = new IOSDeviceInfo();
deviceInfo.name = device[1];
deviceInfo.version = device[2];
deviceInfo.udid = device[3];
// noSimulatorDevice = JSExec.jsMatchExpr(line, simulatorRegex);
// deviceInfo.simulator = (noSimulatorDevice != null);
deviceInfo.simulator = line.endsWith("(Simulator)");// To enable quick exec
if(noSimulator) {
if(!deviceInfo.simulator) {
deviceInfos.add(deviceInfo);
}
} else {
deviceInfos.add(deviceInfo);
}
}
});
} catch (ExecutionException e) {
e.printStackTrace();
NotificationUtils.errorNotification( "xcrun invocation failed. Please check that Xcode is installed." );
return null;
}
return deviceInfos;
}