Skip to content

Commit

Permalink
Improve BwB initial indexing (#545)
Browse files Browse the repository at this point in the history
We no longer perform the `Fix Info.plists` script during Index Build. This allows initial indexing to get further, before the project is built the first time.
  • Loading branch information
brentleyjones authored Jun 13, 2022
1 parent 0c65cdd commit 6849ec3
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/ios_app/test/fixtures/bwb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
FC6E45C2D1E2FBCFC2D1471E /* Fix Info.plists */ = {
Expand All @@ -941,7 +941,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
FF28C25A21C1530CA1AF5318 /* Fix Modulemaps */ = {
Expand Down
4 changes: 2 additions & 2 deletions examples/ios_app/test/fixtures/bwx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
A1B677A301B894FBD0B5AB58 /* Fix Info.plists */ = {
Expand All @@ -1015,7 +1015,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/command_line/bwb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
CF5964970607E7A9795E2A66 /* Copy Bazel Outputs */ = {
Expand Down Expand Up @@ -735,7 +735,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
FF28C25A21C1530CA1AF5318 /* Fix Modulemaps */ = {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/command_line/bwx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
88F7F6781328CA74DCF58611 /* Copy Swift Generated Header */ = {
Expand Down Expand Up @@ -705,7 +705,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/multiplatform/bwb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
DF8E9D9CD1E839DFDDC57F9F /* Copy Bazel Outputs */ = {
Expand Down Expand Up @@ -1371,7 +1371,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/multiplatform/bwx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
A1B677A301B894FBD0B5AB58 /* Fix Info.plists */ = {
Expand All @@ -1273,7 +1273,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/tvos_app/bwb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
FC6E45C2D1E2FBCFC2D1471E /* Fix Info.plists */ = {
Expand All @@ -550,7 +550,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/tvos_app/bwx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink.\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
shellScript = "set -euo pipefail\n\ncd \"$BAZEL_OUT\"\n\n# Sync to \"$BUILD_DIR/bazel-out\". This is the same as \"$GEN_DIR\" for normal\n# builds, but is different for Index Builds. `PBXBuildFile`s will use the\n# \"$GEN_DIR\" version, so indexing might get messed up until they are normally\n# generated. It's the best we can do though as we need to use the `gen_dir`\n# symlink, because Index Build can't modify the normal build's \"$BUILD_DIR\".\nrsync \\\n --files-from \"$INTERNAL_DIR/generated.rsynclist\" \\\n --chmod=u+w \\\n -L \\\n . \\\n \"$BUILD_DIR/bazel-out\"\n";
showEnvVarsInLog = 0;
};
A1B677A301B894FBD0B5AB58 /* Fix Info.plists */ = {
Expand All @@ -479,7 +479,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
shellScript = "set -euo pipefail\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # Info.plist file paths are `GEN_DIR` based, so this isn't needed during\n # Index Build\n exit\nfi\n\nwhile IFS= read -r input; do\n output=\"${input%.plist}.xcode.plist\"\n cp \"$input\" \"$output\"\n plutil -remove UIDeviceFamily \"$output\" > /dev/null 2>&1 || true\ndone < \"$SCRIPT_INPUT_FILE_LIST_0\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ cd "$BAZEL_OUT"
# builds, but is different for Index Builds. `PBXBuildFile`s will use the
# "$GEN_DIR" version, so indexing might get messed up until they are normally
# generated. It's the best we can do though as we need to use the `gen_dir`
# symlink.
# symlink, because Index Build can't modify the normal build's "$BUILD_DIR".
rsync \
--files-from "\#(
try filePathResolver
Expand Down Expand Up @@ -526,6 +526,12 @@ done < "$SCRIPT_INPUT_FILE_LIST_0"
shellScript: #"""
set -euo pipefail
if [ "$ACTION" == "indexbuild" ]; then
# Info.plist file paths are `GEN_DIR` based, so this isn't needed during
# Index Build
exit
fi
while IFS= read -r input; do
output="${input%.plist}.xcode.plist"
cp "$input" "$output"
Expand Down

0 comments on commit 6849ec3

Please sign in to comment.