File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def _java_gapic_postprocess_srcjar_impl(ctx):
3737 WORKING_DIR=`pwd`
3838
3939 # Main source files.
40- cd {output_dir_path}/src/main/java
40+ cd {output_dir_path}/src/main
4141 zip -r $WORKING_DIR/{output_srcjar_name}.srcjar ./
4242
4343 # Resource name source files.
Original file line number Diff line number Diff line change @@ -274,6 +274,14 @@ def _java_gapic_srcs_pkg_impl(ctx):
274274 unzip -q -o $src -d {package_dir_path}/src/main/java
275275 rm -r -f {package_dir_path}/src/main/java/META-INF
276276
277+ # GAPIC libraries generate java/ and resources/ folders, unlike grpc and proto.
278+ # If this is a GAPIC library, move its output up one directory.
279+ if [ -d {package_dir_path}/src/main/java/java ]; then
280+ mv {package_dir_path}/src/main/java {package_dir_path}/src/main/tmp-java
281+ mv {package_dir_path}/src/main/tmp-java/* {package_dir_path}/src/main
282+ rm -d {package_dir_path}/src/main/tmp-java
283+ fi
284+
277285 # Remove empty files. If there are no resource names, one such file might have
278286 # been created. See java_gapic.bzl.
279287 find {package_dir_path}/src/main/java -type f -size 0 | while read f; do rm -f $f; done
You can’t perform that action at this time.
0 commit comments