internal

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Do not hash the implementation classpath for a Groovy DSL script to use for in-memory script caching, but instead use the parent `ClassLoader` identity and the hash of the script itself, as this is faster and identifies the script implementation equally well.

This was the previous behavior, which was accidentally changed in a previous commit. This commit restores the previous behaviour but in a way that (hopefully) is harder to accidentally break in the future.

    • -3
    • +1
    ./DefaultScriptCompilationHandler.java
  1. … 9 more files in changeset.
make inner classes static where possible

Signed-off-by: Steven Crockett <crockett.j.steven@gmail.com>

    • -1
    • +1
    ./BuildOperationBackedScriptCompilationHandler.java
    • -1
    • +1
    ./TaskDefinitionScriptTransformer.java
  1. … 41 more files in changeset.
Simplify and improve the reliability of serializing classes to the instant execution cache.

Fixes a case where loading the instant execution cache after writing a task graph that references a different set of build scripts to that referenced last time the task graph was written.

    • -5
    • +8
    ./DefaultScriptCompilationHandler.java
  1. … 7 more files in changeset.
Fix `ClassNotFoundExeception` when loading objects whose class is defined in a build script from the instant execution cache, after recreating the cache from a daemon process that has previously successfully used the cache.

For example, running `gradle taskA`, `gradle taskA`, `gradle taskB`, `gradle taskB` would fail if `taskB` uses types from a build script.

This was happening because the script ClassLoaders are cached and reused, but the association between ClassLoader and scope was lost, and this association is what instant execution uses to know how to load the class.

This change fixes one case of this problem, but the same problem can still happen if the set of build scripts being referenced changes.

    • -0
    • +1
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -12
    • +27
    ./DefaultScriptCompilationHandler.java
    • -0
    • +5
    ./FileCacheBackedScriptClassCompiler.java
  1. … 22 more files in changeset.
Remove duplicate vendor from javaVmVersion String

    • -1
    • +1
    ./RegistryAwareClassLoaderHierarchyHasher.java
Do not follow symlinks when removing work outputs

    • -3
    • +3
    ./DefaultScriptCompilationHandler.java
  1. … 18 more files in changeset.
Record the ClassLoader associated with each class that is serialized to the instant execution cache, and use this to make class lookup on deserialize faster and to deal correctly with multiple classes with the same name.

Move some ClassLoader lifecycling from Groovy DSL script compilation to `ClassLoaderScope`, so that the scope takes care of creating and caching the script ClassLoader.

    • -3
    • +2
    ./BuildOperationBackedScriptCompilationHandler.java
    • -3
    • +2
    ./BuildScopeInMemoryCachingScriptClassCompiler.java
    • -3
    • +1
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -21
    • +8
    ./DefaultScriptCompilationHandler.java
    • -6
    • +3
    ./FileCacheBackedScriptClassCompiler.java
  1. … 24 more files in changeset.
Support plugins {} in settings scripts

    • -1
    • +1
    ./InitialPassStatementTransformer.java
  1. … 9 more files in changeset.
Support plugins {} in settings scripts

    • -1
    • +1
    ./InitialPassStatementTransformer.java
  1. … 9 more files in changeset.
Move Deleter interface out of impl package

    • -1
    • +1
    ./DefaultScriptCompilationHandler.java
  1. … 41 more files in changeset.
Use Deleter when removing the output for Groovy script compilation

    • -7
    • +19
    ./DefaultScriptCompilationHandler.java
  1. … 3 more files in changeset.
Revert "Revert "Let instant execution reuse classloaders when loading""

    • -2
    • +3
    ./BuildOperationBackedScriptCompilationHandler.java
    • -3
    • +4
    ./BuildScopeInMemoryCachingScriptClassCompiler.java
    • -3
    • +5
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -7
    • +14
    ./DefaultScriptCompilationHandler.java
    • -2
    • +4
    ./FileCacheBackedScriptClassCompiler.java
  1. … 30 more files in changeset.
Revert "Let instant execution reuse classloaders when loading"

    • -3
    • +2
    ./BuildOperationBackedScriptCompilationHandler.java
    • -4
    • +3
    ./BuildScopeInMemoryCachingScriptClassCompiler.java
    • -5
    • +3
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -14
    • +7
    ./DefaultScriptCompilationHandler.java
    • -4
    • +2
    ./FileCacheBackedScriptClassCompiler.java
  1. … 30 more files in changeset.
Re-allows multiple `plugins` blocks in the Groovy DSL

    • -2
    • +0
    ./InitialPassStatementTransformer.java
  1. … 1 more file in changeset.
Simplify ScriptCompiler.compile() contract

