This commit is contained in:
Nikita Bykov
2020-10-16 12:40:24 +03:00
130 changed files with 876 additions and 431 deletions

View File

@@ -1,8 +1,26 @@
#!/bin/bash -e
source ~/utils/utils.sh
ANDROID_PLATFORM_LIST=($(get_toolset_value '.android."platform-list"[]'))
ANDROID_BUILD_TOOLS=($(get_toolset_value '.android."build-tools"[]'))
function filter_components_by_version {
minimumVersion=$1
shift
toolsArr=("$@")
for item in ${toolsArr[@]}
do
# take the last argument after spliting string by ';'' and '-''
version=$(echo "${item##*[-;]}")
if verlte $minimumVersion $version
then
components+=($item)
fi
done
}
components=()
ANDROID_PLATFORM=($(get_toolset_value '.android.platform_min_version'))
ANDROID_BUILD_TOOL=($(get_toolset_value '.android.build_tools_min_version'))
ANDROID_EXTRA_LIST=($(get_toolset_value '.android."extra-list"[]'))
ANDROID_ADDON_LIST=($(get_toolset_value '.android."addon-list"[]'))
@@ -48,17 +66,14 @@ echo y | $SDKMANAGER "cmake;3.6.4111459"
echo "Installing latest ndk..."
echo y | $SDKMANAGER "ndk-bundle"
for platform_name in "${ANDROID_PLATFORM_LIST[@]}"
do
echo "Installing platform $platform_name ..."
echo y | $SDKMANAGER "platforms;$platform_name"
done
availablePlatforms=($(${ANDROID_HOME}/tools/bin/sdkmanager --list | grep "platforms;android-" | cut -d"|" -f 1 | sort -u))
filter_components_by_version $ANDROID_PLATFORM "${availablePlatforms[@]}"
for build_tools_version in "${ANDROID_BUILD_TOOLS[@]}"
do
echo "Installing build tools $build_tools_version ..."
echo y | $SDKMANAGER "build-tools;$build_tools_version"
done
allBuildTools=($(${ANDROID_HOME}/tools/bin/sdkmanager --list --include_obsolete | grep "build-tools;" | cut -d"|" -f 1 | sort -u))
availableBuildTools=$(echo ${allBuildTools[@]//*rc[0-9]/})
filter_components_by_version $ANDROID_BUILD_TOOL "${availableBuildTools[@]}"
echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager ${components[@]}
for extra_name in "${ANDROID_EXTRA_LIST[@]}"
do

View File

@@ -1,23 +1,19 @@
#!/bin/sh
#!/bin/bash -e -o pipefail
echo "Installing Homebrew..."
source ~/utils/utils.sh
echo Installing Homebrew...
HOMEBREW_INSTALL_URL="https://raw.githubusercontent.com/Homebrew/install/master/install.sh"
/bin/bash -c "$(curl -fsSL ${HOMEBREW_INSTALL_URL})"
echo Disabling Homebrew analytics...
echo "Disabling Homebrew analytics..."
brew analytics off
echo Installing the last version of curl
echo "Installing the latest curl..."
brew install curl
echo Installing wget...
echo "Installing wget..."
brew install wget
echo Installing jq
echo "Installing jq..."
brew install jq
# init brew bundle feature

View File

@@ -1,11 +1,6 @@
source ~/utils/utils.sh
node_common_modules=(
node-gyp
mobile-center-cli
)
node_catalina_modules=(
node_modules=(
appcenter-cli
newman
)
@@ -23,6 +18,10 @@ if is_Less_Catalina; then
npm install -g npm@3
npm config set prefix /usr/local
# This step is required to install App Center CLI
echo Installing Omelette...
npm install -g omelette@0.4.14
echo Installing App Center CLI...
npm install -g appcenter-cli@^1.0.0
else
@@ -30,7 +29,7 @@ else
brew install node@12
brew link node@12 --force
for module in ${node_catalina_modules[@]}; do
for module in ${node_modules[@]}; do
echo "Install $module"
npm install -g $module
done
@@ -40,8 +39,6 @@ echo Installing yarn...
curl -o- -L https://yarnpkg.com/install.sh | bash
if is_Less_BigSur; then
for module in ${node_common_modules[@]}; do
echo "Install $module"
npm install -g $module
done
echo "Install node-gyp"
npm install -g node-gyp
fi

View File

@@ -4,7 +4,12 @@ source ~/utils/utils.sh
echo "Installing Python Tooling"
echo "Brew Installing Python 3"
/usr/local/bin/brew install python3
# Workaround to have both 3.8 & 3.9(which required by some brew formulas) in the system, but only 3.8 is linked
/usr/local/bin/brew install python@3.8
/usr/local/bin/brew install python@3.9
/usr/local/bin/brew unlink python@3.9
/usr/local/bin/brew unlink python@3.8
/usr/local/bin/brew link python@3.8
echo "Brew Installing Python 2"
# Create local tap with formula due to python2 formula depreciation

View File

@@ -0,0 +1,43 @@
#!/bin/bash -e -o pipefail
is_clt_installed() {
clt_path=`xcode-select -p 2>&1`
[[ -d "$clt_path" ]]
}
install_clt() {
echo "Searching online for the Command Line Tools"
# This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools
clt_placeholder="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
sudo touch $clt_placeholder
clt_label_command="/usr/sbin/softwareupdate -l |
grep -B 1 -E 'Command Line Tools' |
awk -F'*' '/^ *\\*/ {print \$2}' |
sed -e 's/^ *Label: //' -e 's/^ *//' |
sort -V |
tail -n1"
clt_label=$(eval $clt_label_command) || true
if [[ -n "$clt_label" ]]; then
echo "Installing $clt_label"
sudo "/usr/sbin/softwareupdate" "-i" "$clt_label"
fi
sudo "/bin/rm" "-f" "$clt_placeholder"
}
echo "Installing Command Line Tools..."
install_clt
# Retry the installation if tools are not installed from the first attempt
retries=30
sleepInterval=60
while ! is_clt_installed; do
if [[ $retries -eq 0 ]]; then
echo "Unable to find the Command Line Tools, all the attempts exhausted"
exit 1
fi
echo "Command Line Tools not found, trying to install them via softwareupdates, $retries attempts left"
install_clt
((retries--))
echo "Wait $sleepInterval seconds before the next check for installed Command Line Tools"
sleep $sleepInterval
done

View File

@@ -1,19 +0,0 @@
#!/bin/bash
# Homebrew doesn't support installation of command line tools on MacOS 11.0
# https://github.com/Homebrew/install/blob/master/install.sh#L191
# Copy-paste script from brew installation process
# https://github.com/Homebrew/install/blob/master/install.sh#L530
# This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools
clt_placeholder="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
touch $clt_placeholder
clt_label=`/usr/sbin/softwareupdate -l |
grep -B 1 -E 'Command Line Tools beta 5' |
awk -F'*' '/^ *\\*/ {print \$2}' |
sed -e 's/^ *Label: //' -e 's/^ *//' |
sort -V |
tail -n1`
/usr/sbin/softwareupdate -i "$clt_label"
rm -f $clt_placeholder
sudo xcode-select --switch "/Library/Developer/CommandLineTools/"