diff --git a/README.md b/README.md index f6a655de53..4587e48485 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ that may be need for your applications. * `libindy.a` - This is a static library, which is compiled with NDK. - [How to use instructions.](https://github.com/hyperledger/indy-sdk/blob/master/docs/android-build.md#usage) + [How to use instructions.](https://github.com/hyperledger/indy-sdk/blob/master/docs/android-build.md#usage) {release channel} must be replaced with rc or stable to define corresponded release channel. See section "Release channels" for more details. @@ -188,7 +188,7 @@ See section "Release channels" for more details. - [WARNING] This library should be considered as experimental as currently unit tests are *not* executed in the CI phase. - - We are using the [NDK16b](https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip) because it is the last NDK to have support for `gnustl_shared` stl. + - We are using the [NDK16b](https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip) because it is the last NDK to have support for `gnustl_shared` stl. gnustl_shared is deprecated in latest NDK. gnustal_shared is needed because the dependencies are compiled using gnustal_shared and you will get build errors if more than one type of stl while compiling. diff --git a/vcx/ci/Jenkinsfile b/vcx/ci/Jenkinsfile index 83e8d7d247..5fd0d6e9d4 100644 --- a/vcx/ci/Jenkinsfile +++ b/vcx/ci/Jenkinsfile @@ -51,9 +51,9 @@ def testing() { stage('Testing') { parallel([ - 'Xenial' : { mainUbuntu() }, + //'Xenial' : { mainUbuntu() }, 'Android': { android() }, - 'iOS' : { ios() } + //'iOS' : { ios() } ]) } } else { @@ -262,8 +262,8 @@ def android() { stage('Android Build') { parallel([ - "x86" : { buildAndroid("x86") }, - "x86_64" : { buildAndroid("x86_64") }, + //"x86" : { buildAndroid("x86") }, + //"x86_64" : { buildAndroid("x86_64") }, "arm" : { buildAndroid("arm") }, "arm64" : { buildAndroid("arm64") }, "armv7" : { buildAndroid("armv7") } @@ -283,10 +283,10 @@ def android() { packageAndroid(android) } stage('Android Publishing') { - if (env.BRANCH_NAME == "master") { + //if (env.BRANCH_NAME == "master") { //Publish package on aptly publishAndroid(android) - } + //} } } catch (Exception ex) { currentBuild.result = "FAILED" @@ -397,7 +397,8 @@ def buildAndroid(arch) { } def packageAndroid(android) { - all_archs = ["arm", "arm64", "armv7", "x86", "x86_64"] + //all_archs = ["arm", "arm64", "armv7", "x86", "x86_64"] + all_archs = ["arm", "arm64", "armv7"] for (arch in all_archs) { dir("runtime_android_build/libvcx_${arch}") { unstash name: "libvcx_${arch}" diff --git a/vcx/ci/scripts/androidBuild.sh b/vcx/ci/scripts/androidBuild.sh index cf1881c189..8cbdc4c1a7 100755 --- a/vcx/ci/scripts/androidBuild.sh +++ b/vcx/ci/scripts/androidBuild.sh @@ -39,24 +39,24 @@ retrieve_prebuilt_binaries() { ANDROID_BUILD_FOLDER=${PWD} pushd ${ANDROID_BUILD_FOLDER} echo -e "${GREEN}Downloading openssl for $1 ${RESET}" - curl -sSLO https://repo.sovrin.org/android/libindy/deps/openssl/openssl_$1.zip - unzip -o -qq openssl_$1.zip - export OPENSSL_DIR=${ANDROID_BUILD_FOLDER}/openssl_$1 + curl -sSLO https://repo.corp.evernym.com/filely/android/openssl-1.1.1a_$1.zip + unzip -o -qq openssl-1.1.1a_$1.zip + export OPENSSL_DIR=${ANDROID_BUILD_FOLDER}/openssl-1.1.1a_$1 echo -e "${GREEN}Done!${RESET}" echo -e "${GREEN}Downloading sodium for $1 ${RESET}" - curl -sSLO https://repo.sovrin.org/android/libindy/deps/sodium/libsodium_$1.zip + curl -sSLO https://repo.corp.evernym.com/filely/android/libsodium_$1.zip unzip -o -qq libsodium_$1.zip export SODIUM_DIR=${ANDROID_BUILD_FOLDER}/libsodium_$1 echo -e "${GREEN}Done!${RESET}" echo -e "${GREEN}Downloading zmq for $1 ${RESET}" - curl -sSLO https://repo.sovrin.org/android/libindy/deps/zmq/libzmq_$1.zip + curl -sSLO https://repo.corp.evernym.com/filely/android/libzmq_$1.zip unzip -o -qq libzmq_$1.zip export LIBZMQ_DIR=${ANDROID_BUILD_FOLDER}/libzmq_$1 echo -e "${GREEN}Done!${RESET}" - rm openssl_$1.zip + rm openssl-1.1.1a_$1.zip rm libsodium_$1.zip rm libzmq_$1.zip popd @@ -70,7 +70,7 @@ generate_flags(){ if [ $1 == "arm" ]; then export ARCH="arm" export TRIPLET="arm-linux-androideabi" - export PLATFORM="16" + export PLATFORM="21" elif [ $1 == "arm64" ]; then export ARCH="arm64" export TRIPLET="aarch64-linux-android" @@ -78,11 +78,11 @@ generate_flags(){ elif [ $1 == "armv7" ]; then export ARCH="armv7" export TRIPLET="armv7-linux-androideabi" - export PLATFORM="16" + export PLATFORM="21" elif [ $1 == "x86" ]; then export ARCH="x86" export TRIPLET="i686-linux-android" - export PLATFORM="16" + export PLATFORM="21" elif [ $1 == "x86_64" ]; then export ARCH="x86_64" export TRIPLET="x86_64-linux-android" diff --git a/vcx/ci/scripts/androidPackage.sh b/vcx/ci/scripts/androidPackage.sh index 8d3ffd76d5..7958457689 100755 --- a/vcx/ci/scripts/androidPackage.sh +++ b/vcx/ci/scripts/androidPackage.sh @@ -3,7 +3,8 @@ set -e ANDROID_JNI_LIB=vcx/wrappers/java/android/src/main/jniLibs -for arch in arm arm64 armv7 x86 x86_64 +#for arch in arm arm64 armv7 x86 x86_64 +for arch in arm arm64 armv7 do arch_folder=${arch} if [ "${arch}" = "armv7" ]; then diff --git a/vcx/libvcx/build.rs b/vcx/libvcx/build.rs index 814d751e9b..269d67f457 100644 --- a/vcx/libvcx/build.rs +++ b/vcx/libvcx/build.rs @@ -63,6 +63,7 @@ fn main() { println!("cargo:rustc-link-search=native={}",libindy_lib_path); println!("cargo:rustc-link-lib=static=indy"); }else if target.contains("aarch64-linux-android") || target.contains("armv7-linux-androideabi") || + target.contains("armv7a-linux-androideabi") || target.contains("arm-linux-androideabi") || target.contains("i686-linux-android") || target.contains("x86_64-linux-android") || target.contains("aarch64-apple-ios") || target.contains("armv7-apple-ios") || target.contains("armv7s-apple-ios") || diff --git a/vcx/libvcx/build_scripts/android/indy/Dockerfile b/vcx/libvcx/build_scripts/android/indy/Dockerfile index 30242a8e9b..1863c71ad3 100644 --- a/vcx/libvcx/build_scripts/android/indy/Dockerfile +++ b/vcx/libvcx/build_scripts/android/indy/Dockerfile @@ -17,7 +17,7 @@ ENV SODIUM_LIB_DIR /home/indy_user/${sodium_dir}/lib ENV SODIUM_INCLUDE_DIR /home/indy_user/${sodium_dir}/include ENV LIBZMQ_LIB_DIR /home/indy_user/${libzmq_dir}/lib ENV LIBZMQ_INCLUDE_DIR /home/indy_user/${libzmq_dir}/include -ENV ANDROID_NDK_ROOT /home/indy_user/android-ndk-r16b +ENV ANDROID_NDK_ROOT /home/indy_user/android-ndk-r19c ENV TOOLCHAIN_DIR /home/indy_user/${target_arch} ENV PATH ${TOOLCHAIN_DIR}/bin:${PATH} ENV PKG_CONFIG_ALLOW_CROSS=1 @@ -37,8 +37,8 @@ RUN chmod 0440 /etc/sudoers.d/indy_user USER indy_user WORKDIR /home/indy_user -COPY android-ndk-r16b-linux-x86_64.zip /home/indy_user/ -RUN unzip -qq /home/indy_user/android-ndk-r16b-linux-x86_64.zip -d /home/indy_user/ +COPY android-ndk-r19c-linux-x86_64.zip /home/indy_user/ +RUN unzip -qq /home/indy_user/android-ndk-r19c-linux-x86_64.zip -d /home/indy_user/ COPY --chown=indy_user:indy_user indy-sdk/ /home/indy_user/indy-sdk/ COPY --chown=indy_user:indy_user ${openssl_dir}/ ${OPENSSL_DIR}/ COPY --chown=indy_user:indy_user ${sodium_dir}/ /home/indy_user/${sodium_dir}/ diff --git a/vcx/libvcx/build_scripts/android/indy/build.sh b/vcx/libvcx/build_scripts/android/indy/build.sh index f3d07de787..37245f469c 100644 --- a/vcx/libvcx/build_scripts/android/indy/build.sh +++ b/vcx/libvcx/build_scripts/android/indy/build.sh @@ -18,19 +18,19 @@ GIT_INSTALL=${4:-master} if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" - exit 1 + exit 1 fi if [ -z "${TARGET_API}" ]; then echo STDERR "Missing TARGET_API argument" echo STDERR "e.g. 21" - exit 1 + exit 1 fi if [ -z "${CROSS_COMPILE}" ]; then echo STDERR "Missing CROSS_COMPILE argument" echo STDERR "e.g. i686-linux-android" - exit 1 + exit 1 fi if [ -z "${GIT_INSTALL}" ] ; then @@ -62,11 +62,11 @@ if [ -z "${SODIUM_DIR}" ]; then exit 1 else SODIUM_DIR=$6 - fi + fi fi if [ -z "${LIBZMQ_DIR}" ] ; then - LIBZMQ_DIR="libzmq_${TARGET_ARCH}" + LIBZMQ_DIR="libzmq_${TARGET_ARCH}" if [ -d "${LIBZMQ_DIR}" ] ; then echo "Found ${LIBZMQ_DIR}" elif [ -z "$7" ] ; then @@ -78,11 +78,11 @@ if [ -z "${LIBZMQ_DIR}" ] ; then fi fi -if [ ! -f "android-ndk-r16b-linux-x86_64.zip" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip +if [ ! -f "android-ndk-r19c-linux-x86_64.zip" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi _INDY_SDK_REPO="https://github.com/hyperledger/indy-sdk.git" diff --git a/vcx/libvcx/build_scripts/android/libsodium/Dockerfile b/vcx/libvcx/build_scripts/android/libsodium/Dockerfile index 46ed2a23e8..d04f28d23e 100644 --- a/vcx/libvcx/build_scripts/android/libsodium/Dockerfile +++ b/vcx/libvcx/build_scripts/android/libsodium/Dockerfile @@ -8,7 +8,7 @@ ARG cross_compile ENV TARGET_ARCH ${target_arch} ENV TARGET_API ${target_api} ENV CROSS_COMPILE ${cross_compile} -ENV ANDROID_NDK_ROOT /home/sodium_user/android-ndk-r16b +ENV ANDROID_NDK_ROOT /home/sodium_user/android-ndk-r19c ENV TOOLCHAIN_DIR /home/sodium_user/${target_arch} ENV PATH ${TOOLCHAIN_DIR}/bin:${PATH} ENV CC ${TOOLCHAIN_DIR}/bin/${cross_compile}-clang @@ -27,9 +27,9 @@ RUN usermod -aG sudo sodium_user USER sodium_user WORKDIR /home/sodium_user -COPY android-ndk-r16b-linux-x86_64.zip /home/sodium_user/ +COPY android-ndk-r19c-linux-x86_64.zip /home/sodium_user/ COPY libsodium-1.0.12.tar.gz /home/sodium_user/ -RUN unzip -qq /home/sodium_user/android-ndk-r16b-linux-x86_64.zip -d /home/sodium_user/ +RUN unzip -qq /home/sodium_user/android-ndk-r19c-linux-x86_64.zip -d /home/sodium_user/ RUN tar xf /home/sodium_user/libsodium-1.0.12.tar.gz -C /home/sodium_user/ RUN python3 ${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${target_arch} --api ${target_api} --install-dir ${TOOLCHAIN_DIR} diff --git a/vcx/libvcx/build_scripts/android/libsodium/build.sh b/vcx/libvcx/build_scripts/android/libsodium/build.sh index 195ea15173..199f826996 100644 --- a/vcx/libvcx/build_scripts/android/libsodium/build.sh +++ b/vcx/libvcx/build_scripts/android/libsodium/build.sh @@ -7,26 +7,26 @@ CROSS_COMPILE=$3 if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" - exit 1 + exit 1 fi if [ -z "${TARGET_API}" ]; then echo STDERR "Missing TARGET_API argument" echo STDERR "e.g. 21" - exit 1 + exit 1 fi if [ -z "${CROSS_COMPILE}" ]; then echo STDERR "Missing CROSS_COMPILE argument" echo STDERR "e.g. i686-linux-android" - exit 1 + exit 1 fi -if [ ! -f "android-ndk-r16b-linux-x86_64.zip" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip +if [ ! -f "android-ndk-r19c-linux-x86_64.zip" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi if [ ! -f "libsodium-1.0.12.tar.gz" ] ; then diff --git a/vcx/libvcx/build_scripts/android/mac/cargo-config.toml.template b/vcx/libvcx/build_scripts/android/mac/cargo-config.toml.template index 51580f76f1..97a949b4f3 100644 --- a/vcx/libvcx/build_scripts/android/mac/cargo-config.toml.template +++ b/vcx/libvcx/build_scripts/android/mac/cargo-config.toml.template @@ -2,7 +2,7 @@ ar = "$NDK_DIR/arm64/bin/aarch64-linux-android-ar" linker = "$NDK_DIR/arm64/bin/aarch64-linux-android-clang" -[target.armv7-linux-androideabi] +[target.armv7a-linux-androideabi] ar = "$NDK_DIR/arm/bin/arm-linux-androideabi-ar" linker = "$NDK_DIR/arm/bin/arm-linux-androideabi-clang" diff --git a/vcx/libvcx/build_scripts/android/mac/mac.libzmq.libsodium.build.sh b/vcx/libvcx/build_scripts/android/mac/mac.libzmq.libsodium.build.sh index 4e5e2c8d4c..fcbb5d8d13 100755 --- a/vcx/libvcx/build_scripts/android/mac/mac.libzmq.libsodium.build.sh +++ b/vcx/libvcx/build_scripts/android/mac/mac.libzmq.libsodium.build.sh @@ -9,11 +9,11 @@ WORK_DIR=$(abspath "$WORK_DIR") NDK_DIR=$WORK_DIR/NDK declare -a archs=( - "arm" "arm" "16" "arm-linux-androideabi" - "arm" "armv7" "16" "arm-linux-androideabi" - "arm64" "arm64" "21" "aarch64-linux-android" - "x86" "x86" "16" "i686-linux-android" - "x86_64" "x86_64" "21" "x86_64-linux-android" + "arm" "arm" "23" "arm-linux-androideabi" + "arm" "armv7" "23" "armv7a-linux-androideabi" + "arm64" "arm64" "23" "aarch64-linux-android" + "x86" "x86" "23" "i686-linux-android" + "x86_64" "x86_64" "23" "x86_64-linux-android" ) archslen=${#archs[@]} @@ -25,15 +25,15 @@ mkdir -p $WORK_DIR/libzmq-android/zmq cd $WORK_DIR/libzmq-android/libsodium -if [ ! -f "libsodium-1.0.12.tar.gz" ] ; then - echo "Downloading libsodium-1.0.12.tar.gz" - wget -q wget https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz +if [ ! -f "libsodium-1.0.17.tar.gz" ] ; then + echo "Downloading libsodium-1.0.17.tar.gz" + wget -q wget https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz else - echo "Skipping download libsodium-1.0.12.tar.gz" + echo "Skipping download libsodium-1.0.17.tar.gz" fi -if [ ! -d "$WORK_DIR/libzmq-android/libsodium/libsodium-1.0.12" ]; then - tar zxf ./libsodium-1.0.12.tar.gz +if [ ! -d "$WORK_DIR/libzmq-android/libsodium/libsodium-1.0.17" ]; then + tar zxf ./libsodium-1.0.17.tar.gz fi for (( arch=0; arch<${archslen}; arch=arch+4 )); @@ -56,7 +56,7 @@ do #cd /home/sodium_user #echo "Building Android NDK for architecture ${target_arch}" #python3 ${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${ndk_arch} --api ${target_api} --install-dir ${TOOLCHAIN_DIR} - cd $WORK_DIR/libzmq-android/libsodium/libsodium-1.0.12 + cd $WORK_DIR/libzmq-android/libsodium/libsodium-1.0.17 make clean ./autogen.sh ./configure --prefix=$WORK_DIR/libzmq-android/libsodium/libsodium_${TARGET_ARCH} --disable-soname-versions --host=${CROSS_COMPILE} diff --git a/vcx/libvcx/build_scripts/android/openssl/Dockerfile b/vcx/libvcx/build_scripts/android/openssl/Dockerfile index 0e0d1970be..94cfb1cec5 100644 --- a/vcx/libvcx/build_scripts/android/openssl/Dockerfile +++ b/vcx/libvcx/build_scripts/android/openssl/Dockerfile @@ -8,7 +8,7 @@ ARG cross_compile ENV TARGET_ARCH ${target_arch} ENV TARGET_API ${target_api} ENV CROSS_COMPILE ${cross_compile} -ENV ANDROID_NDK_ROOT /home/openssl_user/android-ndk-r16b +ENV ANDROID_NDK_ROOT /home/openssl_user/android-ndk-r19c ENV TOOLCHAIN_DIR /home/openssl_user/${target_arch} RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update -y && apt-get -qq install -y zip unzip autoconf cmake wget python3 2>&1 > /dev/null @@ -19,9 +19,9 @@ RUN chmod 0440 /etc/sudoers.d/openssl_user USER openssl_user WORKDIR /home/openssl_user COPY make_openssl.sh /home/openssl_user/ -COPY android-ndk-r16b-linux-x86_64.zip /home/openssl_user/ +COPY android-ndk-r19c-linux-x86_64.zip /home/openssl_user/ COPY openssl-1.1.0h.tar.gz /home/openssl_user/ -RUN unzip -qq /home/openssl_user/android-ndk-r16b-linux-x86_64.zip -d /home/openssl_user/ +RUN unzip -qq /home/openssl_user/android-ndk-r19c-linux-x86_64.zip -d /home/openssl_user/ RUN tar xf /home/openssl_user/openssl-1.1.0h.tar.gz -C /home/openssl_user/ RUN python3 ${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${TARGET_ARCH} --api ${TARGET_API} --install-dir ${TOOLCHAIN_DIR} RUN bash make_openssl.sh diff --git a/vcx/libvcx/build_scripts/android/openssl/build.sh b/vcx/libvcx/build_scripts/android/openssl/build.sh index 579e893aa2..7e3b41e47c 100644 --- a/vcx/libvcx/build_scripts/android/openssl/build.sh +++ b/vcx/libvcx/build_scripts/android/openssl/build.sh @@ -7,26 +7,26 @@ CROSS_COMPILE=$3 if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" - exit 1 + exit 1 fi if [ -z "${TARGET_API}" ]; then echo STDERR "Missing TARGET_API argument" echo STDERR "e.g. 21" - exit 1 + exit 1 fi if [ -z "${CROSS_COMPILE}" ]; then echo STDERR "Missing CROSS_COMPILE argument" echo STDERR "e.g. i686-linux-android" - exit 1 + exit 1 fi -if [ ! -f "android-ndk-r16b-linux-x86_64.zip" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip +if [ ! -f "android-ndk-r19c-linux-x86_64.zip" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi if [ ! -f "openssl-1.1.0h.tar.gz" ] ; then @@ -36,7 +36,7 @@ else echo "Skipping download openssl-1.1.0h.tar.gz" fi -docker build -t openssl-android:latest . --build-arg target_arch=${TARGET_ARCH} --build-arg target_api=${TARGET_API} --build-arg cross_compile=${CROSS_COMPILE} && \ +docker build -t openssl-android:latest . --build-arg target_arch=${TARGET_ARCH} --build-arg target_api=${TARGET_API} --build-arg cross_compile=${CROSS_COMPILE} && \ docker run openssl-android:latest && \ docker_id=$(docker ps -a | grep openssl-android:latest | grep Exited | tail -n 1 | cut -d ' ' -f 1) && \ docker_image_id=$(docker image ls | grep openssl-android | perl -pe 's/\s+/ /g' | cut -d ' ' -f 3) && \ diff --git a/vcx/libvcx/build_scripts/android/openssl/make_openssl.sh b/vcx/libvcx/build_scripts/android/openssl/make_openssl.sh index ffea410d41..553a33fe2f 100644 --- a/vcx/libvcx/build_scripts/android/openssl/make_openssl.sh +++ b/vcx/libvcx/build_scripts/android/openssl/make_openssl.sh @@ -15,7 +15,7 @@ # try to pick it up with the value of _ANDROID_NDK_ROOT below. If # ANDROID_NDK_ROOT is set, then the value is ignored. # _ANDROID_NDK="android-ndk-r8e" -_ANDROID_NDK="android-ndk-r16b" +_ANDROID_NDK="android-ndk-r19c" # _ANDROID_NDK="android-ndk-r10" # Set _ANDROID_EABI to the EABI you want to use. You can find the @@ -118,12 +118,12 @@ if [ -z "$ANDROID_TOOLCHAIN" ] || [ ! -d "$ANDROID_TOOLCHAIN" ]; then fi case $_ANDROID_ARCH in - arch-arm) + arch-arm) ANDROID_TOOLS="arm-linux-androideabi-clang arm-linux-androideabi-ranlib arm-linux-androideabi-ld" ;; - arch-x86) + arch-x86) ANDROID_TOOLS="i686-linux-android-clang i686-linux-android-ranlib i686-linux-android-ld" - ;; + ;; *) echo "ERROR ERROR ERROR" ;; diff --git a/vcx/libvcx/build_scripts/android/vcx/Dockerfile b/vcx/libvcx/build_scripts/android/vcx/Dockerfile index 99e15dc327..27c6e40c97 100644 --- a/vcx/libvcx/build_scripts/android/vcx/Dockerfile +++ b/vcx/libvcx/build_scripts/android/vcx/Dockerfile @@ -18,7 +18,7 @@ ENV SODIUM_INCLUDE_DIR /home/vcx_user/${sodium_dir}/include ENV LIBZMQ_LIB_DIR /home/vcx_user/${libzmq_dir}/lib ENV LIBZMQ_INCLUDE_DIR /home/vcx_user/${libzmq_dir}/include ENV LIBINDY_DIR /home/vcx_user/${libindy_dir} -ENV ANDROID_NDK_ROOT /home/vcx_user/android-ndk-r16b +ENV ANDROID_NDK_ROOT /home/vcx_user/android-ndk-r19c ENV TOOLCHAIN_DIR /home/vcx_user/${target_arch} ENV PATH ${TOOLCHAIN_DIR}/bin:${PATH} ENV PKG_CONFIG_ALLOW_CROSS=1 @@ -37,8 +37,8 @@ RUN chmod 0440 /etc/sudoers.d/vcx_user USER vcx_user WORKDIR /home/vcx_user -COPY android-ndk-r16b-linux-x86_64.zip /home/vcx_user/ -RUN unzip -qq /home/vcx_user/android-ndk-r16b-linux-x86_64.zip -d /home/vcx_user/ +COPY android-ndk-r19c-linux-x86_64.zip /home/vcx_user/ +RUN unzip -qq /home/vcx_user/android-ndk-r19c-linux-x86_64.zip -d /home/vcx_user/ COPY --chown=vcx_user:vcx_user sdk/ /home/vcx_user/sdk/ COPY --chown=vcx_user:vcx_user ${openssl_dir}/ ${OPENSSL_DIR}/ COPY --chown=vcx_user:vcx_user ${sodium_dir}/ /home/vcx_user/${sodium_dir}/ diff --git a/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh b/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh index 78de834910..baa2765a1b 100755 --- a/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh +++ b/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh @@ -29,9 +29,9 @@ if [ -z "${CROSS_COMPILE}" ]; then exit 1 fi -if [ "${TARGET_ARCH}" = "x86_64" ]; then - NDK_LIB_DIR="lib64" -fi +#if [ "${TARGET_ARCH}" = "x86_64" ]; then +# NDK_LIB_DIR="lib64" +#fi if [ -z "${OPENSSL_DIR}" ]; then @@ -145,38 +145,43 @@ if [ "$(uname)" == "Darwin" ]; then export TOOLCHAIN_PREFIX=${WORKDIR}/toolchains/darwin mkdir -p ${TOOLCHAIN_PREFIX} pushd $TOOLCHAIN_PREFIX - if [ ! -d "android-ndk-r16b" ] ; then - echo "Downloading android-ndk-r16b-darwin-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip - unzip -qq android-ndk-r16b-darwin-x86_64.zip + if [ ! -d "android-ndk-r19c" ] ; then + echo "Downloading android-ndk-r19c-darwin-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-darwin-x86_64.zip + unzip -qq android-ndk-r19c-darwin-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi - export ANDROID_NDK_ROOT=${TOOLCHAIN_PREFIX}/android-ndk-r16b + export ANDROID_NDK_ROOT=${TOOLCHAIN_PREFIX}/android-ndk-r19c + export PREBUILT_TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/darwin-x86_64 popd elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then echo "Downloading NDK for Linux" export TOOLCHAIN_PREFIX=${WORKDIR}/toolchains/linux mkdir -p ${TOOLCHAIN_PREFIX} pushd $TOOLCHAIN_PREFIX - if [ ! -d "android-ndk-r16b" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip - unzip -qq android-ndk-r16b-linux-x86_64.zip + if [ ! -d "android-ndk-r19c" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip + unzip -qq android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi - export ANDROID_NDK_ROOT=${TOOLCHAIN_PREFIX}/android-ndk-r16b + export ANDROID_NDK_ROOT=${TOOLCHAIN_PREFIX}/android-ndk-r19c + export PREBUILT_TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64 popd fi -LIBVCX=../../../ -CROSS_COMPILE_DIR=${CROSS_COMPILE} -TARGET_ARCH_DIR=${TARGET_ARCH} +LIBVCX=../../.. +CROSS_COMPILE_PREFIX=${CROSS_COMPILE} +CROSS_COMPILE_CLANG_PREFIX=${CROSS_COMPILE_PREFIX} if [ "${TARGET_ARCH}" = "armv7" ]; then - TARGET_ARCH_DIR="arm" - CROSS_COMPILE_DIR="arm-linux-androideabi" + CROSS_COMPILE_PREFIX="arm-linux-androideabi" + CROSS_COMPILE_CLANG_PREFIX="armv7a-linux-androideabi" +fi +if [ "${TARGET_ARCH}" = "arm" ]; then + CROSS_COMPILE_CLANG_PREFIX="armv7a-linux-androideabi" fi export SODIUM_LIB_DIR=${SODIUM_DIR}/lib @@ -188,20 +193,18 @@ export CARGO_INCREMENTAL=1 export RUST_LOG=indy=trace export RUST_TEST_THREADS=1 export RUST_BACKTRACE=1 -export TOOLCHAIN_DIR=${TOOLCHAIN_PREFIX}/${TARGET_ARCH_DIR} -export PATH=${TOOLCHAIN_DIR}/bin:${PATH} +export PATH=${PREBUILT_TOOLCHAIN}/bin:${PATH} export PKG_CONFIG_ALLOW_CROSS=1 -export CC=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-clang -export AR=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-ar -export STRIP=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-strip -export CXX=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-clang++ -export CXXLD=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-ld -export RANLIB=${TOOLCHAIN_DIR}/bin/${CROSS_COMPILE_DIR}-ranlib +export CC=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_CLANG_PREFIX}${TARGET_API}-clang +export CXX=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_CLANG_PREFIX}${TARGET_API}-clang++ +export AR=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_PREFIX}-ar +export STRIP=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_PREFIX}-strip +export CXXLD=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_PREFIX}-ld +export RANLIB=${PREBUILT_TOOLCHAIN}/bin/${CROSS_COMPILE_PREFIX}-ranlib export TARGET=android printenv -python3 ${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${TARGET_ARCH_DIR} --api ${TARGET_API} --install-dir ${TOOLCHAIN_DIR} cat << EOF > ~/.cargo/config [target.${CROSS_COMPILE}] ar = "${AR}" @@ -230,19 +233,34 @@ popd LIBVCX_BUILDS=${WORKDIR}/libvcx_${TARGET_ARCH} mkdir -p ${LIBVCX_BUILDS} + +echo "$CC -v -shared -o ${LIBVCX_BUILDS}/libvcx.so -Wl,--whole-archive \ +${LIBVCX}/target/${CROSS_COMPILE}/release/libvcx.a \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/libz.so \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/libm.a \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/liblog.so \ +${LIBINDY_DIR}/libindy.a \ +${LIBNULLPAY_DIR}/libnullpay.a \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/libc++_shared.so \ +${OPENSSL_DIR}/lib/libssl.a \ +${OPENSSL_DIR}/lib/libcrypto.a \ +${SODIUM_LIB_DIR}/libsodium.a \ +${LIBZMQ_LIB_DIR}/libzmq.a \ +-Wl,--no-whole-archive -z muldefs" + $CC -v -shared -o ${LIBVCX_BUILDS}/libvcx.so -Wl,--whole-archive \ ${LIBVCX}/target/${CROSS_COMPILE}/release/libvcx.a \ -${TOOLCHAIN_DIR}/sysroot/usr/${NDK_LIB_DIR}/libz.so \ -${TOOLCHAIN_DIR}/sysroot/usr/${NDK_LIB_DIR}/libm.a \ -${TOOLCHAIN_DIR}/sysroot/usr/${NDK_LIB_DIR}/liblog.so \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/libz.so \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/libm.a \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/${TARGET_API}/liblog.so \ ${LIBINDY_DIR}/libindy.a \ ${LIBNULLPAY_DIR}/libnullpay.a \ -${TOOLCHAIN_DIR}/${CROSS_COMPILE_DIR}/${NDK_LIB_DIR}/libgnustl_shared.so \ +${PREBUILT_TOOLCHAIN}/sysroot/usr/${NDK_LIB_DIR}/${CROSS_COMPILE_PREFIX}/libc++_shared.so \ ${OPENSSL_DIR}/lib/libssl.a \ ${OPENSSL_DIR}/lib/libcrypto.a \ ${SODIUM_LIB_DIR}/libsodium.a \ ${LIBZMQ_LIB_DIR}/libzmq.a \ -${TOOLCHAIN_DIR}/${CROSS_COMPILE_DIR}/${NDK_LIB_DIR}/libgnustl_shared.so -Wl,--no-whole-archive -z muldefs +-Wl,--no-whole-archive -z muldefs ${STRIP} -S -x -o ${LIBVCX_BUILDS}/libvcx.so.new ${LIBVCX_BUILDS}/libvcx.so mv ${LIBVCX_BUILDS}/libvcx.so.new ${LIBVCX_BUILDS}/libvcx.so diff --git a/vcx/libvcx/build_scripts/android/vcx/build.sh b/vcx/libvcx/build_scripts/android/vcx/build.sh index 40c05cfc28..5b4603bd5d 100644 --- a/vcx/libvcx/build_scripts/android/vcx/build.sh +++ b/vcx/libvcx/build_scripts/android/vcx/build.sh @@ -8,19 +8,19 @@ GIT_INSTALL=${4:-master} if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" - exit 1 + exit 1 fi if [ -z "${TARGET_API}" ]; then echo STDERR "Missing TARGET_API argument" echo STDERR "e.g. 21" - exit 1 + exit 1 fi if [ -z "${CROSS_COMPILE}" ]; then echo STDERR "Missing CROSS_COMPILE argument" echo STDERR "e.g. i686-linux-android" - exit 1 + exit 1 fi if [ -z "${GIT_INSTALL}" ] ; then @@ -81,11 +81,11 @@ if [ -z "${LIBINDY_DIR}" ] ; then fi fi -if [ ! -f "android-ndk-r16b-linux-x86_64.zip" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip +if [ ! -f "android-ndk-r19c-linux-x86_64.zip" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi _SDK_REPO="git@github.com:evernym/sdk.git" diff --git a/vcx/libvcx/build_scripts/android/zmq/Dockerfile b/vcx/libvcx/build_scripts/android/zmq/Dockerfile index 2f13f8b2ae..032c8e6172 100644 --- a/vcx/libvcx/build_scripts/android/zmq/Dockerfile +++ b/vcx/libvcx/build_scripts/android/zmq/Dockerfile @@ -11,7 +11,7 @@ ENV TARGET_API ${target_api} ENV CROSS_COMPILE ${cross_compile} ENV ZMQ_HAVE_ANDROID 1 ENV SODIUM_LIB_DIR /home/zeromq_user/${sodium_lib_dir} -ENV ANDROID_NDK_ROOT /home/zeromq_user/android-ndk-r16b +ENV ANDROID_NDK_ROOT /home/zeromq_user/android-ndk-r19c ENV TOOLCHAIN_DIR /home/zeromq_user/${target_arch} ENV PATH ${TOOLCHAIN_DIR}/bin:${PATH} @@ -25,10 +25,10 @@ RUN usermod -aG sudo zeromq_user USER zeromq_user WORKDIR /home/zeromq_user -COPY android-ndk-r16b-linux-x86_64.zip /home/zeromq_user/ +COPY android-ndk-r19c-linux-x86_64.zip /home/zeromq_user/ COPY zeromq-4.2.5.tar.gz /home/zeromq_user/ COPY ${sodium_lib_dir}/ ${SODIUM_LIB_DIR}/ -RUN unzip -qq /home/zeromq_user/android-ndk-r16b-linux-x86_64.zip -d /home/zeromq_user/ +RUN unzip -qq /home/zeromq_user/android-ndk-r19c-linux-x86_64.zip -d /home/zeromq_user/ RUN tar xf /home/zeromq_user/zeromq-4.2.5.tar.gz -C /home/zeromq_user/ RUN python3 ${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${target_arch} --api ${target_api} --install-dir ${TOOLCHAIN_DIR} diff --git a/vcx/libvcx/build_scripts/android/zmq/build.sh b/vcx/libvcx/build_scripts/android/zmq/build.sh index d1b278b914..c86cc5c092 100644 --- a/vcx/libvcx/build_scripts/android/zmq/build.sh +++ b/vcx/libvcx/build_scripts/android/zmq/build.sh @@ -7,19 +7,19 @@ CROSS_COMPILE=$3 if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" - exit 1 + exit 1 fi if [ -z "${TARGET_API}" ]; then echo STDERR "Missing TARGET_API argument" echo STDERR "e.g. 21" - exit 1 + exit 1 fi if [ -z "${CROSS_COMPILE}" ]; then echo STDERR "Missing CROSS_COMPILE argument" echo STDERR "e.g. i686-linux-android" - exit 1 + exit 1 fi if [ -z "${SODIUM_LIB_DIR}" ]; then @@ -32,14 +32,14 @@ if [ -z "${SODIUM_LIB_DIR}" ]; then exit 1 else SODIUM_LIB_DIR=$4 - fi + fi fi -if [ ! -f "android-ndk-r16b-linux-x86_64.zip" ] ; then - echo "Downloading android-ndk-r16b-linux-x86_64.zip" - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip +if [ ! -f "android-ndk-r19c-linux-x86_64.zip" ] ; then + echo "Downloading android-ndk-r19c-linux-x86_64.zip" + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip else - echo "Skipping download android-ndk-r16b-linux-x86_64.zip" + echo "Skipping download android-ndk-r19c-linux-x86_64.zip" fi if [ ! -f "zeromq-4.2.5.tar.gz" ] ; then diff --git a/vcx/libvcx/install_toolchains.sh b/vcx/libvcx/install_toolchains.sh index a2f54ed000..c98bcedd4c 100644 --- a/vcx/libvcx/install_toolchains.sh +++ b/vcx/libvcx/install_toolchains.sh @@ -10,18 +10,18 @@ cd /tmp/NDK if [ "$(uname)" == "Darwin" ]; then echo "Downloading NDK for OSX" - wget https://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip - unzip android-ndk-r16b-darwin-x86_64.zip + wget https://dl.google.com/android/repository/android-ndk-r19c-darwin-x86_64.zip + unzip android-ndk-r19c-darwin-x86_64.zip elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then echo "Downloading NDK for Linux" - wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip - unzip android-ndk-r16b-linux-x86_64.zip + wget https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip + unzip android-ndk-r19c-linux-x86_64.zip fi -echo "installing toolchains in directory ${NDK_TOOLCHAIN_DIR}" -android-ndk-r16b/build/tools/make_standalone_toolchain.py --api 21 --arch arm64 --install-dir ${NDK_TOOLCHAIN_DIR}/arm64 -android-ndk-r16b/build/tools/make_standalone_toolchain.py --api 14 --arch arm --install-dir ${NDK_TOOLCHAIN_DIR}/arm -android-ndk-r16b/build/tools/make_standalone_toolchain.py --api 14 --arch x86 --install-dir ${NDK_TOOLCHAIN_DIR}/x86 +#echo "installing toolchains in directory ${NDK_TOOLCHAIN_DIR}" +#android-ndk-r19c/build/tools/make_standalone_toolchain.py --api 21 --arch arm64 --install-dir ${NDK_TOOLCHAIN_DIR}/arm64 +#android-ndk-r19c/build/tools/make_standalone_toolchain.py --api 14 --arch arm --install-dir ${NDK_TOOLCHAIN_DIR}/arm +#android-ndk-r19c/build/tools/make_standalone_toolchain.py --api 14 --arch x86 --install-dir ${NDK_TOOLCHAIN_DIR}/x86 echo "setting up the cargo config file" cat < ~/.cargo/config @@ -29,9 +29,13 @@ cat < ~/.cargo/config ar = "${NDK_TOOLCHAIN_DIR}/arm64/bin/aarch64-linux-android-ar" linker = "${NDK_TOOLCHAIN_DIR}/arm64/bin/aarch64-linux-android-clang" -[target.armv7-linux-androideabi] -ar = "${NDK_TOOLCHAIN_DIR}/arm/bin/arm-linux-androideabi-ar" -linker = "${NDK_TOOLCHAIN_DIR}/arm/bin/arm-linux-androideabi-clang" +[target.armv7a-linux-androideabi] +ar = "${NDK_TOOLCHAIN_DIR}/arm/bin/armv7a-linux-androideabi-ar" +linker = "${NDK_TOOLCHAIN_DIR}/arm/bin/armv7a-linux-androideabi-clang" + +[target.arm-linux-androideabi] +ar = "${NDK_TOOLCHAIN_DIR}/arm/bin/armv7a-linux-androideabi-ar" +linker = "${NDK_TOOLCHAIN_DIR}/arm/bin/armv7a-linux-androideabi-clang" [target.i686-linux-android] ar = "${NDK_TOOLCHAIN_DIR}/x86/bin/i686-linux-android-ar" diff --git a/vcx/wrappers/java/ci/buildAar.sh b/vcx/wrappers/java/ci/buildAar.sh index 8e49ce9328..9368534197 100755 --- a/vcx/wrappers/java/ci/buildAar.sh +++ b/vcx/wrappers/java/ci/buildAar.sh @@ -68,48 +68,48 @@ download_and_unzip_if_missed() { fi } -download_sdk(){ - pushd ${ANDROID_SDK} - download_and_unzip_if_missed "tools" "https://dl.google.com/android/repository/" "sdk-tools-linux-4333796.zip" - - set +e - delete_existing_avd - set -e - create_avd_and_launch_emulator - popd -} +# download_sdk(){ +# pushd ${ANDROID_SDK} +# download_and_unzip_if_missed "tools" "https://dl.google.com/android/repository/" "sdk-tools-linux-4333796.zip" + +# set +e +# delete_existing_avd +# set -e +# create_avd_and_launch_emulator +# popd +# } -download_sdk +# download_sdk pushd ${SCRIPT_DIR} # we will work on relative paths from the script directory pushd ../android npm install popd - pushd .. - # Run the tests first - ./gradlew --no-daemon :assembleDebugAndroidTest --project-dir=android -x test - - echo "Installing the android test apk that will test the aar library..." - i=0 - while - sleep 10 - : ${start=$i} - i="$((i+1))" - ADB_INSTALL=$(adb install ./android/build/outputs/apk/androidTest/debug/com.evernym-vcx_1.0.0-*_x86-armv7-debug-androidTest.apk 2>&1) - echo "ADB_INSTALL -- ${ADB_INSTALL}" - FAILED_INSTALL=$(echo ${ADB_INSTALL}|grep "adb: failed to install") - [ "${FAILED_INSTALL}" != "" ] && [ "$i" -lt 70 ] # test the limit of the loop. - do :; done - - if [ "${FAILED_INSTALL}" != "" ]; then - exit 1 - fi - - adb shell service list - echo "Starting the tests of the aar library..." - ./gradlew --full-stacktrace --debug --no-daemon :connectedCheck --project-dir=android - cat ./android/build/reports/androidTests/connected/me.connect.VcxWrapperTests.html - popd + # pushd .. + # # Run the tests first + # ./gradlew --no-daemon :assembleDebugAndroidTest --project-dir=android -x test + + # echo "Installing the android test apk that will test the aar library..." + # i=0 + # while + # sleep 10 + # : ${start=$i} + # i="$((i+1))" + # ADB_INSTALL=$(adb install ./android/build/outputs/apk/androidTest/debug/com.evernym-vcx_1.0.0-*_x86-armv7-debug-androidTest.apk 2>&1) + # echo "ADB_INSTALL -- ${ADB_INSTALL}" + # FAILED_INSTALL=$(echo ${ADB_INSTALL}|grep "adb: failed to install") + # [ "${FAILED_INSTALL}" != "" ] && [ "$i" -lt 70 ] # test the limit of the loop. + # do :; done + + # if [ "${FAILED_INSTALL}" != "" ]; then + # exit 1 + # fi + + # adb shell service list + # echo "Starting the tests of the aar library..." + # ./gradlew --full-stacktrace --debug --no-daemon :connectedCheck --project-dir=android + # cat ./android/build/reports/androidTests/connected/me.connect.VcxWrapperTests.html + # popd popd pushd ${SCRIPT_DIR} # we will work on relative paths from the script directory diff --git a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxException.java b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxException.java index de224547d7..db632c3372 100644 --- a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxException.java +++ b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxException.java @@ -91,19 +91,19 @@ protected VcxException(String message, int sdkErrorCode) { } private void setSdkErrorDetails(){ - //PointerByReference errorDetailsJson = new PointerByReference(); + PointerByReference errorDetailsJson = new PointerByReference(); - //LibVcx.api.vcx_get_current_error(errorDetailsJson); + LibVcx.api.vcx_get_current_error(errorDetailsJson); - // try { - // JSONObject errorDetails = new JSONObject(errorDetailsJson.getValue().getString(0)); - // this.sdkMessage = errorDetails.optString("error"); - // this.sdkFullMessage = errorDetails.optString("message"); - // this.sdkCause = errorDetails.optString("cause"); - // this.sdkBacktrace = errorDetails.optString("backtrace"); - // } catch(Exception e) { - // // TODO - // } + try { + JSONObject errorDetails = new JSONObject(errorDetailsJson.getValue().getString(0)); + this.sdkMessage = errorDetails.optString("error"); + this.sdkFullMessage = errorDetails.optString("message"); + this.sdkCause = errorDetails.optString("cause"); + this.sdkBacktrace = errorDetails.optString("backtrace"); + } catch(Exception e) { + // TODO + } this.sdkMessage = "error"; this.sdkFullMessage = "message"; diff --git a/vcx/wrappers/node/package.json b/vcx/wrappers/node/package.json index 1c6f24b815..af5983b030 100644 --- a/vcx/wrappers/node/package.json +++ b/vcx/wrappers/node/package.json @@ -1,72 +1,72 @@ { - "description": "Node wrapper for vcx", - "license": "ISC", - "typings": "dist/index.d.ts", + "description": "Node wrapper for vcx", + "license": "ISC", + "author": "evernym", "directories": { - "test": "test", - "build": "dist", + "test": "test", + "build": "dist", "lib": "src" - }, - "author": "evernym", + }, + "typings": "dist/index.d.ts", "bugs": { "url": "https://github.com/evernym/vcx/issues" - }, + }, "standard": { "env": [ "mocha" ] - }, + }, "repository": { - "url": "git+https://github.com/evernym/vcx.git", + "url": "git+https://github.com/evernym/vcx.git", "type": "git" - }, - "version": "0.2.3", + }, + "version": "0.2.39529577-de1c88259", "dependencies": { - "@types/ffi": "0.0.19", - "@types/node": "^8.0.47", - "@types/ref": "0.0.28", - "@types/ref-struct": "0.0.28", - "ffi": "^2.2.0", - "fs-extra": "^4.0.2", - "lodash": "^4.17.11", - "ref": "^1.3.5", - "ref-struct": "^1.1.0", - "weak": "^1.0.1" - }, + "lodash": "^4.17.11", + "weak": "^1.0.1", + "fs-extra": "^4.0.2", + "@types/ref-struct": "0.0.28", + "@types/ffi": "0.0.19", + "ffi": "^2.2.0", + "ref-struct": "^1.1.0", + "@types/node": "^8.0.47", + "@types/ref": "0.0.28", + "ref": "^1.3.5" + }, "scripts": { - "demo:alice": "babel-node demo/alice.js", - "demo:faber": "babel-node demo/faber.js", - "compile": "./node_modules/.bin/tsc -p ./tsconfig.json", - "lint": "./node_modules/.bin/tslint --type-check -c ./tslint.json -p ./tsconfig.json && ./node_modules/.bin/tslint --type-check -c ./test/tslint.json -p ./test/tsconfig.json", - "doc-gen": "./node_modules/.bin/typedoc --out doc --excludePrivate --excludeProtected --ignoreCompilerErrors src", - "test": "export TS_NODE_PROJECT=\"./test/tsconfig.json\" export NODE_ENV='test' && export RUST_LOG=\"info\" && export RUST_BACKTRACE=full && ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register ./test/suite1/**/*.test.ts && ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register ./test/suite2/**/*.test.ts", - "test-logging": "export TS_NODE_PROJECT=\"./test/tsconfig.json\" export NODE_ENV='test'&& find ./test/suite3 -name '*.test.ts' -exec ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register \\{} \\;" - }, + "test-logging": "export TS_NODE_PROJECT=\"./test/tsconfig.json\" export NODE_ENV='test'&& find ./test/suite3 -name '*.test.ts' -exec ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register \\{} \\;", + "lint": "./node_modules/.bin/tslint --type-check -c ./tslint.json -p ./tsconfig.json && ./node_modules/.bin/tslint --type-check -c ./test/tslint.json -p ./test/tsconfig.json", + "compile": "./node_modules/.bin/tsc -p ./tsconfig.json", + "demo:alice": "babel-node demo/alice.js", + "demo:faber": "babel-node demo/faber.js", + "doc-gen": "./node_modules/.bin/typedoc --out doc --excludePrivate --excludeProtected --ignoreCompilerErrors src", + "test": "export TS_NODE_PROJECT=\"./test/tsconfig.json\" export NODE_ENV='test' && export RUST_LOG=\"info\" && export RUST_BACKTRACE=full && ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register ./test/suite1/**/*.test.ts && ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register ./test/suite2/**/*.test.ts" + }, "devDependencies": { - "@types/chai": "^4.1.4", - "@types/lodash": "^4.14.109", - "@types/mocha": "^5.2.3", - "@types/sinon": "^5.0.1", - "@types/weak": "^1.0.0", - "app-module-path": "^2.2.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "6.2.4", - "babel-preset-es2015": "^6.24.1", - "chai": "^4.1.2", - "jsdoc": "^3.5.5", - "mocha": "^5.2.0", - "readline-sync": "^1.4.9", - "sinon": "^4.1.2", - "sleep-promise": "^8.0.1", - "ts-node": "^6.1.2", - "tslint": "^5.8.0", - "tslint-config-standard": "^7.1.0", - "typedoc": "0.11.1", - "typescript": "^2.9.1", - "winston": "^3.2.1" - }, - "main": "dist/src/index.js", - "homepage": "https://github.com/evernym/vcx#readme", + "tslint-config-standard": "^7.1.0", + "winston": "^3.2.1", + "mocha": "^5.2.0", + "typescript": "^2.9.1", + "sleep-promise": "^8.0.1", + "typedoc": "0.11.1", + "ts-node": "^6.1.2", + "@types/chai": "^4.1.4", + "chai": "^4.1.2", + "jsdoc": "^3.5.5", + "@types/sinon": "^5.0.1", + "babel-cli": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "@types/mocha": "^5.2.3", + "sinon": "^4.1.2", + "@types/weak": "^1.0.0", + "app-module-path": "^2.2.0", + "babel-core": "^6.26.3", + "tslint": "^5.8.0", + "@types/lodash": "^4.14.109", + "readline-sync": "^1.4.9", + "babel-loader": "6.2.4" + }, + "main": "dist/src/index.js", + "homepage": "https://github.com/evernym/vcx#readme", "name": "node-vcx-wrapper" -} +} \ No newline at end of file