Package org.gradle.api

Examples of org.gradle.api.Project


        assertThat(textOutput.toString(), containsLine("Root Project"));
    }

    @Test
    public void writeSubProjectHeader() throws IOException {
        final Project project = context.mock(Project.class);
        TestStyledTextOutput textOutput = new TestStyledTextOutput();

        context.checking(new Expectations() {{
            allowing(project).getRootProject();
            will(returnValue(context.mock(Project.class, "root")));
View Full Code Here


        assertThat(textOutput.toString(), containsLine("Project <path>"));
    }

    @Test
    public void includesProjectDescriptionInHeader() throws IOException {
        final Project project = context.mock(Project.class);
        TestStyledTextOutput textOutput = new TestStyledTextOutput();

        context.checking(new Expectations() {{
            allowing(project).getRootProject();
            will(returnValue(project));
View Full Code Here

    }

    @Test
    public void accessMethodsForNonExistingsPaths() {
        projectRegistry = new DefaultProjectRegistry<ProjectInternal>();
        Project otherRoot = HelperUtil.createRootProject();
        assertNull(projectRegistry.getProject(otherRoot.getPath()));
        assertEquals(new TreeSet<ProjectInternal>(), projectRegistry.getAllProjects(otherRoot.getPath()));
        assertEquals(new TreeSet<ProjectInternal>(), projectRegistry.getSubProjects(otherRoot.getPath()));
        assertNull(projectRegistry.getProject(otherRoot.getProjectDir()));
    }
View Full Code Here

        task.generate();
    }

    @Test
    public void passesEachProjectToRenderer() throws IOException {
        final Project child1 = createChildProject(project, "child1");
        final Project child2 = createChildProject(project, "child2");
        task.setProjects(project.getAllprojects());
        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");

            one(renderer).setOutput((StyledTextOutput) with(notNullValue()));
View Full Code Here

                dependencyProjectStub, instruction)));
        assertThat(new DefaultProjectDependency(dependencyProjectStub, "conf1", instruction), strictlyEqual(new DefaultProjectDependency(
                dependencyProjectStub, "conf1", instruction)));
        assertThat(new DefaultProjectDependency(dependencyProjectStub, "conf1", instruction), not(equalTo(new DefaultProjectDependency(
                dependencyProjectStub, "conf2", instruction))));
        Project otherProject = context.mock(Project.class, "otherProject");
        assertThat(new DefaultProjectDependency(dependencyProjectStub, instruction), not(equalTo(new DefaultProjectDependency(
                otherProject, instruction))));
        assertThat(new DefaultProjectDependency(dependencyProjectStub, instruction), not(equalTo(new DefaultProjectDependency(
                dependencyProjectStub, new ProjectDependenciesBuildInstruction(null)))));
    }
View Full Code Here

import org.junit.Test;

public class ReportingBasePluginTest {
    @Test
    public void addsTasksAndConventionToProject() {
        Project project = HelperUtil.createRootProject();
        new ReportingBasePlugin().apply(project);

        assertThat(project.getConvention().getPlugins().get("reportingBase"), instanceOf(ReportingBasePluginConvention.class));
    }
View Full Code Here

        if (parent != null)
        {
            builder = builder.withParent(parent);
        }

        Project project = builder.build();

        if (buildFile != null)
        {
            HashMap<String, String> map = new HashMap<String, String>();
            map.put("from", buildFile.getAbsolutePath());

            project.apply(map);
        }

        return project;
    }
View Full Code Here

        {
            File buildscript = projectFile.call();
            if (!buildscript.exists())
                return null;
           
            Project proj = BasePlugin.getProject(buildscript, getProject());
            libs = proj.getConfigurations().getByName(projectConfig);

            if (includeJar)
            {
                AbstractTask jarTask = (AbstractTask)proj.getTasks().getByName("jar");
                executeTask(jarTask);
                File compiled = (File)jarTask.property("archivePath");
                libs = getProject().files(compiled, libs);
            }
        }
View Full Code Here

    private Action<Task>                configureTask;

    @TaskAction
    public void doTask() throws IOException
    {
        Project childProj = FmlDevPlugin.getProject(getBuildFile(), getProject());
       
        // configure the project
        for (Action<Project> act : configureProject)
        {
            if (act != null)
                act.execute(childProj);
        }

        for (String task : tasks.split(" "))
        {
            Set<Task> list = childProj.getTasksByName(task, false);
            for (Task t : list)
            {
                if (configureTask != null)
                    configureTask.execute(t);
                executeTask((AbstractTask) t);
View Full Code Here

    @TaskAction
    public void doTask() throws IOException
    {
        getLogger().debug("Building child project model...");
        Project childProj = FmlDevPlugin.getProject(getBuildFile(), getProject());
        for (Action<Project> act : configureProject)
        {
            if (act != null)
                act.execute(childProj);
        }
       
        AbstractTask compileTask = (AbstractTask) childProj.getTasks().getByName("compileJava");
        AbstractTask jarTask = (AbstractTask) childProj.getTasks().getByName(subTask);

        // executing jar task
        getLogger().debug("Executing child "+subTask+" task...");
        executeTask(jarTask);
       
View Full Code Here

TOP

Related Classes of org.gradle.api.Project

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.