Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose current repository name to Java with @AutoBazelRepository #16736

Merged
merged 1 commit into from
Nov 10, 2022

Commits on Nov 10, 2022

  1. Expose current repository name to Java with @AutoBazelRepository

    Java targets depending on `@bazel_tools//tools/java/runfiles` can add the new `@AutoBazelRepository` to a class to have an annotation processor generate a companion class with a `BAZEL_REPOSITORY` constant containing the repository name of the target that compiled the class.
    
    This requires a small addition to JavaBuilder to parse the repository name out of the target label and pass it to javac as a processor option.
    
    Work towards bazelbuild#16124
    
    Closes bazelbuild#16534.
    
    PiperOrigin-RevId: 487573496
    Change-Id: Id9b6526ce32268089c91c6d17363d1e7682f64a4
    fmeum committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    2b3a14d View commit details
    Browse the repository at this point in the history