Resolves properties in a certain i.e. like SpringBoot, but less functionality to suite Gradle context.
Modifiers | Name | Description |
---|---|---|
static PropertyResolveOrder |
PROJECT_SYSTEM_ENV |
|
static PropertyResolveOrder |
SYSTEM_ENV_PROPERTY |
Constructor and description |
---|
PropertyResolver
(Project project) Creates a property resolver that will use PROJECT_SYSTEM_ENV by default. |
PropertyResolver
(Project project, PropertyResolveOrder order) Creates a property resolver with a custom resolve order |
PropertyResolver
(ProjectOperations projectOperations) Creates a property resolver with a custom resolve order |
Type Params | Return Type | Name and description |
---|---|---|
|
String |
get(String name) Gets a property. |
|
String |
get(String name, String defaultValue) Gets a property. |
|
String |
get(String name, PropertyResolveOrder order) Gets a property using a specific resolve order. |
|
String |
get(String name, String defaultValue, PropertyResolveOrder order) Gets a property using a specific resolve order |
|
void |
order(PropertyResolveOrder newOrder) Change the existing property order |
|
Provider<String> |
provide(String name) Gets a provider to a property. |
|
Provider<String> |
provide(String name, String defaultValue) Gets a provider to a property. |
|
Provider<String> |
provide(String name, String defaultValue, PropertyResolveOrder order, boolean atConfigurationTime) Gets a provider to a property using a specific resolve order. |
|
Provider<String> |
provideAtConfiguration(String name) Gets a provider to a property that is safe to use at configuration-time. |
|
Provider<String> |
provideAtConfiguration(String name, String defaultValue) Gets a provider to a property that is safe to use at configuration-time. |
Creates a property resolver that will use PROJECT_SYSTEM_ENV by default.
project
- Project context in which to resolve properties.
The project will not be cached, but is used to obtain a reference to the project's properties.Creates a property resolver with a custom resolve order
project
- Project context in which to resolve properties.order
- Custom property resolve orderCreates a property resolver with a custom resolve order
projectOperations
- Project context in which to resolve properties.order
- Custom property resolve orderGets a property.
name
- Name of property to resolvenull
if no property was found.Gets a property.
name
- Name of property to resolve.defaultValue
- Value to return if property cannot be resolved.defaultValue
if no property was found.Gets a property using a specific resolve order.
name
- Name of property to resolveorder
- Resolve ordernull
if no property was found.Gets a property using a specific resolve order
name
- Name of property to resolve.defaultValue
- Value to return if property cannot be resolved.order
- Resolve order.defaultValue
if no property was found.Change the existing property order
newOrder
- New property resolve order.Gets a provider to a property.
name
- Name of property to resolve.Gets a provider to a property.
name
- Name of property to resolve.defaultValue
- Value to return if property cannot be resolved.Gets a provider to a property using a specific resolve order.
name
- Name of property to resolve.defaultValue
- Value to resturn if property cannot be resolved. (Can beorder
- Resolve order.atConfigurationTime
- Whether to make the provider safe for usage at configuration time.Gets a provider to a property that is safe to use at configuration-time.
name
- Name of property to resolve.