Search in sources :

Example 1 with NativeBinarySpec

use of org.gradle.nativeplatform.NativeBinarySpec in project gradle by gradle.

the class ProjectLibraryBinaryLocator method getBinaries.

// Converts the binaries of a project library into regular binary instances
@Nullable
@Override
public DomainObjectSet<NativeLibraryBinary> getBinaries(LibraryIdentifier libraryIdentifier) {
    ModelRegistry projectModel = projectModelResolver.resolveProjectModel(libraryIdentifier.getProjectPath());
    ComponentSpecContainer components = projectModel.find("components", ComponentSpecContainer.class);
    if (components == null) {
        return null;
    }
    String libraryName = libraryIdentifier.getLibraryName();
    NativeLibrarySpec library = components.withType(NativeLibrarySpec.class).get(libraryName);
    if (library == null) {
        return null;
    }
    ModelMap<NativeBinarySpec> projectBinaries = library.getBinaries().withType(NativeBinarySpec.class);
    DomainObjectSet<NativeLibraryBinary> binaries = domainObjectCollectionFactory.newDomainObjectSet(NativeLibraryBinary.class);
    for (NativeBinarySpec nativeBinarySpec : projectBinaries.values()) {
        binaries.add((NativeLibraryBinary) nativeBinarySpec);
    }
    return binaries;
}
Also used : NativeLibraryBinary(org.gradle.nativeplatform.NativeLibraryBinary) ModelRegistry(org.gradle.model.internal.registry.ModelRegistry) NativeBinarySpec(org.gradle.nativeplatform.NativeBinarySpec) ComponentSpecContainer(org.gradle.platform.base.ComponentSpecContainer) NativeLibrarySpec(org.gradle.nativeplatform.NativeLibrarySpec) Nullable(javax.annotation.Nullable)

Example 2 with NativeBinarySpec

use of org.gradle.nativeplatform.NativeBinarySpec in project gradle by gradle.

the class NativeTestSuiteBinaryRenderer method renderDetails.

@Override
protected void renderDetails(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) {
    NativeTestSuiteSpec testSuite = binary.getTestSuite();
    NativeComponentSpec testedComponent = testSuite.getTestedComponent();
    if (testedComponent != null) {
        builder.item("component under test", testedComponent.getDisplayName());
    }
    NativeBinarySpec testedBinary = binary.getTestedBinary();
    if (testedBinary != null) {
        builder.item("binary under test", testedBinary.getDisplayName());
    }
    super.renderDetails(binary, builder);
}
Also used : NativeTestSuiteSpec(org.gradle.nativeplatform.test.NativeTestSuiteSpec) NativeComponentSpec(org.gradle.nativeplatform.NativeComponentSpec) NativeBinarySpec(org.gradle.nativeplatform.NativeBinarySpec)

Aggregations

NativeBinarySpec (org.gradle.nativeplatform.NativeBinarySpec)2 Nullable (javax.annotation.Nullable)1 ModelRegistry (org.gradle.model.internal.registry.ModelRegistry)1 NativeComponentSpec (org.gradle.nativeplatform.NativeComponentSpec)1 NativeLibraryBinary (org.gradle.nativeplatform.NativeLibraryBinary)1 NativeLibrarySpec (org.gradle.nativeplatform.NativeLibrarySpec)1 NativeTestSuiteSpec (org.gradle.nativeplatform.test.NativeTestSuiteSpec)1 ComponentSpecContainer (org.gradle.platform.base.ComponentSpecContainer)1