use of org.gradle.api.artifacts.ExternalDependency in project gradle by gradle.
the class DependencyStringNotationConverter method createDependencyFromString.
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
StrictVersionParser.RichVersion version = strictVersionParser.parse(parsedNotation.getVersion());
T moduleDependency = instantiator.newInstance(wantedType, stringInterner.intern(parsedNotation.getGroup()), stringInterner.intern(parsedNotation.getName()), stringInterner.intern(version.require));
maybeEnrichVersion(version, moduleDependency);
if (moduleDependency instanceof ExternalDependency) {
ModuleFactoryHelper.addExplicitArtifactsIfDefined((ExternalDependency) moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
}
return moduleDependency;
}
use of org.gradle.api.artifacts.ExternalDependency in project gradle by gradle.
the class DefaultIvyPublication method populateDependencies.
private void populateDependencies(Set<? extends UsageContext> usageContexts, PublicationWarningsCollector publicationWarningsCollector) {
for (UsageContext usageContext : usageContexts) {
publicationWarningsCollector.newContext(usageContext.getName());
for (ModuleDependency dependency : usageContext.getDependencies()) {
String confMapping = confMappingFor(usageContext, dependency);
if (!dependency.getAttributes().isEmpty()) {
publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared with Gradle attributes", dependency.getGroup(), dependency.getName(), dependency.getVersion()));
}
if (dependency instanceof ProjectDependency) {
addProjectDependency((ProjectDependency) dependency, confMapping);
} else {
ExternalDependency externalDependency = (ExternalDependency) dependency;
if (platformSupport.isTargetingPlatform(dependency)) {
publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared as platform", dependency.getGroup(), dependency.getName(), dependency.getVersion()));
}
if (!versionMappingInUse && externalDependency.getVersion() == null) {
publicationWarningsCollector.addUnsupported(String.format("%s:%s declared without version", externalDependency.getGroup(), externalDependency.getName()));
}
addExternalDependency(externalDependency, confMapping, ((AttributeContainerInternal) usageContext.getAttributes()).asImmutable());
}
}
if (!usageContext.getDependencyConstraints().isEmpty()) {
for (DependencyConstraint constraint : usageContext.getDependencyConstraints()) {
publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared as a dependency constraint", constraint.getGroup(), constraint.getName(), constraint.getVersion()));
}
}
if (!usageContext.getCapabilities().isEmpty()) {
for (Capability capability : usageContext.getCapabilities()) {
publicationWarningsCollector.addVariantUnsupported(String.format("Declares capability %s:%s:%s which cannot be mapped to Ivy", capability.getGroup(), capability.getName(), capability.getVersion()));
}
}
}
}
Aggregations