This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set the correct main class on the desugar java_binary target in Bazel.
This will make it easier to build the desugarer tool from the Bazel source tree as an executable (deploy) jar and then use it for something else. For example, with this CL, you can do the following steps to get a standalone desugarer binary: 1. git clone https://github.com/bazelbuild/bazel 2. bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:desugar_bin_deploy.jar 3. cp bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/desugar_bin_deploy.jar ~/bin/desugar.jar And then you can invoke desugar without bazel with `java -jar ~/bin/desugar.jar`. bazelbuild#2975 RELNOTES: None PiperOrigin-RevId: 155629711
- Loading branch information
1 parent
889bbe5
commit 20824c1
Showing
3 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/tools/android/java/com/google/devtools/build/android/desugar/BUILD.tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# This target is named "Desugar_embedded" instead of "Desugar" so as to avoid | ||
# a naming conflict with the existing Desugar_deploy.jar that it depends on. | ||
java_binary( | ||
name = "Desugar", | ||
name = "Desugar_embedded", | ||
main_class = "com.google.devtools.build.android.desugar.Desugar", | ||
runtime_deps = [":desugar_bin_deploy.jar"], | ||
) | ||
runtime_deps = [":Desugar_deploy.jar"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters