KotlinBuildScriptDependenciesResolver.kt

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce resolver request correlation id

And make it possible to correlate events from the Kotlin DSL resolver

log with the daemon log.

    • -12
    • +23
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 4 more files in changeset.
Move kotlin-dsl in a sub directory

    • -219
    • +0
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 1579 more files in changeset.
Serve the right classpath for scripts in nested projects

By doing a 2nd tooling API query against a potential nested project

whenever the given script cannot be determined to belong to the

imported project.

    • -26
    • +0
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 6 more files in changeset.
Move project root discovery logic lower in the stack

So it can be tested separately from the resolver.

    • -13
    • +1
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 3 more files in changeset.
Always resolve the script classpath against the imported project dir

To account for subprojects outside the root project directory.

This commit temporarily breaks the support for nested projects like

the ones found in `kotlin-dsl/samples` which shall be restored in a

subsequent commit.

Resolves #1231

    • -3
    • +16
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 7 more files in changeset.
Let resolver log cancelled requests

    • -1
    • +5
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 1 more file in changeset.
Let script dependencies resolver prioritise requests by recency

And signal the cancellation of superseded requests by responding with

`null`.

    • -40
    • +6
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 8 more files in changeset.
Polish `KotlinBuildScriptDependenciesResolver`

- join internal constructor with field declaration

- delegate to primary constructor

- explicit declare non-obvious return type

    • -12
    • +8
    ./KotlinBuildScriptDependenciesResolver.kt
IDE resolver distinguishes TAPI failures and early build failures

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

    • -0
    • +12
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 2 more files in changeset.
Fix mapping to IDE editor line number

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

    • -1
    • +1
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 1 more file in changeset.
Disable editor syntax highlighting on unrecoverable failure

and report an error if able to reuse previous dependencies

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

    • -6
    • +6
    ./KotlinBuildScriptDependenciesResolver.kt
Move editor messages out of tooling-models

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

    • -1
    • +0
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 5 more files in changeset.
Report line error on runtime failure in currently edited script

if location aware

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

    • -6
    • +20
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 3 more files in changeset.
Migrate off of experimental coroutines API

    • -8
    • +5
    ./KotlinBuildScriptDependenciesResolver.kt
Move warning calculation to the tooling model builder

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

    • -11
    • +15
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 5 more files in changeset.
Simplify warning message

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

    • -4
    • +2
    ./KotlinBuildScriptDependenciesResolver.kt
Add coverage for KotlinBuildScriptDependenciesResolver

by making it testable

no change in behavior

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

    • -15
    • +33
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 2 more files in changeset.
Resume continuation after completely handling the request

Outside the try block to avoid double resuming (first via `resume`

then later with `resumeWithException`).

Exceptions thrown by the continuation are simply logged.

    • -2
    • +14
    ./KotlinBuildScriptDependenciesResolver.kt
Remove location aware exception hints from IDE resolver temporarily

They need some more love to be more useful and less distracting

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

    • -53
    • +0
    ./KotlinBuildScriptDependenciesResolver.kt
Polish `KotlinBuildScriptDependenciesResolver`

- Check for script file nullability only once during `Report.exceptions`

- Canonicalize script file only once

    • -9
    • +17
    ./KotlinBuildScriptDependenciesResolver.kt
Report currently edited script location aware exceptions as IDE hints

This lets runtime failures surface right in the editor at the offending

line.

Script compilation failures are ignored as the native IDE hints already

provides enough feedback.

Only location aware exceptions for the currently edited script are

reported.

Reflection is used on the location aware exceptions because their java

class comes from another class loader.

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

    • -7
    • +53
    ./KotlinBuildScriptDependenciesResolver.kt
Remove script dependencies resolver short-circuit

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

    • -107
    • +12
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 2 more files in changeset.
Polish `RequestQueue`

Reuse `fetchKotlinBuildScriptModelFor` by making it a non-suspending

function.

    • -11
    • +1
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 1 more file in changeset.
Polish `RequestQueue`

By extracting common thread and queueing logic into `EventLoop<T>`.

    • -32
    • +10
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 2 more files in changeset.
Serialize TAPI requests

In order to avoid spawning a Gradle daemon per open .gradle.kts

script.

See #942

    • -1
    • +64
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 2 more files in changeset.
Move all subprojects to the `subprojects` directory

    • -0
    • +287
    ./KotlinBuildScriptDependenciesResolver.kt
  1. … 521 more files in changeset.