Package org.gradle.api.internal.project

Examples of org.gradle.api.internal.project.ProjectInternal


        DefaultProjectDescriptor projectDescriptor = new DefaultProjectDescriptor(null, name, projectDir, new DefaultProjectDescriptorRegistry(),
                topLevelRegistry.get(FileResolver.class));
        ClassLoaderScope baseScope = gradle.getClassLoaderScope();
        ClassLoaderScope rootProjectScope = baseScope.createChild();
        ProjectInternal project = topLevelRegistry.get(IProjectFactory.class).createProject(projectDescriptor, null, gradle, rootProjectScope, baseScope);

        gradle.setRootProject(project);
        gradle.setDefaultProject(project);

        return project;
View Full Code Here


    }

    public Spec<Task> getFilter(String path) {
        final ResolvedTaskPath taskPath = taskPathResolver.resolvePath(path, gradle.getDefaultProject());
        if (!taskPath.isQualified()) {
            ProjectInternal targetProject = taskPath.getProject();
            configurer.configure(targetProject);
            TaskSelectionResult tasks = taskNameResolver.selectWithName(taskPath.getTaskName(), taskPath.getProject(), true);
            if (tasks != null) {
                // An exact match in the target project - can just filter tasks by path to avoid configuring sub-projects at this point
                return new TaskPathSpec(targetProject, taskPath.getTaskName());
View Full Code Here

            }
        };
    }

    public TaskSelection getSelection(@Nullable String projectPath, String path) {
        ProjectInternal project = projectPath != null
                ? gradle.getRootProject().findProject(projectPath)
                : gradle.getDefaultProject();
        return getSelection(path, project);
    }
View Full Code Here

        return getSelection(path, project);
    }

    private TaskSelection getSelection(String path, ProjectInternal project) {
        ResolvedTaskPath taskPath = taskPathResolver.resolvePath(path, project);
        ProjectInternal targetProject = taskPath.getProject();
        if (taskPath.isQualified()) {
            configurer.configure(targetProject);
        } else {
            configurer.configureHierarchy(targetProject);
        }
View Full Code Here

     * @param path the task path, e.g. 'someTask', 'sT', ':sT', ':foo:bar:sT'
     * @param startFrom the starting project the task should be found recursively
     * @return resolved task path
     */
    public ResolvedTaskPath resolvePath(String path, ProjectInternal startFrom) {
        ProjectInternal project;
        String taskName; //eg. 'someTask' or 'sT'
        String prefix; //eg. '', ':' or ':foo:bar'

        if (path.contains(Project.PATH_SEPARATOR)) {
            int idx = path.lastIndexOf(Project.PATH_SEPARATOR);
View Full Code Here

            fail();
        } catch (IllegalStateException e) {
            assertThat(e.getMessage(), equalTo("The root project is not yet available for " + gradle + "."));
        }

        ProjectInternal rootProject = context.mock(ProjectInternal.class);
        gradle.setRootProject(rootProject);

        assertThat(gradle.getRootProject(), sameInstance(rootProject));
    }
View Full Code Here

    }

    @Test
    public void rootProjectActionIsExecutedWhenProjectsAreLoaded() {
        final Action<Project> action = context.mock(Action.class);
        final ProjectInternal rootProject = context.mock(ProjectInternal.class);

        gradle.rootProject(action);

        context.checking(new Expectations() {{
            one(action).execute(rootProject);
View Full Code Here

    }

    @Test
    public void allprojectsActionIsExecutedWhenProjectAreLoaded() {
        final Action<Project> action = context.mock(Action.class);
        final ProjectInternal rootProject = context.mock(ProjectInternal.class);

        gradle.allprojects(action);

        context.checking(new Expectations() {{
            one(rootProject).allprojects(action);
View Full Code Here

    @Test
    public void hasToString() {
        assertThat(gradle.toString(), equalTo("build"));

        final ProjectInternal project = context.mock(ProjectInternal.class);
        context.checking(new Expectations() {{
            allowing(project).getName();
            will(returnValue("rootProject"));
        }});
        gradle.setRootProject(project);
View Full Code Here

            return Arrays.asList(JavaBasePlugin.BUILD_TASK_NAME);
        }

        public FileCollection getRuntimeClasspath() {
            FileCollection runtimeClasspath = convention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getRuntimeClasspath();
            ProjectInternal project = convention.getProject();
            FileCollection gradleApi = project.getConfigurations().detachedConfiguration(project.getDependencies().gradleApi(), project.getDependencies().localGroovy());
            return runtimeClasspath.minus(gradleApi);
        }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.project.ProjectInternal

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.