StreamingResolutionResultBuilderTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Add requested attributes to the resolution result

This is done so that it is possible to find out what

attributes were requested/compatible/missing in variants

based on the consumer attributes, without having to

resort on finding the configuration being resolved.

This is mostly useful in build scans where the plugin

listens to every resolution result, but does not necessarily

know what configuration was resolved to generate this

result.

    • -1
    • +12
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 16 more files in changeset.
Add requested attributes to the resolution result

This is done so that it is possible to find out what

attributes were requested/compatible/missing in variants

based on the consumer attributes, without having to

resort on finding the configuration being resolved.

This is mostly useful in build scans where the plugin

listens to every resolution result, but does not necessarily

know what configuration was resolved to generate this

result.

    • -1
    • +12
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 16 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

    • -3
    • +6
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 25 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

    • -3
    • +6
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 27 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

    • -3
    • +6
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 27 more files in changeset.
Replace most usages of `NamedObjectInstantiator.INSTANCE` with injection of a global service instead. This allows the instantiator to be contextualized, for example to handle caching of the generated types.

    • -3
    • +6
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 27 more files in changeset.
Return immutable `ComponentSelectionReason` where appropriate

    • -2
    • +2
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 9 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

    • -2
    • +2
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 64 more files in changeset.
Renamed `VersionSelectionReasons` -> `ComponentSelectionReasons`

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 30 more files in changeset.
Make dependency locking failures lenient

Locking failures no longer cause an exception to be thrown, they are

instead recorded in the resolution result.

This enables lenient consumption of the resolution result to succeed

while preserving the failure behaviour for non lenient use cases.

This is done by recording artificial edges from the root component to

the different locking violations, either a missing module or an

unexpected one.

Issue #6383

    • -5
    • +6
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 12 more files in changeset.
Improved name and documentation of attribute container serializer

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 10 more files in changeset.
Normalize `ModuleIdentifier`

This commit reworks the `ComponentModuleIdentifier`/`ComponentModuleSelector`/`ModuleVersionSelector`

classes to use `ModuleIdentifier` under the hood, instead of storing denormalized strings. This has

the advantage that we can reduce the use of the module identifier factory, which is called very

often during dependency resolution. Sharing instances reduces the need for conversions, and makes

comparisons faster.

    • -6
    • +7
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 164 more files in changeset.
Add a non lossy AttributeContainer serializer

This will be required for supporting the serialization of a fully

realised ModuleComponentResolveMetadata.

Issue #5653

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 8 more files in changeset.
Add a non lossy AttributeContainer serializer

This will be required for supporting the serialization of a fully

realised ModuleComponentResolveMetadata.

Issue #5653

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 8 more files in changeset.
Refactor graph visitors

* Update start parameter type to be the more specific RootGraphNode

* Add unit tests for DependencyLockingArtifactVisitor

    • -5
    • +18
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 18 more files in changeset.
Rework component selection reason to support composite explanations

This commit changes how `ComponentSelectionReason` works, so that we can save a list of selection

reasons, instead of a single one. This should let us give richer explananations about why a component

was selected. In particular, a component may be selected because another one was rejected, or it

can be selected by a rule **and** by conflict resolution. This last case was handled in an adhoc

manner, it's now a regular case.

Signed-off-by: Cedric Champeau <cedric@gradle.com>

    • -9
    • +9
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 41 more files in changeset.
Add support for showing the resolved variant and its attributes in `ResolvedComponentResult`

This commit adds a `ResolvedNamedVariantResult getVariant()` method on `ResolvedComponentResult`,

which gives access to the resolved variant details. In practice, the details are currently limited

to:

- the name of the variant

- the attributes attached to this variant

The attributes are desugared: if the original variant had strongly-typed attributes, what we get

by the result of this call is an attribute container where all attributes are of type `String`.

As a consequence, it should only be used for diagnostics.

The `ResolveTestFixture` has been adjusted so that we can now (optionally) check the selected

variant and its attributes. One test has been adjusted to check the variant.

Signed-off-by: Cedric Champeau <cedric@gradle.com>

    • -5
    • +3
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 25 more files in changeset.
Rename `DefaultVersionConstraint` to `DefaultMutableVersionConstraint`

... and use the immutable version whenever possible.

    • -2
    • +2
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 63 more files in changeset.
Adjust `Dependency` and module selection to use `VersionConstraint`

This fixes the mismatch between immutable and mutable version constraints.

    • -1
    • +5
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 32 more files in changeset.
Make `ModuleComponentSelector` the source of truth for version constraints

This commit pushes `VersionConstraint` as a primary concept in `ModuleComponentSelector`. It replaces the (now)

deprecated `getVersion` call, which didn't reflect all possible constraints on a version. This change has several

consequences:

- version constraints now need to be "serializable"

- version constraints now consist of a preferred version and a list of rejected versions

- only a single item in the rejection list is supported

- Gradle module metadata parsing now generates a prefer/reject list

- Gradle module metadata writing does **not** yet support writing prefer/reject

- the module metadata binary format has been bumped to support prefer/reject in module descriptors

- metadata rules can say `useTarget(VersionConstraint)`

Issue #3312

    • -1
    • +2
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 93 more files in changeset.
Cache module version identifiers

In a similar way to module identifiers, use the module identifier factory to cache the module version identifiers.

It allows faster comparisons as we will hit `a==b` much more often and don't have to go the `equals` route. There

are still places where the factory is not used, but it doesn't seem to have a huge impact on performance.

    • -1
    • +4
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 49 more files in changeset.
Changed resolution result serialization to de-duplicate the component selectors written to the file.

    • -24
    • +51
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 15 more files in changeset.
Fix weird test rename (eager refactoring?)

    • -0
    • +202
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 1 more file in changeset.
Simplify `AttributeValue` API

Now that we have both `CompatibilityCheckDetails` and `MultipleCandidatesDetails` there's no need

for a complex `AttributeValue` API. The next step is going to remove the need to `return` and rely

on composition of rules instead.

    • -202
    • +0
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 7 more files in changeset.
Renamed`id` to `moduleVersion` in dependency resolve results `ComponentResult` to make more explicit that this is simply a bucket of attributes, not an identifier for the component.

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 11 more files in changeset.
Inlined a couple of classes.

    • -40
    • +104
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 9 more files in changeset.
Use more efficient serialization for the resolution result of a configuration.

    • -29
    • +28
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 18 more files in changeset.
Renamed some classes.

    • -10
    • +10
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 24 more files in changeset.
Moved some exception and result types out of org.gradle.api.internal.artifacts into org.gradle.internal.resolve

    • -1
    • +1
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 109 more files in changeset.
Moved some meta-data types out of org.gradle.api.internal.artifacts to org.gradle.internal.component, and split up into base, local and external types.

    • -2
    • +2
    ./StreamingResolutionResultBuilderTest.groovy
  1. … 307 more files in changeset.