From 95340052b3a931f55688d4ced3d1a9581123c6f7 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Thu, 6 Aug 2020 16:50:02 -0700 Subject: [PATCH] Update bazel example in README (#43) * Update bazel example in README * remove readonly * Use more accurate input/output paths --- README.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fe5356f..b68a6b1 100644 --- a/README.md +++ b/README.md @@ -49,16 +49,27 @@ A more complex example is importing an index from a [Bazel](https://bazel.build) ```sh #!/bin/bash -bazel_root="^/private/var/tmp/_bazel_[^/]+/[^/]+/execroot/[^/]+" -bazel_module_dir="bazel-out/[^/]+/bin/Modules/([^/]+)" -xcode_module_dir="$CONFIGURATION_TEMP_DIR/\$1.build/Objects-normal/$ARCHS" +# ex: /private/var/tmp/_bazel_//execroot/ +bazel_root="^/private/var/tmp/_bazel_.+?/.+?/execroot/[^/]+" +# ex: bazel-out/ios-x86_64-min11.0-applebin_ios-ios_x86_64-dbg/bin +bazel_bin="^(?:$bazel_root/)?bazel-out/.+?/bin" + +# ex: $bazel_bin//_objs/.swift.o +bazel_swift_object="$bazel_bin/.*/(.+?)_objs/.*/(.+?)\\.swift\\.o$" +# ex: Build/Intermediates.noindex/.build/Debug-iphonesimulator/.build/Objects-normal/x86_64/.o +xcode_object="$CONFIGURATION_TEMP_DIR/\$1.build/Objects-normal/$ARCHS/\$2.o" + +# ex: $bazel_bin//.swiftmodule +bazel_module="$bazel_bin/.*/(.+?)\\.swiftmodule$" +# ex: Build/Products/Debug-iphonesimulator/.swiftmodule/x86_64.swiftmodule +xcode_module="$BUILT_PRODUCTS_DIR/\$1.swiftmodule/$ARCHS.swiftmodule" index-import \ - -remap "$bazel_root/$bazel_module_dir/\\1.swiftmodule=$xcode_module_dir/\$1.swiftmodule" \ - -remap "^$bazel_module_dir/.+/([^/]+).swift.o=$xcode_module_dir/\$2.o" \ + -remap "$bazel_module=$xcode_module" \ + -remap "$bazel_swift_object=$xcode_object" \ -remap "$bazel_root=$SRCROOT" \ - path/to/input/index \ - path/to/xcode/index + "$SRCROOT/bazel-out//bin//.indexstore" \ + "$HOME/Library/Developer/Xcode/DerivedData//Index/DataStore" ```