Package org.gradle.api

Examples of org.gradle.api.ProjectEvaluationListener


        assertThat(gradle.getGradleUserHomeDir(), equalTo(new File("user").getCanonicalFile()));
    }

    @Test
    public void broadcastsProjectEventsToListeners() {
        final ProjectEvaluationListener listener = context.mock(ProjectEvaluationListener.class, "listener");
        final ProjectEvaluationListener broadcaster = context.mock(ProjectEvaluationListener.class, "broadcaster");
        context.checking(new Expectations() {{
            one(listenerManager).addListener(listener);
            one(listenerManager).getBroadcaster(ProjectEvaluationListener.class);
            will(returnValue(broadcaster));
        }});
View Full Code Here


    public void evaluate(ProjectInternal project, ProjectStateInternal state) {
        if (state.getExecuted()) {
            return;
        }

        ProjectEvaluationListener listener = project.getProjectEvaluationBroadcaster();
        listener.beforeEvaluate(project);
        state.setExecuting(true);
        try {
            evaluator.evaluate(project, state);
        } finally {
            state.setExecuting(false);
            state.executed();
            listener.afterEvaluate(project, state);
        }
    }
View Full Code Here

   * Bad, internal-API-dependent code that works around the issue of 'afterEvaluated' not being called
   */
  private static void callAfterEvaluated(Project project) {
    ProjectStateInternal projectState = new ProjectStateInternal();
    projectState.executed();
    ProjectEvaluationListener evaluationListener = ((AbstractProject) project).getProjectEvaluationBroadcaster();
    evaluationListener.afterEvaluate(project, projectState);   
  }
View Full Code Here

        //TODO this is one of the places to look into thread safety when we implement parallel configuration
        if (state.getExecuted() || state.getExecuting()) {
            return;
        }

        ProjectEvaluationListener listener = project.getProjectEvaluationBroadcaster();
        try {
            listener.beforeEvaluate(project);
        } catch (Exception e) {
            addConfigurationFailure(project, state, e);
            return;
        }
View Full Code Here

        assertThat(gradle.getGradleUserHomeDir(), equalTo(new File("user").getCanonicalFile()));
    }

    @Test
    public void broadcastsProjectEventsToListeners() {
        final ProjectEvaluationListener broadcaster = context.mock(ProjectEvaluationListener.class, "broadcaster");
        context.checking(new Expectations() {{
            one(projectEvaluationListenerBroadcast).getSource();
            will(returnValue(broadcaster));
        }});
View Full Code Here

TOP

Related Classes of org.gradle.api.ProjectEvaluationListener

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.