IvyDescriptorFileGeneratorTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce new metadata marker for Gradle 6 (#11109)

See: https://github.com/gradle/gradle/issues/11105

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 14 more files in changeset.
Introduce new metadata marker for Gradle 6

See: https://github.com/gradle/gradle/issues/11105

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 14 more files in changeset.
Introduce new metadata marker for Gradle 6

See: https://github.com/gradle/gradle/issues/11105

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 14 more files in changeset.
Introduce new metadata marker for Gradle 6

See: https://github.com/gradle/gradle/issues/11105

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 11 more files in changeset.
Publication of resolved versions for Ivy xml

While the feature was added for the Gradle metadata linked to an Ivy

publication, it was missed for the Ivy xml itself.

This commit corrects that, relying on the usage context attributes to

map the Ivy dependency to the requested resolved configuration.

Fixes #8948

    • -3
    • +9
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 11 more files in changeset.
Implement Gradle metadata marker in published pom/ivy files

This commit implements a performance optimization for Gradle metadata.

Given that today there's no library published in any repository with

Gradle metadata, it's much more likely to find a POM (or Ivy) metadata

file for an external dependency, rather than a Gradle metadata file.

If we decided to add `gradleMetadata()` sources by default to all

repositories, then we would probably introduce a performance regression

to a lot of builds, because we would first try to get Gradle metadata,

then fail, and search for POM/Ivy files.

To avoid this, whenever a library is going to be published with Gradle

metadata, we will introduce a _marker_ in the published POM or Ivy

file. When Gradle _resolves_ such a dependency, it will parse the POM

file and look for the marker. If it finds it, then it will _redirect_

to use Gradle metadata instead. This means that when Gradle metadata is

present, we will pay the price of looking for a POM or Ivy file first,

start parsing, only to discover we should parse Gradle metadata. This

should be ok in the beginning, knowing that if `gradleMetadata()` is

added, then we would systematically look at Gradle metadata first.

This means that this is a _temporary_ solution, until Gradle metadata

becomes widespread. So "temporary" should be understood as several

months, if not years.

The marker introduced in POM and Ivy files is _neutral_ for both Ivy

and Maven. By this we mean that it uses an XML comment. While not super

nice, we couldn't use a custom namespace because both Ivy and Maven

fail when parsing this. Properties were considered too, but Ivy doesn't

support them so for consistency both models use comments.

It's worth noting that we will still _completely parse_ the POM or Ivy

descriptor. It's a waste of time, but it helps in case we find a marker

but that for some reason the Gradle metadata file is absent. In this

case we fallback on the model we found.

This change also introduces a change in the semantics of the incubating

metadata sources API: those should be considered _hints_, and not strong

statements anymore.

Finally, should a producer want to avoid publishing Gradle metadata,

it's now possible to disable the task that creates the metadata file.

    • -2
    • +14
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 57 more files in changeset.
Rework task dependency inference so that `Provider` implementations use the same `TaskDependencyContainer` interface that most other things use to declare their producer task to the task resolution infrastructure, rather than having special knowledge sprinkled around various places.

Cleaned up a bunch of `Provider` and `Property` implementations so that more logic is reused rather than reimplemented.

    • -2
    • +2
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 30 more files in changeset.
Support propagation of the producer task for provider instances that are created using `Provider.map()`.

Now, when a provider represents a task or task output, whether mapped or not, that task is taken as the producer of the value and the mapping function is not called. Otherwise, the value of the provider is unpacked and resolved, as it previously was.

Rework the protocol by which providers communicate their build dependencies to consumers.

    • -2
    • +2
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 34 more files in changeset.
Add dedicated DSL to customize Ivy descriptor to ivy-publish plugin

This commit adds a type safe DSL for customizing the generated Ivy

module descriptor of an IvyPublication to the ivy-publish plugin:

descriptor {

license {

name = 'The Apache License, Version 2.0'

url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'

}

author {

name = 'Jane Doe'

url = 'http://example.com/users/jane'

}

description {

text = 'A concise description of my library'

homepage = 'http://www.example.com/library'

}

}

Only interfaces are exposed as part of the public API, all of them are

prefixed with `IvyModuleDescriptor`. The exposed properties make use of

the Provider API.

In addition, the new DSL is documented in the User Guide, DSL Reference

and Release Notes.

Resolves #5193.

    • -0
    • +82
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 31 more files in changeset.
Make IvyArtifact lazy

    • -8
    • +10
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 13 more files in changeset.
Reflect transitive flag in generated metadata from Ivy Publish plugin

+review REVIEW-6123

    • -4
    • +4
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 5 more files in changeset.
Cleanup test outputs for unit tests in 'ivy' subproject

    • -3
    • +4
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 2 more files in changeset.
Some post merge cleanup and additional test coverage for Ivy publication excludes

+review REVIEW-5755

    • -9
    • +29
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 6 more files in changeset.
ivy: added support for publishing exclude in descriptors

    • -0
    • +18
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 5 more files in changeset.
Review items for 'Make branch attribute available when publishing and resolving Ivy modules' story

- Changed groovy.xml.QName to javax.xml.namespace.QName

- Minor change to error message and construction of namespace list

- Minor change to dsl doc

- Changed IvyModuleDescriptorSpec to return mutable view of IvyExtraInfoSpec

- Minor change to sample build script

+review REVIEW-5059

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 18 more files in changeset.
Review items for 'Make branch attribute available when publishing and resolving Ivy modules' story

- Changed extraInfo from a Map to an IvyExtraInfo with a map view

+review REVIEW-5059

    • -5
    • +6
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 31 more files in changeset.
Review items for 'Make branch attribute available when publishing and resolving Ivy modules' story

- Moved NamespaceId and IvyModuleDescriptor to artifacts.ivy subpackage

- Added test for NamespaceId

- Updated javadoc comment for IvyModuleDescriptor.getIvyStatus to reflect that it is immutable

+review REVIEW-5059

    • -1
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 27 more files in changeset.
Addressing open issues for 'Make branch attribute available when publishing and resolving Ivy modules'

- Adding support for publishing extra info elements

- Change extra info map to use composite key for namespacing

+review REVIEW-5059

    • -0
    • +18
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 24 more files in changeset.
Documentation and tweaks for 'Make branch attribute available when publishing and resolving Ivy modules' story +review REVIEW-5054

    • -8
    • +1
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 8 more files in changeset.
First iteration of 'Make branch attribute available when publishing and resolving Ivy modules' story

    • -0
    • +16
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 22 more files in changeset.
Some fixes for tests to work under Groovy 2.2

    • -4
    • +5
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 4 more files in changeset.
Fixed Ivy publication of project dependencies with customised publication coordinates - If depended project has no PublishingExtension, use project properties for dependency coordinates - If depended project has PublishingExtension, then add dependency for each IvyPublication - Moved mapping of ModuleDependency->IvyDependency into IvyPublication (out of IvyDescriptorFileGenerator) - Even closer to having model for customising dependencies...

    • -30
    • +4
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 8 more files in changeset.
Better test coverage for escaping and encoding in PomFile and IvyDescriptorFile generators (REVIEW-1585, REVIEW-1554)

    • -8
    • +22
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 3 more files in changeset.
Reworked default values and validation for IvyPublication and MavenPublication - Default IvyArtifact.name to module name on construction, rather than at time of writing ivy.xml (REVIEW-1678) - Don't permit null values for IvyArtifact.[name|extension|type] or MavenArtifact.extension - Allow empty string for extention only - Updated javadocs for MavenArtifact and IvyArtifact, adding @Nullable where appropriate (REVIEW-1572, REVIEW-1575)

    • -9
    • +11
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 19 more files in changeset.
Don't assume that all dependencies for a Usage are "runtime" in Ivy - Added IvyDependency api and impl which wraps a ModuleDependency and conf mapping string - Only currently used by components: user configuration of dependencies is not supported.

    • -9
    • +7
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 16 more files in changeset.
REVIEW-1544: Simplified IvyDescriptorFileGenerator

    • -5
    • +8
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 1 more file in changeset.
REVIEW-1522, REVIEW-1544: Move classes and tests to better packages

    • -0
    • +248
    ./IvyDescriptorFileGeneratorTest.groovy
  1. … 9 more files in changeset.