AbstractModuleDependencySpec.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Change exception to InvalidUserCodeException

Issue #10532

    • -13
    • +14
    ./AbstractModuleDependencySpec.groovy
  1. … 1 more file in changeset.
Change exception to InvalidUserCodeException

Issue #10532

    • -13
    • +14
    ./AbstractModuleDependencySpec.groovy
  1. … 1 more file in changeset.
Change exception to InvalidUserCodeException

Issue #10532

    • -13
    • +14
    ./AbstractModuleDependencySpec.groovy
  1. … 1 more file in changeset.
Further invalid dependency declaration

* Prevent combining artifact and target configuration declaration

Fixes #10532

    • -0
    • +32
    ./AbstractModuleDependencySpec.groovy
  1. … 4 more files in changeset.
Further invalid dependency declaration

* Prevent combining artifact and target configuration declaration

Fixes #10532

    • -0
    • +32
    ./AbstractModuleDependencySpec.groovy
  1. … 5 more files in changeset.
Further invalid dependency declaration

* Prevent combining artifact and target configuration declaration

Fixes #10532

    • -0
    • +32
    ./AbstractModuleDependencySpec.groovy
  1. … 5 more files in changeset.
Further invalid dependency declaration

* Prevent combining artifact and target configuration declaration

Fixes #10532

    • -0
    • +32
    ./AbstractModuleDependencySpec.groovy
  1. … 4 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +128
    ./AbstractModuleDependencySpec.groovy
  1. … 2 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +128
    ./AbstractModuleDependencySpec.groovy
  1. … 2 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +128
    ./AbstractModuleDependencySpec.groovy
  1. … 2 more files in changeset.
Introduce constraint inheritance API

    • -0
    • +59
    ./AbstractModuleDependencySpec.groovy
  1. … 41 more files in changeset.
Relax constraints inheritance behavior

    • -40
    • +2
    ./AbstractModuleDependencySpec.groovy
  1. … 1 more file in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -0
    • +59
    ./AbstractModuleDependencySpec.groovy
  1. … 61 more files in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -0
    • +59
    ./AbstractModuleDependencySpec.groovy
  1. … 62 more files in changeset.
Add `inheritSubgraphConstraints()` API to dependencies

    • -0
    • +59
    ./AbstractModuleDependencySpec.groovy
  1. … 63 more files in changeset.
Simplify handling of attributes

Make the copy path conditional, thus preserving the contract of

`attributes` and its link to the `attributesFactory`.

Allows to get rid of the added `AttributeContainerInternal.isImmutable`.

  1. … 5 more files in changeset.
Make AbstractModuleDependency.copyTo safe

Copy mutable attributes

Fix copying capabilities

Signed-off-by: Dan Sanduleac <sanduleac.dan@gmail.com>

    • -0
    • +44
    ./AbstractModuleDependencySpec.groovy
  1. … 7 more files in changeset.
Split off value snapshotting and attributes related methods of TestUtil

  1. … 64 more files in changeset.
Don't implicitly add 'prefer' with 'require'

  1. … 11 more files in changeset.
Fix broken unit tests

  1. … 1 more file in changeset.
Fix unit tests for change to VersionConstraint

  1. … 1 more file in changeset.
Introduce ability to declare attributes on dependencies

This commit introduces the possibility to declare attributes on dependencies.

Attributes are, currently, unused. You can declare them, but they do not

participate in dependency resolution. Attributes can be mutated using the

`attributes(Action<? super AttributeContainer>)` method.

Implementation wise, in order to avoid memory overhead, an attribute container

is lazily created whenever attributes are added. This forces us to pass

the attribute factory down to the various concrete dependency implementations.

However, we do this by setter injection, when a dependency or constraint is

created using the container. This means that we can potentially miss injecting

the factory for dependencies which were created in an adhoc manner, which

can happen in plugins which use internal APIs. A warning is issued if we find

such a dependency.

    • -3
    • +43
    ./AbstractModuleDependencySpec.groovy
  1. … 14 more files in changeset.
Validate the name of a dependency artifact defined in the build script (#3981)

Throw a proper error if the name is missing. This is similar to the

error we throw if a user attempts to create a dependency without name.

Before, an NPE was thrown as the name was assumed to be never null.

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -0
    • +12
    ./AbstractModuleDependencySpec.groovy
  1. … 3 more files in changeset.
Remove `getVersionConstraint` from `Dependency`

We will at some point deprecate `getVersion` on `Dependency`, which is nullable because it doesn't always

make sense (ex: project dependencies). So instead of having version constraints on dependency, it will

only be introduced on the relevant type (external dependencies only).

  1. … 8 more files in changeset.
Adjust `Dependency` and module selection to use `VersionConstraint`

This fixes the mismatch between immutable and mutable version constraints.

  1. … 32 more files in changeset.
Remove support for `optional` in the DSL

The rationale behind this change is that we're not going to offer "optional" as a first-class concept. What we support is understanding

optional dependencies as found in POM files. However, optional dependencies will be better modelled using some kind of "features" declaration.

In other words, a dependency is often optional because it only needs to be brought in if you are using a particular feature of

a library. For example, "if you are going to use mysql as the backend, include the mysql dependency". But that's not really an optional

dependency: it's something that needs to be there when compiling the provider, but only for some consumers.

  1. … 12 more files in changeset.
Add support for optional dependencies

This commit adds support for optional dependencies:

- the `dependencies` DSL now adds a `setOptional` method on `ModuleDependency`

- when a dependency is optional, it's not included in the graph, unless a "hard" (non optional) dependency

on the same module is found during traversal

- Maven "optional" dependencies are now participating in the graph with the same semantics

    • -3
    • +13
    ./AbstractModuleDependencySpec.groovy
  1. … 27 more files in changeset.
Remove misc deprecated classes and methods in core module (#1755)

  1. … 18 more files in changeset.
Remove the use of `Optional` in `ProjectDependency#getTargetConfiguration`

+review REVIEW-6242

  1. … 13 more files in changeset.
Deprecate `ModuleDependency#getConfiguration` in favor of `ModuleDependency#getTargetConfiguration`

We want to be able to differentiate between two cases when dependencies on projects are declared:

1. the user didn't choose any specific configuration

2. the user chose a configuration, and it can be the same as the default one

The previous implementation required that `getConfiguration` returns a non-null value, making it impossible to

make a difference between the following cases:

`compile project(':')`

and

`compile project(path: ':', configuration: 'default')`

The new `getTargetConfiguration` method returns an `Optional<String>`, which will be `absent` if the user

didn't choose anything specific, and `present` if he did.

This allows us to make an explicit configuration selection take precedence over automatic configuration

selection when attributes are defined.

  1. … 15 more files in changeset.