RunBuildActionTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix unit test.

Use native-platform to detect whether stdin is attached to a console, rather than `System.console()`, as this can detect more cases, such as when Gradle is running from mintty on Windows (e.g. the cygwin terminal).

This allows the `init` task to prompt the user interactively when run from mintty on Windows.

Also consolidate some of the "is x connected to a console?" logic into a single place.

  1. … 12 more files in changeset.
Use native-platform to detect whether stdin is attached to a console, rather than `System.console()`, as this can detect more cases, such as when Gradle is running from mintty on Windows (e.g. the cygwin terminal).

This allows the `init` task to prompt the user interactively when run from mintty on Windows.

Also consolidate some of the "is x connected to a console?" logic into a single place.

  1. … 12 more files in changeset.
Represent the result of `BuildActionExecuter.execute()` as an object that encapsulates either a result object or a failure, rather than as an opaque return value or a thrown `ReportedException`.

  1. … 25 more files in changeset.
Move serialization of the exception to send back to the client out of the `BuildActionRunner` implementations so that it is a cross cutting concern applied for all build actions.

  1. … 26 more files in changeset.
Ensure command-line deprecation messages are sent from the client to the daemon, as was previously happening when Java serialization was used. Change signatures on various types to communicate this expectation better.

It would be better if the messages were logged in the client rather than travelling to the daemon and then back again. This change does not address this and simply recreates the situation that was already in place.

  1. … 19 more files in changeset.
Remove remaining Java serialization from the initial build request message sent from the client to the daemon. There is now no Java serialization used between the client and daemon when running builds from the command-line. There is still some when using the Tooling API.

  1. … 24 more files in changeset.
Simplify time handling internally and for build scans (#2857)

* Don't make TimeProvider Serializable.

This isn't safe and generally doesn't make sense.

* Extract and promote the concept of a build timer.

This was previously not well defined and being overlaid with the concept of when a user/tool requested something, which is not always the same thing.

* Pare down the deprecated org.gradle.util.Clock down to the minimum required.

Internal usage is replaced by a `getStartTime()` directly on BuildRequestContext.

What is left is only kept for backwards compatibility with scans.

* Rename TimeProvider to Clock.

* Move BuildExecutionTimer out of baseServices into core, and into a better package.

* Remove unused.

* Simplify the time package by merging types.

* Prevent the client's build started timestamp from being later than when the provider received the build request.

* Provide a dedicated mechanism for conveying the build start time to build scans.

* Consolidate the ways of formatting durations.

  1. … 179 more files in changeset.
Clean up resources when the execution completes

- could release locked files in some cases

  1. … 2 more files in changeset.
Removing BuildSession and handling BuildSessionScopeServices entirely in ContinuousBuildActionExecuter

+review REVIEW-5510

  1. … 32 more files in changeset.
Add cancel() to BuildCancellationToken to allow a cancel to be invoked from within the build.

  1. … 19 more files in changeset.
Print a message suggesting using the daemon when it's not used and has not been explicitly disabled.

+review REVIEW-5426

  1. … 18 more files in changeset.
Removed BuildActionParameters.getBuildRequestMetaData() as it has moved to BuildRequestContext.

  1. … 11 more files in changeset.
Pass a BuildRequestContext instead of a BuildCancellationToken to BuildActionExecuter instances.

  1. … 16 more files in changeset.
Move BuildCancellationToken to :core to make it available during the build.

  1. … 33 more files in changeset.
ToolingAPI cancel event sends daemon exit request.

  1. … 21 more files in changeset.
Renamed GradleLauncherActionExecuter to BuildActionExecuter.

  1. … 21 more files in changeset.
- Renamed DaemonBuildAction to RunBuildAction, as it is used in locations other than the daemon. - Moved InProcessGradleLauncherActionExecuter from o.g.launcher.cli to o.g.launcher.exec, as it is used in locations other than the cli.

  1. … 10 more files in changeset.
Added InProcessGradleLauncherActionExecuter and reused DaemonBuildAction for running in process builds. This way, we have a single action that drives an executer abstraction, with an implementation for in-process, single use daemon, and reusable daemon execution.

  1. … 5 more files in changeset.
Moved Factory and ServiceRegistry back to where they were, and leave behind some deprecated subtypes for the old compiled tasks to find.

  1. … 142 more files in changeset.
- Moved ServiceFactory and Factory back to their old packages (for now) to avoid breaking tasks implemented in Groovy and compiled against older Gradle versions. - Added some int test coverage for this case.

  1. … 145 more files in changeset.
Shuffled some classes around to some new packages.

  1. … 243 more files in changeset.
Split more launcher classes into “exec” and “cli” packages.

• exec - the general infrastructure for executing a build

• cli - adapting the command line input into “exec” usage

    • -0
    • +67
    ./RunBuildActionTest.groovy
  1. … 61 more files in changeset.