org.gradle.api.ProjectEvaluationListener Java Examples

The following examples show how to use org.gradle.api.ProjectEvaluationListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DefaultGradle(Gradle parent, StartParameter startParameter, ServiceRegistryFactory parentRegistry) {
    this.parent = parent;
    this.startParameter = startParameter;
    this.services = parentRegistry.createFor(this);
    this.listenerManager = services.get(ListenerManager.class);
    taskGraph = services.get(TaskGraphExecuter.class);
    distributionLocator = services.get(GradleDistributionLocator.class);
    classLoaderScope = services.get(ClassLoaderScopeRegistry.class).getCoreAndPluginsScope();
    pluginContainer = services.get(PluginContainer.class);
    fileResolver = services.get(FileResolver.class);
    scriptPluginFactory = services.get(ScriptPluginFactory.class);
    scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    buildListenerBroadcast = listenerManager.createAnonymousBroadcaster(BuildListener.class);
    projectEvaluationListenerBroadcast = listenerManager.createAnonymousBroadcaster(ProjectEvaluationListener.class);
    buildListenerBroadcast.add(new BuildAdapter() {
        @Override
        public void projectsLoaded(Gradle gradle) {
            rootProjectActions.execute(rootProject);
            rootProjectActions = null;
        }
    });
}
 
Example #2
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DefaultGradle(Gradle parent, StartParameter startParameter, ServiceRegistryFactory parentRegistry) {
    this.parent = parent;
    this.startParameter = startParameter;
    this.services = parentRegistry.createFor(this);
    this.listenerManager = services.get(ListenerManager.class);
    taskGraph = services.get(TaskGraphExecuter.class);
    distributionLocator = services.get(GradleDistributionLocator.class);
    classLoaderScope = services.get(ClassLoaderScopeRegistry.class).getCoreAndPluginsScope();
    pluginContainer = services.get(PluginContainer.class);
    fileResolver = services.get(FileResolver.class);
    scriptPluginFactory = services.get(ScriptPluginFactory.class);
    scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    buildListenerBroadcast = listenerManager.createAnonymousBroadcaster(BuildListener.class);
    projectEvaluationListenerBroadcast = listenerManager.createAnonymousBroadcaster(ProjectEvaluationListener.class);
    buildListenerBroadcast.add(new BuildAdapter() {
        @Override
        public void projectsLoaded(Gradle gradle) {
            rootProjectActions.execute(rootProject);
            rootProjectActions = null;
        }
    });
}
 
Example #3
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DefaultGradle(Gradle parent, StartParameter startParameter, ServiceRegistryFactory parentRegistry) {
    this.parent = parent;
    this.startParameter = startParameter;
    this.services = parentRegistry.createFor(this);
    this.listenerManager = services.get(ListenerManager.class);
    taskGraph = services.get(TaskGraphExecuter.class);
    distributionLocator = services.get(GradleDistributionLocator.class);
    classLoaderScope = services.get(ClassLoaderScope.class);
    pluginContainer = services.get(PluginContainer.class);
    fileResolver = services.get(FileResolver.class);
    scriptPluginFactory = services.get(ScriptPluginFactory.class);
    scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    buildListenerBroadcast = listenerManager.createAnonymousBroadcaster(BuildListener.class);
    projectEvaluationListenerBroadcast = listenerManager.createAnonymousBroadcaster(ProjectEvaluationListener.class);
    buildListenerBroadcast.add(new BuildAdapter() {
        @Override
        public void projectsLoaded(Gradle gradle) {
            rootProjectActions.execute(rootProject);
            rootProjectActions = null;
        }
    });
}
 
Example #4
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DefaultGradle(Gradle parent, StartParameter startParameter, ServiceRegistryFactory parentRegistry) {
    this.parent = parent;
    this.startParameter = startParameter;
    this.services = parentRegistry.createFor(this);
    this.listenerManager = services.get(ListenerManager.class);
    taskGraph = services.get(TaskGraphExecuter.class);
    distributionLocator = services.get(GradleDistributionLocator.class);
    classLoaderScope = services.get(ClassLoaderScope.class);
    pluginContainer = services.get(PluginContainer.class);
    fileResolver = services.get(FileResolver.class);
    scriptPluginFactory = services.get(ScriptPluginFactory.class);
    scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    buildListenerBroadcast = listenerManager.createAnonymousBroadcaster(BuildListener.class);
    projectEvaluationListenerBroadcast = listenerManager.createAnonymousBroadcaster(ProjectEvaluationListener.class);
    buildListenerBroadcast.add(new BuildAdapter() {
        @Override
        public void projectsLoaded(Gradle gradle) {
            rootProjectActions.execute(rootProject);
            rootProjectActions = null;
        }
    });
}
 
Example #5
Source File: LifecycleProjectEvaluator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void notifyAfterEvaluate(ProjectEvaluationListener listener, ProjectInternal project, ProjectStateInternal state) {
    try {
        listener.afterEvaluate(project, state);
    } catch (Exception e) {
        if (state.hasFailure()) {
            // Just log this failure, and pass the existing failure out in the project state
            LOGGER.error("Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.", e);
            return;
        }
        addConfigurationFailure(project, state, e);
    }
}
 
