private ModuleDescriptor findProject(DependencyDescriptor descriptor) { String projectPathValue = descriptor.getAttribute(DependencyDescriptorFactory.PROJECT_PATH_KEY); if (projectPathValue == null) { return null; } Project project = gradle.getRootProject().project(projectPathValue); Module projectModule = ((ProjectInternal) project).getModule(); ModuleDescriptor projectDescriptor = moduleDescriptorConverter.convert( project.getConfigurations().getAll(), projectModule, IvyContext.getContext().getIvy().getSettings()); for (DependencyArtifactDescriptor artifactDescriptor : descriptor.getAllDependencyArtifacts()) { for (Artifact artifact : projectDescriptor.getAllArtifacts()) { if (artifact.getName().equals(artifactDescriptor.getName()) && artifact.getExt().equals(artifactDescriptor.getExt())) { String path = artifact.getExtraAttribute(DefaultIvyDependencyPublisher.FILE_PATH_EXTRA_ATTRIBUTE); ReflectionUtil.invoke( artifactDescriptor, "setExtraAttribute", new Object[] {DefaultIvyDependencyPublisher.FILE_PATH_EXTRA_ATTRIBUTE, path}); } } } return projectDescriptor; }
public DefaultResolvedArtifact( ResolvedDependency resolvedDependency, Artifact artifact, Factory<File> artifactSource) { this.resolvedDependency = resolvedDependency; // Unpack the stuff that we're interested from the artifact and discard. The artifact instance // drags in a whole pile of stuff that // we don't want to retain references to. this.name = artifact.getName(); this.type = artifact.getType(); this.ext = artifact.getExt(); this.extraAttributes = new HashMap<String, String>(artifact.getQualifiedExtraAttributes()); this.artifactSource = artifactSource; }