index-import
index-import copied to clipboard
Need Help In Depth for Integration Guide
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:
- Create
dummy targetin the Xcode for bazel local project. The target name should be the same with your module. (CMIIW). Why we need thisdummy target? Target is required by Xcode to create indexing. Xcode also automatically create folders insideDerivedDatabased by these targets. (for example<module_name>.buildfolders) - Add this script into your main target (target where you have
Bazel Buildscript running). Add this after theBazel Buildscript. - 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) insidebazel-outfolder. - 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 toDerivedData, by usingindex-importlib.
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
remapoption inindex-importcreates directory if it's not exist? What does theremapoption 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"?