BuildActionsFactoryTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Change `DefaultServiceRegistry.getAll()` so that it does not return services from parents that have been decorated or overridden by the current registry.

Also change the interaction between parent and child registry so as to avoid assuming a particular parent implementation.

  1. … 13 more files in changeset.
Change `DefaultServiceRegistry.getAll()` so that it does not return services from parents that have been decorated or overridden by the current registry.

Also change the interaction between parent and child registry so as to avoid assuming a particular parent implementation.

  1. … 13 more files in changeset.
Reuse the logic in `BasicGlobalServices` to set up the services needed by the client to decide whether to run the build in process or in the daemon, rather than using some hard-coded wiring. When the daemon is used, reuse the service instances too (not just the logic).

    • -36
    • +15
    ./BuildActionsFactoryTest.groovy
  1. … 4 more files in changeset.
Reuse the logic in `BasicGlobalServices` to set up the services needed by the client to decide whether to run the build in process or in the daemon, rather than using some hard-coded wiring. When the daemon is used, reuse the service instances too (not just the logic).

    • -36
    • +15
    ./BuildActionsFactoryTest.groovy
  1. … 4 more files in changeset.
Replace some direct usages of `DefaultConfigurableFileCollection` with `FileCollectionFactory`.

  1. … 50 more files in changeset.
Replace some direct usages of `DefaultConfigurableFileCollection` with `FileCollectionFactory`.

  1. … 50 more files in changeset.
Make JavaVersion support JDK 11 and JEP-223 (#4759)

Add JavaVersion.VERSION_11 and support JEP223

  1. … 3 more files in changeset.
Optimize ServiceRegistry

The service lookups were showing up as a hot spot in many

configuration time scenarios. The heart of the problem was

that OwnServices was doing too much work on a lookup - it

iterated over all providers, even if their raw type didn't

match the requested type. To work around that we had added

a "hasService" method as well as a CachingProvider in the

past. These somewhat mitigated follow-up requests, but only

made the problem worse on the first lookup of a service.

This change moves the analysis to service registering time.

Services are kept in a multimap structure that associates

them with their raw type. Only the providers with the right

raw type are asked on each lookup. After this change, the

"hasService" method and the CachingProvider were no longer

necessary, as the normal lookup was fast enough.

Another problem was that we created lots of garbage when

walking up the parent hierarchy on a "getAll" request. Each

layer would create a new array list to hold intermediate

results. This has been changed and we now pass the collecting

array from the lowest layer up the parent hierarchy.

The code that was handling cycles in service lookups used a

HashSet, which lead to two problems: We couldn't report the

actual cycle (since we lost the order) and we were paying

the price of hashing, which is not worth it for such tiny

collections. It now uses an ArrayDeque and a "contains" call

instead, which is more efficient and provides better error

reporting.

The handling of service dependencies was also using a HashSet,

which again lead to unnecessary hash operations. An ArrayList

works fine here and uses less CPU cycles.

Finally, CompositeStoppable was crazy expensive, because it used

a CopyOnWriteArrayList and added each Closable one by one. It now

uses simple synchronization instead, greatly reducing GC pressure.

In order to be able to use some of those data structures that are

Java 6+, I moved the Java version check earlier in the chain so we

don't try to set up any services before checking whether we run on

a supported Java version.

The whole DefaultServiceRegistry class should be broken up for

easier understanding, but I didn't go down that path yet to make

this change easier to review.

  1. … 14 more files in changeset.
Make worker daemons reusable across builds

  1. … 26 more files in changeset.
Improve error when an in-process executer is not used

Wire Execution scope services into other scopes

  1. … 10 more files in changeset.
Fix mocking of services

  1. … 7 more files in changeset.
Moved setup of requested logging level so that it happens around the entire session. Previously it happened much later in the lifecycle and once per build per invocation. This change means that the logging level applies to all logging done during the session.

  1. … 6 more files in changeset.
Moved validation of certain aspects of the provided `StartParameters` to happen early at the start of the session, so that the values can be used during session setup. The validation used to happen much later.

Also added some error reporting around the session, so that any unreported exception that happens during the session is correctly reported and transformed. For example, a failure to setup the session services.

  1. … 5 more files in changeset.
BuildOperationExecutor now distinguish managed/unmanaged threads

Motivated by the Gretty plugin smoke test that broke with previous

changes. This plugin spawns its own threads that do some dependency

resolution.

All Gradle threads are now flagged as “managed”.

BuildOperationExecutor::getCurrentOperation() still throws an IAE when

there’s no current operation in a managed thread. However, it now does

log a warning and return a dummy operation when there’s no current

operation in an unmanaged thread.

  1. … 6 more files in changeset.
Introduced a service scope to represent the services that are scoped to a particular Gradle user home directory, and which can be reused across builds. This can include, for example, caches and the shared services that use them.

The services in this scope are reused while the Gradle user home dir remains unchanged, and recreated when it changes.

  1. … 9 more files in changeset.
Use default excludes to ignore files in continuous build

+review REVIEW-6261

  1. … 13 more files in changeset.
Fixed class cycle

  1. … 5 more files in changeset.
Draft gradle --status to display pid, version and status of running daemons. +review REVIEW-6064

  1. … 19 more files in changeset.
Don't use a real jvm in unit test.

  1. … 2 more files in changeset.
Enable Gradle Daemon by default

  1. … 21 more files in changeset.
Moved progress logging and styled text logging interfaces to live in their own packages.

  1. … 155 more files in changeset.
Moved logging events to live in their own package.

  1. … 77 more files in changeset.
Moved internal logging classes from 'core' to 'logging' project.

  1. … 418 more files in changeset.
Remove Composite build changes from 2.12 release

  1. … 51 more files in changeset.
Add infrastructure for composite builds on daemon side

+review REVIEW-5817

  1. … 10 more files in changeset.
Don't include `-XX:MaxPermSize` in the default JVM args for the daemon when the target is >= Java 9.

This means that the daemon and tooling API now work with Java 9, when no JVM args specified.

  1. … 6 more files in changeset.
Changed DeamonParameters to use `JavaInfo` instances instead of File java home to represent the target JVM for build execution.

  1. … 10 more files in changeset.
Adding build session scope to PluginServiceRegistry

+review REVIEW-5510

  1. … 34 more files in changeset.
remove ContinuousModeParameters and move flag to StartParameters - simplifies parameter handling in Tooling API provider

+review REVIEW-5509

  1. … 11 more files in changeset.