forked from mozilla-mobile/focus-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
l10n-screenshots.sh
executable file
·49 lines (38 loc) · 1.23 KB
/
l10n-screenshots.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -ex
function get_abs_path {
local file_path="$1"
echo "$( cd "$(dirname "$file_path")" >/dev/null 2>&1 ; pwd -P )"
}
CURRENT_DIR="$(get_abs_path $0)"
PROJECT_DIR="$(get_abs_path $CURRENT_DIR/../../../..)"
if [ -d l10n-screenshots ]; then
echo "The l10n-screenshots directory already exists. You decide."
exit 1
fi
mkdir -p l10n-screenshots
if [ "$1" = '--test-without-building' ]; then
EXTRA_FAST_LANE_ARGS='--test_without_building'
shift
fi
LOCALES=$*
if [ $# -eq 0 ]; then
echo "Please provide locales to test. Available locales live in 'l10n-screenshots-config.yml'. E.g.: $0 af an anp ar"
exit 1
fi
DEVICE="iPhone 11"
for lang in $LOCALES; do
# start simple with Focus only
echo "Snapshotting on $DEVICE"
mkdir -p "l10n-screenshots/$lang"
fastlane snapshot --project Blockzilla.xcodeproj --scheme "FocusSnapshotTests" \
--derived_data_path l10n-screenshots-dd \
--skip_open_summary \
--xcargs "-maximum-parallel-testing-workers 2" \
--erase_simulator --localize_simulator \
--devices "$DEVICE" \
--languages "$lang" \
--output_directory "l10n-screenshots/$lang" \
$EXTRA_FAST_LANE_ARGS
echo "Fastlane exited with code: $?"
done