use of org.gradle.nativeplatform.NativeComponentSpec 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);
}
use of org.gradle.nativeplatform.NativeComponentSpec in project gradle by gradle.
the class NativeDependentBinariesResolutionStrategy method buildState.
private State buildState() {
State state = new State();
List<ProjectInternal> orderedProjects = Ordering.usingToString().sortedCopy(projectRegistry.getAllProjects());
for (ProjectInternal project : orderedProjects) {
if (project.getPlugins().hasPlugin(ComponentModelBasePlugin.class)) {
ModelRegistry modelRegistry = projectModelResolver.resolveProjectModel(project.getPath());
ModelMap<NativeComponentSpec> components = modelRegistry.realize("components", ModelTypes.modelMap(NativeComponentSpec.class));
for (NativeBinarySpecInternal binary : allBinariesOf(components.withType(VariantComponentSpec.class))) {
state.registerBinary(binary);
}
ModelMap<Object> testSuites = modelRegistry.find("testSuites", ModelTypes.modelMap(Object.class));
if (testSuites != null) {
for (NativeBinarySpecInternal binary : allBinariesOf(testSuites.withType(NativeComponentSpec.class).withType(VariantComponentSpec.class))) {
state.registerBinary(binary);
}
}
}
}
for (NativeBinarySpecInternal nativeBinary : state.dependencies.keySet()) {
for (NativeLibraryBinary libraryBinary : nativeBinary.getDependentBinaries()) {
// Skip prebuilt libraries
if (libraryBinary instanceof NativeBinarySpecInternal) {
// Unfortunate cast! see LibraryBinaryLocator
state.dependencies.get(nativeBinary).add((NativeBinarySpecInternal) libraryBinary);
}
}
if (testSupport != null) {
state.dependencies.get(nativeBinary).addAll(testSupport.getTestDependencies(nativeBinary));
}
}
return state;
}
Aggregations