BuildOperationSettingsProcessorTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Make script source hashing faster

Do not calcualte the hash for the same script multiple times.

The hash is now stored in the text resource itself so we don't need

an externall managed cache. The UriTextResource implementation has

been thoroughly optimized for local file URIs. Previously reading

those in was a major bottleneck due to copying every byte into 4(!)

different buffers.

Adding the HashCode to the TextResource made me aware of the fact

that the tooling API depended on these interfaces, although it should

never be reading scripts. It turns out that the script was attached to

the BuildLayout, where it didn't really belong. It is now only created

once the build is running and we are actually trying to load the settings

file. There were a few changes to types marked with @UsedByScanPlugin.

These were all checked against the scan plugin code base to ensure they

are safe. The reported data is now more accurate as it returns a `null`

value for a non-existing settings file instead of reporting a dummy path.

    • -5
    • +2
    ./BuildOperationSettingsProcessorTest.groovy
  1. … 24 more files in changeset.
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
    • +1
    ./BuildOperationSettingsProcessorTest.groovy
  1. … 147 more files in changeset.
Fire gradle.settingsEvaluated right after evaluating the settings script (#3996)

This restores the ability to configure the build cache settings from an init script. More generally, it allows more reliable configuration of the settings object as the callback now fires effectively before anything tries to inspect the settings object. Previously, this callback fired later after some inspections were already done.

    • -0
    • +78
    ./BuildOperationSettingsProcessorTest.groovy
  1. … 13 more files in changeset.