Skip to content

Commit ffb9965

Browse files
author
Charlie Fenton
committed
Mac: rework how we update version numbers in info.plist files to fix Xcode race condition
1 parent 9c7ebaa commit ffb9965

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

mac_build/Update_Info_Plists.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
# This file is part of BOINC.
4+
# http://boinc.berkeley.edu
5+
# Copyright (C) 2025 University of California
6+
#
7+
# BOINC is free software; you can redistribute it and/or modify it
8+
# under the terms of the GNU Lesser General Public License
9+
# as published by the Free Software Foundation,
10+
# either version 3 of the License, or (at your option) any later version.
11+
#
12+
# BOINC is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15+
# See the GNU Lesser General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Lesser General Public License
18+
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
19+
#
20+
#
21+
# Update_Info_Plists.sh
22+
# by Charlie Fenton 7/11/25
23+
#
24+
25+
## Called from pre-actions in BOINC Xcode project when compiling BOINC.
26+
## Note that Xcode runs build pre-actions pnly for the currently selected
27+
## build target, not for any dependent targets that may also be built along
28+
## with the selected target. So this script is called only once for any
29+
## build operation, even the build_all target. The ovehead of running this
30+
## script is minimal, so rather than comparing all the Info.plist file's
31+
## modification dates to that of version.h, we just run this script for
32+
## every build operation.
33+
##
34+
## Usage:
35+
## export WORKSPACE_PATH=
36+
## source {path}/mac_build/Update_Info_Plists.sh
37+
## Called from pre-actions as:
38+
## source "$WORKSPACE_PATH/../../Update_Info_Plists.sh"
39+
##
40+
##
41+
originalDir=`pwd`
42+
directory=$(dirname "$WORKSPACE_PATH")
43+
directory=$(dirname "$directory")
44+
echo "Directory is " "$directory"
45+
cd "$directory"
46+
echo "About to check for " "$directory/build/Development/SetVersion"
47+
echo "compared to " "$directory/../clientgui/mac/Setversion.cpp"
48+
if [ "$directory/../clientgui/mac/Setversion.cpp" -nt "$directory/build/Development/SetVersion" ]; then
49+
##if [ ! -e "$directory/build/Development/SetVersion" ]; then
50+
echo "About to run xcodebuild"
51+
xcodebuild -project boinc.xcodeproj -target SetVersion -configuration Development
52+
if [ $? -ne 0 ]; then
53+
echo "ERROR: xcodebuild failed"
54+
cd "${originalDir}"
55+
return 1
56+
fi
57+
echo "After xcodebuild, about to check for " "$directory/build/Development/SetVersion"
58+
if [ ! -e "$directory/build/Development/SetVersion" ]; then
59+
return 1
60+
fi
61+
fi
62+
###$directory="$directory/build/Development"
63+
echo "Running SetVersion"
64+
"$directory/build/Development/SetVersion"
65+
cd "${originalDir}"
66+
return 0

0 commit comments

Comments
 (0)