mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 09:23:16 +08:00
Cache apt dependencies in test_android
Summary: Closes https://github.com/facebook/react-native/pull/18576 Differential Revision: D7415216 Pulled By: hramos fbshipit-source-id: 9b7199fe5fb91a26ba0881e426a85395b2923f26
This commit is contained in:
committed by
Facebook Github Bot
parent
2ff8b7024e
commit
de1040fcff
25
scripts/circleci/apt-get-android-deps.sh
Executable file
25
scripts/circleci/apt-get-android-deps.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Downloading package lists..."
|
||||
sudo apt-get update -y
|
||||
|
||||
if ! [[ -d ~/vendor/apt ]]; then
|
||||
mkdir -p ~/vendor/apt
|
||||
fi
|
||||
|
||||
# First check for archives cache
|
||||
if ! [[ -d ~/vendor/apt/archives ]]; then
|
||||
# It doesn't so download the packages
|
||||
echo "Downloading build dependencies..."
|
||||
sudo apt-get install --download-only ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y
|
||||
# Then move them to our cache directory
|
||||
sudo cp -R /var/cache/apt ~/vendor/
|
||||
# Making sure our user has ownership, in order to cache
|
||||
sudo chown -R ${USER:=$(/usr/bin/id -run)}:$USER ~/vendor/apt
|
||||
fi
|
||||
|
||||
# Install all packages in the cache
|
||||
echo "Installing build dependencies..."
|
||||
sudo dpkg -i ~/vendor/apt/archives/*.deb
|
||||
Reference in New Issue
Block a user