use of org.gradle.platform.base.internal.dependents.DependentBinariesResolvedResult in project gradle by gradle.
the class NativeDependentBinariesResolutionStrategy method doBuildResolvedResult.
private List<DependentBinariesResolvedResult> doBuildResolvedResult(final NativeBinarySpecInternal target, State state, Deque<NativeBinarySpecInternal> stack) {
if (stack.contains(target)) {
onCircularDependencies(state, stack, target);
}
List<DependentBinariesResolvedResult> result = resultsCache.getIfPresent(target);
if (result != null) {
return result;
}
stack.push(target);
result = Lists.newArrayList();
List<NativeBinarySpecInternal> dependents = state.getDependents(target);
for (NativeBinarySpecInternal dependent : dependents) {
List<DependentBinariesResolvedResult> children = doBuildResolvedResult(dependent, state, stack);
result.add(new DefaultDependentBinariesResolvedResult(dependent.getId(), dependent.getProjectScopedName(), dependent.isBuildable(), isTestSuite(dependent), children));
}
stack.pop();
resultsCache.put(target, result);
return result;
}
use of org.gradle.platform.base.internal.dependents.DependentBinariesResolvedResult in project gradle by gradle.
the class NativeComponents method getDependentTaskDependencies.
private static List<Task> getDependentTaskDependencies(String dependedOnBinaryTaskName, BinarySpecInternal binary, DependentBinariesResolver dependentsResolver, ProjectModelResolver projectModelResolver) {
List<Task> dependencies = Lists.newArrayList();
DependentBinariesResolvedResult result = dependentsResolver.resolve(binary).getRoot();
for (DependentBinariesResolvedResult dependent : result.getChildren()) {
if (dependent.isBuildable()) {
ModelRegistry modelRegistry = projectModelResolver.resolveProjectModel(dependent.getId().getProjectPath());
ModelMap<NativeBinarySpecInternal> projectBinaries = modelRegistry.realize("binaries", ModelTypes.modelMap(NativeBinarySpecInternal.class));
ModelMap<Task> projectTasks = modelRegistry.realize("tasks", ModelTypes.modelMap(Task.class));
NativeBinarySpecInternal dependentBinary = projectBinaries.get(dependent.getProjectScopedName());
dependencies.add(projectTasks.get(dependentBinary.getNamingScheme().getTaskName(dependedOnBinaryTaskName)));
}
}
return dependencies;
}
use of org.gradle.platform.base.internal.dependents.DependentBinariesResolvedResult in project gradle by gradle.
the class DependentComponentsRenderableDependency method of.
public static DependentComponentsRenderableDependency of(DependentBinariesResolvedResult resolvedResult) {
LibraryBinaryIdentifier id = resolvedResult.getId();
String name = DependentComponentsUtils.getBuildScopedTerseName(id);
String description = id.getDisplayName();
boolean buildable = resolvedResult.isBuildable();
boolean testSuite = resolvedResult.isTestSuite();
LinkedHashSet<DependentComponentsRenderableDependency> children = Sets.newLinkedHashSet();
for (DependentBinariesResolvedResult childResolutionResult : resolvedResult.getChildren()) {
children.add(of(childResolutionResult));
}
return new DependentComponentsRenderableDependency(id, name, description, buildable, testSuite, children);
}
Aggregations