Project project = findProject(requirement);
ComponentSpecContainer componentSpecContainer = project.getExtensions().findByType(ComponentSpecContainer.class);
if (componentSpecContainer == null) {
throw new LibraryResolveException(String.format("Project does not have a libraries container: '%s'", project.getPath()));
}
DomainObjectSet<NativeBinarySpec> projectBinaries = componentSpecContainer.withType(NativeLibrarySpec.class).getByName(requirement.getLibraryName()).getNativeBinaries();
DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
// TODO:DAZ Convert, don't cast
for (NativeBinarySpec nativeBinarySpec : projectBinaries) {
binaries.add((NativeLibraryBinary) nativeBinarySpec);
}