index-import icon indicating copy to clipboard operation
index-import copied to clipboard

Need Help In Depth for Integration Guide

Open hendych opened this issue 2 years ago • 0 comments

Hi, I'm trying to integrate this into my bazel local project. Need your help to understand better on how integrating this and clear my own assumptions so I'm in the right track. What I understand, to integrate this library:

  1. Create dummy target in the Xcode for bazel local project. The target name should be the same with your module. (CMIIW). Why we need this dummy target? Target is required by Xcode to create indexing. Xcode also automatically create folders inside DerivedData based by these targets. (for example <module_name>.build folders)
  2. Add this script into your main target (target where you have Bazel Build script running). Add this after the Bazel Build script.
  3. When Bazel is compiling the project, it will create indexstore (if you enabled it by adding build --features="swift.index_while_building" flag in .bazelrc) inside bazel-out folder.
  4. To properly create indexing, we need to add some files in the bazel-out/**/*.indexstore/* into "$BUILD_DIR"/../../Index/DataStore. Also, some objects compiled by Bazel needs to be moved to DerivedData, by using index-import lib.

Up to this step I have hard times to detect if index-import is properly working or not. I managed to get all indexstores into "$BUILD_DIR"/../../Index/DataStore but I can't see some of the compiled objects for swift or objc in the "$CONFIGURATION_TEMP_DIR/\$1.build/Objects-normal/$BUILD_ARCH/\$2.o" folder.

  • Does the remap option in index-import creates directory if it's not exist? What does the remap option do?
  • Since there are no failures or any output, how can I debug the missing objc and swift objects in "$CONFIGURATION_TEMP_DIR/\$1.build/Objects-normal/$BUILD_ARCH/\$2.o"?

hendych avatar May 12 '22 13:05 hendych