Package org.gradle.api

Examples of org.gradle.api.InvalidUserDataException


    }

    public DependencyResolver mavenRepo(Map args) {
        List<String> urls = createStringifiedListFromMapArg(args, "urls");
        if (urls == null) {
            throw new InvalidUserDataException("You must specify a urls for a Maven repo.");
        }
        List<String> extraUrls = urls.subList(1, urls.size());
        return add(getResolverFactory().createMavenRepoResolver(
                getNameFromMap(args, urls.get(0)),
                urls.get(0),
View Full Code Here


    }

    public DefaultExternalModuleDependency(String group, String name, String version, String configuration) {
        super(configuration);
        if (name == null) {
            throw new InvalidUserDataException("Name must not be null!");
        }
        this.group = group;
        this.name = name;
        this.version = version;
    }
View Full Code Here

        return this;
    }

    private void addValue(Object dependency) {
        if (dependency == null) {
            throw new InvalidUserDataException("A dependency must not be empty");
        }
        this.values.add(dependency);
    }
View Full Code Here

        Task task = taskFactory.createTask(project, mutableOptions);
        String name = task.getName();

        if (!replace && findByNameWithoutRules(name) != null) {
            throw new InvalidUserDataException(String.format(
                    "Cannot add %s as a task with that name already exists.", task));
        }

        addObject(name, task);
View Full Code Here

        return type.cast(add(GUtil.map(Task.TASK_NAME, name, Task.TASK_TYPE, type, Task.TASK_OVERWRITE, true)));
    }

    public Task findByPath(String path) {
        if (!GUtil.isTrue(path)) {
            throw new InvalidUserDataException("A path must be specified!");
        }
        if (!path.contains(Project.PATH_SEPARATOR)) {
            return findByName(path);
        }
View Full Code Here

        return project.getTasks().findByName(StringUtils.substringAfterLast(path, Project.PATH_SEPARATOR));
    }

    public Task resolveTask(Object path) {
        if (!GUtil.isTrue(path)) {
            throw new InvalidUserDataException("A path must be specified!");
        }
        return getByPath(path.toString());
    }
View Full Code Here

public class DefaultPublishArtifactFactory implements PublishArtifactFactory {
    public PublishArtifact createArtifact(Object notation) {
        if (notation instanceof AbstractArchiveTask) {
            return new ArchivePublishArtifact((AbstractArchiveTask) notation);
        }
        throw new InvalidUserDataException("Notation is invalid for an artifact! Passed notation=" + notation);
    }                           
View Full Code Here

        if (parent != null) {
            return parent.loadPlugin(pluginClass);
        }

        if (!Plugin.class.isAssignableFrom(pluginClass)) {
            throw new InvalidUserDataException(String.format(
                    "Cannot create plugin of type '%s' as it does not implement the Plugin interface.",
                    pluginClass.getSimpleName()));
        }
        try {
            return pluginClass.newInstance();
View Full Code Here

            result = createMavenRepoResolver(userDescriptionMap.get(ResolverContainer.RESOLVER_NAME),
                    userDescriptionMap.get(ResolverContainer.RESOLVER_URL));
        } else if (userDescription instanceof DependencyResolver) {
            result = (DependencyResolver) userDescription;
        } else {
            throw new InvalidUserDataException("Illegal Resolver type");
        }
        return result;
    }
View Full Code Here

    public ConventionMapping map(Map<String, ? extends ConventionValue> mapping) {
        for (Map.Entry<String, ? extends ConventionValue> entry : mapping.entrySet()) {
            String propertyName = entry.getKey();
            if (!ReflectionUtil.hasProperty(source, propertyName)) {
                throw new InvalidUserDataException(
                        "You can't map a property that does not exist: propertyName=" + propertyName);
            }
            if (entry.getValue() == null) {
                throw new IllegalArgumentException("No convention value provided: propertyName= " + propertyName);
            }
View Full Code Here

TOP

Related Classes of org.gradle.api.InvalidUserDataException

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.