scripts

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix compilation errors introduced by TextUrlResource.Factory change

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>

  1. … 11 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 284 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 281 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 284 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 282 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 283 more files in changeset.
Use 'implementation' dependencies everywhere

    • -1
    • +1
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 283 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
    ./internal/DefaultScriptSourceHasherTest.groovy
    • -4
    • +2
    ./internal/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
    ./internal/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
    ./internal/DefaultScriptSourceHasherTest.groovy
  1. … 2 more files in changeset.
Got rid of the last of the `@RunWith(JMock)`

  1. … 15 more files in changeset.
Converted a bunch more tests from JMock -> Spock

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

The corresponding `StartParameter` property is now deprecated.

Resolves #6306.

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

The corresponding `StartParameter` property is now deprecated.

Resolves #6306.

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

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

    • -12
    • +2
    ./internal/DefaultScriptSourceHasherTest.groovy
  1. … 11 more files in changeset.
Update JMock to 2.8.4

  1. … 2 more files in changeset.
Organize imports

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

    • -1
    • +1
    ./internal/BuildScriptTransformerSpec.groovy
    • -1
    • +1
    ./internal/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
    ./internal/DefaultScriptSourceHasherTest.groovy
  1. … 72 more files in changeset.
Remove deprecated Class.newInstance() (#6496)

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

    • -3
    • +4
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 34 more files in changeset.
Expose insights to build script compilation (#6097)

    • -1
    • +2
    ./internal/BuildScriptTransformerSpec.groovy
    • -0
    • +12
    ./internal/DefaultScriptCompilationHandlerTest.groovy
  1. … 8 more files in changeset.
Add support for URI-backed text resources

This can be used to point tasks like Checkstyle

to a remote, shared configuration file without

having to package it into an archive and using

dependency resolution.

The implementation reuses the same caching logic

we have for remote build scripts.

  1. … 20 more files in changeset.
Let Groovy DSL script compilation cache hold weak references to ClassLoaders (#4163)

And remove useless build-scope in-memory cache layer

    • -131
    • +0
    ./internal/BuildScopeInMemoryCachingScriptClassCompilerTest.groovy
  1. … 4 more files in changeset.
Let Groovy DSL script compilation cache hold weak references to ClassLoaders

And remove useless build-scope in-memory cache layer

    • -131
    • +0
    ./internal/BuildScopeInMemoryCachingScriptClassCompilerTest.groovy
  1. … 4 more files in changeset.
Changed the process forking infrastructure so that it attempts to reuse threads rather than creating 3 or more threads per process that is forked.

There is now a global `ExecFactory` service that manages the infrastructure, including a pool of threads. It provides various factory methods to create instances of `ExecHandleBuilder`, `ExecAction`, `JavaExecHandleBuilder` and `JavaExecAction` backed by this infrastructure.

Replaced all direct instantiation of these types with usages of these factory methods.

  1. … 44 more files in changeset.
Script plugins applied using plugins {} can use mixed scripting languages

  1. … 7 more files in changeset.
Use our own hashing architecture, take 2 (#2817)

This replaces Guava's hashing. We need this for two reasons:

- it allows the addition of custom hash functions, like BLAKE2b which would not be possible with Guava's closed design

- it fixes a few performance issues that Guava only fixes in version 20 (which we can't upgrade to right now, because we still need to support Java 5 in places)

    • -3
    • +2
    ./internal/BuildScriptTransformerSpec.groovy
    • -4
    • +3
    ./internal/DefaultScriptCompilationHandlerTest.groovy
    • -6
    • +5
    ./internal/DefaultScriptSourceHasherTest.groovy
    • -5
    • +5
    ./internal/FileCacheBackedScriptClassCompilerTest.groovy
  1. … 155 more files in changeset.
Fix merge issues

  1. … 22 more files in changeset.
Move FileHasher to base-services

+review REVIEW-6562

    • -1
    • +1
    ./internal/DefaultScriptSourceHasherTest.groovy
  1. … 74 more files in changeset.
Hash script sources separately

+review REVIEW-6562

    • -0
    • +77
    ./internal/DefaultScriptSourceHasherTest.groovy
    • -5
    • +4
    ./internal/FileCacheBackedScriptClassCompilerTest.groovy
  1. … 21 more files in changeset.