kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/extractor/testdata/run_objc_bazel_extraction.sh (about) 1 #!/bin/bash -e 2 # Copyright 2016 The Kythe Authors. All rights reserved. 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 set -o pipefail 17 18 if [ "$(uname)" != "Darwin" ]; then 19 echo "Objective C Bazel extraction can only be done on darwin" 20 exit 2 21 fi 22 23 BAZELOUT="$(bazel info workspace)/bazel-out" 24 bazel build \ 25 --experimental_action_listener=//kythe/extractors:extract_kzip_objc \ 26 --experimental_extra_action_top_level_only \ 27 --experimental_proto_extra_actions \ 28 --ios_sdk_version=10.0 \ 29 :objc_lib 30 31 if [ $? -ne 0 ]; then 32 echo "Build failed" 33 exit 1 34 fi 35 36 # HACK: It is possible that there are other xa files in here. 37 D="$(pwd)" 38 pushd "$BAZELOUT" 39 find . \ 40 -path "*/extra_actions/kythe/cxx/extractor/extra_action_objc/kythe/cxx/extractor/testdata/*.xa" \ 41 -exec cp {} "$D/objc_lib.xa" \; \ 42 && \ 43 chmod -x "$D/objc_lib.xa" 44 popd