private void ensureConfigured(Configuration config) { for (Dependency dependency : config.getAllDependencies()) { if (dependency instanceof ProjectDependency) { ProjectDependency projectDependency = (ProjectDependency) dependency; project.evaluationDependsOn(projectDependency.getDependencyProject().getPath()); try { ensureConfigured(projectDependency.getProjectConfiguration()); } catch (Throwable e) { throw new UnknownProjectException(String.format( "Cannot evaluate module %s : %s", projectDependency.getName(), e.getMessage()), e); } } } }
@Override public ModelRegistry resolveProjectModel(String path) { ProjectInternal projectInternal = delegate.getProject(path); if (projectInternal == null) { throw new UnknownProjectException("Project with path '" + path + "' not found."); } // TODO This is a brain-dead way to ensure that the reference project's model is ready to access projectInternal.evaluate(); projectInternal.getTasks().discoverTasks(); return projectInternal.getModelRegistry(); }
@Nullable private LibraryResolutionResult doResolve(String selectorProjectPath, String libraryName) { try { ModelRegistry projectModel = projectModelResolver.resolveProjectModel(selectorProjectPath); Collection<VariantComponent> candidates = libraryResolver.resolveCandidates(projectModel, libraryName); if (candidates.isEmpty()) { return LibraryResolutionResult.emptyResolutionResult(binaryType); } return LibraryResolutionResult.of(binaryType, candidates, libraryName, binaryPredicate); } catch (UnknownProjectException e) { return LibraryResolutionResult.projectNotFound(binaryType); } }
public DefaultProjectDescriptor project(String path) { DefaultProjectDescriptor projectDescriptor = getProjectDescriptorRegistry().getProject(path); if (projectDescriptor == null) { throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", path)); } return projectDescriptor; }
public DefaultProjectDescriptor project(File projectDir) { DefaultProjectDescriptor projectDescriptor = getProjectDescriptorRegistry().getProject(projectDir); if (projectDescriptor == null) { throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", projectDir)); } return projectDescriptor; }
PluginResolutionServiceResolver createPluginResolutionServiceResolver(PluginResolutionServiceClient pluginResolutionServiceClient, Instantiator instantiator, VersionMatcher versionMatcher, StartParameter startParameter, final DependencyManagementServices dependencyManagementServices, final FileResolver fileResolver, final DependencyMetaDataProvider dependencyMetaDataProvider, ClassLoaderScopeRegistry classLoaderScopeRegistry) { final ProjectFinder projectFinder = new ProjectFinder() { public ProjectInternal getProject(String path) { throw new UnknownProjectException("Cannot use project dependencies in a plugin resolution definition."); } }; return new PluginResolutionServiceResolver(pluginResolutionServiceClient, instantiator, versionMatcher, startParameter, classLoaderScopeRegistry.getCoreScope(), new Factory<DependencyResolutionServices>() { public DependencyResolutionServices create() { return dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, new BasicDomainObjectContext()); } }); }
public DefaultProjectDescriptor project(String path) { DefaultProjectDescriptor projectDescriptor = projectDescriptorRegistry.getProject(path); if (projectDescriptor == null) { throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", path)); } return projectDescriptor; }
public DefaultProjectDescriptor project(File projectDir) { DefaultProjectDescriptor projectDescriptor = projectDescriptorRegistry.getProject(projectDir); if (projectDescriptor == null) { throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", projectDir)); } return projectDescriptor; }
@Override public ProjectInternal getProject(String path) { throw new UnknownProjectException(exceptionMessage); }
public ProjectInternal getProject(String path) { throw new UnknownProjectException("Cannot use project dependencies in a script classpath definition."); }
public ProjectInternal getProject(String path) { throw new UnknownProjectException("Cannot use project dependencies in a plugin resolution definition."); }
/** * <p>Returns the project with the given path.</p> * * @param path The path. * @return The project with the given path. Never returns null. * @throws UnknownProjectException If no project with the given path exists. */ ProjectDescriptor project(String path) throws UnknownProjectException;
/** * <p>Returns the project with the given project directory.</p> * * @param projectDir The project directory. * @return The project with the given project directory. Never returns null. * @throws UnknownProjectException If no project with the given path exists. */ ProjectDescriptor project(File projectDir) throws UnknownProjectException;
ModelRegistry resolveProjectModel(String path) throws UnknownProjectException;
ProjectInternal project(String path) throws UnknownProjectException;