xcode_version
target is to be used if
no xcode_version
build flag is specified.
*/
.add(attr(DEFAULT_ATTR_NAME, LABEL)
.allowedRuleClasses("xcode_version")
.allowedFileTypes()
.nonconfigurable("this rule determines configuration"))
/*
Accepted xcode_version targets that may be used.
If the value of the xcode_version
build flag matches one of the aliases
or version number of any of the given xcode_version
targets, the matching
target will be used.
*/
.add(attr(VERSIONS_ATTR_NAME, LABEL_LIST)
.allowedRuleClasses("xcode_version")
.allowedFileTypes()
.nonconfigurable("this rule determines configuration"))
/*
Whether to require the build's xcode version match one of the declared targets.
If true, this will raise an error if either the xcode_version
flag value
or default
attribute value do not match one of the versions declared
among xcode_verison
targets.
*/
.add(attr(REQUIRE_DEFINED_VERSIONS_ATTR_NAME, BOOLEAN)
.value(false)
.nonconfigurable("this rule determines configuration"))
.build();
}
@Override
public Metadata getMetadata() {
return RuleDefinition.Metadata.builder()
.name("xcode_config")
.ancestors(BaseRuleClasses.BaseRule.class)
.factoryClass(XcodeConfig.class)
.build();
}
}
/*
A single target of this rule can be referenced by the --xcode_config
build flag to
translate the --xcode_version
flag into an accepted official xcode version. This
allows selection of a an official xcode version from a number of registered aliases.
*/