Package org.gradle.api

Examples of org.gradle.api.IllegalDependencyNotation


        if (notation instanceof String || notation instanceof GString) {
            return type.cast(createDependencyFromString(notation.toString()));
        } else if (notation instanceof Map) {
            return type.cast(mapNotationParser.createDependency(DefaultExternalModuleDependency.class, notation));
        }
        throw new IllegalDependencyNotation();
    }
View Full Code Here


    }

    public <T extends Dependency> T createDependency(Class<T> type, Object userDependencyDescription)
            throws IllegalDependencyNotation {
        if (!(userDependencyDescription instanceof FileCollection)) {
            throw new IllegalDependencyNotation();
        }

        FileCollection fileCollection = (FileCollection) userDependencyDescription;
        return type.cast(classGenerator.newInstance(DefaultSelfResolvingDependency.class, fileCollection));
    }
View Full Code Here

    }

    private void assignValuesFromModuleNotation(String moduleNotation) {
        String[] moduleNotationParts = moduleNotation.split(":");
        if (moduleNotationParts.length < 2 || moduleNotationParts.length > 4) {
            throw new IllegalDependencyNotation("The description " + moduleNotation + " is invalid");
        }
        group = GUtil.elvis(moduleNotationParts[0], null);
        name = moduleNotationParts[1];
        version = moduleNotationParts.length == 2 ? null : moduleNotationParts[2];
        if (moduleNotationParts.length == 4) {
View Full Code Here

        if (notation instanceof String || notation instanceof GString) {
            return type.cast(createDependencyFromString(notation.toString()));
        } else if (notation instanceof Map) {
            return type.cast(mapNotationParser.createDependency(DefaultClientModule.class, notation));
        }
        throw new IllegalDependencyNotation();
    }
View Full Code Here

                    = (DependencyFactory.ClassPathNotation) userDependencyDescription;
            FileCollection files = fileResolver.resolveFiles(classPathRegistry.getClassPathFiles(classPathNotation.name()));
            return type.cast(classGenerator.newInstance(DefaultSelfResolvingDependency.class, files));
        }
       
        throw new IllegalDependencyNotation();
    }
View Full Code Here

    public <T extends Dependency> T createDependency(Class<T> type, Object userDependencyDescription) throws IllegalDependencyNotation {
        if (userDependencyDescription instanceof Project) {
            return type.cast(classGenerator.newInstance(DefaultProjectDependency.class, userDependencyDescription, instruction));
        }
        throw new IllegalDependencyNotation();
    }
View Full Code Here

    @Test(expected = InvalidUserDataException.class)
    public void testCreateDependencyWithInvalidDescriptionShouldThrowInvalidUserDataEx() {
        final IDependencyImplementationFactory testImplStringFactoryStub = context.mock(IDependencyImplementationFactory.class, "String");
        context.checking(new Expectations() {{
            allowing(testImplPointFactoryStub).createDependency(with(equalTo(Dependency.class)), with(not(instanceOf(Point.class))));
            will(throwException(new IllegalDependencyNotation()));
            allowing(testImplStringFactoryStub).createDependency(with(equalTo(Dependency.class)), with(not(instanceOf(String.class))));
            will(throwException(new IllegalDependencyNotation()));
        }});
        dependencyFactory.createDependency(createAnonymousInteger());
    }
View Full Code Here

    }

    private void assignValuesFromModuleNotation(String moduleNotation) {
        String[] moduleNotationParts = moduleNotation.split(":");
        if (moduleNotationParts.length < 2 || moduleNotationParts.length > 4) {
            throw new IllegalDependencyNotation("Supplied String module notation '" + moduleNotation + "' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.");
        }
        group = GUtil.elvis(moduleNotationParts[0], null);
        name = moduleNotationParts[1];
        version = moduleNotationParts.length == 2 ? null : moduleNotationParts[2];
        if (moduleNotationParts.length == 4) {
View Full Code Here

TOP

Related Classes of org.gradle.api.IllegalDependencyNotation

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.