# convention

abstract fun convention(@Nullable value: @Nullable Directory): DirectoryProperty(source)

Specifies the value to use as the convention (default value) for this property. If the convention is set and no explicit value or value provider has been specified, then the convention will be returned as the value of the property (when queried).

This method can be used to specify that the property does not have a default value, by passing it null}.

abstract fun convention(provider: Provider<out Directory>): DirectoryProperty(source)

Specifies the provider to be used to query the convention (default value) for this property. If a convention provider has been set and no explicit value or value provider has been specified, then the convention provider's value will be returned as the value of the property (when queried).

The property's convention tracks the convention provider. Whenever the convention's actual value is needed, the convention provider will be queried anew.

This method can't be used to specify that a property does not have a default value. Passing in a null} provider will result in an IllegalArgumentException} being thrown. When the provider doesn't have a value, then the property will behave as if it wouldn't have a convention specified.