Java Code Examples for org.gradle.api.plugins.PluginContainer

The following examples show how to use org.gradle.api.plugins.PluginContainer. These examples are extracted from open source projects. 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 Project: pushfish-android   Author: PushFish   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void apply(final Project project) {
    project.getPlugins().apply(BasePlugin.class);

    final EarPluginConvention earPluginConvention = instantiator.newInstance(EarPluginConvention.class, fileResolver, instantiator);
    project.getConvention().getPlugins().put("ear", earPluginConvention);
    earPluginConvention.setLibDirName("lib");
    earPluginConvention.setAppDirName("src/main/application");

    wireEarTaskConventions(project, earPluginConvention);
    configureConfigurations(project);

    PluginContainer plugins = project.getPlugins();

    setupEarTask(project, earPluginConvention);

    configureWithJavaPluginApplied(project, earPluginConvention, plugins);
    configureWithNoJavaPluginApplied(project, earPluginConvention);
}
 
Example #2
Source Project: pushfish-android   Author: PushFish   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public BaseSettings(ServiceRegistryFactory serviceRegistryFactory, GradleInternal gradle,
                    ClassLoaderScope classLoaderScope, ClassLoaderScope rootClassLoaderScope, File settingsDir,
                    ScriptSource settingsScript, StartParameter startParameter) {
    this.gradle = gradle;
    this.rootClassLoaderScope = rootClassLoaderScope;
    this.settingsDir = settingsDir;
    this.settingsScript = settingsScript;
    this.startParameter = startParameter;
    this.classLoaderScope = classLoaderScope;
    ServiceRegistry services = serviceRegistryFactory.createFor(this);
    this.plugins = services.get(PluginContainer.class);
    this.fileResolver = services.get(FileResolver.class);
    this.scriptPluginFactory = services.get(ScriptPluginFactory.class);
    this.scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    this.projectDescriptorRegistry = services.get(ProjectDescriptorRegistry.class);
    rootProjectDescriptor = createProjectDescriptor(null, settingsDir.getName(), settingsDir);
}
 
Example #3
Source Project: pushfish-android   Author: PushFish   File: DefaultGradle.java    License: 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 #4
Source Project: pushfish-android   Author: PushFish   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void apply(final Project project) {
    project.getPlugins().apply(BasePlugin.class);

    final EarPluginConvention earPluginConvention = instantiator.newInstance(EarPluginConvention.class, fileResolver);
    project.getConvention().getPlugins().put("ear", earPluginConvention);
    earPluginConvention.setLibDirName("lib");
    earPluginConvention.setAppDirName("src/main/application");

    wireEarTaskConventions(project, earPluginConvention);
    configureConfigurations(project);

    PluginContainer plugins = project.getPlugins();

    setupEarTask(project, earPluginConvention);

    configureWithJavaPluginApplied(project, earPluginConvention, plugins);
    configureWithNoJavaPluginApplied(project, earPluginConvention);
}
 
Example #5
Source Project: pushfish-android   Author: PushFish   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public BaseSettings(ServiceRegistryFactory serviceRegistryFactory, GradleInternal gradle,
                    ClassLoaderScope classLoaderScope, File settingsDir, ScriptSource settingsScript,
                    StartParameter startParameter) {
    this.gradle = gradle;
    this.settingsDir = settingsDir;
    this.settingsScript = settingsScript;
    this.startParameter = startParameter;
    this.classLoaderScope = classLoaderScope;
    ServiceRegistry services = serviceRegistryFactory.createFor(this);
    this.plugins = services.get(PluginContainer.class);
    this.fileResolver = services.get(FileResolver.class);
    this.scriptPluginFactory = services.get(ScriptPluginFactory.class);
    this.scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    this.projectDescriptorRegistry = services.get(ProjectDescriptorRegistry.class);
    rootProjectDescriptor = createProjectDescriptor(null, settingsDir.getName(), settingsDir);
}
 
Example #6
Source Project: pushfish-android   Author: PushFish   File: DefaultGradle.java    License: 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 #7
Source Project: Pushjet-Android   Author: Pushjet   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void apply(final Project project) {
    project.getPlugins().apply(BasePlugin.class);

    final EarPluginConvention earPluginConvention = instantiator.newInstance(EarPluginConvention.class, fileResolver, instantiator);
    project.getConvention().getPlugins().put("ear", earPluginConvention);
    earPluginConvention.setLibDirName("lib");
    earPluginConvention.setAppDirName("src/main/application");

    wireEarTaskConventions(project, earPluginConvention);
    configureConfigurations(project);

    PluginContainer plugins = project.getPlugins();

    setupEarTask(project, earPluginConvention);

    configureWithJavaPluginApplied(project, earPluginConvention, plugins);
    configureWithNoJavaPluginApplied(project, earPluginConvention);
}
 
