use of org.gradle.tooling.internal.gradle.DefaultGradleModuleVersion in project gradle by gradle.
the class IdeaModelBuilder method buildDependencies.
private void buildDependencies(Map<String, DefaultIdeaModule> modules, IdeaModule ideaModule) {
ideaModule.setOffline(offlineDependencyResolution);
Set<Dependency> resolved = ideaModule.resolveDependencies();
List<DefaultIdeaDependency> dependencies = new LinkedList<DefaultIdeaDependency>();
for (Dependency dependency : resolved) {
if (dependency instanceof SingleEntryModuleLibrary) {
SingleEntryModuleLibrary d = (SingleEntryModuleLibrary) dependency;
DefaultIdeaSingleEntryLibraryDependency defaultDependency = new DefaultIdeaSingleEntryLibraryDependency().setFile(d.getLibraryFile()).setSource(d.getSourceFile()).setJavadoc(d.getJavadocFile()).setScope(new DefaultIdeaDependencyScope(d.getScope())).setExported(d.isExported());
if (d.getModuleVersion() != null) {
defaultDependency.setGradleModuleVersion(new DefaultGradleModuleVersion(d.getModuleVersion()));
}
dependencies.add(defaultDependency);
} else if (dependency instanceof ModuleDependency) {
ModuleDependency moduleDependency = (ModuleDependency) dependency;
DefaultIdeaModuleDependency ideaModuleDependency = new DefaultIdeaModuleDependency(moduleDependency.getName()).setExported(moduleDependency.isExported()).setScope(new DefaultIdeaDependencyScope(moduleDependency.getScope()));
// Find IdeaModule model for dependency within same build: may be null
DefaultIdeaModule targetModule = modules.get(moduleDependency.getName());
ideaModuleDependency.setDependencyModule(targetModule);
dependencies.add(ideaModuleDependency);
}
}
modules.get(ideaModule.getName()).setDependencies(dependencies);
}
use of org.gradle.tooling.internal.gradle.DefaultGradleModuleVersion in project gradle by gradle.
the class PublicationsBuilder method publications.
private List<DefaultGradlePublication> publications(DefaultProjectIdentifier projectIdentifier) {
List<DefaultGradlePublication> gradlePublications = Lists.newArrayList();
Set<ProjectPublication> projectPublications = publicationRegistry.getPublications(projectIdentifier.getProjectPath());
for (ProjectPublication projectPublication : projectPublications) {
gradlePublications.add(new DefaultGradlePublication().setId(new DefaultGradleModuleVersion(projectPublication.getId())).setProjectIdentifier(projectIdentifier));
}
return gradlePublications;
}
Aggregations