org.gradle.language.base.plugins.LanguageBasePlugin Java Examples
The following examples show how to use
org.gradle.language.base.plugins.LanguageBasePlugin.
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: LegacyJavaComponentPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public void apply(final Project target) { target.getPlugins().apply(LanguageBasePlugin.class); BinaryContainer binaryContainer = target.getExtensions().getByType(BinaryContainer.class); binaryContainer.registerFactory(ClassDirectoryBinarySpec.class, new NamedDomainObjectFactory<ClassDirectoryBinarySpec>() { public ClassDirectoryBinarySpec create(String name) { return instantiator.newInstance(DefaultClassDirectoryBinarySpec.class, name, toolChain, new DefaultJavaPlatform(JavaVersion.current())); } }); binaryContainer.withType(ClassDirectoryBinarySpecInternal.class).all(new Action<ClassDirectoryBinarySpecInternal>() { public void execute(ClassDirectoryBinarySpecInternal binary) { createBinaryLifecycleTask(binary, target); setClassesDirConvention(binary, target); createProcessResourcesTaskForBinary(binary, target); createCompileJavaTaskForBinary(binary, target); } }); }
Example #2
Source File: JavaBasePlugin.java From javaide with GNU General Public License v3.0 | 6 votes |
public void apply(ProjectInternal project) { project.getPluginManager().apply(BasePlugin.class); project.getPluginManager().apply(ReportingBasePlugin.class); project.getPluginManager().apply(LanguageBasePlugin.class); project.getPluginManager().apply(BinaryBasePlugin.class); JavaPluginConvention javaConvention = new JavaPluginConvention(project, instantiator); project.getConvention().getPlugins().put("java", javaConvention); configureCompileDefaults(project, javaConvention); BridgedBinaries binaries = configureSourceSetDefaults(javaConvention); modelRegistry.register(ModelRegistrations.bridgedInstance(ModelReference.of("bridgedBinaries", BridgedBinaries.class), binaries) .descriptor("JavaBasePlugin.apply()") .hidden(true) .build()); configureJavaDoc(project, javaConvention); configureTest(project, javaConvention); configureBuildNeeded(project); configureBuildDependents(project); }
Example #3
Source File: LegacyJavaComponentPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public void apply(final Project target) { target.getPlugins().apply(LanguageBasePlugin.class); BinaryContainer binaryContainer = target.getExtensions().getByType(BinaryContainer.class); binaryContainer.registerFactory(ClassDirectoryBinarySpec.class, new NamedDomainObjectFactory<ClassDirectoryBinarySpec>() { public ClassDirectoryBinarySpec create(String name) { return instantiator.newInstance(DefaultClassDirectoryBinarySpec.class, name, toolChain, new DefaultJavaPlatform(JavaVersion.current())); } }); binaryContainer.withType(ClassDirectoryBinarySpecInternal.class).all(new Action<ClassDirectoryBinarySpecInternal>() { public void execute(ClassDirectoryBinarySpecInternal binary) { createBinaryLifecycleTask(binary, target); setClassesDirConvention(binary, target); createProcessResourcesTaskForBinary(binary, target); createCompileJavaTaskForBinary(binary, target); } }); }
Example #4
Source File: NativeBinariesModelPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void apply(final ProjectInternal project) { project.getPlugins().apply(BasePlugin.class); project.getPlugins().apply(LanguageBasePlugin.class); modelRules.register("toolChains", ToolChainRegistryInternal.class, factory(DefaultToolChainRegistry.class)); modelRules.register("platforms", PlatformContainer.class, factory(DefaultPlatformContainer.class)); modelRules.register("buildTypes", BuildTypeContainer.class, factory(DefaultBuildTypeContainer.class)); modelRules.register("flavors", FlavorContainer.class, factory(DefaultFlavorContainer.class)); project.getModelRegistry().create("repositories", Arrays.asList("flavors", "platforms", "buildTypes"), new RepositoriesFactory(instantiator, fileResolver)); modelRules.rule(new CreateDefaultPlatform()); modelRules.rule(new CreateDefaultBuildTypes()); modelRules.rule(new CreateDefaultFlavors()); modelRules.rule(new AddDefaultToolChainsIfRequired()); modelRules.rule(new CreateNativeBinaries(instantiator, project, resolver)); modelRules.rule(new CloseBinariesForTasks()); project.getExtensions().create( "executables", DefaultExecutableContainer.class, instantiator, project ); project.getExtensions().create( "libraries", DefaultLibraryContainer.class, instantiator, project ); // TODO:DAZ Lazy configuration actions: need a better way to accomplish these. configurationActions.add(Actions.composite( new ConfigureGeneratedSourceSets(), new ApplySourceSetConventions() )); }
Example #5
Source File: NativeBinariesModelPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void apply(final ProjectInternal project) { project.getPlugins().apply(BasePlugin.class); project.getPlugins().apply(LanguageBasePlugin.class); modelRules.register("toolChains", ToolChainRegistryInternal.class, factory(DefaultToolChainRegistry.class)); modelRules.register("platforms", PlatformContainer.class, factory(DefaultPlatformContainer.class)); modelRules.register("buildTypes", BuildTypeContainer.class, factory(DefaultBuildTypeContainer.class)); modelRules.register("flavors", FlavorContainer.class, factory(DefaultFlavorContainer.class)); project.getModelRegistry().create("repositories", Arrays.asList("flavors", "platforms", "buildTypes"), new RepositoriesFactory(instantiator, fileResolver)); modelRules.rule(new CreateDefaultPlatform()); modelRules.rule(new CreateDefaultBuildTypes()); modelRules.rule(new CreateDefaultFlavors()); modelRules.rule(new AddDefaultToolChainsIfRequired()); modelRules.rule(new CreateNativeBinaries(instantiator, project, resolver)); modelRules.rule(new CloseBinariesForTasks()); project.getExtensions().create( "executables", DefaultExecutableContainer.class, instantiator, project ); project.getExtensions().create( "libraries", DefaultLibraryContainer.class, instantiator, project ); // TODO:DAZ Lazy configuration actions: need a better way to accomplish these. configurationActions.add(Actions.composite( new ConfigureGeneratedSourceSets(), new ApplySourceSetConventions() )); }
Example #6
Source File: CpdPluginTest.java From gradle-cpd-plugin with Apache License 2.0 | 5 votes |
static Stream<Class<? extends Plugin>> CpdPlugin_shouldAddCpdCheckTaskAsDependencyOfCheckLifecycleTaskIfPluginIsApplied() { return Stream.of( LifecycleBasePlugin.class, BasePlugin.class, LanguageBasePlugin.class, JavaBasePlugin.class, JavaPlugin.class, GroovyPlugin.class, CppPlugin.class ); }