/** * Returns the canonical name of this flavor - which is the name which should be used as an interface to users. * The canonical name of this flavor is: * <ul> * <li>If it replaces one flavor, the canonical name of the flavor it replaces * <li>If it replaces multiple or no flavors - itself * </ul> * * The logic is that we can use this to capture the gritty details of configurations in exact flavor names * but also encourage users to refer to them by a common name by letting such flavor variants declare that they * replace the canonical name we want. However, if a node replaces multiple names, we have no basis for choosing one * of them as the canonical, so we return the current as canonical. */ public String canonicalName() { return isCanonical() ? name : replacesFlavors.get(0).canonicalName(); }