Example #8
Source Project: Pushjet-Android   Author: Pushjet   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public BaseSettings(ServiceRegistryFactory serviceRegistryFactory, GradleInternal gradle,
                    ClassLoaderScope classLoaderScope, ClassLoaderScope rootClassLoaderScope, File settingsDir,
                    ScriptSource settingsScript, StartParameter startParameter) {
    this.gradle = gradle;
    this.rootClassLoaderScope = rootClassLoaderScope;
    this.settingsDir = settingsDir;
    this.settingsScript = settingsScript;
    this.startParameter = startParameter;
    this.classLoaderScope = classLoaderScope;
    ServiceRegistry services = serviceRegistryFactory.createFor(this);
    this.plugins = services.get(PluginContainer.class);
    this.fileResolver = services.get(FileResolver.class);
    this.scriptPluginFactory = services.get(ScriptPluginFactory.class);
    this.scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    this.projectDescriptorRegistry = services.get(ProjectDescriptorRegistry.class);
    rootProjectDescriptor = createProjectDescriptor(null, settingsDir.getName(), settingsDir);
}
 
Example #9
Source Project: Pushjet-Android   Author: Pushjet   File: DefaultGradle.java    License: 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 #10
Source Project: Pushjet-Android   Author: Pushjet   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void apply(final Project project) {
    project.getPlugins().apply(BasePlugin.class);

    final EarPluginConvention earPluginConvention = instantiator.newInstance(EarPluginConvention.class, fileResolver);
    project.getConvention().getPlugins().put("ear", earPluginConvention);
    earPluginConvention.setLibDirName("lib");
    earPluginConvention.setAppDirName("src/main/application");

    wireEarTaskConventions(project, earPluginConvention);
    configureConfigurations(project);

    PluginContainer plugins = project.getPlugins();

    setupEarTask(project, earPluginConvention);

    configureWithJavaPluginApplied(project, earPluginConvention, plugins);
    configureWithNoJavaPluginApplied(project, earPluginConvention);
}
 
Example #11
Source Project: Pushjet-Android   Author: Pushjet   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public BaseSettings(ServiceRegistryFactory serviceRegistryFactory, GradleInternal gradle,
                    ClassLoaderScope classLoaderScope, File settingsDir, ScriptSource settingsScript,
                    StartParameter startParameter) {
    this.gradle = gradle;
    this.settingsDir = settingsDir;
    this.settingsScript = settingsScript;
    this.startParameter = startParameter;
    this.classLoaderScope = classLoaderScope;
    ServiceRegistry services = serviceRegistryFactory.createFor(this);
    this.plugins = services.get(PluginContainer.class);
    this.fileResolver = services.get(FileResolver.class);
    this.scriptPluginFactory = services.get(ScriptPluginFactory.class);
    this.scriptHandlerFactory = services.get(ScriptHandlerFactory.class);
    this.projectDescriptorRegistry = services.get(ProjectDescriptorRegistry.class);
    rootProjectDescriptor = createProjectDescriptor(null, settingsDir.getName(), settingsDir);
}
 
Example #12
Source Project: Pushjet-Android   Author: Pushjet   File: DefaultGradle.java    License: 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 #13
Source Project: pushfish-android   Author: PushFish   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void configureWithJavaPluginApplied(final Project project, final EarPluginConvention earPluginConvention, PluginContainer plugins) {
    plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
        public void execute(JavaPlugin javaPlugin) {
            final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

            SourceSet sourceSet = javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
            sourceSet.getResources().srcDir(new Callable() {
                public Object call() throws Exception {
                    return earPluginConvention.getAppDirName();
                }
            });
            project.getTasks().withType(Ear.class, new Action<Ear>() {
                public void execute(final Ear task) {
                    task.dependsOn(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
                                    .getRuntimeClasspath();
                        }
                    });
                    task.from(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput();
                        }
                    });
                }
            });
        }
    });
}
 
