Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Make selected variant accessible on dependency

For resolved dependency results, we now tell what

is the corresponding selected variant.

  1. … 24 more files in changeset.
Make selected variant accessible on dependency

For resolved dependency results, we now tell what

is the corresponding selected variant.

  1. … 24 more files in changeset.
Optimize `ModuleVersionResolveException`

During resolution, we may throw a lot of `ModuleVersionResolveException`

or `ModuleVersionNotFoundException`. Often, one per repository, when

a version is not found in that repository. But in the end, the version

may be found, or a different version may be selected, in which case we

don't care about the failure, which is only used if _no version_ could

be selected.

As a consequence, we had a lot of overhead in both generating a stack

trace **and** an error message, that would never be used.

This commit reworks those special exceptions used during resolution so

that we avoid filling the stack trace (we don't care) and we create

the message lazily (only if it will actually be used).

  1. … 23 more files in changeset.
Optimize `ModuleVersionResolveException`

During resolution, we may throw a lot of `ModuleVersionResolveException`

or `ModuleVersionNotFoundException`. Often, one per repository, when

a version is not found in that repository. But in the end, the version

may be found, or a different version may be selected, in which case we

don't care about the failure, which is only used if _no version_ could

be selected.

As a consequence, we had a lot of overhead in both generating a stack

trace **and** an error message, that would never be used.

This commit reworks those special exceptions used during resolution so

that we avoid filling the stack trace (we don't care) and we create

the message lazily (only if it will actually be used).

  1. … 23 more files in changeset.
Optimize `ModuleVersionResolveException`

During resolution, we may throw a lot of `ModuleVersionResolveException`

or `ModuleVersionNotFoundException`. Often, one per repository, when

a version is not found in that repository. But in the end, the version

may be found, or a different version may be selected, in which case we

don't care about the failure, which is only used if _no version_ could

be selected.

As a consequence, we had a lot of overhead in both generating a stack

trace **and** an error message, that would never be used.

This commit reworks those special exceptions used during resolution so

that we avoid filling the stack trace (we don't care) and we create

the message lazily (only if it will actually be used).

  1. … 24 more files in changeset.
Optimize `ModuleVersionResolveException`

During resolution, we may throw a lot of `ModuleVersionResolveException`

or `ModuleVersionNotFoundException`. Often, one per repository, when

a version is not found in that repository. But in the end, the version

may be found, or a different version may be selected, in which case we

don't care about the failure, which is only used if _no version_ could

be selected.

As a consequence, we had a lot of overhead in both generating a stack

trace **and** an error message, that would never be used.

This commit reworks those special exceptions used during resolution so

that we avoid filling the stack trace (we don't care) and we create

the message lazily (only if it will actually be used).

  1. … 24 more files in changeset.
Optimize `ModuleVersionResolveException`

During resolution, we may throw a lot of `ModuleVersionResolveException`

or `ModuleVersionNotFoundException`. Often, one per repository, when

a version is not found in that repository. But in the end, the version

may be found, or a different version may be selected, in which case we

don't care about the failure, which is only used if _no version_ could

be selected.

As a consequence, we had a lot of overhead in both generating a stack

trace **and** an error message, that would never be used.

This commit reworks those special exceptions used during resolution so

that we avoid filling the stack trace (we don't care) and we create

the message lazily (only if it will actually be used).

  1. … 24 more files in changeset.
Initial support for optional features

This commit introduces initial support for optional features, by

implementing a way for a dependency declaration (currently *only* in

the DSL) to request variants of the target component that provide one

or more capabilities.

Previously to this change, selection was (simplified) done like this:

1. find the target component

2. select the variant of the target component which matches the requested

attributes

Now, selection introduces another step:

1. find the target component

2. filter variants by eliminating those which do not provide the requested

capabilities

3. select the variant in this list which matches the requested attributes

Several changes had to be implemented:

First, component metadata rules calling `addCapability` will now return

a component which capabilities _include_ the default capability.

Second, attribute filtering is done in a secondary step, which means that

if there are no variant matching the requested capabilities, we will immediately

fail.

  1. … 58 more files in changeset.
Support depending on multiple variants of the same component

This commit changes the resolution engine so that it is possible

to resolve multiple variants of the same component when using

variant-aware dependency management.

Before, in order to have 2 dependencies on the same component

but using different variants, one had to use explicit configuration

dependencies. Now, with this change, it is possible to have

two dependencies on the same component, but with different attributes.

Those components would resolve to different variants.

Special treatment is applied when attributes are declared on constraints:

in this case, we _merge_ the constraint attributes, and make sure that

the edge is computed using the merged attributes. Should they be

incompatible, the build would fail as before.

  1. … 29 more files in changeset.
Add 'constraint' property to dependencies in ResolutionResult

It's important to be able to differentiate between hard dependencies and

dependency constraints when analysing the resolution result. This was done

by adding a simple boolean property to `DependencyResult`, indicating if

the source of the edge was a dependency or a constraint.

The new API is not yet used in any dependency reporting.

  1. … 16 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

  1. … 64 more files in changeset.
Renamed `VersionSelectionReasons` -> `ComponentSelectionReasons`

  1. … 30 more files in changeset.
Add support for emitting information about repositories used during configuration resolution process, and sourced repository for a component (#5959)

- `ResolveConfigurationDependenciesBuildOperationType.Details` now contains a `List<Repository>` eventually provided by all `ResolutionAwareRepository` implementations

- `ResolvedComponentResult` has been subclassed to `ResolvedComponentResultInternal`, to provide the `repositoryName` used as source. This can be `null` in case of project dependency.

- Note that even when artifacts are resolved from the cache, they still convey the original repository that was used as source. The `name` of a repository is guaranteed to be unique inside a given repository container, and we use a single repository container to resolve a given configuration. Hence, the name can be safely used to uniquely identify which repository was used to source components.

- This commit also moves custom serialization logic to the owning type of `SerializedOperation` implementations to their owning types

  1. … 52 more files in changeset.
Simplify construction of ModuleVersionSelector in unit tests

  1. … 13 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.

  1. … 164 more files in changeset.
Avoid eager creation of display name for variants

In a lot of cases, we were eagerly concatenating strings in `visitFile` even if the name was never used.

  1. … 24 more files in changeset.
Revert changes from PR5628

This reverts the following commits:

10a25358953dfb28b09cf04356945517d5cc560e

54d19a74ab2d29673219d9c6d27388b93c55eada

d0eb19dbf28df1a108742ba177eda56301e1fab4

dcf5f65b49db17fb625ecab7498b060ab8191b9b

99847ad25f9e0ab7b1f65beb976dcb59cbadd1b9

f2f412141e1ab29e0cfafc72fd962ae645508720

99b45c8d7f0e94d2d41c43c731ca1329d6f07606

  1. … 40 more files in changeset.
Removed `ModuleVersionSelector.versionConstraint`

- Pushed `getVersionConstraint()` down to `ExternalDependency` and

`DependencyConstraint`

- Only use a single version string when constructing `ModuleVersionSelector`

  1. … 19 more files in changeset.
Removed `ModuleVersionSelector.versionConstraint`

- Pushed `getVersionConstraint()` down to `ExternalDependency` and

`DependencyConstraint`

- Only use a single version string when constructing `ModuleVersionSelector`

  1. … 19 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>

  1. … 41 more files in changeset.
Remove `ResolvedNamedVariantResult`

This commit removes the "named" version of the resolved variant resolution result

in favor of a `getDisplayName()` method directly on `ResolvedVariantResult`.

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

  1. … 10 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>

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

... and use the immutable version whenever possible.

  1. … 63 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. … 93 more files in changeset.
Revert De-duplicate commonly used immutable objects in dependency resolution and IDE changes

Commits reverted:

- 807b1e4f8d1585d93c1de3e9ca83d99d0819e2d2

- 9482b0b05374253cafdb776550d7016385912e04

- 4ecead06b53ec6b0f15c517bf0d0c6a74c3b3c05

- db1135a8a5f1c507e0df3c03ad12ddc963799e4d

- 7350bcbae30a777909cec74ebfd5a91d2c89081e

Additionally, minor changes to avoid usage of introduced

classes and methods from subsequent commits.

Issue: gradle/gradle-private#563

  1. … 109 more files in changeset.
De-duplicate (= intern) some instances in dependency resolution

- Reduce memory usage of dependency resolution by de-duplicating the

most commonly used immutable instances.

- Objects aren't strictly immutable: displayName is calculated lazily

- solution is thread-safe without synchronization

- lazy calculation is needed for efficient interning since a lookup

will always create a new instance.

- Use strong references in some instance interners

- strong references cause less GC overhead than weak references

- Strong references:

DefaultModuleIdentifier

DefaultModuleVersionIdentifier

DefaultModuleVersionSelector

DefaultModuleComponentIdentifier

DefaultModuleComponentSelector

DefaultProjectComponentSelector

- Weak references:

DefaultLibraryBinaryIdentifier

DefaultLibraryComponentSelector

DefaultIvyArtifactName

- Both reference types:

DefaultBuildIdentifier

DefaultProjectComponentIdentifier

- The reason for special handing is that DefaultBuildIdentifier

has a state field "current" as part of the instance which

isn't part of equals/hashCode.

+review REVIEW-6277

  1. … 104 more files in changeset.
Moved some exception and result types out of org.gradle.api.internal.artifacts into org.gradle.internal.resolve

  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.

  1. … 307 more files in changeset.
Renamed subprojects/core-impl to subprojects/dependency-management.

    • -0
    • +48
    ./ResolutionResultDataBuilder.groovy
  1. … 1384 more files in changeset.