Not requiring the ClassLoader anymore but only the ClassLoaderScope

as all implementations now use the export loader from the given scope.

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -2
    • +2
    ./BuildOperationBackedScriptCompilationHandler.java
    • -3
    • +3
    ./BuildScopeInMemoryCachingScriptClassCompiler.java
    • -3
    • +2
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -6
    • +4
    ./DefaultScriptCompilationHandler.java
    • -2
    • +2
    ./FileCacheBackedScriptClassCompiler.java
  1. … 8 more files in changeset.
Add TODO:instant-execution to use a scope for Groovy script classes

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -0
    • +1
    ./DefaultScriptCompilationHandler.java
Apply `Merge identical catch branches` inspection the whole project

  1. … 15 more files in changeset.
Artificially create a class loader scope for Groovy script classes

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -2
    • +3
    ./BuildOperationBackedScriptCompilationHandler.java
    • -2
    • +3
    ./BuildScopeInMemoryCachingScriptClassCompiler.java
    • -2
    • +5
    ./CrossBuildInMemoryCachingScriptClassCache.java
    • -5
    • +13
    ./DefaultScriptCompilationHandler.java
    • -1
    • +3
    ./FileCacheBackedScriptClassCompiler.java
  1. … 8 more files in changeset.
Move ClassLoaderHierarchyHasher to :hashing

    • -1
    • +1
    ./FileCacheBackedScriptClassCompiler.java
  1. … 34 more files in changeset.
Remove ClassLoaderHasher

There is no need to separate this from HashingClassLoaderFactory.

    • -3
    • +3
    ./RegistryAwareClassLoaderHierarchyHasher.java
  1. … 6 more files in changeset.
Remove dependency on HashCode in HashUtil

    • -1
    • +1
    ./FileCacheBackedScriptClassCompiler.java
  1. … 5 more files in changeset.
Adds constraints to the use of plugins and pluginManagement blocks

    • -1
    • +3
    ./InitialPassStatementTransformer.java
  1. … 5 more files in changeset.
Provide the line-number of the plugins block when invoking

    • -1
    • +10
    ./InitialPassStatementTransformer.java
  1. … 3 more files in changeset.
Remove unused `BuildScriptMetadata`

    • -33
    • +0
    ./BuildScriptMetadataSerializer.java
    • -7
    • +1
    ./InitialPassStatementTransformer.java
    • -0
    • +61
    ./NoDataCompileOperation.java
  1. … 2 more files in changeset.
Polish `InitialPassStatementTransformer`

- Add documentation comment

- Extract explaining methods

- Remove unnecessary `else` clauses to simplify control flow

    • -54
    • +76
    ./InitialPassStatementTransformer.java
Execute the `plugins` block in order to extract plugin requests

Previously, we were extracting `PluginRequests` when compiling a build script,

using AST transforms. This prevented any sort of dynamic behaviour within the

plugins block, such as reading plugin versions from a properties file.

This behaviour was by design, and the syntax of the plugins block was explicitly

restricted to ensure the plugin requests were statically defined.

This restricted syntax has been the cause of much user angst, and the expected

benefits of a truly imperative plugins block have not eventuated. Furthermore,

the implementation of `plugins` in the Kotlin DSL does not add the same

restrictions.

With this change, the `plugins` block is actually invoked to extract any plugin

requests. While the restricted syntax remains (for now), this change opens up

the possibility of supporting property replacement for version numbers and other

dynamic behaviour.

One limitation of this change is that the line number of each plugin request

is not captured correctly: the line number is always reportes as 0 for any

request. Several tests are failing due to this limitation.

    • -0
    • +35
    ./BuildScriptMetadata.java
    • -0
    • +33
    ./BuildScriptMetadataSerializer.java
    • -8
    • +9
    ./InitialPassStatementTransformer.java
  1. … 5 more files in changeset.
Validate plugin request values when invoking plugins block

This is a further change toward allowing the plugins block to support

property replacement or other dynamic features. Instead of validating

the plugin id and version values when compiling the script, we now

perform this validation when these values are extracted, during

invocation of the `plugins` block.

    • -7
    • +7
    ./InitialPassStatementTransformer.java
  1. … 5 more files in changeset.
Add missing @Override to public api types

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -0
    • +1
    ./DefaultScriptCompilationHandler.java
    • -0
    • +10
    ./FileCacheBackedScriptClassCompiler.java
    • -0
    • +1
    ./InitialPassStatementTransformer.java
    • -0
    • +2
    ./TaskDefinitionScriptTransformer.java
  1. … 334 more files in changeset.
spelling: prefer

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

spelling: knowledge

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>