Package org.gradle.api.plugins

Examples of org.gradle.api.plugins.UnknownPluginException


            return implClass;
        }

        URL resource = classLoader.getResource(String.format("META-INF/gradle-plugins/%s.properties", pluginId));
        if (resource == null) {
            throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");
        }

        Properties properties = GUtil.loadProperties(resource);
        String implClassName = properties.getProperty("implementation-class");
        if (!GUtil.isTrue(implClassName)) {
View Full Code Here


    }

    public Plugin getPlugin(String id) {
        Plugin plugin = findPlugin(id);
        if (plugin == null) {
            throw new UnknownPluginException("Plugin with id " + id + " has not been used.");
        }
        return plugin;
    }
View Full Code Here

    }

    public <T extends Plugin> T getPlugin(Class<T> type) throws UnknownPluginException {
        Plugin plugin = findPlugin(type);
        if (plugin == null) {
            throw new UnknownPluginException("Plugin with type " + type + " has not been used.");
        }
        return type.cast(plugin);
    }
View Full Code Here

    public Plugin apply(String id) {
        SingleMessageLogger.nagUserOfReplacedMethod("PluginContainer.apply(String)", "PluginAware.apply(Map) or PluginAware.apply(Closure)");
        PotentialPluginWithId potentialPlugin = pluginRegistry.lookup(id);
        if (potentialPlugin == null) {
            throw new UnknownPluginException("Plugin with id '" + id + "' not found.");
        }

        Class<? extends Plugin<?>> pluginClass = potentialPlugin.asImperativeClass();

        if (pluginClass == null) {
View Full Code Here

    }

    public Plugin getPlugin(String id) {
        Plugin plugin = findPlugin(id);
        if (plugin == null) {
            throw new UnknownPluginException("Plugin with id " + id + " has not been used.");
        }
        return plugin;
    }
View Full Code Here

    }

    public <P extends Plugin> P getPlugin(Class<P> type) throws UnknownPluginException {
        P plugin = findPlugin(type);
        if (plugin == null) {
            throw new UnknownPluginException("Plugin with type " + type + " has not been used.");
        }
        return type.cast(plugin);
    }
View Full Code Here

    }

    public void apply(String pluginId) {
        PotentialPluginWithId potentialPluginWithId = pluginRegistry.lookup(pluginId);
        if (potentialPluginWithId == null) {
            throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");
        }
        doApply(potentialPluginWithId.getPluginId().toString(), potentialPluginWithId);
    }
View Full Code Here

                    request.getScriptSource(), request.getLineNumber());
        }

        if (!result.isFound()) {
            String message = buildNotFoundMessage(request, result);
            Exception exception = new UnknownPluginException(message);
            throw new LocationAwareException(exception, request.getScriptSource(), request.getLineNumber());
        }

        return result;
    }
View Full Code Here

        loaderScope.local(classPath);
        loaderScope.lock();
        PluginRegistry pluginRegistry = new DefaultPluginRegistry(pluginInspector, loaderScope.getLocalClassLoader());
        PotentialPluginWithId lookup = pluginRegistry.lookup(pluginId.toString());
        if (lookup == null) {
            throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");

        }
        return lookup.asClass();
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.plugins.UnknownPluginException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.