当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionException.printStackTrace方法代码示例

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

    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:21,代码来源:TestParseIOSDevices.java

示例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;
        }
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:26,代码来源:TestParseIOSDevices.java

示例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();
            }
        }
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:32,代码来源:RNUtil.java

示例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();
    }
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:16,代码来源:RNUtil.java

示例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();
    }
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:11,代码来源:SassLintRunnerTest.java

示例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;
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:48,代码来源:IOSDevicesParser.java


注:本文中的com.intellij.execution.ExecutionException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。