Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Move codegen code to main source set

Mainly to work around a loader constraint violation that appeared when

updating to the latest snapshot.

In the long run it makes sense to have the code available in the

distribution for when we implement code generation at the project site.

Temporarily disable Kotlin API generation until the Action extensions

can be generated again.

Temporarily disable checking the `copy` sample until the Action

extensions are available.

    • -35
    • +0
    • -178
    • +0
    • -45
    • +0
  1. … 20 more files in changeset.
Polish whitespace

  1. … 2 more files in changeset.
Favor expression body

    • -18
    • +12
Address code review feedback from @cbeams

- Rename `requiresExtension` to `conflictsWithExtensions`

- Rename `eraseMethodsMatching` to `removeMethodsMatching`

  1. … 7 more files in changeset.
Compile scripts against generated Kotlin API jar

We would like Kotlin build scripts to behave as if all the `Action<T>`

parameters in the Gradle API had been declared as `T.() -> Unit` to

avoid the need for explicitly qualifying the single argument to the

given lambda expressions with `it`.

In other words, we would like users to be writing code like:

copySpec {




Instead of:

copySpec {




Where `copySpec` is declared in the Gradle Java API as:

CopySpec copySpec(Action<? super CopySpec> configuration)

So far we have been able to avoid the qualifying `it` in some situations

via mindful use of inheritance and Kotlin extensions but a comprehensive

solution was still lacking. The underlying issue is that while Kotlin

does provide a type extension mechanism, type members still take

precedence over extensions and currently there's no mechanism to

instruct Kotlin otherwise.

In the future we might be able to implement a different solution to this

particular issue via a new Kotlin language feature still in discussion:


In the meantime, by giving the Kotlin compiler a carefully crafted API

jar with all members that could potentially conflict with our provided

extensions removed we can work around the fact that interface members

take precedence over extension members and expose all the extensions we


And that is the solution implemented in this commit:

- Remove all API methods that take a last `Action<T>` parameter

- Generate shim extensions that take a last `T.() -> Unit`

Proper treatment for generic types will be implemented in a future


Resolves: #52

See also: #54, #117

    • -0
    • +26
    • -0
    • +49
    • -0
    • +35
    • -0
    • +185
    • -0
    • +38
    • -0
    • +45
  1. … 22 more files in changeset.