DefaultArtifactSetTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Do not drop variant attributes in results based on maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

This is only affecting the attributes reported in the result. During

matching, which happens earlier, all attributes were already considered.

  1. … 17 more files in changeset.
Do not drop variant attributes in results based on maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

This is only affecting the attributes reported in the result. During

matching, which happens earlier, all attributes were already considered.

  1. … 17 more files in changeset.
Do not drop variant attributes in results based on maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

This is only affecting the attributes reported in the result. During

matching, which happens earlier, all attributes were already considered.

  1. … 17 more files in changeset.
Do not drop variant attributes in results based on maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

This is only affecting the attributes reported in the result. During

matching, which happens earlier, all attributes were already considered.

  1. … 17 more files in changeset.
Do not drop variant attributes for 'traditional' maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

  1. … 27 more files in changeset.
Do not drop variant attributes for 'traditional' maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

  1. … 15 more files in changeset.
Do not share exclusion cache

For some reason (that I'm obviously not smart enough to figure out),

we can't share the exclusion cache for the whole build, because even

if its safe, resolution is sensitive to the order of entries in

the cache.

  1. … 5 more files in changeset.
Do not share exclusion cache

For some reason (that I'm obviously not smart enough to figure out),

we can't share the exclusion cache for the whole build, because even

if its safe, resolution is sensitive to the order of entries in

the cache.

  1. … 5 more files in changeset.
Move all infrastructure to the new exclude merging package

The old package is still here and will be removed in a subsequent commit.

  1. … 18 more files in changeset.
Add verbose logging of dependency resolution

DO NOT MERGE INTO MASTER

  1. … 13 more files in changeset.
Introduce ecosystem registration

This commit introduces the concept of "ecosystem", that can be

registered on an attributes schema. When a component is published,

it may provide a list of ecosystems. This list is used by consumers

when resolving. If, for some reason, variant resolution fails, and

that the consumer didn't use a plugin which provides the expected

ecosystem, the error message will indicate that they probably

miss a plugin that understands that ecosystem.

This is useful when a plugin extends an existing ecosystem with

additional attributes, that consumers may not be aware of. In

this case it is expected that the plugin declares an ecosystem.

Currently the error message will only indicate what ecosystem

is missing, and an optional description. It will not tell _how_

such plugin can be found, nor what plugins provide it.

By default, for adhoc components, publishing will use the

ecosystems of the producer. For example, for a Java project,

the published Gradle metadata file will include the java

ecosystem requirement.

For components which are not adhoc, they must implement the

`ComponentWithEcosystems` interface in order to tell which

ecosystems are in use.

  1. … 54 more files in changeset.
Honor dependency attributes when they override configuration attributes

This commit fixes artifact selection so that when we resolve artifacts, we also use

the attributes defined on the dependency itself, if ever. Before, when we were resolving

artifacts, only the consumer configuration attributes were used.

  1. … 23 more files in changeset.
Do not pass variant attributes to `(single|multiple)Variants`

Instead, we make sure that the variant passed to the artifact set already contains the right set of

attributes. This involves wrapping the original `ComponentVariant` into a wrapper that will execute

the attribute rules lazily (and only once).

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

  1. … 16 more files in changeset.
Pass variant attributes down to `DefaultArtifactSet` to avoid passing the rules there

This doesn't prevent the rules from being applied multiple times, but it will: now the

variant attributes are passed, meaning that once we cache the application of the rules,

they will only be computed once.

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

  1. … 17 more files in changeset.
Rename the internal and test fixtures `VariantMetadata` to avoid confusion

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

  1. … 25 more files in changeset.
Rework variant dependency/constraint/attributes rules

This commit changes how the variant rules (dependencies, constraints or attributes) are

handled. Instead of being indexed by variant name, it's now a generic container, which

checks if the specified `VariantMetadata` applies. This will allow us to implement rules

which apply unconditionnaly on every variant, or on variants which have a specific

attribute set.

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

  1. … 23 more files in changeset.
Initial implementation of component metadata rules allowing modification of variant attributes

This commit introduces metadata rules that support modification of variant attributes. Variant attributes

are specific to each variant and can be found in module metadata. Those are NOT component level attributes,

which could be used during dependency resolution. This will be added in a subsequent commit.

  1. … 49 more files in changeset.
Added an `ArtifactSet` implementation specialized for a configuration with only a single variant (eg those of all external modules), to retain less state in the dependency resolution result.

  1. … 4 more files in changeset.
Started pushing creation of the `ArtifactSet` instances that are retained in the dependency resolution result closer to the origin of the artifacts. This will allow the artifact sets to be contextualized with only the specific data that is relevant to that origin, rather than unpacking this data into some generic form and then repacking it into an `ArtifactSet` graph that has to cater for all origins. This will also allow caching of this information in a way that makes sense for the specific origin.

  1. … 15 more files in changeset.
Use a `List` instead of a `Map` to hold the `ArtifactSet` instances for a dependency resolve result.

  1. … 8 more files in changeset.
Removed now pointless intermediate object.

  1. … 2 more files in changeset.
Generate less garbage while collecting the results of traversing the dependency graph. Specifically, snapshot each `ArtifactSet` prior to adding it to the id -> `ArtifactSet` map in the results, instead of collecting the original `ArtifactSet` instances in a temporary map and then later making a copy containing the snapshots.

  1. … 6 more files in changeset.
Added a public API reachable from `DependencyHandler` that allows a plugin to define attributes that should be attached to artifacts with a given extension, for example when consuming a Maven module or files defined by a file dependency.

The intention is that this meta-data about artifact types would complement (and maybe serve as input for) additional meta-data attached to a Maven/Ivy/local module by various meta-data rules.

  1. … 23 more files in changeset.
Include the component display name in the various error messages when unable to select a variant of the component (such as multiple matches, no matches, etc), to help with diagnostics.

  1. … 15 more files in changeset.
Changed `ResolvedVariant` so that it has-a set of artifacts instead of is-a set of artifacts.

  1. … 13 more files in changeset.
Added some initial support to honour the producer's schema when selecting a particular variant of something.

  1. … 18 more files in changeset.
Remove ResolvedVariant.getArtifacts()

- Replaced ResolvedVariant.getArtifacts() with inline visit() and prepare()

- Inlined a bunch of `ResolvedArtifactSet` impls into `ResolvedVariant` impls

  1. … 14 more files in changeset.
Replace generic `Transformer` with typed `VariantSelector`

This change allows us to use `select` instead of `transform` as the

action method and should also locate uses/implementations of this

interface.

  1. … 23 more files in changeset.
Pushed some of the differences between artifacts and file dependencies further back into dependency resolution.

Changed `ArtifactSet` so that it can represent either artifacts from a configuration node or files from a file dependency. Added an implementation for file dependencies and use this to take care of selection.

    • -0
    • +51
    ./DefaultArtifactSetTest.groovy
  1. … 11 more files in changeset.