Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Reuse `FileUtils#canonicalize`

    • -10
    • +3
    ./org/gradle/internal/resource/UriTextResource.java
Reverted changes from PR#1900

  1. … 24 more files in changeset.
Convey the number of content bytes read in the download build operation result.

This provides a more (but not absolutely) reliable indicator of bytes transferred than the advertised content length pre transfer.

    • -0
    • +65
    ./org/gradle/internal/resource/ExternalResourceReadResult.java
  1. … 10 more files in changeset.
Made settings.gradle apply works (and added test)

  1. … 14 more files in changeset.
Javadocs.

  1. … 2 more files in changeset.
Javadocs.

  1. … 1 more file in changeset.
Cache script display name

    • -7
    • +15
    ./org/gradle/internal/resource/UriTextResource.java
Clean up cached artifact transform outputs on failure or crash.

  1. … 6 more files in changeset.
Javadocs.

    • -1
    • +17
    ./org/gradle/internal/resource/local/FileStore.java
  1. … 1 more file in changeset.
Introduced an abstraction that represents a snapshot of a resource's content and changed `IncrementalFileSnapshot` to extend this.

  1. … 9 more files in changeset.
Merge pull request #690 from kiddouk:story/S3-repository-can-be-configured-to-authenticate-using-AWS-EC2-instance-metadata

S3 repository can authenticate using AWS EC2 instance metadata

* This is related to https://github.com/gradle/gradle/blob/c2dc9979706e6b3beca13f1de860834e9255fb1b/design-docs/finding-and-using-credentials.md#story-an-s3-repository-can-be-configured-to-authenticate-using-awss-ec2-instance-metadata

* Note that the AWS S3 Client implementation will now use the following

credentials (in this specific order)

- Environment (AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY,

AWS_SESSION_TOKEN)

- Java System Properties - aws.accessKeyId and aws.secretKey

- Credential profiles file at the default

location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

- Instance Profile Credentials - delivered through the Amazon EC2

metadata service

* The implementation assumes that only ONE authentication can be used

per s3-resource at a time

* This patch enforces that each Authentication now declares

`requiresCredentials` to be explicit

Integration tests:

Note that we cannot mock the instance meta data since it uses the ip

169.254.169.254 so we mock the system properties that the client

CredentialsProviderChain will look for.

  1. … 22 more files in changeset.
Only list direct children form the S3 ExternalResourceLister

- Document the contract of ExternalResourceLister

- Fix the S#Stub server to return the correct file contents and common prefixes in a listing

- Simplify S3 resource name extraction

+review REVIEW-5988

  1. … 10 more files in changeset.
Disable caching for Jar URIs opened by `UriTextResource`

The underlying caching of `JarURLConnection` will prevent the file handle

to the backing Jar file being released even when the input stream is

closed. This change disables caching for JarURLConnection when loading

via `UriTextResource`.

This change will have a performance impact for any UriScriptSource created

with a URL like `jar://my-jar-file.jar!/build-script.gradle`. On inspection

this will only occur if such a URL is used in an `apply from: ...` construct.

This fix should address leaking file handles in `UriTextResourceTest`.

  1. … 2 more files in changeset.
Add ability to reset cache statistics

+review REVIEW-5952

  1. … 1 more file in changeset.
Add ability to record remote access statistics

This plugin introduces optional recording of statistics of access for external resources.

To use it, you must run the build with `-Dgradle.externalresources.recordstats=(none|count|trace)` where:

- `count` will only record the number of times resources are fetched

- `trace` will record the number of times _each_ URI is accessed

The trace mode can have a significant impact on memory usage since all URIs are recorded.

By default, statistics are not recorded (equivalent to use `none` as the statistics recorder).

+review REVIEW-5952

  1. … 1 more file in changeset.
Add ability to revalidate external resource requests

The argument allows Cache-Control: max-age=0 to be added in cases where it's desirable for artifact repositories or caching proxies to revalidate requests:

- Listing version metadata

- Resource has exceeded it's cache lifetime on disk, such as dynamic/snapshot dependencies or when --refresh-dependencies is specified

  1. … 23 more files in changeset.
Use consistent exceptions and error messages when a resource cannot be read.

  1. … 6 more files in changeset.
Merged internal `ResourceNotFoundException` into public `MissingResourceException`.

  1. … 9 more files in changeset.
Merged internal `ResourceException` into public `ResourceException`.

    • -0
    • +45
    ./org/gradle/internal/resource/ResourceExceptions.java
  1. … 26 more files in changeset.
A slight improvement to the check whether a URI resource has content or not.

    • -1
    • +10
    ./org/gradle/internal/resource/UriTextResource.java
Moved public `ResourceException` and its subtypes from core to resources project.

    • -0
    • +26
    ./org/gradle/api/resources/MissingResourceException.java
    • -0
    • +37
    ./org/gradle/api/resources/ResourceException.java
    • -0
    • +28
    ./org/gradle/internal/resource/ResourceIsAFolderException.java
  1. … 5 more files in changeset.
Added methods to get `TextResource` content as a `Reader` and to query the encoding of the backing file, if present.

    • -4
    • +26
    ./org/gradle/internal/resource/UriTextResource.java
  1. … 4 more files in changeset.
Fixed the location reported when a pom or ivy.xml cannot be parsed so that it points to the origin of the resource, not the cached file.

Also changed the error message to use file path for an origin that is on the file system and a URI for a remote origin. Plus added some test coverage for this.

  1. … 3 more files in changeset.
Extracted `o.g.internal.resource.Resource` as a supertype for all 5 of our different resource abstractions.

Currently doesn't allow anything super useful, the various pieces can be migrated over time.

  1. … 14 more files in changeset.
Renamed `o.g.internal.resource.Resource` to `TextResource`.

    • -74
    • +0
    ./org/gradle/internal/resource/CachingResource.java
    • -0
    • +74
    ./org/gradle/internal/resource/CachingTextResource.java
    • -88
    • +0
    ./org/gradle/internal/resource/StringResource.java
    • -0
    • +88
    ./org/gradle/internal/resource/StringTextResource.java
    • -0
    • +89
    ./org/gradle/internal/resource/TextResource.java
    • -234
    • +0
    ./org/gradle/internal/resource/UriResource.java
    • -0
    • +234
    ./org/gradle/internal/resource/UriTextResource.java
  1. … 26 more files in changeset.
Split `Resource.file` into two things: an optional file that represents the backing location of the resource, and an optional file that contains the same contents as the resource. Sometimes these are the same, sometimes they are not.

    • -0
    • +54
    ./org/gradle/internal/resource/ResourceLocation.java
    • -2
    • +30
    ./org/gradle/internal/resource/StringResource.java
  1. … 14 more files in changeset.
Some changes to the contracts on `Resource`, to make the contracts a little more consistent and explicit.

  1. … 9 more files in changeset.
Removed unnecessary modifiers.

Added some query methods to `Resource` and use these instead of instanceof checks in several places.

    • -6
    • +30
    ./org/gradle/internal/resource/CachingResource.java
    • -0
    • +10
    ./org/gradle/internal/resource/StringResource.java
  1. … 9 more files in changeset.
Extract writing of a properties file without the timestamp header into a reusable method.

+review REVIEW-5839

  1. … 15 more files in changeset.