Skip to content

Commit 16c168e

Browse files
committed
Limit files generated when using custom schemes
Before this change `BazelDependencies` would generate files for all of the targets in a scheme, even when only a subset of targets were being built. Now we leverage the cached data in `XCBuildData` to gain insight into what targets are actually being built, allowing us to only build what is needed. Sadly this cached data doesn't say which exact target is being built as part of Index Build, so we still have to rely on our off-by-one logic there. Also of note, SwiftUI Previews build every target in a scheme, and this behavior is preserved with this method.
1 parent 5b08cfe commit 16c168e

File tree

119 files changed

+2772
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+2772
-230
lines changed

examples/ios_app/test/fixtures/bwb.xcodeproj/project.pbxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@
10121012
);
10131013
runOnlyForDeploymentPostprocessing = 0;
10141014
shellPath = /bin/bash;
1015-
shellScript = "set -euo pipefail\n\n# Xcode doesn't adjust `$OBJROOT` in scheme action scripts when building for\n# previews. So we need to look in the non-preview build directory for this file.\noutput_groups_file=\"${BAZEL_BUILD_OUTPUT_GROUPS_FILE/\\/Intermediates.noindex\\/Previews\\/*\\///Intermediates.noindex/}\"\n\n# We need to read from this file as soon as possible, as concurrent writes to it\n# can happen during indexing, which breaks the off-by-one-by-design nature of it\noutput_groups=()\nif [ -s \"$output_groups_file\" ]; then\n while IFS= read -r output_group; do\n output_groups+=(\"$output_group\")\n done < \"$output_groups_file\"\nfi\n\nif [ -z \"${output_groups:-}\" ]; then\n if [ \"$ACTION\" == \"indexbuild\" ]; then\n echo \"error: Can't yet determine Index Build output group. Next build should succeed. If not, please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n else\n echo \"error: BazelDependencies invoked without any output groups set. Please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n fi\nfi\noutput_groups_flag=\"--output_groups=$(IFS=, ; echo \"${output_groups[*]}\")\"\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # We use a different output base for Index Build to prevent normal builds and\n # indexing waiting on bazel locks from the other\n output_base=\"$OBJROOT/bazel_output_base\"\nelif [ \"${ENABLE_PREVIEWS:-}\" == \"YES\" ]; then\n # We use a different output base for SwiftUI Previews since they have\n # different swiftcopts, preventing output trashing\n output_base=\"$OBJROOT/bazel_output_base\"\nfi\n\nif [[ \"${COLOR_DIAGNOSTICS:-NO}\" == \"YES\" ]]; then\n color=yes\nelse\n color=no\nfi\n\noutput_path=$(env -i \\\n DEVELOPER_DIR=\"$DEVELOPER_DIR\" \\\n HOME=\"$HOME\" \\\n PATH=\"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" \\\n USER=\"$USER\" \\\n \"$BAZEL_PATH\" \\\n ${output_base:+--output_base \"$output_base\"} \\\n info \\\n --color=\"$color\" \\\n --experimental_convenience_symlinks=ignore \\\n --symlink_prefix=/ \\\n --bes_backend= \\\n --bes_results_url= \\\n output_path)\nexec_root=\"${output_path%/*}\"\nexternal=\"${exec_root%/*/*}/external\"\n\nif [[ \"$ACTION\" != \"indexbuild\" && \"${ENABLE_PREVIEWS:-}\" != \"YES\" ]]; then\n \"$BAZEL_INTEGRATION_DIR/create_lldbinit.sh\" \"$exec_root\" > \"$BAZEL_LLDB_INIT\"\nfi\n\n# We only want to modify `$LINKS_DIR` during normal builds since Indexing can\n# run concurrent to normal builds\nif [ \"$ACTION\" != \"indexbuild\" ]; then\n mkdir -p \"$LINKS_DIR\"\n cd \"$LINKS_DIR\"\n\n # Add BUILD and DONT_FOLLOW_SYMLINKS_WHEN_TRAVERSING_THIS_DIRECTORY_VIA_A_RECURSIVE_TARGET_PATTERN\n # files to the internal links directory to prevent Bazel from recursing into\n # it, and thus following the `external` symlink\n touch BUILD\n touch DONT_FOLLOW_SYMLINKS_WHEN_TRAVERSING_THIS_DIRECTORY_VIA_A_RECURSIVE_TARGET_PATTERN\n\n # Need to remove the directories that Xcode creates as part of output prep\n rm -rf external\n rm -rf gen_dir\n\n ln -sf \"$external\" external\n ln -sf \"$BAZEL_OUT\" gen_dir\nfi\n\n# Use actual paths for Bazel generated files\n# This also fixes Index Build to use its version of generated files\ncat > \"$OBJROOT/gen_dir-overlay.yaml\" <<EOF\n{\"case-sensitive\": \"false\", \"fallthrough\": true, \"roots\": [{\"external-contents\": \"$output_path\",\"name\": \"$GEN_DIR\",\"type\": \"directory-remap\"}],\"version\": 0}\nEOF\n\ncd \"$OBJROOT\"\n\nrm -rf external\nrm -rf bazel-exec-root\n\nln -s \"$external\" external\nln -s \"$exec_root\" bazel-exec-root\n\ncd \"$SRCROOT\"\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n index_flags=(\n --bes_backend=\n --bes_results_url=\n )\nelif [ \"${ENABLE_PREVIEWS:-}\" == \"YES\" ]; then\n swiftui_previews_flags=(\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-implicit-dynamic\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-private-imports\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-dynamic-replacement-chaining\n )\nfi\n\ndate +%s > \"$INTERNAL_DIR/toplevel_cache_buster\"\n\nbuild_marker=\"$OBJROOT/bazel_build_start\"\ntouch \"$build_marker\"\n\nlog=$(mktemp)\nenv -i \\\n DEVELOPER_DIR=\"$DEVELOPER_DIR\" \\\n HOME=\"$HOME\" \\\n PATH=\"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" \\\n USER=\"$USER\" \\\n \"$BAZEL_PATH\" \\\n ${output_base:+--output_base \"$output_base\"} \\\n build \\\n --color=\"$color\" \\\n --experimental_convenience_symlinks=ignore \\\n --symlink_prefix=/ \\\n ${index_flags:+${index_flags[*]}} \\\n ${swiftui_previews_flags:+${swiftui_previews_flags[*]}} \\\n \"$output_groups_flag\" \\\n //test/fixtures:fixture_bwb \\\n 2>&1 | tee -i \"$log\"\n\nfor output_group in \"${output_groups[@]}\"; do\n filelist=\"fixture_bwb-${output_group//\\//_}\"\n filelist=\"${filelist/#/$output_path/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/test/fixtures/}\"\n filelist=\"${filelist/%/.filelist}\"\n if [[ \"$filelist\" -ot \"$build_marker\" ]]; then\n echo \"error: Bazel didn't generate the correct files (it should have generated outputs for output group \\\"$output_group\\\", but the timestamp for \\\"$filelist\\\" was from before the build). Please regenerate the project to fix this.\" >&2\n echo \"error: If your bazel version is less than 5.2, you may need to \\`bazel clean\\` and/or \\`bazel shutdown\\` to work around a bug in project generation.\" >&2\n echo \"error: If you are still getting this error after all of that, please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n fi\ndone\n";
1015+
shellScript = "set -euo pipefail\n\n# Xcode doesn't adjust `$OBJROOT` in scheme action scripts when building for\n# previews. So we need to look in the non-preview build directory for this file.\nnon_preview_objroot=\"${OBJROOT/\\/Intermediates.noindex\\/Previews\\/*//Intermediates.noindex}\"\nbase_objroot=\"${non_preview_objroot/\\/Index\\/Build\\/Intermediates.noindex//Build/Intermediates.noindex}\"\nscheme_target_ids_file=\"$non_preview_objroot/scheme_target_ids\"\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n output_group_prefix=i\nelse\n output_group_prefix=b\nfi\n\n# We need to read from `$output_groups_file` as soon as possible, as concurrent\n# writes to it can happen during indexing, which breaks the off-by-one-by-design\n# nature of it\nIFS=$'\\n' read -r -d '' -a output_groups < \\\n <( \"$CALCULATE_OUTPUT_GROUPS_SCRIPT\" \\\n \"$non_preview_objroot\" \\\n \"$base_objroot\" \\\n \"$scheme_target_ids_file\" \\\n $output_group_prefix \\\n && printf '\\0' )\n\nif [ -z \"${output_groups:-}\" ]; then\n if [ \"$ACTION\" == \"indexbuild\" ]; then\n echo \"error: Can't yet determine Index Build output group. Next build should succeed. If not, please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n else\n echo \"error: BazelDependencies invoked without any output groups set. Please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n fi\nfi\noutput_groups_flag=\"--output_groups=$(IFS=, ; echo \"${output_groups[*]}\")\"\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n # We use a different output base for Index Build to prevent normal builds and\n # indexing waiting on bazel locks from the other\n output_base=\"$OBJROOT/bazel_output_base\"\nelif [ \"${ENABLE_PREVIEWS:-}\" == \"YES\" ]; then\n # We use a different output base for SwiftUI Previews since they have\n # different swiftcopts, preventing output trashing\n output_base=\"$OBJROOT/bazel_output_base\"\nfi\n\nif [[ \"${COLOR_DIAGNOSTICS:-NO}\" == \"YES\" ]]; then\n color=yes\nelse\n color=no\nfi\n\noutput_path=$(env -i \\\n DEVELOPER_DIR=\"$DEVELOPER_DIR\" \\\n HOME=\"$HOME\" \\\n PATH=\"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" \\\n USER=\"$USER\" \\\n \"$BAZEL_PATH\" \\\n ${output_base:+--output_base \"$output_base\"} \\\n info \\\n --color=\"$color\" \\\n --experimental_convenience_symlinks=ignore \\\n --symlink_prefix=/ \\\n --bes_backend= \\\n --bes_results_url= \\\n output_path)\nexec_root=\"${output_path%/*}\"\nexternal=\"${exec_root%/*/*}/external\"\n\nif [[ \"$ACTION\" != \"indexbuild\" && \"${ENABLE_PREVIEWS:-}\" != \"YES\" ]]; then\n \"$BAZEL_INTEGRATION_DIR/create_lldbinit.sh\" \"$exec_root\" > \"$BAZEL_LLDB_INIT\"\nfi\n\n# We only want to modify `$LINKS_DIR` during normal builds since Indexing can\n# run concurrent to normal builds\nif [ \"$ACTION\" != \"indexbuild\" ]; then\n mkdir -p \"$LINKS_DIR\"\n cd \"$LINKS_DIR\"\n\n # Add BUILD and DONT_FOLLOW_SYMLINKS_WHEN_TRAVERSING_THIS_DIRECTORY_VIA_A_RECURSIVE_TARGET_PATTERN\n # files to the internal links directory to prevent Bazel from recursing into\n # it, and thus following the `external` symlink\n touch BUILD\n touch DONT_FOLLOW_SYMLINKS_WHEN_TRAVERSING_THIS_DIRECTORY_VIA_A_RECURSIVE_TARGET_PATTERN\n\n # Need to remove the directories that Xcode creates as part of output prep\n rm -rf external\n rm -rf gen_dir\n\n ln -sf \"$external\" external\n ln -sf \"$BAZEL_OUT\" gen_dir\nfi\n\n# Use actual paths for Bazel generated files\n# This also fixes Index Build to use its version of generated files\ncat > \"$OBJROOT/gen_dir-overlay.yaml\" <<EOF\n{\"case-sensitive\": \"false\", \"fallthrough\": true, \"roots\": [{\"external-contents\": \"$output_path\",\"name\": \"$GEN_DIR\",\"type\": \"directory-remap\"}],\"version\": 0}\nEOF\n\ncd \"$OBJROOT\"\n\nrm -rf external\nrm -rf bazel-exec-root\n\nln -s \"$external\" external\nln -s \"$exec_root\" bazel-exec-root\n\ncd \"$SRCROOT\"\n\nif [ \"$ACTION\" == \"indexbuild\" ]; then\n index_flags=(\n --bes_backend=\n --bes_results_url=\n )\nelif [ \"${ENABLE_PREVIEWS:-}\" == \"YES\" ]; then\n swiftui_previews_flags=(\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-implicit-dynamic\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-private-imports\n --swiftcopt=-Xfrontend\n --swiftcopt=-enable-dynamic-replacement-chaining\n )\nfi\n\ndate +%s > \"$INTERNAL_DIR/toplevel_cache_buster\"\n\nbuild_marker=\"$OBJROOT/bazel_build_start\"\ntouch \"$build_marker\"\n\nlog=$(mktemp)\nenv -i \\\n DEVELOPER_DIR=\"$DEVELOPER_DIR\" \\\n HOME=\"$HOME\" \\\n PATH=\"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" \\\n USER=\"$USER\" \\\n \"$BAZEL_PATH\" \\\n ${output_base:+--output_base \"$output_base\"} \\\n build \\\n --color=\"$color\" \\\n --experimental_convenience_symlinks=ignore \\\n --symlink_prefix=/ \\\n ${index_flags:+${index_flags[*]}} \\\n ${swiftui_previews_flags:+${swiftui_previews_flags[*]}} \\\n \"$output_groups_flag\" \\\n //test/fixtures:fixture_bwb \\\n 2>&1 | tee -i \"$log\"\n\nfor output_group in \"${output_groups[@]}\"; do\n filelist=\"fixture_bwb-${output_group//\\//_}\"\n filelist=\"${filelist/#/$output_path/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/test/fixtures/}\"\n filelist=\"${filelist/%/.filelist}\"\n if [[ \"$filelist\" -ot \"$build_marker\" ]]; then\n echo \"error: Bazel didn't generate the correct files (it should have generated outputs for output group \\\"$output_group\\\", but the timestamp for \\\"$filelist\\\" was from before the build). Please regenerate the project to fix this.\" >&2\n echo \"error: If your bazel version is less than 5.2, you may need to \\`bazel clean\\` and/or \\`bazel shutdown\\` to work around a bug in project generation.\" >&2\n echo \"error: If you are still getting this error after all of that, please file a bug report here: https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.\" >&2\n exit 1\n fi\ndone\n";
10161016
showEnvVarsInLog = 0;
10171017
};
10181018
E4007F3470769810A6EC2EEF /* Create link.params */ = {
@@ -1633,13 +1633,13 @@
16331633
isa = XCBuildConfiguration;
16341634
buildSettings = {
16351635
ALWAYS_SEARCH_USER_PATHS = NO;
1636-
BAZEL_BUILD_OUTPUT_GROUPS_FILE = "$(OBJROOT)/bazel_build_output_groups";
16371636
BAZEL_EXTERNAL = "$(LINKS_DIR)/external";
16381637
BAZEL_INTEGRATION_DIR = "$(INTERNAL_DIR)/bazel";
16391638
BAZEL_LLDB_INIT = "$(OBJROOT)/bazel.lldbinit";
16401639
BAZEL_OUT = "$(OBJROOT)/bazel-exec-root/bazel-out";
16411640
BAZEL_PATH = bazel;
16421641
BUILT_PRODUCTS_DIR = "$(INDEXING_BUILT_PRODUCTS_DIR__$(INDEX_ENABLE_BUILD_ARENA))";
1642+
CALCULATE_OUTPUT_GROUPS_SCRIPT = "$(BAZEL_INTEGRATION_DIR)/calculate_output_groups.py";
16431643
CC = "$(BAZEL_INTEGRATION_DIR)/cc.sh";
16441644
CLANG_ENABLE_OBJC_ARC = YES;
16451645
CLANG_MODULES_AUTOLINK = NO;
@@ -1663,6 +1663,7 @@
16631663
LIBTOOL = "$(BAZEL_INTEGRATION_DIR)/libtool.sh";
16641664
LINKS_DIR = "$(INTERNAL_DIR)/links";
16651665
ONLY_ACTIVE_ARCH = YES;
1666+
SCHEME_TARGET_IDS_FILE = "$(OBJROOT)/scheme_target_ids";
16661667
SUPPORTS_MACCATALYST = NO;
16671668
SWIFT_EXEC = "$(BAZEL_INTEGRATION_DIR)/swiftc.py";
16681669
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#!/usr/bin/python3
2+
3+
import glob
4+
import json
5+
import os
6+
import sys
7+
import time
8+
import traceback
9+
10+
def _calculate_build_request_file(objroot):
11+
build_description_cache = max(
12+
glob.iglob(f"{objroot}/XCBuildData/BuildDescriptionCacheIndex-*"),
13+
key = os.path.getctime,
14+
)
15+
with open(build_description_cache, 'rb') as f:
16+
f.seek(-32, os.SEEK_END)
17+
build_request_id = f.read().decode('ASCII')
18+
return f"{objroot}/XCBuildData/{build_request_id}-buildRequest.json"
19+
20+
def _calculate_output_group_target_ids(
21+
build_request_file,
22+
scheme_target_ids,
23+
guid_target_ids):
24+
try:
25+
# The first time a certain buildRequest is used, the buildRequest.json
26+
# might not exist yet, so we wait a bit for it to exist
27+
wait_counter = 0
28+
time_to_wait = 10
29+
while not os.path.exists(build_request_file):
30+
time.sleep(1)
31+
wait_counter += 1
32+
if wait_counter > time_to_wait:
33+
break
34+
35+
with open(build_request_file, encoding = "utf-8") as f:
36+
# Parse the build-request.json file
37+
build_request = json.load(f)
38+
39+
buildable_target_ids = []
40+
for target in build_request["configuredTargets"]:
41+
buildable_target_ids.extend(guid_target_ids[target["guid"]])
42+
except Exception as error:
43+
print(
44+
f"""\
45+
warning: Failed to parse '{build_request_file}':
46+
{type(error).__name__}: {error}.
47+
48+
warning: Using scheme target ids as a fallback. Please file a bug report here: \
49+
https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.""",
50+
file = sys.stderr,
51+
)
52+
return scheme_target_ids
53+
54+
target_ids = set(buildable_target_ids).intersection(scheme_target_ids)
55+
56+
if not target_ids:
57+
print(
58+
f"""\
59+
warning: Target ids from PIFCache ({buildable_target_ids}) \
60+
didn't match any scheme target ids ({scheme_target_ids}).
61+
62+
warning: Using scheme target ids as a fallback. Please file a bug report here: \
63+
https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.""",
64+
file = sys.stderr,
65+
)
66+
target_ids = scheme_target_ids
67+
68+
return target_ids
69+
70+
def _calculate_guid_target_ids(base_objroot):
71+
pif_cache = f"{base_objroot}/XCBuildData/PIFCache"
72+
73+
project_pif = max(
74+
glob.iglob(f"{pif_cache}/project/*"),
75+
key = os.path.getctime,
76+
)
77+
78+
guid_target_ids_parent = f"{base_objroot}/guid_target_ids"
79+
guid_target_ids_path = f"""\
80+
{guid_target_ids_parent}/{os.path.basename(project_pif)}.json"""
81+
82+
if os.path.exists(guid_target_ids_path):
83+
with open(guid_target_ids_path, encoding = "utf-8") as f:
84+
return json.load(f)
85+
86+
with open(project_pif, encoding = "utf-8") as f:
87+
project_pif = json.load(f)
88+
89+
targets = project_pif["targets"]
90+
91+
target_cache = f"{pif_cache}/target"
92+
93+
guid_target_ids = {}
94+
for target_name in targets:
95+
target_file = f"{target_cache}/{target_name}-json"
96+
with open(target_file, encoding = "utf-8") as f:
97+
target_pif = json.load(f)
98+
99+
guid = target_pif["guid"]
100+
guid_target_ids[guid] = [
101+
value
102+
for configuration in target_pif["buildConfigurations"]
103+
for key, value in configuration["buildSettings"].items()
104+
if key.startswith("BAZEL_TARGET_ID")
105+
]
106+
107+
os.makedirs(guid_target_ids_parent, exist_ok = True)
108+
with open(guid_target_ids_path, "w", encoding = "utf-8") as f:
109+
json.dump(guid_target_ids, f)
110+
111+
return guid_target_ids
112+
113+
def _main(objroot, base_objroot, scheme_target_id_file, prefix):
114+
if not os.path.exists(scheme_target_id_file):
115+
return
116+
117+
with open(scheme_target_id_file, encoding = "utf-8") as f:
118+
scheme_target_ids = set(f.read().splitlines())
119+
120+
if not scheme_target_ids:
121+
return
122+
123+
try:
124+
build_request_file = _calculate_build_request_file(objroot)
125+
guid_target_ids = _calculate_guid_target_ids(base_objroot)
126+
except Exception:
127+
print(
128+
f"""\
129+
warning: Failed to calculate target ids from PIFCache:
130+
{traceback.format_exc()}
131+
warning: Using scheme target ids as a fallback. Please file a bug report here: \
132+
https://github.com/buildbuddy-io/rules_xcodeproj/issues/new?template=bug.md.""",
133+
file = sys.stderr,
134+
)
135+
target_ids = scheme_target_ids
136+
else:
137+
target_ids = _calculate_output_group_target_ids(
138+
build_request_file,
139+
scheme_target_ids,
140+
guid_target_ids,
141+
)
142+
143+
print("\n".join([f"{prefix} {id}" for id in target_ids]))
144+
145+
146+
if __name__ == "__main__":
147+
_main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])

