Mike Kruskal | fc46e87 | 2022-12-16 15:31:27 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # This script updates all our generated files and exports them to a given |
| 4 | # directory. This is intended to simplify the process of updating these from |
| 5 | # google3. After copybara generates a branch for testings, run the following |
| 6 | # from a git clone: |
| 7 | # git fetch --all |
| 8 | # git checkout upstream/<copybara branch> |
| 9 | # ./google3_export_generated_files <ldap>/<citc_workspace> |
| 10 | # |
| 11 | # Note: this is a temporary script and won't be needed once we automatically |
| 12 | # update these. |
| 13 | |
| 14 | set -ex |
| 15 | |
| 16 | OUTPUT_PATH=/google/src/cloud/$1/google3/third_party/protobuf/github |
| 17 | |
| 18 | update_staleness() { |
| 19 | TARGET_DIR=$1 |
| 20 | TARGET=$2 |
| 21 | GEN_PATH=$3 |
| 22 | GEN_FILES=${@:4} |
| 23 | bazel build //$TARGET_DIR:$TARGET |
| 24 | bazel-bin/$TARGET_DIR/$TARGET --fix |
| 25 | for file in $GEN_FILES; do |
| 26 | cp $GEN_PATH/$file $OUTPUT_PATH/$GEN_PATH/ |
| 27 | done |
| 28 | } |
| 29 | |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 30 | update_staleness ruby/ext/google/protobuf_c test_amalgamation_staleness ruby/ext/google/protobuf_c ruby-upb.* |
Mike Kruskal | fc46e87 | 2022-12-16 15:31:27 -0800 | [diff] [blame] | 31 | update_staleness php test_amalgamation_staleness php/ext/google/protobuf php-upb.* |