api / org.gradle.api.plugins / ExtraPropertiesExtension / set

set

abstract fun set(name: String, value: Any): Unit

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" 

Parameters

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

value - The value to set for the property