# set

abstract fun set(name: String, @Nullable value: @Nullable Any)(source)

Updates the value for, or creates, the registered property with the given name to the given value. When using an extra properties extension from Groovy, you can also set properties via Groovy's property syntax. All of the following lines of code are equivalent.

    project.ext.set("foo", "bar")
    project.ext.foo = "bar"
    project.ext["foo"] = "bar"

    // Once the property has been created via the extension, it can be changed by the owner.
    project.foo = "bar"
    project["foo"] = "bar"

Content copied to clipboard

#### Since

1.0

#### Parameters

name

The name of the property to update the value of or create

value

The value to set for the property