| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Invoked by the Xcode projects to build the protos needed for the unittests. | 3 # Invoked by the Xcode projects to build the protos needed for the unittests. |
| 4 | 4 |
| 5 set -eu | 5 set -eu |
| 6 | 6 |
| 7 readonly OUTPUT_DIR="${PROJECT_DERIVED_FILE_DIR}/protos" | 7 readonly OUTPUT_DIR="${PROJECT_DERIVED_FILE_DIR}/protos" |
| 8 | 8 |
| 9 # Helper for bailing. | 9 # Helper for bailing. |
| 10 die() { | 10 die() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 fi | 60 fi |
| 61 | 61 |
| 62 if [[ "${RUN_PROTOC}" != "yes" ]] ; then | 62 if [[ "${RUN_PROTOC}" != "yes" ]] ; then |
| 63 # Up to date. | 63 # Up to date. |
| 64 exit 0 | 64 exit 0 |
| 65 fi | 65 fi |
| 66 | 66 |
| 67 # Ensure the output dir exists | 67 # Ensure the output dir exists |
| 68 mkdir -p "${OUTPUT_DIR}/google/protobuf" | 68 mkdir -p "${OUTPUT_DIR}/google/protobuf" |
| 69 | 69 |
| 70 CORE_PROTO_FILES=( \ | 70 CORE_PROTO_FILES=( |
| 71 src/google/protobuf/unittest_arena.proto \ | 71 src/google/protobuf/unittest_arena.proto |
| 72 src/google/protobuf/unittest_custom_options.proto \ | 72 src/google/protobuf/unittest_custom_options.proto |
| 73 src/google/protobuf/unittest_enormous_descriptor.proto \ | 73 src/google/protobuf/unittest_enormous_descriptor.proto |
| 74 src/google/protobuf/unittest_embed_optimize_for.proto \ | 74 src/google/protobuf/unittest_embed_optimize_for.proto |
| 75 src/google/protobuf/unittest_empty.proto \ | 75 src/google/protobuf/unittest_empty.proto |
| 76 src/google/protobuf/unittest_import.proto \ | 76 src/google/protobuf/unittest_import.proto |
| 77 src/google/protobuf/unittest_import_lite.proto \ | 77 src/google/protobuf/unittest_import_lite.proto |
| 78 src/google/protobuf/unittest_lite.proto \ | 78 src/google/protobuf/unittest_lite.proto |
| 79 src/google/protobuf/unittest_mset.proto \ | 79 src/google/protobuf/unittest_mset.proto |
| 80 src/google/protobuf/unittest_mset_wire_format.proto \ | 80 src/google/protobuf/unittest_mset_wire_format.proto |
| 81 src/google/protobuf/unittest_no_arena.proto \ | 81 src/google/protobuf/unittest_no_arena.proto |
| 82 src/google/protobuf/unittest_no_arena_import.proto \ | 82 src/google/protobuf/unittest_no_arena_import.proto |
| 83 src/google/protobuf/unittest_no_generic_services.proto \ | 83 src/google/protobuf/unittest_no_generic_services.proto |
| 84 src/google/protobuf/unittest_optimize_for.proto \ | 84 src/google/protobuf/unittest_optimize_for.proto |
| 85 src/google/protobuf/unittest.proto \ | 85 src/google/protobuf/unittest.proto |
| 86 src/google/protobuf/unittest_import_public.proto \ | 86 src/google/protobuf/unittest_import_public.proto |
| 87 src/google/protobuf/unittest_import_public_lite.proto \ | 87 src/google/protobuf/unittest_import_public_lite.proto |
| 88 src/google/protobuf/unittest_drop_unknown_fields.proto \ | 88 src/google/protobuf/unittest_drop_unknown_fields.proto |
| 89 src/google/protobuf/unittest_preserve_unknown_enum.proto \ | 89 src/google/protobuf/unittest_preserve_unknown_enum.proto |
| 90 src/google/protobuf/map_lite_unittest.proto \ | 90 src/google/protobuf/map_lite_unittest.proto |
| 91 src/google/protobuf/map_proto2_unittest.proto \ | 91 src/google/protobuf/map_proto2_unittest.proto |
| 92 src/google/protobuf/map_unittest.proto \ | 92 src/google/protobuf/map_unittest.proto |
| 93 ) |
| 94 |
| 95 # The unittest_custom_options.proto extends the messages in descriptor.proto |
| 96 # so we build it in to test extending in general. The library doesn't provide |
| 97 # a descriptor as it doesn't use the classes/enums. |
| 98 CORE_PROTO_FILES+=( |
| 99 src/google/protobuf/descriptor.proto |
| 93 ) | 100 ) |
| 94 | 101 |
| 95 compile_proto() { | 102 compile_proto() { |
| 96 src/protoc \ | 103 src/protoc \ |
| 97 --objc_out="${OUTPUT_DIR}/google/protobuf" \ | 104 --objc_out="${OUTPUT_DIR}/google/protobuf" \ |
| 98 --proto_path=src/google/protobuf/ \ | 105 --proto_path=src/google/protobuf/ \ |
| 99 --proto_path=src \ | 106 --proto_path=src \ |
| 100 $* | 107 $* |
| 101 } | 108 } |
| 102 | 109 |
| 103 for a_proto in "${CORE_PROTO_FILES[@]}" ; do | 110 for a_proto in "${CORE_PROTO_FILES[@]}" ; do |
| 104 compile_proto "${a_proto}" | 111 compile_proto "${a_proto}" |
| 105 done | 112 done |
| 106 | 113 |
| 107 OBJC_PROTO_FILES=( \ | 114 OBJC_PROTO_FILES=( |
| 108 objectivec/Tests/unittest_cycle.proto \ | 115 objectivec/Tests/unittest_cycle.proto |
| 109 objectivec/Tests/unittest_runtime_proto2.proto \ | 116 objectivec/Tests/unittest_runtime_proto2.proto |
| 110 objectivec/Tests/unittest_runtime_proto3.proto \ | 117 objectivec/Tests/unittest_runtime_proto3.proto |
| 111 objectivec/Tests/unittest_objc.proto \ | 118 objectivec/Tests/unittest_objc.proto |
| 112 objectivec/Tests/unittest_objc_startup.proto \ | 119 objectivec/Tests/unittest_objc_startup.proto |
| 113 ) | 120 ) |
| 114 | 121 |
| 115 for a_proto in "${OBJC_PROTO_FILES[@]}" ; do | 122 for a_proto in "${OBJC_PROTO_FILES[@]}" ; do |
| 116 compile_proto --proto_path="objectivec/Tests" "${a_proto}" | 123 compile_proto --proto_path="objectivec/Tests" "${a_proto}" |
| 117 done | 124 done |
| OLD | NEW |