-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Script to build iOS sample app (Objective-C or Swift) | ||
# $REGEX variable, using ios_build.sh script. | ||
|
||
set -eo pipefail | ||
|
||
# An array that holds the google3 path to each example app | ||
EXAMPLE_APPS_PATHS_ARRAY=() | ||
|
||
while read -r line; do | ||
app_path=$(dirname "${line}"); | ||
EXAMPLE_APPS_PATHS_ARRAY+=("${app_path#./}"); | ||
done < <(find . -name Podfile -type f -d | grep -E "${REGEX}") | ||
|
||
for example_app_path in "${EXAMPLE_APPS_PATHS_ARRAY[@]}" | ||
do | ||
CHANGES="$(git --no-pager diff --name-only "${COMMIT_RANGE}")"; | ||
echo "Project dir: ${example_app_path}"; | ||
if [[ -n "$(grep -E "(${example_app_path}|\.github\/workflows)" <<< "${CHANGES}")" ]]; then | ||
echo "Building for ${example_app_path}"; | ||
example_name=$(echo "${example_app_path}" | xargs -I{} basename {}); | ||
echo "::set-output name=building_app::Pod install for App (${example_name})"; | ||
pushd "${example_app_path}"; | ||
pod install --no-repo-update; | ||
echo "::set-output name=building_app::Building App (${example_name})"; | ||
eval "xcodebuild -workspace ${example_name}.xcworkspace -scheme ${example_name} -sdk iphonesimulator -arch x86_64 | xcpretty"; | ||
popd; | ||
fi | ||
done |