From ed6f2877d7474c5da75e8d62dc024195d820dbca Mon Sep 17 00:00:00 2001 From: TriplEight Date: Tue, 15 Jan 2019 17:27:43 +0100 Subject: [PATCH] Update for Android cross-compilation. (#10180) * build-unix update * .gitlab-ci update * Update build-unix.sh add android postprocessing * path to android lib libparity.so * fix path to libparity * add android lib to artifacts --- .gitlab-ci.yml | 3 ++- scripts/gitlab/build-unix.sh | 40 +++++++++++++++++------------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d5f483da12..a1a1c979987 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -146,8 +146,9 @@ build-android: script: - scripts/gitlab/build-unix.sh tags: - - rust-arm + - linux-docker allow_failure: true + <<: *collect_artifacts test-beta: stage: optional diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index cf6bfe1476c..9bb6cd0f3f2 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -10,38 +10,36 @@ echo "CARGO_TARGET: " $CARGO_TARGET echo "CC: " $CC echo "CXX: " $CXX -echo "__________CARGO CONFIG__________" +echo "_____ Building target: "$CARGO_TARGET" _____" if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ] then - # use build container's cargo config - cat /.cargo/config +# only thing we need for android + time cargo build --target $CARGO_TARGET --release -p parity-clib --features final else - mkdir -p .cargo - rm -f .cargo/config - echo "[target.$CARGO_TARGET]" >> .cargo/config - echo "linker= \"$CC\"" >> .cargo/config - cat .cargo/config + time cargo build --target $CARGO_TARGET --release --features final + time cargo build --target $CARGO_TARGET --release -p evmbin + time cargo build --target $CARGO_TARGET --release -p ethstore-cli + time cargo build --target $CARGO_TARGET --release -p ethkey-cli + time cargo build --target $CARGO_TARGET --release -p whisper-cli fi - -echo "_____ Building target: "$CARGO_TARGET" _____" -time cargo build --target $CARGO_TARGET --release --features final -time cargo build --target $CARGO_TARGET --release -p evmbin -time cargo build --target $CARGO_TARGET --release -p ethstore-cli -time cargo build --target $CARGO_TARGET --release -p ethkey-cli -time cargo build --target $CARGO_TARGET --release -p whisper-cli - echo "_____ Post-processing binaries _____" rm -rf artifacts mkdir -p artifacts cd artifacts mkdir -p $CARGO_TARGET cd $CARGO_TARGET -cp -v ../../target/$CARGO_TARGET/release/parity ./parity -cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm -cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore -cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey -cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper +if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ] +then +# only thing we need for android + cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so +else + cp -v ../../target/$CARGO_TARGET/release/parity ./parity + cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm + cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore + cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey + cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper +fi # stripping can also be done on release build time