Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Changed `JvmLanguageCompileSpec.classpath` back to `Iterable<File>` for backwards compatibility for now (these are internal types).

  1. … 17 more files in changeset.
Added internal method back for now.

  1. … 3 more files in changeset.
Fixes to ensure correct results when using annotation processors for Java source compilation. The fixes apply to Java compilation in both incremental and non-incremental modes.

Added `CompileOptions.annotationProcessorPath` to allow an annotation processor path to be explicitly declared for a compile task. When declared, this path is used to locate annotation processors, instead of searching the compile classpath for processors.

Added `JavaCompile.effectiveAnnotationProcessorPath` which returns the actual annotation processor path to use for compilation. This is marked with `@Classpath` so that source is recompiled when an annotation processor implementation or runtime dependency changes in some way that affects runtime execution.

The effective annotation processor path is calculated as follows:

- When explicitly set on the compile options, use this value. Can be empty.

- When an annotation processor is present in the compile classpath, use the compile classpath.

- When no annotation processors are present in the compile classspath, use an empty path.

Changed the incremental Java compile to fall back to full compile when the annotation processor path is not empty. This is an intentionally dumb strategy that can be made better later.

Made some simplifications to the generation of javac compiler args.

Added a bunch of test coverage for incremental builds in the presence of annotation processors.

  1. … 22 more files in changeset.
Treat `AbstractCompile.classpath` as an `@Internal` property for now.

Move `@CompileClasspath` to `JavaCompile` only for now

  1. … 1 more file in changeset.
Spike compile avoidance using compile classpath aware hashing strategy

  1. … 54 more files in changeset.
Make worker daemon lifecycle logging more meaningful

  1. … 4 more files in changeset.
Fix failing compiler daemon tests

- Fix DaemonJavaCompilerIntegrationTest

- Fixing issue with renamed class

- Fix issues with compiler daemon classpath

- Fixing issue with in-process compiler returning incorrect result

- Removing unnecessary wrapping of compiler result

- Fix checkstyle issues

  1. … 15 more files in changeset.
Improving worker daemon service api

- Removed implementationClass and sharedPackages method from WorkerDaemonExecutor

- Changed service to always infer the full classpath from the implementation class

  1. … 5 more files in changeset.
Fix an issue with the daemon compiler classpath

  1. … 7 more files in changeset.
Fix issue with runnables defined in the build script

  1. … 20 more files in changeset.
Introduce public WorkerDaemonServer and WorkerDaemonExecutor

  1. … 24 more files in changeset.
Introduce Timer abstractions for simpler timekeeping

- Timer provides a 'stopwatch' function, with the benefit of a nicely

formatted elapsed time.

- CountdownTimer tracks if a timeout limit has been reached.

  1. … 22 more files in changeset.
Moved `Clock` and `TimeProvider` into a separate package

This commit reverts recent changes to the API of

`org.gradle.util.Clock`, and instead deprecates the existing type

replacing with a new internal type. This was done because the

`ExtractDslMetaDataTask` uses this type for timing, and external plugins may have copied this pattern.

`org.gradle.util.Clock` is now deprecated.

  1. … 103 more files in changeset.
Clarifying renames in o.g.util.Clock

- `start` -> `startInstant`

- `getTimeInMillis()` -> `getElapsedMillis()`

- `getTime()` -> `getElapsed()`

  1. … 22 more files in changeset.
Generalize compiler daemon infrastructure for any kind of worker

    • -45
    • +0
  1. … 47 more files in changeset.
Mark classpaths as `@Classpath`

Instead of annotating with `@InputFiles` and `@OrderSensitive`, we now have only `@Classpath`.

This also enables relative path normalization for every classpath property.

+review REVIEW-6241

  1. … 32 more files in changeset.
Better name for CLASSPATH PathSensitivity

This is a temporary measure before introducing `@Classpath` to annotate classpath properties.

+review REVIEW-6090

  1. … 5 more files in changeset.
Keep track of file hierarchy for classpaths

Given a file structure like this:










