CachingKotlinCompiler.kt

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Convert to multi-project build in preparation to adding new modules

See #304

  1. … 263 more files in changeset.
Compiler supports ScriptSource with no backing file

  1. … 1 more file in changeset.
Add compilation classpath to script cache key

This is so changes to the now globally cached

`gradle-script-kotlin-accessors.jar` jars are taken into account.

This is necessary because:

- `gradle-script-kotlin-accessors.jar` is cached based only on the

project schema (the set of extensions and conventions paired with

their types)

- type names generated by the Kotlin compiler are not deterministic

Tighten exported API

This commit adds `internal` or `private` to internal members

The only exported API that includes Gradle internals is now in .provider

See #209

  1. … 23 more files in changeset.
Reuse implicit imports provided by Gradle and add Kotlin specifics

  1. … 6 more files in changeset.
Unify handling of JIT and AOT project accessors

This is the first step toward fixing #340.

Resolves #338

Resolves #339

  1. … 27 more files in changeset.
Extract cache properties to field

- Makes it easier to find it

- Avoids recreating the map on every query to the cache

Bump cache version due to the latest API changes

Polish

- Normalise placement of `private`, `protected`, `internal` and

`inline` modifiers

  1. … 42 more files in changeset.
Report correct location for `buildscript` block compilation errors

And for `plugins` block compilation errors.

Resolves #177

  1. … 5 more files in changeset.
Improve logging behaviour

- Make compiler messages format closer to Kotlin's

- Format messages only if the will be logged

  1. … 6 more files in changeset.
Create script ClassLoader via ClassLoaderScope

Resolves #171

  1. … 1 more file in changeset.
Require non-empty source file list for cache key

Polish `CachingKotlinCompiler`

Make generated accessors visible to KotlinBuildScriptModel clients

See #234

  1. … 23 more files in changeset.
Move away from deprecated `ref.javaClass` to `ref::class.java`

See #264

  1. … 9 more files in changeset.
Generate accessors for project extensions during `buildSrc` build

See: #229, #230, #231, #232, #233

  1. … 20 more files in changeset.
Normalise line separators before attempting to lex the script

Resolves: #207, #227

  1. … 4 more files in changeset.
Remove no longer necessary `KotlinRepositoryHandler`

  1. … 3 more files in changeset.
:arrow_up: Kotlin 1.1-M04 :tada:

See #211

  1. … 3 more files in changeset.
Polish top-level definitions, parameter lists and exceptions

* Separate top-level definitions by two lines

* Segregate visibility modifier of top-level definition to

its own line

* Prefer starting long parameter lists at the next line (more

sustainable in face of method renames)

* Remove unnecessary `Exception` suffix from class names

* Remove unnecessary prefixes from field names

* Use better name for exception variables

  1. … 38 more files in changeset.
Support the `plugins` block :tada:

We use a new type - `KotlinPluginDependenciesHandler` - as the target

for the top-level plugins block instead of the core type

`PluginDependenciesSpec` so we can annotate it with a `@DslMarker`

annotation - `@BuildScriptBlockMarker` - in the hopes that once IntelliJ

starts recognising it, the code completion experience will be better.

Better documentation comments and validation will come in subsequent

commits.

See #186

  1. … 10 more files in changeset.
Polish script dependency resolution code

* Remove deprecated support for Kotlin IDEA 1.1-M01

* Pass script file path all the way down to the model builder in

preparation for better multi-project classpath computation

See #130

  1. … 10 more files in changeset.
Remove ScriptTemplateDefinition annotation from KotlinBuildscriptBlock

To avoid confusing IDEs that rely on that information to decide what's

the correct template definition for a script based on its file name pattern.

  1. … 2 more files in changeset.
Preserve build script file name in cached classes

See #172

  1. … 4 more files in changeset.
Bump version of the cache

Due to incompatible base class changes.

Refer to buildscript *blocks* instead of *sections*

And consistenly use a lower-case `s` in the middle of the word when

referring to just the block and an upper-case `S` when referring to the

script file as a whole.

  1. … 8 more files in changeset.
Change logging level from info to debug

To avoid cluttering the info level.

  1. … 1 more file in changeset.
Polish CachingKotlinCompiler

Cache compiled scripts

- Introduce CachingKotlinCompiler

- Add compilation ClassPath (as ClassLoader) to cache key

- Add version number to script cache

- Honor `--recompile-scripts`

- Report compilation progress

Resolves #31

    • -0
    • +139
    ./CachingKotlinCompiler.kt
  1. … 5 more files in changeset.