Skip to content

Commit

Permalink
update appengine proto script
Browse files Browse the repository at this point in the history
  • Loading branch information
kylelemons committed Mar 2, 2013
1 parent 4b42973 commit 04279de
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ae_protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e
AE_COPY=1
if [[ "$1" == "--ae-only" ]]; then
AE_COPY=0
shift
fi

if [[ "$#" -eq 0 ]]; then
Expand All @@ -15,7 +16,7 @@ if [[ "$#" -eq 0 ]]; then
echo "edit each file to be usable on AppEngine by"
echo "removing references to the goprotobuf library."
echo
echo "Unless --ae-also is specified, the compiled protobuf"
echo "Unless --ae-only is specified, the compiled protobuf"
echo "output file will be duplicated to an appengine"
echo "specific .ae.go and both will be guarded with the"
echo "appropriate +build directive."
Expand All @@ -42,8 +43,12 @@ for FILE in "$@"; do
echo "Sanitizing $AE_FILE..."
{
echo "H" # Display human-readable errors, if any
echo "g/goprotobuf/d" # Delete lines containing goprotobuf
echo "g/proto\./d" # Delete lines calling into the library
echo "g/goprotobuf/d" # Delete goprotobuf import
echo "g/var.*Marshal$/d" # Delete Marshal placeholder

# Fix lines calling into the library
echo "g/proto1/s/proto.*CompactTextString([^)]*)/\"not available on AppEngine\"/"

echo "w" # Write
echo "q" # Quit
} | ed -s "$AE_FILE"
Expand Down

0 comments on commit 04279de

Please sign in to comment.