public class DefaultResolutionStrategy extends Object implements ResolutionStrategyInternal
| Constructor and Description |
|---|
DefaultResolutionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheChangingModulesFor(int value,
String units)
Sets the length of time that changing modules will be cached, with units expressed as a String.
|
void |
cacheChangingModulesFor(int value,
TimeUnit units)
Sets the length of time that changing modules will be cached.
|
void |
cacheDynamicVersionsFor(int value,
String units)
Sets the length of time that dynamic versions will be cached, with units expressed as a String.
|
void |
cacheDynamicVersionsFor(int value,
TimeUnit units)
Sets the length of time that dynamic versions will be cached.
|
ResolutionStrategy |
failOnVersionConflict()
In case of conflict, Gradle by default uses the newest of conflicting versions.
|
DefaultResolutionStrategy |
force(Object... forcedModuleNotations)
Allows forcing certain versions of dependencies, including transitive dependencies.
|
CachePolicy |
getCachePolicy()
Gets the current expiry policy for dynamic revisions.
|
ConflictResolution |
getConflictResolution()
Until the feature 'settles' and we receive more feedback, it's internal
|
Set<ModuleVersionSelector> |
getForcedModules()
Returns currently configured forced modules.
|
ResolutionRules |
getResolutionRules()
The nascent DSL for cache control, and possibly other per-module resolution overrides
|
DefaultResolutionStrategy |
setForcedModules(Object... forcedModuleNotations)
Allows forcing certain versions of dependencies, including transitive dependencies.
|
public Set<ModuleVersionSelector> getForcedModules()
ResolutionStrategyResolutionStrategy.force(Object...)getForcedModules in interface ResolutionStrategypublic ResolutionStrategy failOnVersionConflict()
ResolutionStrategyConfiguration.
The check includes both first level and transitive dependencies. See example below:
configurations.all {
resolutionStrategy.failOnVersionConflict()
}
failOnVersionConflict in interface ResolutionStrategypublic ConflictResolution getConflictResolution()
ResolutionStrategyInternalgetConflictResolution in interface ResolutionStrategyInternalpublic ResolutionRules getResolutionRules()
ResolutionStrategyInternalgetResolutionRules in interface ResolutionStrategyInternalpublic DefaultResolutionStrategy force(Object... forcedModuleNotations)
ResolutionStrategyIt accepts following notations:
ModuleVersionSelector
configurations.all {
resolutionStrategy.force 'asm:asm-all:3.3.1', 'commons-io:commons-io:1.4'
}
force in interface ResolutionStrategyforcedModuleNotations - typically group:name:version notations to appendpublic DefaultResolutionStrategy setForcedModules(Object... forcedModuleNotations)
ResolutionStrategy
For information on notations see ResolutionStrategy.force(Object...)
Example:
configurations.all {
resolutionStrategy.forcedModules = ['asm:asm-all:3.3.1', 'commons-io:commons-io:1.4']
}
setForcedModules in interface ResolutionStrategyforcedModuleNotations - typically group:name:version notations to setpublic CachePolicy getCachePolicy()
ResolutionStrategyInternalgetCachePolicy in interface ResolutionStrategyInternalpublic void cacheDynamicVersionsFor(int value,
String units)
ResolutionStrategyA convenience method for ResolutionStrategy.cacheDynamicVersionsFor(int, java.util.concurrent.TimeUnit) with units expressed as a String.
Units are resolved by calling the valueOf(String) method of TimeUnit with the upper-cased string value.
cacheDynamicVersionsFor in interface ResolutionStrategyvalue - The number of time unitsunits - The unitspublic void cacheDynamicVersionsFor(int value,
TimeUnit units)
ResolutionStrategyGradle keeps a cache of dynamic version => resolved version (ie 2.+ => 2.3). By default, these cached values are kept for 24 hours, after which the cached entry is expired and the dynamic version is resolved again.
Use this method to provide a custom expiry time after which the cached value for any dynamic version will be expired.
cacheDynamicVersionsFor in interface ResolutionStrategyvalue - The number of time unitsunits - The unitspublic void cacheChangingModulesFor(int value,
String units)
ResolutionStrategyA convenience method for ResolutionStrategy.cacheChangingModulesFor(int, java.util.concurrent.TimeUnit) with units expressed as a String.
Units are resolved by calling the valueOf(String) method of TimeUnit with the upper-cased string value.
cacheChangingModulesFor in interface ResolutionStrategyvalue - The number of time unitsunits - The unitspublic void cacheChangingModulesFor(int value,
TimeUnit units)
ResolutionStrategyGradle caches the contents and artifacts of changing modules. By default, these cached values are kept for 24 hours, after which the cached entry is expired and the module is resolved again.
Use this method to provide a custom expiry time after which the cached entries for any changing module will be expired.
cacheChangingModulesFor in interface ResolutionStrategyvalue - The number of time unitsunits - The unitsCopyright © 2013. All rights reserved