Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
using hermit in xcode cloud (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelneale authored Apr 18, 2024
1 parent 1c96dd1 commit 428b022
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions ios/ci_scripts/ci_post_clone.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
#!/bin/sh
#!/bin/bash

# Fail this script if any subcommand fails.
set -e

# The default execution directory of this script is the ci_scripts directory.
cd $CI_PRIMARY_REPOSITORY_PATH # change working directory to the root of your cloned repo.
# Set the default execution directory to the root of the cloned repository.
cd "$CI_PRIMARY_REPOSITORY_PATH"

# Install Flutter using git.
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"
# Check if Hermit is installed, and install it if necessary.
if [ ! -x "bin/hermit" ]; then
# Create the bin directory if it doesn't exist.
mkdir -p bin

# Download the Hermit install script.
curl -fsSL https://github.com/cashapp/hermit/releases/download/stable/install.sh -o bin/install-hermit.sh

# Make the install script executable.
chmod +x bin/install-hermit.sh

# Run the Hermit install script.
bin/install-hermit.sh
fi

# Activate the Hermit environment.
source bin/activate-hermit

# Enable caching of Flutter artifacts and dependencies.
if [ "$CACHE_ENABLED" = "true" ]; then
flutter_cache_dir="$HOME/.flutter"
cocoapods_cache_dir="$HOME/Library/Caches/CocoaPods"

mkdir -p "$flutter_cache_dir" "$cocoapods_cache_dir"

echo "Flutter cache directory: $flutter_cache_dir"
echo "CocoaPods cache directory: $cocoapods_cache_dir"
fi

# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios

# Install Flutter dependencies.
flutter pub get
just get

# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
Expand All @@ -23,4 +48,4 @@ brew install cocoapods
# Install CocoaPods dependencies.
cd ios && pod install # run `pod install` in the `ios` directory.

exit 0
exit 0

0 comments on commit 428b022

Please sign in to comment.