Skip to content

Commit

Permalink
Merge pull request #101 from AbsaOSS/android-build/reduce-disk-usage
Browse files Browse the repository at this point in the history
Try to use less space during android build in ci
  • Loading branch information
mirgee authored Sep 24, 2020
2 parents 729f24d + 6fd583e commit 0a5b6d3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions wrappers/java/ci/android.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ prepare_artifacts(){
AAR_DIR=${HOME}/artifacts/aar
mkdir -p ${PACKAGE_DIR}/{include,lib} ${ZIP_DIR} ${AAR_DIR}

cp ${LIBVCX_DIR}/target/${TRIPLET}/release/{libvcx.a,libvcx.so} ${PACKAGE_DIR}/lib
mv ${LIBVCX_DIR}/target/${TRIPLET}/release/{libvcx.a,libvcx.so} ${PACKAGE_DIR}/lib
rm -r ${LIBVCX_DIR}/target

if [ -z "${LIBVCX_VERSION}" ]; then
zip -r ${ZIP_DIR}/libvcx_android_${ABSOLUTE_ARCH}.zip ${PACKAGE_DIR}
else
zip -r ${ZIP_DIR}/libvcx_android_${ABSOLUTE_ARCH}_${LIBVCX_VERSION}.zip ${PACKAGE_DIR}
fi
cp $(ls -r -t1 ${JAVA_WRAPPER_DIR}/android/build/outputs/aar/* | head -n 1) ${AAR_DIR}
mv $(ls -r -t1 ${JAVA_WRAPPER_DIR}/android/build/outputs/aar/* | head -n 1) ${AAR_DIR}
}

build_android_wrapper(){
Expand Down
6 changes: 2 additions & 4 deletions wrappers/java/ci/android.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

ARG USER_ID=1000

# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
libgmp3-dev \
curl \
build-essential \
Expand All @@ -15,12 +14,11 @@ RUN apt-get update && \
apt-transport-https \
ca-certificates \
debhelper \
wget \
devscripts \
libncursesw5-dev \
libzmq3-dev \
zip \
unzip \
python3-distutils \
jq

# Add indy user to sudoers
Expand Down
2 changes: 1 addition & 1 deletion wrappers/java/ci/android.wrapper.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
test_wrapper(){
ANDROID_JNI_LIB="${JAVA_WRAPPER_DIR}/android/src/main/jniLibs"
mkdir -p ${ANDROID_JNI_LIB}
cp ${LIBVCX_DIR}/target/${TRIPLET}/release/{libvcx.a,libvcx.so} ${ANDROID_JNI_LIB}
mv ${LIBVCX_DIR}/target/${TRIPLET}/release/{libvcx.a,libvcx.so} ${ANDROID_JNI_LIB}

pushd ${JAVA_WRAPPER_DIR}

Expand Down
7 changes: 7 additions & 0 deletions wrappers/java/ci/setup.android.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ create_avd(){
mv /home/indy/emu.zip emu.zip
mv emulator emulator_backup
unzip emu.zip
rm "emu.zip"
else
echo "Skipping sdkmanager activity"
fi
Expand Down Expand Up @@ -278,9 +279,15 @@ build_libvcx(){
echo "**************************************************"
LIBVCX_DIR=$1
pushd ${LIBVCX_DIR}
ls -lah ||:
du -h --max-depth=3 ||:
rm -rf target/${TRIPLET}
cargo clean
LIBINDY_DIR=${INDY_LIB_DIR} cargo build --release --target=${TRIPLET}
rm -rf target/${TRIPLET}/release/deps
rm -rf target/${TRIPLET}/release/build
rm -rf target/release/deps
rm -rf target/release/build
popd
}

Expand Down

0 comments on commit 0a5b6d3

Please sign in to comment.