This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
0.2.0
Pre-release
Pre-release
General Notes
Gradle Script Kotlin v0.2.0 is now available for use in Gradle 3.0 M2. To get started, see the samples README.
Updates since v0.1.1
- Build script dependencies and external plugins (#29). Dependencies can now be added to the build script classpath using the
buildscript
block, and any plugins resolved there can be applied using theapply
block. Seesamples/hello-kotlin/build.gradle.kts
for an example. - Seamless project import into IDEA (#26, #43). Importing projects with Kotlin-based builds into IDEA no longer requires running the
generateKtsConfig
andpatchIdeaConfig
tasks, as configuring the Kotlin IDEA plugin and creating an appropriate IDEA library is now handled automatically. Installing the latest dev build of the Kotlin IDEA plugin remains a pre-requisite. Seesamples/README
for complete instructions. - Implicit imports (#33, #57). Members of the commonly-used packages
org.gradle.script.lang.kotlin
andorg.gradle.api.plugins
are now imported by default into all Kotlin-based Gradle build scripts, resulting in less boilerplate. See commita866610
for an example of the difference this creates. - Externally-defined properties (#60). It is now possible to reference project properties by declaring a
val
delegated to the build script's enclosingproject
object. This approach provides a strong contract for which properties should be available to the build script, while remaining agnostic as to how those projects are actually declared—be it viagradle.properties
,-P
flags or otherwise. Seesamples/project-properties/build.gradle.kts
for an example. - Convenient alternatives to string-based dependency configurations (#36). Prior to this release, dependency configurations were expressed as strings, e.g.
"compile"("org.foo:mylib:1.0")
. This approach is still supported, but extension functions such ascompile
andtestCompile
are now available as a a more convenient and tooling-friendly alternative.