Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plugins {

allprojects {
group = "org.gradle"
version = "0.12.2"
version = "0.12.3"
}

val publishedPluginsVersion by extra { "0.12.0" }
Expand Down
22 changes: 22 additions & 0 deletions doc/release-notes/0.12.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Gradle Kotlin DSL 0.12.2 Release Notes
============================

Gradle Kotlin DSL v0.12.2 is another minor update to the [v0.12.0][v0.12.0] release, this time with a fix for a defect identified during the Gradle RC2 testing phase.

v0.12.2 is already included in Gradle 4.3 RC3.

To use it, upgrade your Gradle wrapper in the following fashion:

$ cd $YOUR_PROJECT_ROOT
$ gradle wrapper --gradle-version 4.3-rc-3 --distribution-type all

## Breaking changes

Please check out the [v0.12.0][v0.12.0] release notes for details.

Fixes since v0.12.1
----------------------

* **Auto-applied build scan plugin not found when used in Kotlin DSL** ([#3250](https://github.com/gradle/gradle/issues/3250)). Executing Gradle with the `--scan` command line option in a project where the main build script contains a `buildscript` block that applies other scripts would cause the build to fail as described in the issue. This has been fixed.

[v0.12.0]: https://github.com/gradle/kotlin-dsl/releases/tag/v0.12.0
22 changes: 22 additions & 0 deletions doc/release-notes/0.12.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Gradle Kotlin DSL 0.12.3 Release Notes
============================

Gradle Kotlin DSL v0.12.3 is the final update to the [v0.12.0][v0.12.0] release fixing a breaking change to Kotlin build scripts using the `Property` API.

v0.12.3 is already included in Gradle 4.3 RC4.

To use it, upgrade your Gradle wrapper in the following fashion:

$ cd $YOUR_PROJECT_ROOT
$ gradle wrapper --gradle-version 4.3-rc-4 --distribution-type all

## Breaking changes

Please check out the [v0.12.0][v0.12.0] release notes for details.

Fixes since v0.12.2
----------------------

* **Rename of org.gradle.api.provider.PropertyState to org.gradle.api.provider.Property caused a loss in DSL extension function** ([#574](https://github.com/gradle/kotlin-dsl/issues/574)). The extension members previously only available to `org.gradle.api.provider.PropertyState` are now also available to `org.gradle.api.provider.Property`.

[v0.12.0]: https://github.com/gradle/kotlin-dsl/releases/tag/v0.12.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.gradle.api.Incubating
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.model.ObjectFactory

import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
Expand All @@ -37,6 +38,7 @@ import org.gradle.api.plugins.Convention
import org.gradle.api.plugins.ObjectConfigurationAction
import org.gradle.api.plugins.PluginManager

import org.gradle.api.provider.Property
import org.gradle.api.provider.PropertyState

import org.gradle.api.tasks.TaskContainer
Expand Down Expand Up @@ -184,12 +186,24 @@ operator fun Project.getValue(any: Any, property: KProperty<*>): Any? =
findProperty(property.name)


/**
* Creates a [Property] that holds values of the given type [T].
*
* @see [ObjectFactory.property]
*/
@Incubating
inline
fun <reified T> ObjectFactory.property(): Property<T> =
property(T::class.java)


/**
* Creates a [PropertyState] that holds values of the given type [T].
*
* @see [Project.property]
*/
@Incubating
@Deprecated("Will be removed in 1.0", replaceWith = ReplaceWith("objects.property()"))
inline
fun <reified T> Project.property(): PropertyState<T> =
property(T::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,34 @@

package org.gradle.kotlin.dsl

import org.gradle.api.provider.Property
import org.gradle.api.provider.PropertyState

import kotlin.reflect.KProperty


/**
* Property delegate for [Property] instances.
*
* Example: `val someProperty by somePropertyState`
*/
operator fun <T> Property<T>.getValue(receiver: Any?, property: KProperty<*>): T = get()


/**
* Property delegate for [Property] instances.
*
* Example: `var someProperty by somePropertyState`
*/
operator fun <T> Property<T>.setValue(receiver: Any?, property: KProperty<*>, value: T) = set(value)


/**
* Property delegate for [PropertyState] instances.
*
* Example: `val someProperty by somePropertyState`
*/
@Deprecated("Will be removed in 1.0")
operator fun <T> PropertyState<T>.getValue(receiver: Any?, property: KProperty<*>): T = get()


Expand All @@ -34,4 +52,5 @@ operator fun <T> PropertyState<T>.getValue(receiver: Any?, property: KProperty<*
*
* Example: `var someProperty by somePropertyState`
*/
@Deprecated("Will be removed in 1.0")
operator fun <T> PropertyState<T>.setValue(receiver: Any?, property: KProperty<*>, value: T) = set(value)
2 changes: 1 addition & 1 deletion samples/ant/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
2 changes: 1 addition & 1 deletion samples/copy/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
2 changes: 1 addition & 1 deletion samples/hello-js/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
12 changes: 6 additions & 6 deletions samples/provider-properties/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ open class GreetingPlugin : Plugin<Project> {
open class GreetingPluginExtension(project: Project) {

private
val messageState = project.property<String>()
val messageProperty = project.objects.property<String>()

var message by messageState
var message by messageProperty

val messageProvider: Provider<String> get() = messageState
val messageProvider: Provider<String> get() = messageProperty

var outputFiles by project.files()
}

open class Greeting : DefaultTask() {

private
val messageState = project.property<String>()
val messageProperty = project.objects.property<String>()

@get:Input
var message by messageState
var message by messageProperty

@get:OutputFiles
var outputFiles by project.files()

fun provideMessage(message: Provider<String>) = messageState.set(message)
fun provideMessage(message: Provider<String>) = messageProperty.set(message)

@TaskAction
fun printMessage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip