use of org.gradle.language.base.LanguageSourceSet in project gradle by gradle.
the class DefaultJvmBinarySpec method collectDependencies.
public static List<DependencySpec> collectDependencies(final BinarySpec binary, @Nullable final SourceComponentSpec owner, final Collection<DependencySpec>... specificDependencies) {
List<DependencySpec> dependencies = Lists.newArrayList();
if (specificDependencies != null) {
for (Collection<DependencySpec> deps : specificDependencies) {
dependencies.addAll(deps);
}
}
Collection<LanguageSourceSet> binarySources = binary.getSources().values();
Iterable<LanguageSourceSet> sourceSets = owner != null ? Iterables.concat(owner.getSources().values(), binarySources) : binarySources;
for (LanguageSourceSet sourceSet : sourceSets) {
if (sourceSet instanceof DependentSourceSet) {
dependencies.addAll(((DependentSourceSet) sourceSet).getDependencies().getDependencies());
}
}
return dependencies;
}
use of org.gradle.language.base.LanguageSourceSet in project gradle by gradle.
the class SourceSetNativeDependencyResolver method resolve.
@Override
public void resolve(NativeBinaryResolveResult nativeBinaryResolveResult) {
for (NativeBinaryRequirementResolveResult resolution : nativeBinaryResolveResult.getPendingResolutions()) {
if (resolution.getInput() instanceof LanguageSourceSet) {
LanguageSourceSet input = (LanguageSourceSet) resolution.getInput();
resolution.setNativeDependencySet(createNativeDependencySet(input));
}
}
delegate.resolve(nativeBinaryResolveResult);
}
use of org.gradle.language.base.LanguageSourceSet in project gradle by gradle.
the class DefaultVisualStudioProject method getSourceFiles.
public List<File> getSourceFiles() {
Set<File> allSource = new LinkedHashSet<File>();
allSource.addAll(additionalFiles);
for (LanguageSourceSet sourceSet : sources) {
if (!(sourceSet instanceof WindowsResourceSet)) {
allSource.addAll(sourceSet.getSource().getFiles());
}
}
return new ArrayList<File>(allSource);
}
use of org.gradle.language.base.LanguageSourceSet in project gradle by gradle.
the class PlayIdeaPlugin method configureIdeaModule.
@Mutate
public void configureIdeaModule(@Path("tasks.ideaModule") GenerateIdeaModule ideaModule, @Path("binaries.playBinary") final PlayApplicationBinarySpec playApplicationBinarySpec, @Path("buildDir") final File buildDir, ConfigurationContainer configurations, final FileResolver fileResolver) {
IdeaModule module = ideaModule.getModule();
module.setScopes(buildScopes(configurations));
ConventionMapping conventionMapping = conventionMappingFor(module);
conventionMapping.map("sourceDirs", new Callable<Set<File>>() {
@Override
public Set<File> call() throws Exception {
// TODO: Assets should probably be a source set too
Set<File> sourceDirs = Sets.newHashSet(playApplicationBinarySpec.getAssets().getAssetDirs());
return CollectionUtils.inject(sourceDirs, playApplicationBinarySpec.getInputs(), new Action<CollectionUtils.InjectionStep<Set<File>, LanguageSourceSet>>() {
@Override
public void execute(CollectionUtils.InjectionStep<Set<File>, LanguageSourceSet> step) {
step.getTarget().addAll(step.getItem().getSource().getSrcDirs());
}
});
}
});
conventionMapping.map("testSourceDirs", new Callable<Set<File>>() {
@Override
public Set<File> call() throws Exception {
// TODO: This should be modeled as a source set
return Collections.singleton(fileResolver.resolve("test"));
}
});
conventionMapping.map("singleEntryLibraries", new Callable<Map<String, Iterable<File>>>() {
@Override
public Map<String, Iterable<File>> call() throws Exception {
return ImmutableMap.<String, Iterable<File>>builder().put("COMPILE", Collections.singleton(playApplicationBinarySpec.getClasses().getClassesDir())).put("RUNTIME", playApplicationBinarySpec.getClasses().getResourceDirs()).put("TEST", Collections.singleton(new File(buildDir, "playBinary/testClasses"))).build();
}
});
module.setScalaPlatform(playApplicationBinarySpec.getTargetPlatform().getScalaPlatform());
conventionMapping.map("targetBytecodeVersion", new Callable<JavaVersion>() {
@Override
public JavaVersion call() throws Exception {
return getTargetJavaVersion(playApplicationBinarySpec);
}
});
conventionMapping.map("languageLevel", new Callable<IdeaLanguageLevel>() {
@Override
public IdeaLanguageLevel call() throws Exception {
return new IdeaLanguageLevel(getTargetJavaVersion(playApplicationBinarySpec));
}
});
ideaModule.dependsOn(playApplicationBinarySpec.getInputs());
ideaModule.dependsOn(playApplicationBinarySpec.getAssets());
}
use of org.gradle.language.base.LanguageSourceSet in project gradle by gradle.
the class DefaultVisualStudioProject method getHeaderFiles.
public List<File> getHeaderFiles() {
Set<File> allHeaders = new LinkedHashSet<File>();
for (LanguageSourceSet sourceSet : sources) {
if (sourceSet instanceof HeaderExportingSourceSet) {
HeaderExportingSourceSet exportingSourceSet = (HeaderExportingSourceSet) sourceSet;
allHeaders.addAll(exportingSourceSet.getExportedHeaders().getFiles());
allHeaders.addAll(exportingSourceSet.getImplicitHeaders().getFiles());
}
}
return new ArrayList<File>(allHeaders);
}
Aggregations