Movatterモバイル変換


[0]ホーム

URL:


ComponentSelectionRules

API Documentation:ComponentSelectionRules

Represents a container for component selection rules. Rules can be applied as part of theresolutionStrategy of a configuration and individual components can be explicitly acceptedor rejected by rule. Components that are neither accepted or rejected will be subject tothe default version matching strategies.

configurations {    conf {        resolutionStrategy {            componentSelection {                all { ComponentSelection selection ->if (selection.candidate.module =='someModule' && selection.candidate.version =='1.1') {                        selection.reject("bad version '1.1' for 'someModule'")                    }                }                all { ComponentSelection selection ->if (selection.candidate.module =='someModule' && selection.getDescriptor(IvyModuleDescriptor)?.branch =='testing') {if (selection.metadata == null || selection.metadata.status !='milestone') {                            selection.reject("only use milestones for someModule:testing")                        }                    }                }                withModule("org.sample:api") { ComponentSelection selection ->if (selection.candidate.version =="1.1") {                        selection.reject("known bad version")                    }                }            }        }    }}

Properties

No properties

Methods

MethodDescription
all(closure)

Adds a component selection rule that will apply to all resolved components.Each rule will receive aComponentSelection object as an argument.

all(ruleSource)

Adds a rule-source backed component selection rule that will apply to all resolved components.The ruleSource provides the rule as exactly one rule method annotated withMutate.This rule method:

all(selectionAction)

Adds a simple component selection rule that will apply to all resolved components.Each rule will receive aComponentSelection object as an argument.

withModule(id, closure)

Adds a component selection rule that will apply to the specified module.Each rule will receive aComponentSelection object as an argument.

withModule(id, ruleSource)

Adds a rule-source backed component selection rule that will apply to the specified module.The ruleSource provides the rule as exactly one rule method annotated withMutate.This rule method:

withModule(id, selectionAction)

Adds a component selection rule that will apply to the specified module.Each rule will receive aComponentSelection object as an argument.

Script blocks

No script blocks

Method details

Adds a component selection rule that will apply to all resolved components.Each rule will receive aComponentSelection object as an argument.

Adds a rule-source backed component selection rule that will apply to all resolved components.The ruleSource provides the rule as exactly one rule method annotated withMutate.This rule method:

Adds a simple component selection rule that will apply to all resolved components.Each rule will receive aComponentSelection object as an argument.

ComponentSelectionRuleswithModule(Object id,Closure<?> closure)

Adds a component selection rule that will apply to the specified module.Each rule will receive aComponentSelection object as an argument.

ComponentSelectionRuleswithModule(Object id,Object ruleSource)

Adds a rule-source backed component selection rule that will apply to the specified module.The ruleSource provides the rule as exactly one rule method annotated withMutate.This rule method:

ComponentSelectionRuleswithModule(Object id,Action<? superComponentSelection> selectionAction)

Adds a component selection rule that will apply to the specified module.Each rule will receive aComponentSelection object as an argument.

©Gradle Inc. All rights reserved.
gradle
Careers |Privacy |Terms of Service |Contact

[8]ページ先頭

©2009-2025 Movatter.jp