Java 类org.gradle.api.plugins.PluginContainer 实例源码

项目:Reer    文件:EarPlugin.java   
public void apply(final Project project) {
    project.getPluginManager().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);
}
项目:Pushjet-Android    文件:EarPlugin.java   
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);
}
项目:Pushjet-Android    文件:BaseSettings.java   
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);
}
项目:Pushjet-Android    文件:DefaultGradle.java   
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;
        }
    });
}
项目:Pushjet-Android    文件:EarPlugin.java   
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);
}
项目:Pushjet-Android    文件:BaseSettings.java   
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);
}
项目:Pushjet-Android    文件:DefaultGradle.java   
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;
        }
    });
}
项目:okbuck    文件:ProjectUtil.java   
public static ProjectType getType(Project project) {
    PluginContainer plugins = project.getPlugins();
    if (plugins.hasPlugin(AppPlugin.class)) {
        return ProjectType.ANDROID_APP;
    } else if (plugins.hasPlugin(LibraryPlugin.class)) {
        return ProjectType.ANDROID_LIB;
    } else if (plugins.hasPlugin(GroovyPlugin.class)) {
        return ProjectType.GROOVY_LIB;
    } else if (plugins.hasPlugin(KotlinPluginWrapper.class)) {
        return ProjectType.KOTLIN_LIB;
    } else if (plugins.hasPlugin(ScalaPlugin.class)) {
        return ProjectType.SCALA_LIB;
    } else if (plugins.hasPlugin(JavaPlugin.class)) {
        return ProjectType.JAVA_LIB;
    } else {
        return ProjectType.UNKNOWN;
    }
}
项目:okbuck    文件:ProjectUtil.java   
public static ProjectType getType(Project project) {
    PluginContainer plugins = project.getPlugins();
    if (plugins.hasPlugin(AppPlugin.class)) {
        return ProjectType.ANDROID_APP;
    } else if (plugins.hasPlugin(LibraryPlugin.class)) {
        return ProjectType.ANDROID_LIB;
    } else if (plugins.hasPlugin(GroovyPlugin.class)) {
        return ProjectType.GROOVY_LIB;
    } else if (plugins.hasPlugin(KotlinPluginWrapper.class)) {
        return ProjectType.KOTLIN_LIB;
    } else if (plugins.hasPlugin(ScalaPlugin.class)) {
        return ProjectType.SCALA_LIB;
    } else if (plugins.hasPlugin(JavaPlugin.class)) {
        return ProjectType.JAVA_LIB;
    } else {
        return ProjectType.UNKNOWN;
    }
}
项目:Reer    文件:EarPlugin.java   
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();
                        }
                    });
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:EarPlugin.java   
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();
                        }
                    });
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:EarPlugin.java   
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();
                        }
                    });
                }
            });
        }
    });
}
项目:Reer    文件:AbstractPluginAware.java   
public PluginContainer getPlugins() {
    return getPluginManager().getPluginContainer();
}
项目:Pushjet-Android    文件:AbstractProject.java   
@Inject
public PluginContainer getPlugins() {
    // Decoration takes care of the implementation
    throw new UnsupportedOperationException();
}
项目:Pushjet-Android    文件:BaseSettings.java   
public PluginContainer getPlugins() {
    return plugins;
}
项目:Pushjet-Android    文件:DefaultGradle.java   
public PluginContainer getPlugins() {
    return pluginContainer;
}
项目:Pushjet-Android    文件:ProjectScopeServices.java   
protected PluginContainer createPluginContainer() {
    List<PluginApplicationAction> allPluginApplyActions = getAll(PluginApplicationAction.class);
    return new DefaultPluginContainer<Project>(get(PluginRegistry.class), project, allPluginApplyActions);
}
项目:Pushjet-Android    文件:SettingsScopeServices.java   
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), settings);
}
项目:Pushjet-Android    文件:GradleScopeServices.java   
PluginContainer createPluginContainer(GradleInternal gradle, PluginRegistry pluginRegistry) {
    return new DefaultPluginContainer<GradleInternal>(pluginRegistry, gradle);
}
项目:Pushjet-Android    文件:AbstractProject.java   
public PluginContainer getPlugins() {
    return pluginContainer;
}
项目:Pushjet-Android    文件:BaseSettings.java   
public PluginContainer getPlugins() {
    return plugins;
}
项目:Pushjet-Android    文件:DefaultGradle.java   
public PluginContainer getPlugins() {
    return pluginContainer;
}
项目:Pushjet-Android    文件:ProjectScopeServices.java   
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), project);
}
项目:Pushjet-Android    文件:SettingsScopeServices.java   
protected PluginContainer createPluginContainer() {
    return new DefaultPluginContainer(get(PluginRegistry.class), settings);
}
项目:Pushjet-Android    文件:GradleScopeServices.java   
PluginContainer createPluginContainer(GradleInternal gradle, PluginRegistry pluginRegistry) {
    return new DefaultPluginContainer<GradleInternal>(pluginRegistry, gradle);
}
项目:atlas    文件:PluginManager.java   
public static void addPluginIfNot(Project project, Class<? extends Plugin> pluginClazz){

        PluginContainer pluginManager = project.getPlugins();

        if (pluginManager.hasPlugin(pluginClazz)){
            return;
        }

        pluginManager.apply(pluginClazz);


    }
项目:Reer    文件:PluginManagerInternal.java   
PluginContainer getPluginContainer();