elif len(addresses) > 1:
raise ValueError("Multiple targets might be able to provide {}:\n {}".format(
jvm_package_name, "\n ".join(str(a) for a in addresses)))
return addresses[0].to_address()
@printing_func
@rule(PathGlobs, [Select(JVMPackageName), Select(SourceRoots)])
After Change
@rule(Address, [Select(JVMPackageName), Select(Snapshot)])
def select_package_address(jvm_package_name, snapshot):
Return the Address from the given AddressFamilies which provides the given package.
address_families = yield [Get(AddressFamily, Dir, ds) for ds in snapshot.dir_stats]
addresses = [address for address_family in address_families
for address in address_family.addressables.keys()]
if len(addresses) == 0:
raise ValueError("No targets existed in {} to provide {}".format(