Skip to content

Commit

Permalink
updated bootstrap script
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Sep 10, 2024
1 parent 516b438 commit c6ef1c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
33 changes: 13 additions & 20 deletions Sources/Resources/Scripts/bootstrap-tools
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,20 @@
# All code (c) 2020 - present day, Elegant Chaos Limited.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

# This script builds the rt command line tool and xcconfig files into local locations
# (`.build/tools.rt` and `.rt/` respectively), so that the rest of the scripts/targets
# can find them.
# This script builds the rt command line tool into `.build/tools/rt`,
# so that other scripts or build phases can find it.
# If the --rebuild flag is passed, it will force a rebuild, and then run
# `rt bootstrap` to update the rt scripts (including this one) to their
# latest versions.
#
# It needs to be run once to bootstrap everything. After that, it should be run during
# each build.

# Instructions for use of this script:
# Note that this script is set up to work as a SPM command plugin, but
# running it that way is currently unreliable.
#
# Instead it is recommended that you:
# - copy this script into the client project
# - make a tools target in the client project
# - set this to be a dependency of the main target, so that it is built first
# - add a run script phase to the tools target which
# - runs the local copy of this script
# - runs the rt update-build command

# The local build phase can update the build number with the following lines:
# source "$PROJECT_DIR/Extras/Scripts/bootstrap-tools"
# "$RT" update-build --header "$BUILT_PRODUCTS_DIR/RTInfo.h" --repo "$SOURCE_ROOT"
# - run it once to bootstrap the tools
# - run the `upload` script to upload your app to testflight / the app store

# TODO: use `swift build --show-bin-path ...` to find the path to the built executable
# TODO: add a configuration setting, and switch to release by default?

REBUILD=false
if [[ "$1" == "--rebuild" ]]
Expand All @@ -36,7 +29,7 @@ fi

set -euo pipefail # (add an x to flags to enable debugging)

LOCALTOOLS="$PWD/../ReleaseTools-disabled" # TODO: re-enable this when we have a stable release
LOCALTOOLS="$PWD/../ReleaseTools"
if [[ -e "$LOCALTOOLS" ]]
then
RT="$LOCALTOOLS/.build/debug/rt"
Expand Down Expand Up @@ -65,7 +58,7 @@ then
else
pushd "$RTSRC" > /dev/null
git fetch
git checkout swift6 # TODO: change back to main when we have a stable release
git checkout main
git pull
fi
echo "Updating release tools."
Expand Down
2 changes: 1 addition & 1 deletion Sources/Resources/Scripts/upload
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ $RT archive --platform=iOS --show-output 2> /dev/null | xcpretty
$RT export --platform=iOS
$RT upload --platform=iOS

#open "https://appstoreconnect.apple.com/apps/1519213388/testflight/ios/"
#open "https://appstoreconnect.apple.com/apps/<your-app-id-here>/testflight/ios/"

0 comments on commit c6ef1c2

Please sign in to comment.