SourceIncrementalJavaCompilationIntegrationTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Groovy incremental compilation support (#9616)

Inspired by https://github.com/gradle/gradle/pull/9388 , this PR implements Groovy compilation avoidance. Unlike Java, things are a little more complex in Groovy compilation - a compilation unit can generate multiple classes. Thus, we introduced a `sourceClassMappingFile`, which records the source to classes mappings during the compilation process. Later, we can use this information in incremental compiler: only the affected groovy source files get recompiled in next compilation.

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 73 more files in changeset.
Test groovy incremental support

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 38 more files in changeset.
Test groovy incremental support

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 38 more files in changeset.
Test groovy incremental support

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 38 more files in changeset.
Test groovy incremental compilation

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 38 more files in changeset.
polymorphism for RecompilationSpec

    • -1073
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 23 more files in changeset.
Prefer implementation/api over compile in language-java tests

    • -4
    • +4
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 9 more files in changeset.
Prefer implementation/api over compile in language-java tests

    • -4
    • +4
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 9 more files in changeset.
Prefer implementation/api over compile in language-java tests

    • -4
    • +4
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 9 more files in changeset.
Prefer implementation/api over compile in language-java tests

    • -4
    • +4
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 9 more files in changeset.
Removal of source root shouldn't fail incremental compilation

    • -0
    • +22
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 1 more file in changeset.
Address review feedback

    • -6
    • +11
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
Ignore missing source roots for incremental compilation

Fixes #8194

    • -0
    • +19
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 1 more file in changeset.
Guard against broken incremental compile caches

    • -0
    • +25
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 2 more files in changeset.
Guard against broken incremental compile caches

    • -0
    • +25
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 2 more files in changeset.
Recompile when a resource file changes

We can't tell what annotation processors might be doing with a

resource file, as the processing API does not provide any way

of associating resources with outputs. Therefor the only safe

option for now is doing a full recompile.

We no longer force a full recompile when a processor reads a

resource. We only recompile if the resource changes. This makes

it even easier to make a lot of processors incremental.

    • -1
    • +20
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 9 more files in changeset.
Add first-class support for Javac's -h option

Add the headerOutputDirectory as a compile option,

track it as an output directory and delete stale headers

when doing incremental compilation.

    • -0
    • +24
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 20 more files in changeset.
Recompile types in a package if its package-info changes

Annotation processors can inspect the package of a class,

so we need to make sure that that information is up-to-date

when the package-info changes.

To support this feature we now remember all classes in the

class analysis, not just the ones that had dependents. This

leads to a small increase in memory usage, but means we can

accurately recompile only the classes affected by the given

package change. Alternatively we could omit that data and do

a full recompile instead.

    • -0
    • +20
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 7 more files in changeset.
Recompile when module-info files change

This uses a deliberatly simple strategy for now,

recompiling everything if a module file changes.

We could make this smarter by tracking changes

to exported packages and required modules and only

recompiling those who used them. But the gain is

questionable, as module files only rarely change.

    • -0
    • +31
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 7 more files in changeset.
Remove duplicate class analysis from memory

We no longer store the class analysis of a compile task's

output in that compile tasks's own cache. Instead, we compute

it right before we need it when the next compilation starts.

This removes a lot of unnecessary memory pressure, because no

one else was reusing that state.

It would be even better if we could reuse the analysis that

downstream tasks did on that classes directory (which is an input

for them). To do that we'd need to ensure consistent hashing strategies

between the two.

    • -1
    • +1
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 16 more files in changeset.
Make incremental compilation the default.

    • -5
    • +47
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 24 more files in changeset.
Delete empty package directories

When all classes of a package have been removed,

the package directory in the output directory

will now be removed as well. This ensures that

the resulting JAR will be byte-for-byte equivalent

to a clean build.

    • -0
    • +21
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 5 more files in changeset.
Simplify incremental compile logging

We no longer need the task path, because logging is already

grouped by task. The messages are now slightly clearer about

why some of these conditions may have happened.

    • -1
    • +1
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 3 more files in changeset.
Merge pull request #5332 from gradle/oehme/incremental/failsafe-asm-analysis

Guard incremental compilation against broken jars/classes

    • -3
    • +27
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 1 more file in changeset.
Speed up java incremental compilation tests

The isolated user home is no longer necessary,

because we no longer share class analysis data

in the user home, but keep it in the project dir.

    • -1
    • +0
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 1 more file in changeset.
Guard incremental compilation against broken jars/classes

Instead of failing, do a full recompilation if a class or jar

can't be analyzed. Failures just lead to users deactivating

incremental compilation.

    • -2
    • +27
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 4 more files in changeset.
Track type literals in annotations

Annotations are part of a classes API.

Annotation processors can read the value

and need to be called again if the referenced

type changes.

    • -6
    • +102
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 3 more files in changeset.
Address review comments

    • -1
    • +1
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 1 more file in changeset.
Obtain source roots by visiting root elements

    • -2
    • +4
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 3 more files in changeset.
Change int tests to use relevant fixture methods to express their expectations about the build log output.

    • -9
    • +9
    ./SourceIncrementalJavaCompilationIntegrationTest.groovy
  1. … 22 more files in changeset.