Example #6
Source File: LifecycleProjectEvaluator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void notifyAfterEvaluate(ProjectEvaluationListener listener, ProjectInternal project, ProjectStateInternal state) {
    try {
        listener.afterEvaluate(project, state);
    } catch (Exception e) {
        if (state.hasFailure()) {
            // Just log this failure, and pass the existing failure out in the project state
            LOGGER.error("Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.", e);
            return;
        }
        addConfigurationFailure(project, state, e);
    }
}
 
Example #7
Source File: LifecycleProjectEvaluator.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void notifyAfterEvaluate(ProjectEvaluationListener listener, ProjectInternal project, ProjectStateInternal state) {
    try {
        listener.afterEvaluate(project, state);
    } catch (Exception e) {
        if (state.hasFailure()) {
            // Just log this failure, and pass the existing failure out in the project state
            LOGGER.error("Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.", e);
            return;
        }
        addConfigurationFailure(project, state, e);
    }
}
 
Example #8
Source File: LifecycleProjectEvaluator.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void notifyAfterEvaluate(ProjectEvaluationListener listener, ProjectInternal project, ProjectStateInternal state) {
    try {
        listener.afterEvaluate(project, state);
    } catch (Exception e) {
        if (state.hasFailure()) {
            // Just log this failure, and pass the existing failure out in the project state
            LOGGER.error("Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.", e);
            return;
        }
        addConfigurationFailure(project, state, e);
    }
}
 
Example #9
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener) {
    addListener(listener);
    return listener;
}
 
Example #10
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeProjectEvaluationListener(ProjectEvaluationListener listener) {
    removeListener(listener);
}
 
Example #11
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener getProjectEvaluationBroadcaster() {
    return projectEvaluationListenerBroadcast.getSource();
}
 
Example #12
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener getProjectEvaluationBroadcaster() {
    return projectEvaluationListenerBroadcast.getSource();
}
 
Example #13
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeProjectEvaluationListener(ProjectEvaluationListener listener) {
    removeListener(listener);
}
 
Example #14
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener) {
    addListener(listener);
    return listener;
}
 
Example #15
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener) {
    addListener(listener);
    return listener;
}
 
Example #16
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener getProjectEvaluationBroadcaster() {
    return projectEvaluationListenerBroadcast.getSource();
}
 
Example #17
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeProjectEvaluationListener(ProjectEvaluationListener listener) {
    removeListener(listener);
}
 
Example #18
Source File: DefaultGradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener) {
    addListener(listener);
    return listener;
}
 
Example #19
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeProjectEvaluationListener(ProjectEvaluationListener listener) {
    removeListener(listener);
}
 
Example #20
Source File: DefaultGradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ProjectEvaluationListener getProjectEvaluationBroadcaster() {
    return projectEvaluationListenerBroadcast.getSource();
}
 
Example #21
Source File: Gradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Removes the given listener from this build.
 *
 * @param listener The listener to remove. Does nothing if this listener has not been added.
 */
void removeProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #22
Source File: GradleInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Returns the broadcaster for {@link ProjectEvaluationListener} events for this build
 */
ProjectEvaluationListener getProjectEvaluationBroadcaster();
 
Example #23
Source File: Gradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Adds a listener to this build, to receive notifications as projects are evaluated.
 *
 * @param listener The listener to add. Does nothing if this listener has already been added.
 * @return The added listener.
 */
ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #24
Source File: Gradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Adds a listener to this build, to receive notifications as projects are evaluated.
 *
 * @param listener The listener to add. Does nothing if this listener has already been added.
 * @return The added listener.
 */
ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #25
Source File: GradleInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Returns the broadcaster for {@link ProjectEvaluationListener} events for this build
 */
ProjectEvaluationListener getProjectEvaluationBroadcaster();
 
Example #26
Source File: Gradle.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Removes the given listener from this build.
 *
 * @param listener The listener to remove. Does nothing if this listener has not been added.
 */
void removeProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #27
Source File: Gradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Adds a listener to this build, to receive notifications as projects are evaluated.
 *
 * @param listener The listener to add. Does nothing if this listener has already been added.
 * @return The added listener.
 */
ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #28
Source File: GradleInternal.java    From pushfish-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Returns the broadcaster for {@link ProjectEvaluationListener} events for this build
 */
ProjectEvaluationListener getProjectEvaluationBroadcaster();
 
Example #29
Source File: Gradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Removes the given listener from this build.
 *
 * @param listener The listener to remove. Does nothing if this listener has not been added.
 */
void removeProjectEvaluationListener(ProjectEvaluationListener listener);
 
Example #30
Source File: Gradle.java    From pushfish-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Adds a listener to this build, to receive notifications as projects are evaluated.
 *
 * @param listener The listener to add. Does nothing if this listener has already been added.
 * @return The added listener.
 */
ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener);