blob: 6abdee55be90d9e807b7582b7a04499a168caeac [file] [log] [blame]
# Common package prefixes, in the order we want to check for them
_PREFIXES = (".com.", ".org.", ".net.", ".io.")
# By default bazel computes the name of test classes based on the
# standard Maven directory structure, which we may not always use,
# so try to compute the correct package name.
def package_name():
pkg = native.package_name().replace("/", ".")
for prefix in _PREFIXES:
idx = pkg.find(prefix)
if idx != -1:
return pkg[idx + 1:] + "."
return ""