Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Rationalise handling of “current” build operation and build operation ID

For an upcoming change to emit console logging as build operation progress events, we need to associate all progress logging with the build operation. This pulled a thread on some long overdue cleanup.

The end result is:

1. Base build operation infrastructure is consolidated org.gradle.internal.operations.

2. Mechanism for passing thread global current build operation is more test friendly, and better named.

3. A consistent mechanism is used for binding the current operation to the thread, instead of two mechanisms.

4. Build operation IDs are typed to OperationIdentifier.

There is no public API or user behaviour change.

  1. … 147 more files in changeset.
Only support moving into file store

    • -10
    • +0
  1. … 11 more files in changeset.
Identify host fragment as host in file:////host/path resource names (#4074)

Before, also 'host' was treated as part of the path. With the changes

in e13e45a, we do additional path normalization on resource names

when we resolve a relative path. That is, all additional '/'s are

stripped. This also converted '//host' to '/host'. Which is different:

the first is a host (i.e. a network share), and the second is just the

first segment of a path. This fix identifies a host in a path that

starts with '//' and makes this host part of the 'root' in a

ExternalResourceName rather than the path.

This fixes #4002, which is a 4.4 regression. In practice, these changes

only have an effect on Windows.

  1. … 2 more files in changeset.
Make UriTextResource#getFile cheaper

This method was checking whether the file exists,

which doesn't make sense, because it could only

happen if a file URI was passed in the constructor.

If that file doesn't exist, then trying to read

content from the URI won't work either. We were

basically checking the existence twice - once when

calling getFile and another time when hashing it or

when trying to read from the URI instead. This made

the happy case unnecessarily slow without improving

failure behavior.

We now return the file unaltered and instead catch

the FileNotFoundException during hashing to provide

a nicer error message.

  1. … 3 more files in changeset.
Fixed some formatting issues.

Some fixes to handling relative URLs specified in the module metadata file.

  1. … 1 more file in changeset.
Some changes to caching of external resources:

- Moved the file store to live under `caches/modules-2` as the file store is protected by the lock on this directory. The external resource metadata is cached under this directory as well.

- Use a hash of the _content_ of the external resource to calculate the resource's location in the file store, so that entries never need to be overwritten. Previously a hash of the _location_ of the external resource was used. Also include the base name from the URL to allow a human to get some idea of what each file contains.

- Use custom serialization rather than Java serialization for the external resource metadata cache.

- Renamed a couple of metadata caches to better reflect their purpose.

  1. … 15 more files in changeset.
Use our own hashing architecture, take 2 (#2817)

This replaces Guava's hashing. We need this for two reasons:

- it allows the addition of custom hash functions, like BLAKE2b which would not be possible with Guava's closed design

- it fixes a few performance issues that Guava only fixes in version 20 (which we can't upgrade to right now, because we still need to support Java 5 in places)

  1. … 159 more files in changeset.
Move PathKeyFileStore to `:resources`

+review REVIEW-6562

  1. … 16 more files in changeset.
Move FileHasher to base-services

+review REVIEW-6562

  1. … 73 more files in changeset.
Consolidated ExternalResourceUriResolver and ExternalResourceRepositoryAccessor

- ExternalResourceAccessor takes care of downloading and caching URI resources

- Only cache HTTP and HTTPS URI resources

- Use a shared FileStore<String>

  1. … 13 more files in changeset.
Wrap downloaded URI resource

- Use a wrapper for downloaded URI resource so that it appears

to have been read directly.

- Preserve the content type for the downloaded URI

    • -8
    • +12
  1. … 1 more file in changeset.
Introduce TextResourceLoader service

- Can create a TextResource for File or URI

- Used when loading files for `apply from:`

    • -0
    • +26
  1. … 21 more files in changeset.
Use EmptyFileTextResource directly in place of NonExistentFileScriptSource

  1. … 7 more files in changeset.
Revert "Reverted changes from PR#1900"

This reverts commit 3769869c339a2d4b753f92617641055adb3e4b16.

  1. … 12 more files in changeset.
Replace usages of org.gradle.api.Nullable

With javax.annotation.Nullable.

  1. … 446 more files in changeset.
Require that all rich build operations have result objects.

Later changing from no result to having a result is awkward for listeners to deal with.

So, always use a result type and just have it be empty if there is nothing to convey right now.

There always might be something to convey in the future.

  1. … 11 more files in changeset.
Fix Javadoc for ExternalResourceWriteBuildOperationType.

Merged the file resource implementation for the public `Resource` API into the file resource implementation for `ExternalResource` used by dependency resolution and publishing. This is a small step towards merging and reusing all the various resource implementations.

    • -0
    • +34
  1. … 24 more files in changeset.
Renamed a class.

    • -0
    • +30
  1. … 13 more files in changeset.
Shuffled some methods around in the `ExternalResource` hierarchy.

  1. … 3 more files in changeset.
Moved a class to break a package cycle.

  1. … 3 more files in changeset.
Moved `FileResourceConnector` from 'dependencyManagement' to 'resources' project.

    • -0
    • +63
  1. … 10 more files in changeset.
Detangled the `ExternalResource` implementation that represents a local resource, from the implement that represents a local copy of a remote resource.

  1. … 6 more files in changeset.
Added `FileResourceRepository` as a global service for creating various file backed `ExternalResource` implementations. Use this in various places instead of creating these implementations directly.

    • -0
    • +42
  1. … 41 more files in changeset.

Moved `ExternalResourceRepository` from 'dependencyManagement' to 'resources' project.

    • -0
    • +42
  1. … 20 more files in changeset.
Moved `LazyExternalResource` from 'dependencyManagement' to 'resources' project, and reused to implement `UrlExternalResource`.

  1. … 6 more files in changeset.
Include the number of bytes written in the resource write build operation result.

    • -0
    • +32
  1. … 3 more files in changeset.
Wrap calls to write to a resource in a build operation of type `ExternalResourceWriteBuildOperationType`. No result is attached for these build operations yet.

  1. … 1 more file in changeset.