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); }
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); }
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); }
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; } }); }
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); }
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); }
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; } }); }
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; } }
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(); } }); } }); } }); }
public PluginContainer getPlugins() { return getPluginManager().getPluginContainer(); }
@Inject public PluginContainer getPlugins() { // Decoration takes care of the implementation throw new UnsupportedOperationException(); }
public PluginContainer getPlugins() { return plugins; }
public PluginContainer getPlugins() { return pluginContainer; }
protected PluginContainer createPluginContainer() { List<PluginApplicationAction> allPluginApplyActions = getAll(PluginApplicationAction.class); return new DefaultPluginContainer<Project>(get(PluginRegistry.class), project, allPluginApplyActions); }
protected PluginContainer createPluginContainer() { return new DefaultPluginContainer(get(PluginRegistry.class), settings); }
PluginContainer createPluginContainer(GradleInternal gradle, PluginRegistry pluginRegistry) { return new DefaultPluginContainer<GradleInternal>(pluginRegistry, gradle); }
protected PluginContainer createPluginContainer() { return new DefaultPluginContainer(get(PluginRegistry.class), project); }
public static void addPluginIfNot(Project project, Class<? extends Plugin> pluginClazz){ PluginContainer pluginManager = project.getPlugins(); if (pluginManager.hasPlugin(pluginClazz)){ return; } pluginManager.apply(pluginClazz); }
PluginContainer getPluginContainer();