Package org.gradle.tooling.model

Examples of org.gradle.tooling.model.GradleProject


        }
        return ShrinkWrap.create(ZipImporter.class, archive.getName()).importFrom(result).as(clazz);
    }

    private File importFromDefaultLibsDirectory() {
        final GradleProject currentGradleProject = findCurrentGradleProject();
        final File buildDir = currentGradleProject.getBuildDirectory();
        final File libsDir = new File(buildDir, "libs");
        final File[] results = libsDir.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(final File dir, final String name) {
                return name.startsWith(currentGradleProject.getName());
            }
        });

        if (results == null || results.length == 0) {
            throw new IllegalArgumentException(
View Full Code Here


    private File importFromConfiguredPath() {
        return buildResult;
    }

    private GradleProject findCurrentGradleProject() {
        final GradleProject rootGradleProject = projectConnection.getModel(GradleProject.class);
        if (!rootGradleProject.getName().equals(projectName)) {
            final GradleProject child = findChildProject(rootGradleProject, projectName);
            if (child != null) {
                return child;

            }
        }
View Full Code Here

                return child;
            }
        }

        for (GradleProject child : children) {
            final GradleProject foundChild = findChildProject(child, childProjectName);
            if (foundChild != null) {
                return foundChild;
            }
        }
View Full Code Here

                EclipseProject eclipseProject = (EclipseProject)fetched.get(EclipseProject.class);
                assertEquals("EclipseProject must match the requested one",
                        projectPath, eclipseProject.getGradleProject().getPath());

                IdeaProject ideaProject = (IdeaProject)fetched.get(IdeaProject.class);
                GradleProject gradleProjectOfIdea = null;
                for (IdeaModule ideaModule: ideaProject.getModules()) {
                    if (projectPath.equals(ideaModule.getGradleProject().getPath())) {
                        gradleProjectOfIdea = ideaModule.getGradleProject();
                        break;
                    }
View Full Code Here

            if (childInfo != null) {
                children.add(childInfo);
            }
        }

        GradleProject gradleProject = module.getGradleProject();
        String projectName = gradleProject.getName();
        String projectFullName = gradleProject.getPath();
        GenericProjectProperties properties
                = new GenericProjectProperties(projectName, projectFullName, moduleDir);

        return new NbGradleProjectTree(properties, getTasksOfModule(module), children);
    }
View Full Code Here

        DomainObjectSet<? extends IdeaModule> modules = ideaModel.getModules();
        if (modules.isEmpty()) {
            return null;
        }

        GradleProject rootProject = getRoot(modules.iterator().next().getGradleProject());
        String rootName = rootProject.getPath();

        for (IdeaModule module: ideaModel.getModules()) {
            if (rootName.equals(module.getGradleProject().getPath())) {
                return module;
            }
View Full Code Here

        }
        return null;
    }

    private static GradleProject getRoot(GradleProject project) {
        GradleProject prev = null;
        GradleProject current = project;
        do {
            prev = current;
            current = current.getParent();
        } while (current != null);
        return prev;
    }
View Full Code Here

import java.util.List;
import java.util.SortedSet;

public class BuildInvocationsConverter {
    public ConsumerProvidedBuildInvocations convert(GradleProject project) {
        GradleProject rootProject = project;
        while (rootProject.getParent() != null) {
            rootProject = rootProject.getParent();
        }
        List<ConsumerProvidedTaskSelector> selectors = buildRecursively(rootProject);
        return new ConsumerProvidedBuildInvocations(selectors, convertTasks(rootProject.getTasks()));
    }
View Full Code Here

        // Use an EclipseProject to reference a project
        EclipseProject eclipseProject = controller.getModel(EclipseProject.class);
        visit(eclipseProject, controller, new HashMap<String, CustomModel>());

        // Use a GradleProject to reference a project
        GradleProject rootProject = controller.getModel(GradleProject.class);
        Map<String, CustomModel> projects = new HashMap<String, CustomModel>();
        visit(rootProject, controller, projects);
        return projects;
    }
View Full Code Here

        this.delegate = delegate;
    }

    public <T> T produceModel(Class<T> type, ConsumerOperationParameters operationParameters) {
        if (type.equals(GradleBuild.class)) {
            GradleProject gradleProject = delegate.produceModel(GradleProject.class, operationParameters);
            final DefaultGradleBuild convert = new GradleBuildConverter().convert(gradleProject);
            return adapter.adapt(type, convert);
        }
        return delegate.produceModel(type, operationParameters);
    }
View Full Code Here

TOP

Related Classes of org.gradle.tooling.model.GradleProject

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.