internal

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Simplify the path for an entry in the compiled Groovy DSL script cache, and add some checks to deal with an empty classes directory going missing.

This can happen when restoring the cache on a new build machine when empty directories are ignored.

    • -8
    • +12
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 7 more files in changeset.
Simplify the path for an entry in the compiled Groovy DSL script cache, and add some checks to deal with an empty classes directory going missing.

This can happen when restoring the cache on a new build machine when empty directories are ignored.

    • -8
    • +12
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 7 more files in changeset.
Use a relative path to a script that is used as the location for a configuration cache problem.

    • -0
    • +2
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 49 more files in changeset.
Remove `StringScriptSource`, to be replaced with the existing `TextResourceScriptSource`.

    • -14
    • +15
    ./BuildScriptTransformerSpec.groovy
    • -7
    • +8
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 9 more files in changeset.
Upgrade JUnit version (#12924)

Upgrade JUnit to 4.13, JUnit platform to 5.6.2

    • -1
    • +1
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 331 more files in changeset.
Apply system property read detection to Groovy DSL scripts.

    • -166
    • +0
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 36 more files in changeset.
Extract some shared logic for visiting the contents of a classpath from a couple of places.

    • -1
    • +2
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 13 more files in changeset.
Remove some unused methods and fields.

    • -3
    • +1
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 5 more files in changeset.
Move `ScriptExecutionListener` to `o.g.internal.scripts`

In preparation to make it also about Kotlin DSL scripts.

    • -3
    • +3
    ./DefaultScriptRunnerFactoryTest.groovy
  1. … 9 more files in changeset.
Force AbstractTestDirectoryProvider to use Class (#12431)

Closes https://github.com/gradle/gradle-private/issues/2988

This PR adds `className` to `AbstractTestDirectoryProvider` so there'll be no more `unknown-test-class`.

    • -1
    • +1
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 406 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.

    • -16
    • +11
    ./DefaultScriptCompilationHandlerTest.groovy
    • -6
    • +4
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 28 more files in changeset.
Polish test

    • -23
    • +23
    ./DefaultScriptCompilationHandlerTest.groovy
Use Deleter when removing the output for Groovy script compilation

    • -6
    • +11
    ./BuildScriptTransformerSpec.groovy
    • -1
    • +6
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 2 more files in changeset.
Revert "Revert "Let instant execution reuse classloaders when loading""

    • -10
    • +14
    ./DefaultScriptCompilationHandlerTest.groovy
    • -4
    • +8
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 34 more files in changeset.
Revert "Let instant execution reuse classloaders when loading"

    • -14
    • +10
    ./DefaultScriptCompilationHandlerTest.groovy
    • -8
    • +4
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 34 more files 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>

    • -10
    • +10
    ./DefaultScriptCompilationHandlerTest.groovy
    • -5
    • +7
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 12 more files in changeset.
Artificially create a class loader scope for Groovy script classes

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

    • -8
    • +12
    ./DefaultScriptCompilationHandlerTest.groovy
    • -4
    • +6
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 12 more files in changeset.
Move ClassLoaderHierarchyHasher to :hashing

    • -1
    • +1
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 34 more files in changeset.
Replace 'Matchers' with 'CoreMatchers'

So we do not require 'org.hamcrest:hamcrest-library' as additional

dependency anymore. Which was only available for most of the tests

because it leaked onto the test compile classpath.

    • -1
    • +1
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 162 more files in changeset.
Make script source hashing faster

Do not calcualte the hash for the same script multiple times.

The hash is now stored in the text resource itself so we don't need

an externall managed cache. The UriTextResource implementation has

been thoroughly optimized for local file URIs. Previously reading

those in was a major bottleneck due to copying every byte into 4(!)

different buffers.

Adding the HashCode to the TextResource made me aware of the fact

that the tooling API depended on these interfaces, although it should

never be reading scripts. It turns out that the script was attached to

the BuildLayout, where it didn't really belong. It is now only created

once the build is running and we are actually trying to load the settings

file. There were a few changes to types marked with @UsedByScanPlugin.

These were all checked against the scan plugin code base to ensure they

are safe. The reported data is now more accurate as it returns a `null`

value for a non-existing settings file instead of reporting a dummy path.

    • -98
    • +0
    ./DefaultScriptSourceHasherTest.groovy
    • -4
    • +2
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 23 more files in changeset.
Reuse cached content when hashing scripts

This ensures that the hash and the compiled script are taken from

the same source code and neither picks up any changes that the user

does during the build.

Fixes #7992

    • -17
    • +49
    ./DefaultScriptSourceHasherTest.groovy
  1. … 2 more files in changeset.
Reuse cached content when hashing scripts

This ensures that the hash and the compiled script are taken from

the same source code and neither picks up any changes that the user

does during the build.

Fixes #7992

    • -17
    • +49
    ./DefaultScriptSourceHasherTest.groovy
  1. … 2 more files in changeset.
Converted a bunch more tests from JMock -> Spock

    • -0
    • +117
    ./DefaultScriptRunnerFactoryTest.groovy
    • -189
    • +0
    ./DefaultScriptRunnerFactoryTest.java
  1. … 8 more files in changeset.
Remove --recompile-scripts option

The corresponding `StartParameter` property is now deprecated.

Resolves #6306.

    • -26
    • +1
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 23 more files in changeset.
Remove --recompile-scripts option

The corresponding `StartParameter` property is now deprecated.

Resolves #6306.

    • -26
    • +1
    ./FileCacheBackedScriptClassCompilerTest.groovy
  1. … 23 more files in changeset.
Remove unused code

ContentHasherFactory has no real use, so let's decrease complexity.

    • -12
    • +2
    ./DefaultScriptSourceHasherTest.groovy
  1. … 11 more files in changeset.
Organize imports

    • -3
    • +5
    ./DefaultScriptCompilationHandlerTest.groovy
Use MD5 as the default hashing function

    • -1
    • +1
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 37 more files in changeset.
Move all hashing-related stuff to base-services

- Renamed existing Hasher -> PrimitiveHasher

- Renamed BuildCacheHasher -> Hasher (this is the one that prefixes hashed data with the length of the data to avoid collisions)

    • -2
    • +2
    ./DefaultScriptSourceHasherTest.groovy
  1. … 72 more files in changeset.
Remove deprecated Class.newInstance() (#6496)

`Class.newInstance()` was deprecated in Java 9.

    • -3
    • +4
    ./DefaultScriptCompilationHandlerTest.groovy
  1. … 34 more files in changeset.