use of org.gradle.platform.base.internal.BinarySpecInternal in project gradle by gradle.
the class NativeComponents method wireBuildDependentTasks.
public static void wireBuildDependentTasks(final ModelMap<Task> tasks, BinaryContainer binaries, final DependentBinariesResolver dependentsResolver, final ProjectModelResolver projectModelResolver) {
final ModelMap<NativeBinarySpecInternal> nativeBinaries = binaries.withType(NativeBinarySpecInternal.class);
for (final BinarySpecInternal binary : nativeBinaries) {
Task assembleDependents = tasks.get(binary.getNamingScheme().getTaskName(ASSEMBLE_DEPENDENTS_TASK_NAME));
Task buildDependents = tasks.get(binary.getNamingScheme().getTaskName(BUILD_DEPENDENTS_TASK_NAME));
// Wire build dependent components tasks dependencies
Task assembleDependentComponents = tasks.get(getAssembleDependentComponentsTaskName(binary.getComponent()));
if (assembleDependentComponents != null) {
assembleDependentComponents.dependsOn(assembleDependents);
}
Task buildDependentComponents = tasks.get(getBuildDependentComponentsTaskName(binary.getComponent()));
if (buildDependentComponents != null) {
buildDependentComponents.dependsOn(buildDependents);
}
// Wire build dependent binaries tasks dependencies
// Defer dependencies gathering as we need to resolve across project's boundaries
assembleDependents.dependsOn(new Callable<Iterable<Task>>() {
@Override
public Iterable<Task> call() {
return getDependentTaskDependencies(ASSEMBLE_DEPENDENTS_TASK_NAME, binary, dependentsResolver, projectModelResolver);
}
});
buildDependents.dependsOn(new Callable<Iterable<Task>>() {
@Override
public Iterable<Task> call() {
return getDependentTaskDependencies(BUILD_DEPENDENTS_TASK_NAME, binary, dependentsResolver, projectModelResolver);
}
});
}
}
use of org.gradle.platform.base.internal.BinarySpecInternal in project gradle by gradle.
the class DependentComponentsRenderer method getRenderableDependencyOf.
private DependentComponentsRenderableDependency getRenderableDependencyOf(final ComponentSpec componentSpec, ComponentSpecInternal internalProtocol) {
if (resolver != null && componentSpec instanceof VariantComponentSpec) {
VariantComponentSpec variantComponentSpec = (VariantComponentSpec) componentSpec;
LinkedHashSet<DependentComponentsRenderableDependency> children = Sets.newLinkedHashSet();
for (BinarySpecInternal binarySpec : variantComponentSpec.getBinaries().withType(BinarySpecInternal.class)) {
DependentBinariesResolutionResult resolvedBinary = resolver.resolve(binarySpec);
children.add(DependentComponentsRenderableDependency.of(resolvedBinary.getRoot()));
}
return DependentComponentsRenderableDependency.of(componentSpec, internalProtocol, children);
} else {
return DependentComponentsRenderableDependency.of(componentSpec, internalProtocol);
}
}
use of org.gradle.platform.base.internal.BinarySpecInternal in project gradle by gradle.
the class JvmTestSuiteBasePlugin method configureRuntimeClasspath.
@Finalize
public void configureRuntimeClasspath(@Each JvmTestSuiteBinarySpecInternal testBinary, ServiceRegistry serviceRegistry, ModelSchemaStore modelSchemaStore) {
ArtifactDependencyResolver dependencyResolver = serviceRegistry.get(ArtifactDependencyResolver.class);
RepositoryHandler repositories = serviceRegistry.get(RepositoryHandler.class);
List<ResolutionAwareRepository> resolutionAwareRepositories = CollectionUtils.collect(repositories, Transformers.cast(ResolutionAwareRepository.class));
ModelSchema<? extends JvmTestSuiteBinarySpec> schema = Cast.uncheckedCast(modelSchemaStore.getSchema(((BinarySpecInternal) testBinary).getPublicType()));
AttributesSchema attributesSchema = serviceRegistry.get(AttributesSchema.class);
ImmutableModuleIdentifierFactory moduleIdentifierFactory = serviceRegistry.get(ImmutableModuleIdentifierFactory.class);
ModuleExclusions moduleExclusions = serviceRegistry.get(ModuleExclusions.class);
BuildOperationProcessor buildOperationProcessor = serviceRegistry.get(BuildOperationProcessor.class);
testBinary.setRuntimeClasspath(configureRuntimeClasspath(testBinary, dependencyResolver, resolutionAwareRepositories, schema, attributesSchema, moduleIdentifierFactory, moduleExclusions, buildOperationProcessor));
}
Aggregations