genprotos.sh 737 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # TODO This should not be needed. If you set a custom OUT_DIR or OUT_DIR_COMMON_BASE you can
  3. # end up with a command that is extremely long, potentially going passed MAX_ARG_STRLEN due to
  4. # the way sbox rewrites the command. See b/70221552.
  5. set -e
  6. location_aprotoc=$1
  7. location_protoc=$2
  8. location_soong_zip=$3
  9. genDir=$4
  10. depfile=$5
  11. in=$6
  12. out=$7
  13. mkdir -p ${genDir}/${in} && \
  14. ${location_aprotoc} --plugin=${location_protoc} \
  15. --dependency_out=${depfile} \
  16. --javastream_out=${genDir}/${in} \
  17. -Iexternal/protobuf/src \
  18. -I . \
  19. ${in} && \
  20. ${location_soong_zip} -jar -o ${out} -C ${genDir}/${in} -D ${genDir}/${in}