Skip to content

Commit f7294c3

Browse files
ajsecordianegordon
authored andcommitted
Changed clean script to force-clean Xcode projects. (#1144)
1 parent d0bfaa6 commit f7294c3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scripts/clean_all

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,22 @@
1616

1717
readonly SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1818

19-
"$SCRIPTS_DIR"/build_all clean && \
19+
# Clean out CocoaPods.
2020
"$SCRIPTS_DIR"/release/manage_pods.py clean
21+
22+
# Clean out Xcode build products.
23+
# Note that Xcode seems to want to hold on to old Swift module maps, requiring a
24+
# "force" clean instead of just asking xcodebuild to clean normally.
25+
readonly WORKSPACE_SCHEMES=$("$SCRIPTS_DIR"/xcode/list_all_xcode_schemes)
26+
27+
for workspace_scheme in $WORKSPACE_SCHEMES; do
28+
workspace=$(echo $workspace_scheme | cut -d: -f1)
29+
scheme=$(echo $workspace_scheme | cut -d: -f2)
30+
options="-workspace $workspace -scheme $scheme -showBuildSettings"
31+
build_dir=$(xcodebuild $options | grep -m1 "^ BUILD_DIR =" | cut -d= -f2)
32+
if [[ ! -z $build_dir ]]; then
33+
derived_data_dir=$(dirname $(dirname "$build_dir"))
34+
echo "Force-cleaning $derived_data_dir..."
35+
rm -rf "$derived_data_dir"
36+
fi
37+
done

0 commit comments

Comments
 (0)