Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Use `ProjectStateRegistry` in a number of places that need to locate a project given its identity, rather than `ProjectFinder` which is intended to be used to resolve user provided paths relative to some project.

This avoids a bunch of unnecessary lookups during project dependency resolution and also fails when reading an artifact transform from the configuration cache when the corresponding project has not been serialized (for whatever reason) rather than silently treating the transform as a global transform.

    • -22
    • +4
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 19 more files in changeset.
Revert "Duplicate project name detection"

This reverts commits 404c6cf303d to ffb51fb92f1 and

commit a0a662cbe49019adb08f996ae3df5a23aa222bbe.

Fixes #12315

    • -7
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 15 more files in changeset.
Optimize duplicated projects detection

Because project names cannot be changed, we can detect

duplicated project names much earlier and once for all.

This makes it redundant to recompute everytime.

    • -1
    • +4
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 4 more files in changeset.
Fix circular dependencies when project have the same name

Before this commit, during dependency resolution, a synthetic

module version identifier was generated by project, using the

group and name of the project. However, it's possible for a

project in gradle to have the same name as another in the

same build, leading to duplicates. In this case the projects

were mixed together and lead to a circular dependency.

This commit fixes the problem by making sure we generate

distinct module version identifiers for such projects, by

using the full project path as the name instead of the short

name.

This also makes it possible to publish valid publications

when using the maven or ivy publish plugins. However, we detect

this problem early and warn the user that they should overwrite

the project identity in this case.

    • -2
    • +4
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 14 more files in changeset.
Support requested capabilities on external dependencies

This commit adds support for having requested capabilities

part of the module component selector, for external dependencies.

This means that if a component is using Gradle metadata, we can

read requested capabilities and honor them during selection.

This reworks where requested capabilities are stored, and in

particular moves them to the `ComponentSelector`, making them

properly part of the identity of a dependency. As such, two

dependencies requiring two different variants by using distinct

capabilities will now properly appear as two different dependencies

in the dependency graph, instead of two variants of the same

dependency.

    • -1
    • +1
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 63 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
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 164 more files in changeset.
Add support for dependency attributes on project dependencies

There was an inconsistency with dependency attributes, that could be used to

select an external dependency, but not a project dependency. This commit aligns

what is possible for both.

    • -1
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 15 more files in changeset.
Change `ProjectComponentIdentifier` and `ProjectComponentSelector` implementations to carry enough information to report the correct display name and project name. Change more places to delegate to the `BuildState` for a particular build to determine these values for a given project, rather than duplicating the logic to calculate these things.

    • -20
    • +17
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 43 more files in changeset.
Use the `BuildIdentifier` that was assigned to a build when it was registered to refer to that build is most places.

- The build identifier was previously being unpacked to a name string in a few places and recreated from this, potentially losing some context and making too many assumptions about the uniqueness of the name.

- The project dependencies in `LocalComponentMetadata` are no longer transformed to map the build identifier to a "foreign" build identifier. The original build identifier is used instead.

- A "foreign" build identifier is still included in the `LocalComponentMetadata` to make the `isCurrentBuild()` work correctly in the resolution result. This method should go away at some point or at least the "foreign" build identifier should move closer to the result implementation rather than living in the metadata.

    • -18
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 22 more files in changeset.
Move a service implementation into core to live with the service interface, as this service no longer represents a composite build specific view of the projects in the build tree.

    • -1
    • +1
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 22 more files in changeset.
Restore `BuildIdentifier.isCurrentBuild()`.

    • -0
    • +33
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 16 more files in changeset.
Moved responsibility for determining the `BuildIdentifier` for a build into core, from dependencyManagement project, and changed the logic to always produce the same identifier for a given build. Previously, the id could change based on _when_ the id was queried. For example, any kind of dependency resolution in an init script would lead to all build having `:` as their build id.

In this change the build id for all nested builds is calculated based on the root directory of the build.

    • -0
    • +1
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 20 more files in changeset.
Format the project path in display names for `ProjectComponentIdentifier` in the same way that the fully qualified project path is formatted elsewhere.

This logic is still duplicated in `DefaultProjectComponentIdentifier`, and instead the value already calculated for the project should be reused instead of recalculated.

    • -1
    • +1
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 9 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

    • -2
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  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

    • -2
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 104 more files in changeset.
Added `BuildIdentity` service

- Provides the `BuildIdentifier` for the current build

- Used when constructing `ProjectComponentIdentifier` for project

Note that this service is still relying on the `CurrentBuildIdentifier` implementation.

    • -4
    • +10
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 6 more files in changeset.
Always use factory method to create ProjectComponentId

    • -2
    • +3
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 24 more files in changeset.
Merge Module and ModuleInternal as both are internal

    • -3
    • +3
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 26 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.

    • -0
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
    • -58
    • +0
    ./DefaultComponentSpecIdentifierTest.groovy
    • -91
    • +0
    ./DefaultComponentSpecSelectorTest.groovy
    • -81
    • +0
    ./DefaultModuleComponentIdentifierTest.groovy
    • -117
    • +0
    ./DefaultModuleComponentSelectorTest.groovy
    • -60
    • +0
    ./OpaqueComponentIdentifierTest.groovy
  1. … 302 more files in changeset.
Renamed subprojects/core-impl to subprojects/dependency-management.

    • -0
    • +53
    ./DefaultComponentIdentifierFactoryTest.groovy
    • -0
    • +58
    ./DefaultComponentSpecIdentifierTest.groovy
    • -0
    • +91
    ./DefaultComponentSpecSelectorTest.groovy
    • -0
    • +81
    ./DefaultModuleComponentIdentifierTest.groovy
    • -0
    • +117
    ./DefaultModuleComponentSelectorTest.groovy
    • -0
    • +60
    ./OpaqueComponentIdentifierTest.groovy
  1. … 1379 more files in changeset.