And a classpath like this:


We need to normalize paths to this:

- "" (i.e. we ignore the path for library-a.jar)

- "" (same for library-b.jar)

- "a/input-1.txt" (notice that we ignore the root directory "data" itself!)

- "b/input-2.txt"

This allows us to ignore changes to the roots (i.e. it should make a difference for the JavaCompile task if `library-a.jar` was renamed to `other-library-a.jar` as long as contents stay the same). It also allows us to detect if `a/input-1.txt` is moved to `b/input-1.txt` (think of how that changes the behavior of `ClassLoader.getResource("a/input-1.txt")`.

Before this change we ignored every directory, and the whole path of every file on the classpath. This included ignoring the path of `a/input-1.txt`, so if that file was moved, we wouldn't detect the change. This is a false positive that we need to avoid at all cost.

This commit doesn't take us directly to the right solution, though. Instead, we'll keep track of the following information:

- "library-a.jar"

- "library-b.jar"

- "data"

- "data/a/input-1.txt"

- "data/b/input-2.txt"

Basically, we include the name of the root of the hierarchy, and don't remove root directories. This already allows us to detect `a/input-1.txt` being moved. The downside is that we produce false negatives (i.e. we needlessly consider the task out-of-date) when `library-a.jar` is renamed to `other-library-a.jar`. This will be addressed in a later change.

+review REVIEW-6170

  1. … 1 more file in changeset.
Make `@PathSensitive` public

We need this annotation in the public API

+review REVIEW-6170

  1. … 12 more files in changeset.
Introduce `@PathSensitive` annotation

This annotation on a task property specifies which part of the file paths to observe when comparing different states of the task. For example, a Java classpath property will most probably ignore file paths completely, whereas Java sources to be compiled should observe the file names (and ignore the rest of the paths).

This feature enables up-to-date checks to recognize the case where the whole project has been moved, but its internal contents haven't changed. More importantly, this feature enables sharing cached task outputs between different computers where the task is being executed under different root directories.

+review REVIEW-6170

  1. … 44 more files in changeset.
Expose per-property previous task output files

Output files from the previous execution were accessible as a single file collection previously. Now it is possible to query per-property instead. This simplifies the logic somewhat (no need to filter files belonging to other properties). This is also a step towards a more optimal implementation for output directory snapshots, where we can reconstruct the absolute paths of files from the directory path and relative paths of files (instead of storing the full absolute path).

+review REVIEW-6141

  1. … 27 more files in changeset.
Introduce order-sensitive task file inputs

Some task file input properties (such as Java classpaths) need to be treated in an order-sensitive fashion. If the same files are present, but in different order, the corresponding task should be out-of-date.

Fixes GRADLE-3508

+review REVIEW-6114

  1. … 27 more files in changeset.
Expose less about filtering classloaders

There's no need for the caller to know the specific type of classloader

being created.

+review REVIEW-6020

  1. … 4 more files in changeset.
Make `FilteringClassLoader` immutable

`SystemClassLoaderSpec` is moved to its own class so that it can be

included in `gradle-worker.jar`.

+review REVIEW-6020

  1. … 20 more files in changeset.
Revert "Make `FilteringClassLoader` immutable"

This reverts commit 18ee27f8561df18b19761ebd65f209eed88c19f5.

  1. … 15 more files in changeset.
Make `FilteringClassLoader` immutable

+review REVIEW-6020

  1. … 15 more files in changeset.
Remove unused `MutableURLClassLoader.addURL()` method

This effectively makes `MutableURLClassLoader` not publicly mutable,

thus the rename to `VisitableURLClassLoader`.

+review REVIEW-6020

  1. … 21 more files in changeset.
Annotate more task properties

Part of this is fixing missing annotations. Part is applying the new

`@Console` and `@Internal` annotations where appropriate.

+review REVIEW-5932

  1. … 80 more files in changeset.
Revert "Annotate more task properties"

This reverts commit 4b32689375b46bb01ace46d5255118683c7c13ed.

  1. … 68 more files in changeset.