Example #14
Source Project: pushfish-android   Author: PushFish   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void configureWithJavaPluginApplied(final Project project, final EarPluginConvention earPluginConvention, PluginContainer plugins) {
    plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
        public void execute(JavaPlugin javaPlugin) {
            final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

            SourceSet sourceSet = javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
            sourceSet.getResources().srcDir(new Callable() {
                public Object call() throws Exception {
                    return earPluginConvention.getAppDirName();
                }
            });
            project.getTasks().withType(Ear.class, new Action<Ear>() {
                public void execute(final Ear task) {
                    task.dependsOn(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
                                    .getRuntimeClasspath();
                        }
                    });
                    task.from(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput();
                        }
                    });
                }
            });
        }
    });
}
 
Example #15
Source Project: Pushjet-Android   Author: Pushjet   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void configureWithJavaPluginApplied(final Project project, final EarPluginConvention earPluginConvention, PluginContainer plugins) {
    plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
        public void execute(JavaPlugin javaPlugin) {
            final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

            SourceSet sourceSet = javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
            sourceSet.getResources().srcDir(new Callable() {
                public Object call() throws Exception {
                    return earPluginConvention.getAppDirName();
                }
            });
            project.getTasks().withType(Ear.class, new Action<Ear>() {
                public void execute(final Ear task) {
                    task.dependsOn(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
                                    .getRuntimeClasspath();
                        }
                    });
                    task.from(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput();
                        }
                    });
                }
            });
        }
    });
}
 
Example #16
Source Project: Pushjet-Android   Author: Pushjet   File: EarPlugin.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void configureWithJavaPluginApplied(final Project project, final EarPluginConvention earPluginConvention, PluginContainer plugins) {
    plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
        public void execute(JavaPlugin javaPlugin) {
            final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

            SourceSet sourceSet = javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
            sourceSet.getResources().srcDir(new Callable() {
                public Object call() throws Exception {
                    return earPluginConvention.getAppDirName();
                }
            });
            project.getTasks().withType(Ear.class, new Action<Ear>() {
                public void execute(final Ear task) {
                    task.dependsOn(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
                                    .getRuntimeClasspath();
                        }
                    });
                    task.from(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput();
                        }
                    });
                }
            });
        }
    });
}
 
Example #17
Source Project: pushfish-android   Author: PushFish   File: AbstractProject.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Inject
public PluginContainer getPlugins() {
    // Decoration takes care of the implementation
    throw new UnsupportedOperationException();
}
 
Example #18
Source Project: pushfish-android   Author: PushFish   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return plugins;
}
 
Example #19
Source Project: pushfish-android   Author: PushFish   File: DefaultGradle.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return pluginContainer;
}
 
Example #20
Source Project: pushfish-android   Author: PushFish   File: ProjectScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected PluginContainer createPluginContainer() {
    List<PluginApplicationAction> allPluginApplyActions = getAll(PluginApplicationAction.class);
    return new DefaultPluginContainer<Project>(get(PluginRegistry.class), project, allPluginApplyActions);
}
 
Example #21
Source Project: pushfish-android   Author: PushFish   File: SettingsScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), settings);
}
 
Example #22
Source Project: pushfish-android   Author: PushFish   File: GradleScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
PluginContainer createPluginContainer(GradleInternal gradle, PluginRegistry pluginRegistry) {
    return new DefaultPluginContainer<GradleInternal>(pluginRegistry, gradle);
}
 
Example #23
Source Project: pushfish-android   Author: PushFish   File: AbstractProject.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return pluginContainer;
}
 
Example #24
Source Project: pushfish-android   Author: PushFish   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return plugins;
}
 
Example #25
Source Project: pushfish-android   Author: PushFish   File: DefaultGradle.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return pluginContainer;
}
 
Example #26
Source Project: pushfish-android   Author: PushFish   File: ProjectScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), project);
}
 
Example #27
Source Project: pushfish-android   Author: PushFish   File: SettingsScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), settings);
}
 
Example #28
Source Project: pushfish-android   Author: PushFish   File: GradleScopeServices.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
PluginContainer createPluginContainer(GradleInternal gradle, PluginRegistry pluginRegistry) {
    return new DefaultPluginContainer<GradleInternal>(pluginRegistry, gradle);
}
 
Example #29
Source Project: Pushjet-Android   Author: Pushjet   File: AbstractProject.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Inject
public PluginContainer getPlugins() {
    // Decoration takes care of the implementation
    throw new UnsupportedOperationException();
}
 
Example #30
Source Project: Pushjet-Android   Author: Pushjet   File: BaseSettings.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public PluginContainer getPlugins() {
    return plugins;
}