diff options
| author | 2018-08-08 14:57:25 -0700 | |
|---|---|---|
| committer | 2018-08-08 14:57:25 -0700 | |
| commit | 9cd6280f6baadc0d4fd217c59f7d90f45c50a67c (patch) | |
| tree | 3746286ed099febc21994f3bb5dcdc758439b880 | |
| parent | 39ddb130ec73991c042520bb7e17ca3fc17d5baa (diff) | |
| parent | b2432b2ab3b2294bc6e34d9e0dafbdded0b70f71 (diff) | |
Merge "Work around b/70221552" am: f06d3a9857
am: b2432b2ab3
Change-Id: I07faa9adfd5e6589b9989be6056d994c5909408a
| -rw-r--r-- | Android.bp | 22 | ||||
| -rwxr-xr-x | tools/genprotos.sh | 24 |
2 files changed, 36 insertions, 10 deletions
diff --git a/Android.bp b/Android.bp index 605461237f36..646090b5d323 100644 --- a/Android.bp +++ b/Android.bp @@ -735,22 +735,24 @@ gensrcs { name: "framework-javastream-protos", depfile: true, + tool_files: [ "tools/genprotos.sh", ], tools: [ "aprotoc", "protoc-gen-javastream", "soong_zip", ], - cmd: "mkdir -p $(genDir)/$(in) " + - "&& $(location aprotoc) " + - " --plugin=$(location protoc-gen-javastream) " + - " --dependency_out=$(depfile) " + - " --javastream_out=$(genDir)/$(in) " + - " -Iexternal/protobuf/src " + - " -I . " + - " $(in) " + - "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)", - + // TODO This should not be needed. If you set a custom OUT_DIR or OUT_DIR_COMMON_BASE you can + // end up with a command that is extremely long, potentially going passed MAX_ARG_STRLEN due to + // the way sbox rewrites the command. See b/70221552. + cmd: "$(location tools/genprotos.sh) " + + " $(location aprotoc) " + + " $(location protoc-gen-javastream) " + + " $(location soong_zip) " + + " $(genDir) " + + " $(depfile) " + + " $(in) " + + " $(out)", srcs: [ "core/proto/**/*.proto", "libs/incident/**/*.proto", diff --git a/tools/genprotos.sh b/tools/genprotos.sh new file mode 100755 index 000000000000..f901c9f588b6 --- /dev/null +++ b/tools/genprotos.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# TODO This should not be needed. If you set a custom OUT_DIR or OUT_DIR_COMMON_BASE you can +# end up with a command that is extremely long, potentially going passed MAX_ARG_STRLEN due to +# the way sbox rewrites the command. See b/70221552. + +set -e + +location_aprotoc=$1 +location_protoc=$2 +location_soong_zip=$3 +genDir=$4 +depfile=$5 +in=$6 +out=$7 + +mkdir -p ${genDir}/${in} && \ + ${location_aprotoc} --plugin=${location_protoc} \ + --dependency_out=${depfile} \ + --javastream_out=${genDir}/${in} \ + -Iexternal/protobuf/src \ + -I . \ + ${in} && \ + ${location_soong_zip} -jar -o ${out} -C ${genDir}/${in} -D ${genDir}/${in} |