Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing setup on macOS/Darwin for Android only. #766

Merged
merged 1 commit into from
May 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Usage: dev_setup.sh [options]
Configures a Linux or MacOS machine for working with the code in this repo.
Options:
-ni Non-interactive mode, auto answers Yes to all questions.
--skip-ios Skip configuring for iOS development.
-h, --help Show this message
"
}
Expand All @@ -17,6 +18,8 @@ for var in "$@"; do
exit 0
elif [[ $var == '-ni' ]]; then
non_interactive="Y"
elif [[ $var == '--skip-ios' ]]; then
skip_ios="Y"
else
echo "Unknown option: $var"
show_help
Expand Down Expand Up @@ -97,6 +100,13 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
echo "${YELLOW}Homebrew is required to install dependencies: https://docs.brew.sh/Installation${RESET}"
exit 1
fi

# Unless configuring for iOS is skipped, Xcode must be installed.
if [[ $skip_ios != "Y" ]] && ! xcodebuild -version > /dev/null 2> /dev/null; then
echo "${YELLOW}Xcode must be installed to develop for iOS."
echo "${YELLOW}Use option '--skip-ios' to setup development for Android only."
exit 1
fi
fi

# Need Node.js (8.3 or newer)
Expand Down Expand Up @@ -190,7 +200,7 @@ fi

# Install ruby bundler and cocoapods for iOS only, because they're only necessary for iOS development
# Mac OS comes with ruby out of the box.
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$OSTYPE" == "darwin"* ]] && [[ "$skip_ios" != "Y" ]]; then
if ! gem list '^bundler$' -i --version 2.1.4; then
echo "${BLUE}Installing Ruby bundler for Cocoapod management...${RESET}"
sudo gem install bundler
Expand Down