use of org.gradle.internal.DisplayName in project gradle by gradle.
the class DefaultDependencyResolutionManagement method repoMutationDisallowedOnProject.
private void repoMutationDisallowedOnProject(ArtifactRepository artifactRepository) {
UserCodeApplicationContext.Application current = context.current();
DisplayName displayName = current == null ? null : current.getDisplayName();
if (displayName == null) {
displayName = UNKNOWN_CODE;
}
String message = "Build was configured to prefer settings repositories over project repositories but repository '" + artifactRepository.getName() + "' was added by " + displayName;
switch(getConfiguredRepositoriesMode()) {
case FAIL_ON_PROJECT_REPOS:
throw new InvalidUserCodeException(message);
case PREFER_SETTINGS:
LOGGER.warn(message);
break;
}
}
use of org.gradle.internal.DisplayName in project gradle by gradle.
the class AbstractMinimalProvider method cannotQueryValueOf.
private String cannotQueryValueOf(Value<? extends T> value) {
TreeFormatter formatter = new TreeFormatter();
formatter.node("Cannot query the value of ").append(getDisplayName().getDisplayName()).append(" because it has no value available.");
if (!value.getPathToOrigin().isEmpty()) {
formatter.node("The value of ").append(getTypedDisplayName().getDisplayName()).append(" is derived from");
formatter.startChildren();
for (DisplayName displayName : value.getPathToOrigin()) {
formatter.node(displayName.getDisplayName());
}
formatter.endChildren();
}
return formatter.toString();
}
use of org.gradle.internal.DisplayName in project gradle by gradle.
the class NodeState method getResolvedVariant.
public ResolvedVariantResult getResolvedVariant() {
if (cachedVariantResult != null) {
return cachedVariantResult;
}
DisplayName name = Describables.of(metaData.getName());
List<? extends Capability> capabilities = metaData.getCapabilities().getCapabilities();
AttributeContainer attributes = desugar(metaData.getAttributes());
List<Capability> resolvedVariantCapabilities = capabilities.isEmpty() ? Collections.singletonList(component.getImplicitCapability()) : ImmutableList.copyOf(capabilities);
cachedVariantResult = new DefaultResolvedVariantResult(component.getComponentId(), name, attributes, resolvedVariantCapabilities, findExternalVariant());
return cachedVariantResult;
}
use of org.gradle.internal.DisplayName in project gradle by gradle.
the class VariantNameBuilder method getVariantName.
@Nullable
public DisplayName getVariantName(@Nullable List<String> parts) {
if (parts == null) {
return null;
}
DisplayName displayName = names.get(parts);
if (displayName == null) {
displayName = variantName(parts);
names.put(parts, displayName);
}
return displayName;
}
use of org.gradle.internal.DisplayName in project gradle by gradle.
the class DefaultDependencyResolutionManagement method ruleMutationDisallowedOnProject.
private void ruleMutationDisallowedOnProject(DisplayName ruleName) {
UserCodeApplicationContext.Application current = context.current();
DisplayName displayName = current == null ? null : current.getDisplayName();
if (displayName == null) {
displayName = UNKNOWN_CODE;
}
String message = "Build was configured to prefer settings component metadata rules over project rules but rule '" + ruleName + "' was added by " + displayName;
switch(getConfiguredRulesMode()) {
case FAIL_ON_PROJECT_RULES:
throw new InvalidUserCodeException(message);
case PREFER_SETTINGS:
LOGGER.warn(message);
break;
}
}
Aggregations