Package org.gradle.api

Examples of org.gradle.api.InvalidUserDataException


    public Configuration extendsFrom(Configuration... extendsFrom) {
        throwExceptionIfNotInUnresolvedState();
        for (Configuration configuration : extendsFrom) {
            if (configuration.getHierarchy().contains(this)) {
                throw new InvalidUserDataException(String.format(
                        "Cyclic extendsFrom from %s and %s is not allowed. See existing hierarchy: %s", this,
                        configuration, configuration.getHierarchy()));
            }
            this.extendsFrom.add(configuration);
        }
View Full Code Here


        return copyRecursive(Specs.<Dependency>convertClosureToSpec(dependencySpec));
    }

    private void throwExceptionIfNotInUnresolvedState() {
        if (getState() != State.UNRESOLVED) {
            throw new InvalidUserDataException("You can't change a configuration which is not in unresolved state!");
        }
    }
View Full Code Here

    }

    public DefaultClientModule(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

    }

    private Object[] getFlatDirRootDirs(Map args) {
        List dirs = createStringifiedListFromMapArg(args, "dirs");
        if (dirs == null) {
            throw new InvalidUserDataException("You must specify dirs for the flat dir repository.");
        }
        return dirs.toArray();
    }
View Full Code Here

        this.artifactPomFactory = artifactPomFactory;
    }

    public void addArtifact(Artifact artifact, File src) {
        if (artifact == null || src == null) {
            throw new InvalidUserDataException("Artifact or source file must not be null!");
        }
        for (PomFilter activePomFilter : pomFilterContainer.getActivePomFilters()) {
            if (activePomFilter.getFilter().accept(artifact, src)) {
                if (artifactPoms.get(activePomFilter.getName()) == null) {
                    artifactPoms.put(activePomFilter.getName(), artifactPomFactory.createArtifactPom(activePomFilter.getPomTemplate()));
View Full Code Here

    private ParsedModuleStringNotation splitDescriptionIntoModuleNotationAndArtifactType(String notation) {
        Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
        boolean hasArtifactType = matcher.matches();
        if (hasArtifactType) {
            if (matcher.groupCount() != 2) {
                throw new InvalidUserDataException("The description " + notation + " is invalid");
            }
            return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
        }
        return new ParsedModuleStringNotation(notation, null);
    }
View Full Code Here

        return add(name, null);
    }

    public T add(String name, Closure configureClosure) {
        if (findByName(name) != null) {
            throw new InvalidUserDataException(String.format("Cannot add %s '%s' as a %s with that name already exists.",
                    getTypeDisplayName(), name, getTypeDisplayName()));
        }
        T object = create(name);
        addObject(name, object);
        ConfigureUtil.configure(configureClosure, object);
View Full Code Here

                throw new GradleException(String.format("Could not create a dependency using notation: %s", dependencyNotation), e);
            }
        }

        if (dependency == null) {
            throw new InvalidUserDataException(String.format("The dependency notation: %s is invalid.",
                    dependencyNotation));
        }
        return dependency;
    }
View Full Code Here

    public FileTree visit(FileVisitor visitor) {
        if (!zipFile.exists()) {
            return this;
        }
        if (!zipFile.isFile()) {
            throw new InvalidUserDataException(String.format("Cannot expand %s as it is not a file.", this));
        }

        AtomicBoolean stopFlag = new AtomicBoolean();

        try {
View Full Code Here

    public FileTree visit(FileVisitor visitor) {
        if (!tarFile.exists()) {
            return this;
        }
        if (!tarFile.isFile()) {
            throw new InvalidUserDataException(String.format("Cannot expand %s as it is not a file.", this));
        }

        AtomicBoolean stopFlag = new AtomicBoolean();
        try {
            FileInputStream inputStream = new FileInputStream(tarFile);
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.