api / org.gradle.api.plugins / ExtraPropertiesExtension / has

has

abstract fun has(name: String): Boolean

Returns whether or not the extension has a property registered via the given name.

 assert project.ext.has("foo") == false assert project.hasProperty("foo") == false project.ext.foo = "bar" assert project.ext.has("foo") assert project.hasProperty("foo") 

Parameters

name - The name of the property to check for

Return
true if a property has been registered with this name, otherwise false.