build.gradle.kts

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Move kotlin-dsl in a sub directory

  1. … 1579 more files in changeset.
Favour KClass overloads

  1. … 4 more files in changeset.
Fix samples now that container scope string invoke is lazy

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

  1. … 15 more files in changeset.
Improve Copy task sample

- Demonstrate how to declare dependencies on properties

Remove explicit imports of implicit imports in samples

See #215

  1. … 2 more files in changeset.
Refine copy sample

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 {

from("src")

into("out")

}

Instead of:

copySpec {

it.from("src")

it.into("out")

}

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:

- https://youtrack.jetbrains.com/issue/KT-12848

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

want.

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

commit.

Resolves: #52

See also: #54, #117

  1. … 27 more files in changeset.
Revert "Fix copy sample to work against latest Gradle API"

This reverts commit d49facf0025572e3a66987c48af4ed8914aeeb88 since the

motivating changes in the Gradle API were also reverted.

Fix copy sample to work against latest Gradle API

Interim solution until either #52 is implemented or the change in the

Gradle API is reconsidered.

Favor implicit import statements where possible

With the resolution of issues #33 and #57, members declared in the

following packages are now imported implicitly in all Kotlin-based

Gradle build scripts:

- org.gradle.api.plugins

- org.gradle.script.lang.kotlin

This commit removes all explicit declarations of imports from these

packages across our sample projects.

  1. … 4 more files in changeset.
Remove explicit wrapper config from build scripts

In favor of simply modifying gradle/wrapper/gradle-wrapper.properties

directly.

  1. … 3 more files in changeset.
Upgrade wrappers to gradle-gsk-1.0.0-M1 distro

This distribution is not yet in place, but will be immediately following

the publication of v1.0.0-M1 of gradle-script-kotlin.

  1. … 6 more files in changeset.
Upgrade sample wrappers to latest demo distro

  1. … 5 more files in changeset.
Upgrade sample wrappers to latest demo distro

  1. … 8 more files in changeset.
Introduce `DomainObjectCollection.withType` extension

And use it in the samples to configure the `Wrapper` task.

  1. … 3 more files in changeset.
Add Gradle wrapper to samples

with distributionUrl set to (temporary) custom distribution at

https://repo.gradle.org/gradle/demo/demo.zip

  1. … 14 more files in changeset.
Add convenience `CopySpec#filter` extensions

  1. … 1 more file in changeset.
Add `clean` target to `copy` sample

Polish copy sample

Rename demo to samples

  1. … 17 more files in changeset.