Skip to content

Commit

Permalink
Update earl_grey_example function
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral committed Sep 8, 2020
1 parent f8642fa commit ebc4cae
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 20 deletions.
1 change: 0 additions & 1 deletion test_projects/ios/EarlGreyExample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ Pods/
Podfile.lock
xcuserdata/
*.xcworkspace/
dd_tmp
65 changes: 46 additions & 19 deletions test_projects/ios/EarlGreyExample/ops.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,71 @@
#!/usr/bin/env bash

function setup_ios_env() {
if ! [ -x "$(command -v xcpretty)" ]; then
gem install cocoapods
fi
local dir=$(dirname "$BASH_SOURCE")
gem install cocoapods
(cd "$dir" && pod install)
}

function install_xcpretty() {
if ! [ -x "$(command -v xcpretty)" ]; then
gem install xcpretty
fi
}

function universal_framework() {
local dir=$(dirname "$BASH_SOURCE")
"$dir/universal_framework.sh"
}

function earl_grey_example() {
local dir=$(dirname "$BASH_SOURCE")
local buildDir="$dir/build"

for arg in "$@"; do case "$arg" in

'--generate' | '-g')
"$dir/build_example.sh"
;;

'--copy' | '-c')
echo "TODO"
;;
install_xcpretty

esac done
}
rm -rf "$buildDir"

function earl_grey_ftl() {
local dir=$(dirname "$BASH_SOURCE")
for arg in "$@"; do case "$arg" in
xcodebuild build-for-testing \
-allowProvisioningUpdates \
-workspace "$dir/EarlGreyExample.xcworkspace" \
-scheme "EarlGreyExampleSwiftTests" \
-derivedDataPath "$buildDir" \
-sdk iphoneos |
xcpretty

'--generate' | '-g')
"$dir/build_ftl.sh"
xcodebuild build-for-testing \
-allowProvisioningUpdates \
-workspace "$dir/EarlGreyExample.xcworkspace" \
-scheme "EarlGreyExampleTests" \
-derivedDataPath "$buildDir" \
-sdk iphoneos |
xcpretty
;;

'--copy' | '-c')
echo "--copy TODO"

local productsDir="$dir/build/Build/Products"

cp -R "$productsDir/*-iphoneos" "$FLANK_FIXTURES_TMP/"

cp "$productsDir/*.xctestrun" "$FLANK_FIXTURES_TMP/"

cp \
"$productsDir/Debug-iphoneos/EarlGreyExampleTests.xctest/EarlGreyExampleTests" \
"$FLANK_FIXTURES_TMP/objc/"

cp \
"$productsDir/Debug-iphoneos/EarlGreyExampleSwiftTests.xctest/EarlGreyExampleSwiftTests" \
"$FLANK_FIXTURES_TMP/swift/"
;;

esac done
}

function universal_framework() {
local dir=$(dirname "$BASH_SOURCE")
"$dir/universal_framework.sh"
}

echo "iOS test projects ops loaded"

0 comments on commit ebc4cae

Please sign in to comment.