Examples of GroovyJarFile


Examples of org.gradle.api.internal.plugins.GroovyJarFile

        // alternatively, we could return project.files(Runnable)
        // would differ in at least the following ways: 1. live 2. no autowiring
        return new LazilyInitializedFileCollection() {
            @Override
            public FileCollection createDelegate() {
                GroovyJarFile groovyJar = findGroovyJarFile(classpath);
                if (groovyJar == null) {
                    throw new GradleException(String.format("Cannot infer Groovy class path because no Groovy Jar was found on class path: %s", classpath));
                }

                if (groovyJar.isGroovyAll()) {
                    return project.files(groovyJar.getFile());
                }

                if (project.getRepositories().isEmpty()) {
                    throw new GradleException("Cannot infer Groovy class path because no repository is declared for the project.");
                }

                String notation = groovyJar.getDependencyNotation();
                List<Dependency> dependencies = Lists.newArrayList();
                // project.getDependencies().create(String) seems to be the only feasible way to create a Dependency with a classifier
                dependencies.add(project.getDependencies().create(notation));
                if (groovyJar.getVersion().getMajor() >= 2) {
                    // add groovy-ant to bring in Groovydoc
                    dependencies.add(project.getDependencies().create(notation.replace(":groovy:", ":groovy-ant:")));
                }
                return project.getConfigurations().detachedConfiguration(dependencies.toArray(new Dependency[dependencies.size()]));
            }
View Full Code Here

Examples of org.gradle.api.internal.plugins.GroovyJarFile

    }

    private GroovyJarFile findGroovyJarFile(Iterable<File> classpath) {
        if (classpath == null) { return null; }
        for (File file : classpath) {
            GroovyJarFile groovyJar = GroovyJarFile.parse(file);
            if (groovyJar != null) { return groovyJar; }
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.