Search in sources :

Example 1 with FileCollectionAdapter

use of org.gradle.api.internal.file.collections.FileCollectionAdapter in project gradle by gradle.

the class NativeSpecVisualStudioTargetBinary method getHeaderFiles.

@Override
public FileCollection getHeaderFiles() {
    Spec<LanguageSourceSet> filter = new Spec<LanguageSourceSet>() {

        @Override
        public boolean isSatisfiedBy(LanguageSourceSet sourceSet) {
            return sourceSet instanceof HeaderExportingSourceSet;
        }
    };
    Transformer<FileCollection, LanguageSourceSet> transform = new Transformer<FileCollection, LanguageSourceSet>() {

        @Override
        public FileCollection transform(LanguageSourceSet sourceSet) {
            HeaderExportingSourceSet exportingSourceSet = (HeaderExportingSourceSet) sourceSet;
            return exportingSourceSet.getExportedHeaders().plus(exportingSourceSet.getImplicitHeaders());
        }
    };
    return new FileCollectionAdapter(new LanguageSourceSetCollectionAdapter(getComponentName() + " header files", binary.getInputs(), filter, transform));
}
Also used : LanguageSourceSet(org.gradle.language.base.LanguageSourceSet) Transformer(org.gradle.api.Transformer) FileCollectionAdapter(org.gradle.api.internal.file.collections.FileCollectionAdapter) HeaderExportingSourceSet(org.gradle.language.nativeplatform.HeaderExportingSourceSet) SharedLibraryBinarySpec(org.gradle.nativeplatform.SharedLibraryBinarySpec) NativeTestSuiteBinarySpec(org.gradle.nativeplatform.test.NativeTestSuiteBinarySpec) StaticLibraryBinarySpec(org.gradle.nativeplatform.StaticLibraryBinarySpec) Spec(org.gradle.api.specs.Spec) NativeExecutableBinarySpec(org.gradle.nativeplatform.NativeExecutableBinarySpec) NativeBinarySpec(org.gradle.nativeplatform.NativeBinarySpec) FileCollection(org.gradle.api.file.FileCollection) UnionFileCollection(org.gradle.api.internal.file.UnionFileCollection)

Aggregations

Transformer (org.gradle.api.Transformer)1 FileCollection (org.gradle.api.file.FileCollection)1 UnionFileCollection (org.gradle.api.internal.file.UnionFileCollection)1 FileCollectionAdapter (org.gradle.api.internal.file.collections.FileCollectionAdapter)1 Spec (org.gradle.api.specs.Spec)1 LanguageSourceSet (org.gradle.language.base.LanguageSourceSet)1 HeaderExportingSourceSet (org.gradle.language.nativeplatform.HeaderExportingSourceSet)1 NativeBinarySpec (org.gradle.nativeplatform.NativeBinarySpec)1 NativeExecutableBinarySpec (org.gradle.nativeplatform.NativeExecutableBinarySpec)1 SharedLibraryBinarySpec (org.gradle.nativeplatform.SharedLibraryBinarySpec)1 StaticLibraryBinarySpec (org.gradle.nativeplatform.StaticLibraryBinarySpec)1 NativeTestSuiteBinarySpec (org.gradle.nativeplatform.test.NativeTestSuiteBinarySpec)1