examples/ios_app/test/fixtures/bwb.xcodeproj/rules_xcodeproj/bazel/copy_outputs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ readonly exclude_list="$3"
1010
# trap 'echo "private let touch = \"$(date +%s)\"" > "$DERIVED_FILE_DIR/$forced_swift_compile_file"' ERR
1111

1212
if [[ "$ACTION" == indexbuild ]]; then
13-
# Write to "$BAZEL_BUILD_OUTPUT_GROUPS_FILE" to allow next index to catch up
14-
echo "i $BAZEL_TARGET_ID" > "$BAZEL_BUILD_OUTPUT_GROUPS_FILE"
13+
# Write to "$SCHEME_TARGET_IDS_FILE" to allow next index to catch up
14+
echo "$BAZEL_TARGET_ID" > "$SCHEME_TARGET_IDS_FILE"
1515
else
1616
# Copy product
1717
if [[ -n ${BAZEL_OUTPUTS_PRODUCT:-} ]]; then

examples/ios_app/test/fixtures/bwb.xcodeproj/xcshareddata/xcschemes/CoreUtilsObjC.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
1111
<ActionContent
1212
title = "Initialize Bazel Build Output Groups File"
13-
scriptText = "mkdir -p &quot;${BAZEL_BUILD_OUTPUT_GROUPS_FILE%/*}&quot;&#10;if [[ -s &quot;$BAZEL_BUILD_OUTPUT_GROUPS_FILE&quot; ]]; then&#10; rm &quot;$BAZEL_BUILD_OUTPUT_GROUPS_FILE&quot;&#10;fi&#10;">
13+
scriptText = "mkdir -p &quot;${SCHEME_TARGET_IDS_FILE%/*}&quot;&#10;if [[ -s &quot;$SCHEME_TARGET_IDS_FILE&quot; ]]; then&#10; rm &quot;$SCHEME_TARGET_IDS_FILE&quot;&#10;fi&#10;">
1414
<EnvironmentBuildable>
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
@@ -26,7 +26,7 @@
2626
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
2727
<ActionContent
2828
title = "Set Bazel Build Output Groups for CoreUtilsObjC"
29-
scriptText = "echo &quot;b $BAZEL_TARGET_ID&quot; &gt;&gt; &quot;$BAZEL_BUILD_OUTPUT_GROUPS_FILE&quot;&#10;">
29+
scriptText = "echo &quot;$BAZEL_TARGET_ID&quot; &gt;&gt; &quot;$SCHEME_TARGET_IDS_FILE&quot;&#10;">
3030
<EnvironmentBuildable>
3131
<BuildableReference
3232
BuildableIdentifier = "primary"

0 commit comments

Comments
 (0)