diff options
author | Zi Wang <mrziwang@google.com> | 2023-09-18 15:56:15 -0700 |
---|---|---|
committer | Zi Wang <mrziwang@google.com> | 2023-09-19 15:36:45 -0700 |
commit | acc04b8ffd6f17426fc733fbba4952107a5d535e (patch) | |
tree | b824e1e264129566748b22a85ff850eaf6911889 | |
parent | 2d18351e5435f903751b8169336c26cce891dc33 (diff) | |
download | grpc-grpc-java-acc04b8ffd6f17426fc733fbba4952107a5d535e.tar.gz |
Wrap gen_annotations.py in python_binary_host
So that CI python can build grpc-java-annotation-stubs-srcjar
correctly
Test: m and CI
Bug: 301138784
Change-Id: I57d1cf2a4d9b1a3b0ae50d0b645fc3ac24bdb3e2
-rw-r--r-- | annotation-stubs/Android.bp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/annotation-stubs/Android.bp b/annotation-stubs/Android.bp index 9ff8e5504..afd0b431e 100644 --- a/annotation-stubs/Android.bp +++ b/annotation-stubs/Android.bp @@ -40,15 +40,25 @@ java_library { ], } -gensrcs { - name: "grpc-java-annotation-stubs-srcjar", - tool_files: [ +python_binary_host { + name: "gen_annotations", + srcs: [ "gen_annotations.py", ], + version: { + py3: { + embedded_launcher: true, + }, + }, +} + +gensrcs { + name: "grpc-java-annotation-stubs-srcjar", tools: [ "soong_zip", + "gen_annotations", ], - cmd: "$(location gen_annotations.py) $(genDir)/java && " + + cmd: "$(location gen_annotations) $(genDir)/java && " + "$(location soong_zip) -jar -o $(out) -C $(genDir)/java -D $(genDir)/java", srcs: [ // A dummy source file since Soong crashes otherwise. |