Java Code Examples for org.gradle.language.base.FunctionalSourceSet#withType()
The following examples show how to use
org.gradle.language.base.FunctionalSourceSet#withType() .
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: ApplySourceSetConventions.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public void execute(ProjectInternal project) { ProjectSourceSet projectSourceSet = project.getExtensions().getByType(ProjectSourceSet.class); for (FunctionalSourceSet functionalSourceSet : projectSourceSet) { for (LanguageSourceSet languageSourceSet : functionalSourceSet) { // Only apply default locations when none explicitly configured if (languageSourceSet.getSource().getSrcDirs().isEmpty()) { languageSourceSet.getSource().srcDir(String.format("src/%s/%s", functionalSourceSet.getName(), languageSourceSet.getName())); } } for (HeaderExportingSourceSet headerSourceSet : functionalSourceSet.withType(HeaderExportingSourceSet.class)) { // Only apply default locations when none explicitly configured if (headerSourceSet.getExportedHeaders().getSrcDirs().isEmpty()) { headerSourceSet.getExportedHeaders().srcDir(String.format("src/%s/headers", functionalSourceSet.getName())); } headerSourceSet.getImplicitHeaders().setSrcDirs(headerSourceSet.getSource().getSrcDirs()); headerSourceSet.getImplicitHeaders().include("**/*.h"); } } }
Example 2
Source File: ApplySourceSetConventions.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public void execute(ProjectInternal project) { ProjectSourceSet projectSourceSet = project.getExtensions().getByType(ProjectSourceSet.class); for (FunctionalSourceSet functionalSourceSet : projectSourceSet) { for (LanguageSourceSet languageSourceSet : functionalSourceSet) { // Only apply default locations when none explicitly configured if (languageSourceSet.getSource().getSrcDirs().isEmpty()) { languageSourceSet.getSource().srcDir(String.format("src/%s/%s", functionalSourceSet.getName(), languageSourceSet.getName())); } } for (HeaderExportingSourceSet headerSourceSet : functionalSourceSet.withType(HeaderExportingSourceSet.class)) { // Only apply default locations when none explicitly configured if (headerSourceSet.getExportedHeaders().getSrcDirs().isEmpty()) { headerSourceSet.getExportedHeaders().srcDir(String.format("src/%s/headers", functionalSourceSet.getName())); } headerSourceSet.getImplicitHeaders().setSrcDirs(headerSourceSet.getSource().getSrcDirs()); headerSourceSet.getImplicitHeaders().include("**/*.h"); } } }
Example 3
Source File: NativeComponentModelPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate void configureGeneratedSourceSets(ProjectSourceSet sources) { for (FunctionalSourceSet functionalSourceSet : sources) { for (LanguageSourceSetInternal languageSourceSet : functionalSourceSet.withType(LanguageSourceSetInternal.class)) { Task generatorTask = languageSourceSet.getGeneratorTask(); if (generatorTask != null) { languageSourceSet.builtBy(generatorTask); maybeSetSourceDir(languageSourceSet.getSource(), generatorTask, "sourceDir"); if (languageSourceSet instanceof HeaderExportingSourceSet) { maybeSetSourceDir(((HeaderExportingSourceSet) languageSourceSet).getExportedHeaders(), generatorTask, "headerDir"); } } } } }
Example 4
Source File: NativeComponentModelPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Finalize public void applyHeaderSourceSetConventions(ProjectSourceSet sources) { for (FunctionalSourceSet functionalSourceSet : sources) { for (HeaderExportingSourceSet headerSourceSet : functionalSourceSet.withType(HeaderExportingSourceSet.class)) { // Only apply default locations when none explicitly configured if (headerSourceSet.getExportedHeaders().getSrcDirs().isEmpty()) { headerSourceSet.getExportedHeaders().srcDir(String.format("src/%s/headers", functionalSourceSet.getName())); } headerSourceSet.getImplicitHeaders().setSrcDirs(headerSourceSet.getSource().getSrcDirs()); headerSourceSet.getImplicitHeaders().include("**/*.h"); } } }
Example 5
Source File: ConfigureGeneratedSourceSets.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void execute(ProjectInternal project) { ProjectSourceSet projectSourceSet = project.getExtensions().getByType(ProjectSourceSet.class); for (FunctionalSourceSet functionalSourceSet : projectSourceSet) { for (LanguageSourceSetInternal languageSourceSet : functionalSourceSet.withType(LanguageSourceSetInternal.class)) { Task generatorTask = languageSourceSet.getGeneratorTask(); if (generatorTask != null) { languageSourceSet.builtBy(generatorTask); maybeSetSourceDir(languageSourceSet.getSource(), generatorTask, "sourceDir"); if (languageSourceSet instanceof HeaderExportingSourceSet) { maybeSetSourceDir(((HeaderExportingSourceSet) languageSourceSet).getExportedHeaders(), generatorTask, "headerDir"); } } } } }
Example 6
Source File: NativeComponentModelPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate void configureGeneratedSourceSets(ProjectSourceSet sources) { for (FunctionalSourceSet functionalSourceSet : sources) { for (LanguageSourceSetInternal languageSourceSet : functionalSourceSet.withType(LanguageSourceSetInternal.class)) { Task generatorTask = languageSourceSet.getGeneratorTask(); if (generatorTask != null) { languageSourceSet.builtBy(generatorTask); maybeSetSourceDir(languageSourceSet.getSource(), generatorTask, "sourceDir"); if (languageSourceSet instanceof HeaderExportingSourceSet) { maybeSetSourceDir(((HeaderExportingSourceSet) languageSourceSet).getExportedHeaders(), generatorTask, "headerDir"); } } } } }
Example 7
Source File: NativeComponentModelPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Finalize public void applyHeaderSourceSetConventions(ProjectSourceSet sources) { for (FunctionalSourceSet functionalSourceSet : sources) { for (HeaderExportingSourceSet headerSourceSet : functionalSourceSet.withType(HeaderExportingSourceSet.class)) { // Only apply default locations when none explicitly configured if (headerSourceSet.getExportedHeaders().getSrcDirs().isEmpty()) { headerSourceSet.getExportedHeaders().srcDir(String.format("src/%s/headers", functionalSourceSet.getName())); } headerSourceSet.getImplicitHeaders().setSrcDirs(headerSourceSet.getSource().getSrcDirs()); headerSourceSet.getImplicitHeaders().include("**/*.h"); } } }
Example 8
Source File: ConfigureGeneratedSourceSets.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void execute(ProjectInternal project) { ProjectSourceSet projectSourceSet = project.getExtensions().getByType(ProjectSourceSet.class); for (FunctionalSourceSet functionalSourceSet : projectSourceSet) { for (LanguageSourceSetInternal languageSourceSet : functionalSourceSet.withType(LanguageSourceSetInternal.class)) { Task generatorTask = languageSourceSet.getGeneratorTask(); if (generatorTask != null) { languageSourceSet.builtBy(generatorTask); maybeSetSourceDir(languageSourceSet.getSource(), generatorTask, "sourceDir"); if (languageSourceSet instanceof HeaderExportingSourceSet) { maybeSetSourceDir(((HeaderExportingSourceSet) languageSourceSet).getExportedHeaders(), generatorTask, "headerDir"); } } } } }