Search in sources :

Example 1 with PluginNotInstalledException

use of com.thoughtworks.gauge.PluginNotInstalledException in project Intellij-Plugin by getgauge.

the class GaugeLibHelper method gaugeLib.

private ProjectLib gaugeLib(Module module) {
    String libRoot;
    try {
        GaugeService gaugeService = Gauge.getGaugeService(module, true);
        if (gaugeService == null) {
            gaugeService = GaugeModuleComponent.createGaugeService(module);
        }
        GaugeConnection gaugeConnection = gaugeService.getGaugeConnection();
        if (gaugeConnection == null) {
            throw new IOException("Gauge api connection not established");
        }
        libRoot = gaugeConnection.getLibPath("java");
    } catch (IOException e) {
        System.err.println("Could not add gauge lib, add it manually: " + e.getMessage());
        LOG.debug("Could not add gauge lib, add it manually: " + e.getMessage());
        return null;
    } catch (PluginNotInstalledException e) {
        throw new RuntimeException("Gauge " + JAVA + " plugin is not installed.");
    }
    return new ProjectLib(GAUGE_LIB, new File(libRoot));
}
Also used : GaugeService(com.thoughtworks.gauge.core.GaugeService) GaugeConnection(com.thoughtworks.gauge.connection.GaugeConnection) IOException(java.io.IOException) PluginNotInstalledException(com.thoughtworks.gauge.PluginNotInstalledException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PluginNotInstalledException (com.thoughtworks.gauge.PluginNotInstalledException)1 GaugeConnection (com.thoughtworks.gauge.connection.GaugeConnection)1 GaugeService (com.thoughtworks.gauge.core.GaugeService)1 File (java.io.File)1 IOException (java.io.IOException)1