use of org.gradle.api.internal.project.ProjectState in project gradle by gradle.
the class InstantiatingBuildLoader method createChildProjectsRecursively.
private void createChildProjectsRecursively(BuildState owner, DefaultProjectDescriptor parentProjectDescriptor, ClassLoaderScope parentProjectClassLoaderScope, ClassLoaderScope baseProjectClassLoaderScope) {
for (DefaultProjectDescriptor childProjectDescriptor : parentProjectDescriptor.children()) {
ClassLoaderScope childProjectClassLoaderScope = parentProjectClassLoaderScope.createChild("project-" + childProjectDescriptor.getName());
ProjectState projectState = owner.getProjects().getProject(childProjectDescriptor.path());
projectState.createMutableModel(childProjectClassLoaderScope, baseProjectClassLoaderScope);
createChildProjectsRecursively(owner, childProjectDescriptor, childProjectClassLoaderScope, baseProjectClassLoaderScope);
}
}
use of org.gradle.api.internal.project.ProjectState in project gradle by gradle.
the class DefaultConfiguration method markReferencedProjectConfigurationsObserved.
private void markReferencedProjectConfigurationsObserved(InternalState requestedState, ResolverResults results) {
ProjectInternal consumingProject = domainObjectContext.getProject();
ProjectState consumingProjectState = consumingProject == null ? null : consumingProject.getOwner();
for (ResolvedProjectConfiguration projectResult : results.getResolvedLocalComponents().getResolvedProjectConfigurations()) {
ProjectState targetProjectState = projectStateRegistry.stateFor(projectResult.getId());
dependencyObservedBroadcast.dependencyObserved(consumingProjectState, targetProjectState, requestedState, projectResult);
}
}
use of org.gradle.api.internal.project.ProjectState in project gradle by gradle.
the class ProjectArtifactResolver method resolveArtifactLater.
public ValueCalculator<File> resolveArtifactLater(ComponentArtifactMetadata artifact) {
LocalComponentArtifactMetadata projectArtifact = (LocalComponentArtifactMetadata) artifact;
ProjectComponentIdentifier projectId = (ProjectComponentIdentifier) artifact.getComponentId();
ProjectState projectState = projectStateRegistry.stateFor(projectId);
return new ResolvingCalculator(projectState, projectArtifact);
}
use of org.gradle.api.internal.project.ProjectState in project gradle by gradle.
the class DefaultIdeArtifactRegistry method getIdeProjects.
@Override
public <T extends IdeProjectMetadata> List<Reference<T>> getIdeProjects(Class<T> type) {
List<Reference<T>> result = Lists.newArrayList();
for (ProjectState project : projectRegistry.getAllProjects()) {
if (project.getOwner().isImplicitBuild()) {
// Do not include implicit builds in workspace
continue;
}
ProjectComponentIdentifier projectId = project.getComponentIdentifier();
for (IdeProjectMetadata ideProjectMetadata : store.get(projectId)) {
if (type.isInstance(ideProjectMetadata)) {
T metadata = type.cast(ideProjectMetadata);
result.add(new MetadataReference<T>(metadata, projectId));
}
}
}
return result;
}
use of org.gradle.api.internal.project.ProjectState in project gradle by gradle.
the class GradleBuildBuilder method addProjects.
private void addProjects(BuildState target, DefaultGradleBuild model) {
Map<ProjectState, BasicGradleProject> convertedProjects = new LinkedHashMap<>();
ProjectState rootProject = target.getProjects().getRootProject();
BasicGradleProject convertedRootProject = convert(target, rootProject, convertedProjects);
model.setRootProject(convertedRootProject);
for (ProjectState project : target.getProjects().getAllProjects()) {
model.addProject(convertedProjects.get(project));
}
}
Aggregations