VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Reshuffle some tests into subpackages

This is just a refactoring of tests, to make it clearer: the base

package started to grow significantly.

    • -293
    • +0
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 79 more files in changeset.
On CI redirect jcenter queries to local repo for integration tests

    • -3
    • +1
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 51 more files in changeset.
Remove `assumeCompatibleWhenMissing` from `CompatibilityRuleChain`

This method was already a no-op. Now is time for removal.

    • -3
    • +3
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 10 more files in changeset.
Consider the attributes attached to the configuration when selecting a variant.

    • -3
    • +3
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 6 more files in changeset.
Unify attribute modification API

Unified API for through shared interface (HasConfigurableAttributes):

- Configuration

- ConfigurationVariant

- ArtifactView

This removes convenience methods from all three interfaces in

favor of a unified API that uses strongly typed attributes.

    • -6
    • +16
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 29 more files in changeset.
Move `configurationAttributesSchema` down to `DependencyHandler`

This commit fixes gradle/performance#251 by moving the attributes schema to the dependency handler. It's worth noting that

is also renames the configuration method from `configurationAttributesSchema` to simply `attributesSchema`.

    • -1
    • +1
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 18 more files in changeset.
Always perform an equality check at the end of the chain

This commit removes the `eventuallyIncompatible`, `eventuallyCompatible` and

`addEqualityCheck` methods, and instead systematically add an equality check

at the end of the chain. If still after equality check nothing expressed

an opinion (this is possible if any value is not present), then we eventually

fail.

    • -9
    • +3
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 14 more files in changeset.
Rename `configureMatchingStrategy` to `attribute` and add a no configure action variant

    • -3
    • +3
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 15 more files in changeset.
Always require the user to declare the schema of attributes

This commit changes the way matching works, by forcing the user to declare all attributes.

Previously, if, and only if, the type of the attribute was a `String`, then we automatically

assigned a matching strategy. This was inconsistent, while at the same type make it impossible

to make the difference between a missing attribute and an unknown attribute.

This is a preliminary step to the unification of full and partial matching. Note that this

commit doesn't remove the shortcut methods that allow us to use a string as an attribute key.

    • -0
    • +12
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 16 more files in changeset.
Rename the flags that indicate if a configuration can be consumed or resolved

This commit renames the flags used to indicate if a configuration can be consumed or resolved:

- `consumeOrPublishAllowed` is now `canBeConsumed` (because consuming implies publishing)

- `queryOrResolveAllowed` is now `canBeResolved` (because querying implies resolving)

    • -8
    • +8
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 16 more files in changeset.
Remove DSL methods in favor of setters

This commit removes the shortcut DSL methods used to categorize a configuration in favor

of explicit calls to setters.

See: gradle/performance#135

    • -3
    • +4
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 5 more files in changeset.
Remove configuration role in favor of a couple of `boolean` flags

This commit replaces the `ConfigurationRole` enum with a couple of `boolean` flags. At this point there

may be an overlap with the `isVisible` flag but the semantics are slightly different.

+review REVIEW-6339

    • -7
    • +6
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 21 more files in changeset.
Refine configuration roles

This commit tries to refine the configuration roles to make them even clearer.

It also introduces a new type of role, `BUCKET`, which can be used for configurations

which are neither meant to be resolved or published. This is the typical case

for configurations which are a bucket of dependencies used in child configurations.

Marking a configuration as `BUCKET` will explicitly make it non resolvable, but

it can of course still be part of dependency resolution.

See: gradle/performance#135

    • -6
    • +8
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
  1. … 14 more files in changeset.
Attempt to simulate more complex Android setup

This commit tries to simulate how Android wants to avoid to build the `aar` when it just requires

compile dependencies. It introduces a new configuration for resources, and adds an additional

attribute to configurations, for usage.

The compile configurations have the attribute `usage: 'compile'`, while the resources configuration

have the attribute `usage: 'resources'`. We then have 2 kind of artifacts: the `aar` is a complete

artifact which needs the resources, wheareas the `jar` only contains classes (this is done to

simulate compile-only, in the end we want to depend on a directory).

When building the `jar`, resources are not processed.

When building the `aar`, resources are processed.

See: https://github.com/gradle/performance/issues/135

    • -8
    • +51
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
Invert the roles of `_compile` and `compile` to better reflect what the Android plugin does

See: https://github.com/gradle/performance/issues/135

    • -10
    • +10
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy
Add an integration test illustrating how to implement variant aware dependency management

This test is an entry point for a collection of tests that will highlight how to implement variant-aware dependency

managenent with configuration attributes. It tries to simulate what the Android plugin does, and the first useful

test shows that we can make the difference between the dependencies used to compile a project and the dependencies

used when we compile _against_ a project.

In other words, this test implements the equivalent of "exported" dependencies in the software model, or in the Jigsaw

world:

- `client` depends on `core`

- `core` declares a compile dependency onto `commons-lang`, which is used internally

- when we compile `client`, the `commons-lang` dependency is not found on classpath

It is possible to add specific dependencies for compiling the project (`compileFreeDebug` configuration) or

dependencies found when we compile _against_ the project (`_compileFreeDebug`)

See: https://github.com/gradle/performance/issues/135

    • -0
    • +234
    ./VariantAwareResolutionWithConfigurationAttributesIntegrationTest.groovy