diff --git a/vcx/ci/Jenkinsfile b/vcx/ci/Jenkinsfile index 0d18369376..3c63358c9d 100644 --- a/vcx/ci/Jenkinsfile +++ b/vcx/ci/Jenkinsfile @@ -43,43 +43,89 @@ def getCurDir() { return sh(returnStdout: true, script: 'pwd') } +static String rustVersion() { + return "1.31.1" +} + +static String libindyVersion() { + return "1.7.0" +} + +static String libnullVersion() { + return "1.7.0" +} + +static String indyTag() { + return "942" +} + +static String libsovtokenVersion() { + return "0.9.6~-.1.126" +} + +static String libindyDockerfile() { + return 'vcx/ci/libindy.dockerfile' +} + +static String indyBranch() { + return 'master' +} + + +def buildLibindy() { + indyTag=indyTag() + if (indyTag != "") { + indyTag = "~" + indyTag + } + + def LIBINDY_VER = libindyVersion() + indyTag + def LIBNULL_VER = libnullVersion() + indyTag + def LIBSOVTOKEN_VER = libsovtokenVersion() + docker.build("libindy", "--build-arg LIBINDY_VER=${LIBINDY_VER} \ + --build-arg LIBNULL_VER=${LIBNULL_VER} \ + --build-arg LIBSOVTOKEN_VER=${LIBSOVTOKEN_VER} \ + -f ${libindyDockerfile()} .") +} + + def mainUbuntu() { node('ubuntu') { - checkout scm - - def volumeInternalDir = "/sdk/vcx/output" - def revNumber = getRevNumber() - def volumeName = "vcx-volume1-${revNumber}" - def libindyDockerfile = 'vcx/ci/libindy.dockerfile' - def libvcxDockerfile = 'vcx/ci/libvcx.dockerfile' - def pythonDockerfile = 'vcx/wrappers/python3/ci/python.dockerfile' - def nodeDockerfile = 'vcx/wrappers/node/ci/node.dockerfile' - def javaDockerfile = 'vcx/wrappers/java/ci/java.dockerfile' - def uid= sh(returnStdout: true, script: 'id -u').trim() - def cwd= sh(returnStdout: true, script: 'pwd').trim() - def libvcx - def python - def node - def java try { + checkout scm + def volumeInternalDir = "/sdk/vcx/output" + def revNumber = getRevNumber() + def volumeName = "vcx-volume1-${revNumber}" + def libindyDockerfile = 'vcx/ci/libindy.dockerfile' + def libvcxDockerfile = 'vcx/ci/libvcx.dockerfile' + def pythonDockerfile = 'vcx/ci/python.dockerfile' + def nodeDockerfile = 'vcx/wrappers/node/ci/node.dockerfile' + def javaDockerfile = 'vcx/wrappers/java/ci/java.dockerfile' + def uid= sh(returnStdout: true, script: 'id -u').trim() + def cwd= sh(returnStdout: true, script: 'pwd').trim() + def libvcx + def python + def node + def java + + // set this to '--no-test' and the rust code will not run tests. + def rustTestFlag="" + + + sh 'mkdir -p output' + sh 'rm -rf output/*' stage('Build Libindy Image') { + // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) - libindy = docker.build("libindy", "-f ${libindyDockerfile} .") + buildLibindy() } - sh 'mkdir output' stage('Build Libvcx Image, Tests Rust Code') { - - libvcx = docker.build("libvcx", "--build-arg uid=${uid} -f ${libvcxDockerfile} .") + RUST_VERSION = rustVersion() + libvcx = docker.build("libvcx", "--build-arg uid=${uid} --build-arg RUST_VER=${RUST_VERSION} -f ${libvcxDockerfile} .") libvcx.inside() { - sh 'vcx/ci/scripts/package.sh' - } - } - stage('Test Node Wrapper') { - node = docker.build('node', "--build-arg uid=${uid} -f ${nodeDockerfile} .") - node.inside() { - sh 'vcx/wrappers/node/ci/test.sh' + sh "vcx/ci/scripts/package.sh ${rustTestFlag}" } + } stage('Test Python Wrapper'){ python = docker.build("python", "--build-arg uid=${uid} -f ${pythonDockerfile} .") @@ -89,63 +135,68 @@ def mainUbuntu() { } } } + stage('Test Node Wrapper') { + node = docker.build('node', "--build-arg uid=${uid} -f ${nodeDockerfile} .") + node.inside() { + sh 'vcx/wrappers/node/ci/test.sh' + } + } stage('Test Java Wrapper'){ java = docker.build("java", "--build-arg uid=${uid} -f ${javaDockerfile} .") java.inside() { sh 'cd vcx/wrappers/java && ./gradlew --no-daemon test' } } - stage('Package Node Wrapper') { - node.inside() { - sh 'vcx/wrappers/node/ci/package.sh' - } - } stage('Package Python Wrapper') { python.inside() { sh 'vcx/wrappers/python3/ci/package.sh' } } + stage('Package Node Wrapper') { + node.inside() { + sh 'vcx/wrappers/node/ci/package.sh' + + } + } stage('Package Java Wrapper') { java.inside() { - sh 'vcx/wrappers/java/ci/buildJar.sh' + sh 'vcx/wrappers/java/ci/buildJar.sh $(python3 vcx/ci/scripts/toml_utils.py vcx/libvcx/Cargo.toml)' } } - // debug info sh 'ls -al output' - if (env.BRANCH_NAME == "master") { stage('Publish') { // ******** PUBLISHING (artifacts are in a Docker Volume) ******** withCredentials([usernameColonPassword(credentialsId: 'jenkins-kraken-svc', variable: 'KRAKEN_CREDENTIALS')]) { libvcx.inside("--network=host") { - // env.KRAKEN_CREDENTIALS = "${KRAKEN_CREDENTIALS}" + + // ******** Archive with Jenkins ******** + archiveArtifacts allowEmptyArchive: true, artifacts: 'output/*' + // ******** Publish Libvcx Debian to repo ******** sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"libvcx*.deb\" https://kraken.corp.evernym.com/repo/portal_dev/upload" sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"libvcx*.deb\" https://kraken.corp.evernym.com/repo/agency_dev/upload" + // ******** Publish vcx Debian To Repo (NPM PACKAGES) For Agency + sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/agency_dev/upload" + sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/portal_dev/upload" + // ******** Publish Npm Package to filely repo ******** sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"node-vcx-wrapper*.tgz\" https://kraken.corp.evernym.com/repo/npm/upload" + /* // ******** Publish Python Package to filely repo ********* sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"python3-vcx-wrapper*.tar.gz\" https://kraken.corp.evernym.com/repo/python/upload" - - // ******** Publish vcx Debian To Repo (NPM PACKAGES) - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/agency_dev/upload" - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/portal_dev/upload" - - - // ******** Archive with Jenkins ******** - archiveArtifacts allowEmptyArchive: true, artifacts: 'output/*' + */ } - withCredentials([file(credentialsId: 'cloudrepo-artifactory-settings-libvcx', variable: 'settingsFile')]) { + withCredentials([file(credentialsId: 'artifactory-evernym-settings', variable: 'settingsFile')]) { java.inside() { sh 'cp $settingsFile .' sh "chmod +x vcx/wrappers/java/ci/publishJar.sh" sh 'vcx/wrappers/java/ci/publishJar.sh' } } - } } } @@ -162,51 +213,59 @@ def mainUbuntu() { } } - def android() { - stage('Android Build') { - parallel([ - "x86" : { buildAndroid("x86") }, - "x86_64" : { buildAndroid("x86_64") }, - "arm" : { buildAndroid("arm") }, - "arm64" : { buildAndroid("arm64") }, - "armv7" : { buildAndroid("armv7") } - ]) - } - node('ubuntu') { - try { - def uid= sh(returnStdout: true, script: 'id -u').trim() - checkout scm - android = docker.build("android", "--build-arg uid=${uid} -f vcx/wrappers/java/ci/android.dockerfile .") - stage('Android Packaging') { - //Package .so files into .aar - packageAndroid(android) - } - stage('Android Publishing') { - if (env.BRANCH_NAME == "master") { - //Publish package on aptly - publishAndroid(android) - } - } - } catch (Exception ex) { - currentBuild.result = "FAILED" + + stage('Android Build') { + parallel([ + "x86" : { buildAndroid("x86") }, + "x86_64" : { buildAndroid("x86_64") }, + "arm" : { buildAndroid("arm") }, + "arm64" : { buildAndroid("arm64") }, + "armv7" : { buildAndroid("armv7") } + ]) + } + node('ubuntu') { + try { + checkout scm + + def uid= sh(returnStdout: true, script: 'id -u').trim() + stage('Build Libindy Image') { + // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) + buildLibindy() + } + def RUST_VERSION = rustVersion() + android = docker.build("android", "--build-arg uid=${uid} --build-arg RUST_VER=${RUST_VERSION} -f vcx/wrappers/java/ci/android.dockerfile .") + stage('Android Packaging') { + //Package .so files into .aar + packageAndroid(android) + } + stage('Android Publishing') { if (env.BRANCH_NAME == "master") { - fail() + //Publish package on aptly + publishAndroid(android) } - echo "$ex error" - } finally { - sh 'docker system df' - step([$class: 'WsCleanup']) } + } catch (Exception ex) { + currentBuild.result = "FAILED" + if (env.BRANCH_NAME == "master") { + fail() + } + echo "$ex error" + } finally { + sh 'docker system df' + step([$class: 'WsCleanup']) } + } } - def ios() { + node('macos-vcx') { + checkout scm + sh "ls -r vcx/ci/*" + sh "ls vcx/libvcx/build_scripts/ios/mac" stage('iOS Build') { try { - checkout scm SCRIPTS_PATH="vcx/libvcx/build_scripts/ios/mac" WORK_DIR = "/Users/jenkins" @@ -217,7 +276,9 @@ def ios() { if (env.BRANCH_NAME == "master") { withCredentials([usernameColonPassword(credentialsId: 'jenkins-kraken-svc', variable: 'KRAKEN_CREDENTIALS')]) { sh "find /Users/jenkins/IOSBuilds/libvcxpartial/ -type f -name 'vcx.libvcxpartial_*_universal.zip' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" + sh "find /Users/jenkins/IOSBuilds/libvcxpartial/ -type f -name 'libvcx.a.libvcxpartial_*_universal.tar.gz' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" sh "find /Users/jenkins/IOSBuilds/libvcxall/ -type f -name 'vcx.libvcxall_*_universal.zip' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" + sh "find /Users/jenkins/IOSBuilds/libvcxall/ -type f -name 'libvcx.a.libvcxall_*_universal.tar.gz' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" // sh "vcx/ci/scripts/publish.sh 'vcx.libvcxpartial_*_universal.zip' https://kraken.corp.evernym.com/repo/ios/upload /Users/jenkins/IOSBuilds/libvcxpartial/" // sh "vcx/ci/scripts/publish.sh 'vcx.libvcxall_*_universal.zip' https://kraken.corp.evernym.com/repo/ios/upload /Users/jenkins/IOSBuilds/libvcxall/" } @@ -231,12 +292,12 @@ def ios() { } finally { step([$class: 'WsCleanup']) } - } } } def fail() { + def message = [ message: "$JOB_NAME - Build # $BUILD_NUMBER - fail: Check console output at $BUILD_URL to view the results." ] @@ -244,25 +305,29 @@ def fail() { } def buildAndroid(arch) { + node('ubuntu') { try { - def uid= sh(returnStdout: true, script: 'id -u').trim() checkout scm - android = docker.build("android", "--build-arg uid=${uid} -f vcx/wrappers/java/ci/android.dockerfile .") - android.inside { - ANDROID_SCRIPT_PATH = 'vcx/ci/scripts/androidBuild.sh' - LIBINDY_BRANCH="stable" - LIBINDY_VERSION="1.7.0" - LIBINDY_TAG="" + def uid= sh(returnStdout: true, script: 'id -u').trim() + stage('Build Libindy Image') { + // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) + buildLibindy() + } + stage('Build and Publish Android') { + android = docker.build("android", "--build-arg uid=${uid} -f vcx/wrappers/java/ci/android.dockerfile .") + android.inside { + ANDROID_SCRIPT_PATH = 'vcx/ci/scripts/androidBuild.sh' - sh 'sudo ./vcx/ci/scripts/installCert.sh' - sh "LIBINDY_BRANCH=${LIBINDY_BRANCH} LIBINDY_VERSION=${LIBINDY_VERSION} LIBINDY_TAG=${LIBINDY_TAG} ./${ANDROID_SCRIPT_PATH} ${arch}" + sh 'sudo ./vcx/ci/scripts/installCert.sh' + sh "LIBINDY_BRANCH=${indyBranch()} LIBINDY_VERSION=${libindyVersion()} LIBINDY_TAG=${indyTag()} ./${ANDROID_SCRIPT_PATH} ${arch}" - } + } - dir("runtime_android_build/libvcx_${arch}") { - stash includes: "libvcx.so", name: "libvcx_${arch}" + dir("runtime_android_build/libvcx_${arch}") { + stash includes: "libvcx.so", name: "libvcx_${arch}" + } } } catch (Exception ex) { currentBuild.result = "FAILED" @@ -274,7 +339,7 @@ def buildAndroid(arch) { sh 'docker system df' step([$class: 'WsCleanup']) } - } +} } def packageAndroid(android) { diff --git a/vcx/ci/change_toml_version.py b/vcx/ci/change_toml_version.py index df4519603f..cbf951ee46 100644 --- a/vcx/ci/change_toml_version.py +++ b/vcx/ci/change_toml_version.py @@ -55,30 +55,6 @@ def change_version(v, b, h): s = s + "+" + str(h) return s - -# for testing -#def test(): - - #version = "1.2.33346324+cd3sd2fe" - #build = "45678910" - #h = 'beefb23' - #print("before: %s" % version) - #version = change_version(version, build, h) - #print("after: %s" % version) - -# version = "2.3" -# print("before: %s" % version) -# version = change_version(version, build, h) -# print("after: %s" % version) -# -# print('parsing version "version = 1.2.3"') -# print(parse_version("version=1.2.3")) -# -# version = "1.2.3.hasbas" -# print("testing truncate on %s" % version) -# print('truncated: %s ' % truncate(version)) - - # parses out the vesion number from a given # line (pulled from the Cargo.toml file) def parse_version(s): @@ -104,6 +80,3 @@ def parse_version(s): print("PATH = path to Cargo.toml file") print("BUILD_NUM = build number for version") print("HASH_NUM = commit hash for version") - - -# not used diff --git a/vcx/ci/copyNoClobber.sh b/vcx/ci/copyNoClobber.sh new file mode 100755 index 0000000000..ea9522d28d --- /dev/null +++ b/vcx/ci/copyNoClobber.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ $# -ne "1" ]; then + echo USAGE: `basename "$0"` INDY_DIR + exit 1 +elif [ ! -e $INDY ]; then + echo "Incorrect Indy Location" +fi + +INDY=$1 + +ls -al +ls -alr vcx/* +ls -alr vcx/libvcx/* + + +cp -rn $INDY/vcx/* vcx +mkdir -p wrappers/rust +cp -rn $INDY/wrappers/rust/* wrappers/rust +ls -al +ls -alr vcx/* +ls -alr vcx/libvcx/* diff --git a/vcx/ci/libindy.dockerfile b/vcx/ci/libindy.dockerfile index 8ec8fd273f..85e916bf8d 100644 --- a/vcx/ci/libindy.dockerfile +++ b/vcx/ci/libindy.dockerfile @@ -9,7 +9,6 @@ RUN apt-get update -y && apt-get install -y \ libsodium-dev \ libssl-dev \ libgmp3-dev \ - build-essential \ libsqlite3-dev \ libsqlite0 \ cmake \ @@ -20,10 +19,9 @@ RUN apt-get update -y && apt-get install -y \ wget \ git \ curl \ - libffi-dev \ + libffi-dev \ ruby \ ruby-dev \ - sudo \ rubygems \ libzmq5 \ python3 \ @@ -34,14 +32,14 @@ RUN apt-get update -y && apt-get install -y \ libzmq3-dev \ zip \ unzip \ - vim + sudo # Install Nodejs RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && apt-get install -y nodejs # Install Rust -ARG RUST_VER="1.31.0" +ARG RUST_VER ENV RUST_ARCHIVE=rust-${RUST_VER}-x86_64-unknown-linux-gnu.tar.gz ENV RUST_DOWNLOAD_URL=https://static.rust-lang.org/dist/$RUST_ARCHIVE @@ -66,9 +64,12 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 && \ add-apt-repository 'deb https://repo.corp.evernym.com/deb evernym-agency-dev-ubuntu main' && \ curl https://repo.corp.evernym.com/repo.corp.evenym.com-sig.key | apt-key add - +# these are default values if they are not passed into the environment with +# the --build-arg flag from 'docker build' command. ARG LIBINDY_VER="1.7.0" ARG LIBNULL_VER="1.7.0" +ARG LIBSOVTOKEN_VER="0.9.6~-1.126" RUN apt-get update && apt-get install -y \ libindy=${LIBINDY_VER} \ libnullpay=${LIBNULL_VER} diff --git a/vcx/ci/libvcx.dockerfile b/vcx/ci/libvcx.dockerfile index 0e237d3809..ceb3a12c1c 100644 --- a/vcx/ci/libvcx.dockerfile +++ b/vcx/ci/libvcx.dockerfile @@ -4,7 +4,8 @@ ARG uid=1000 RUN useradd -ms /bin/bash -u $uid vcx USER vcx -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.31.0 +ARG RUST_VER +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VER} ENV PATH /home/vcx/.cargo/bin:$PATH WORKDIR /home/vcx ENV PATH /home/vcx:$PATH diff --git a/vcx/ci/python.dockerfile b/vcx/ci/python.dockerfile new file mode 100644 index 0000000000..632025b2e1 --- /dev/null +++ b/vcx/ci/python.dockerfile @@ -0,0 +1,16 @@ +FROM libindy +ARG uid=1000 +RUN useradd -ms /bin/bash -u $uid python + +RUN apt-get update && apt-get install -y python3 + +RUN apt-get install -y python3-pip + +RUN pip3 install pytest==4.1.0 qrcode pytest-asyncio + +ENV PYTHONPATH=vcx/wrappers/python3 + +RUN find . -name \*.pyc -delete +COPY vcx/libvcx/target/debian/*.deb . +RUN dpkg -i *.deb +USER python diff --git a/vcx/ci/scripts/androidBuild.sh b/vcx/ci/scripts/androidBuild.sh index cb6be0b230..68de560ee4 100755 --- a/vcx/ci/scripts/androidBuild.sh +++ b/vcx/ci/scripts/androidBuild.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + setup() { echo "Working Directory: ${PWD}" set -e @@ -8,6 +10,7 @@ setup() { export PATH=$PATH:/opt/gradle/gradle-3.4.1/bin export PATH=${PATH}:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/build-tools/25.0.2/ export PATH=${HOME}/.cargo/bin:${PATH} + export SOVRIN_REPO=https://repo.sovrin.org/android/libsovtoken/stable export VCX_BASE=../vcx # For docker # export VCX_BASE=${HOME}/vcx @@ -56,7 +59,7 @@ retrieve_prebuilt_binaries() { generate_flags(){ if [ -z $1 ]; then - echo "please provide the arch e.g arm, x86 or arm64" + echo "please provide the arch e.g arm, arm64, armv7, x86, or x86_64" exit 1 fi if [ $1 == "arm" ]; then @@ -75,14 +78,13 @@ generate_flags(){ export ARCH="x86" export TRIPLET="i686-linux-android" export PLATFORM="16" - export ABI="x86" - fi - - if [ $1 == "arm64" ]; then - export ARCH="arm64" - export TRIPLET="aarch64-linux-android" + elif [ $1 == "x86_64" ]; then + export ARCH="x86_64" + export TRIPLET="x86_64-linux-android" export PLATFORM="21" - export ABI="arm64-v8a" + else + echo "please provide the arch e.g arm, arm64, armv7, x86, or x86_64" + exit 1 fi } @@ -91,15 +93,16 @@ get_libindy() { if [ -z ${LIBINDY_DIR} ]; then [ -z ${LIBINDY_BRANCH} ] && exit 1 [ -z ${LIBINDY_VERSION} ] && exit 1 - + SIMPLE_LIBINDY_VERSION=$(echo ${LIBINDY_VERSION} | cut -f1 -d'-') if [ ! -d "libindy_${ARCH}" ]; then + if [ "$LIBINDY_BRANCH" = "stable" ]; then wget https://repo.sovrin.org/android/libindy/${LIBINDY_BRANCH}/${LIBINDY_VERSION}/libindy_android_${ARCH}_${LIBINDY_VERSION}.zip else - wget https://repo.sovrin.org/android/libindy/${LIBINDY_BRANCH}/${LIBINDY_VERSION}-${LIBINDY_TAG}/libindy_android_${ARCH}_${LIBINDY_VERSION}.zip + wget https://repo.sovrin.org/android/libindy/${LIBINDY_BRANCH}/1.7.0-934/libindy_android_${ARCH}_${SIMPLE_LIBINDY_VERSION}.zip fi - unzip libindy_android_${ARCH}_${LIBINDY_VERSION}.zip + unzip libindy_android_${ARCH}_${SIMPLE_LIBINDY_VERSION}.zip fi export LIBINDY_DIR="${PWD}/libindy_${ARCH}" @@ -107,6 +110,43 @@ get_libindy() { } +get_libsovtoken() { + set -xv + # Todo: This artifact was manually uploaded to this repo. Eventually, the file format will change. That is why it is hardcoded + if [ -z ${LIBSOVTOKEN_DIR} ]; then + LIBSOVTOKEN_ZIP=libsovtoken_0.9.6-201811211720-4901e95_all.zip + if [ ! -d "libsovtoken" ]; then + echo "retrieving libsovtoken prebuilt library" + wget ${SOVRIN_REPO}/${LIBSOVTOKEN_ZIP} + unzip ${LIBSOVTOKEN_ZIP} + fi + export LIBSOVTOKEN_DIR="${PWD}/libsovtoken/${TRIPLET}" + fi + +} + +get_libnullpay() { + set -xv + if [ -z ${LIBNULLPAY_DIR} ]; then + [ -z ${LIBINDY_BRANCH} ] && exit 1 + [ -z ${LIBINDY_VERSION} ] && exit 1 + SIMPLE_LIBINDY_VERSION=$(echo ${LIBINDY_VERSION} | cut -f1 -d'-') + if [ ! -d "libnullpay_${ARCH}" ]; then + + if [ "$LIBINDY_BRANCH" = "stable" ]; then + wget https://repo.sovrin.org/android/libnullpay/${LIBINDY_BRANCH}/${LIBINDY_VERSION}/libnullpay_android_${ARCH}_${LIBINDY_VERSION}.zip + else + wget https://repo.sovrin.org/android/libnullpay/${LIBINDY_BRANCH}/1.7.0-934/libnullpay_android_${ARCH}_${SIMPLE_LIBINDY_VERSION}.zip + fi + + unzip libnullpay_android_${ARCH}_${SIMPLE_LIBINDY_VERSION}.zip + + fi + export LIBNULLPAY_DIR="${PWD}/libnullpay_${ARCH}" + fi + +} + build_vcx() { # For Jenkins LIBVCX_PATH=${VCX_BASE}/libvcx/build_scripts/android/vcx/ @@ -119,10 +159,18 @@ build_vcx() { echo "missing libindy_${ARCH} directory. Cannot proceed without it." exit 1 fi + if [ ! -d ${LIBSOVTOKEN_DIR} ]; then + echo "missing libsovtoken directory. Cannot proceed without it." + exit 1 + fi + if [ ! -d ${LIBNULLPAY_DIR} ]; then + echo "missing libnullpay directory. Cannot proceed without it." + exit 1 + fi pushd ${LIBVCX_PATH} mkdir -p toolchains/ - ./build.nondocker.sh ${ARCH} ${PLATFORM} ${TRIPLET} ${OPENSSL_DIR} ${SODIUM_DIR} ${LIBZMQ_DIR} ${LIBINDY_DIR} + ./build.nondocker.sh ${ARCH} ${PLATFORM} ${TRIPLET} ${OPENSSL_DIR} ${SODIUM_DIR} ${LIBZMQ_DIR} ${LIBINDY_DIR} ${LIBSOVTOKEN_DIR} ${LIBNULLPAY_DIR} popd rm -rf libvcx_${ARCH} mv ${LIBVCX_PATH}libvcx_${ARCH} . @@ -131,4 +179,6 @@ build_vcx() { setup $1 get_libindy $1 +get_libsovtoken +get_libnullpay build_vcx $1 diff --git a/vcx/ci/scripts/iosBuild.sh b/vcx/ci/scripts/iosBuild.sh index 3309659990..53cbc17079 100644 --- a/vcx/ci/scripts/iosBuild.sh +++ b/vcx/ci/scripts/iosBuild.sh @@ -3,18 +3,43 @@ set -e export SCRIPTS_PATH="vcx/libvcx/build_scripts/ios/mac" export BASE_DIR="../../../../.." +export WRAPPER_BASE="vcx/wrappers/ios/vcx" export WRAPPER_LIBS="vcx/wrappers/ios/vcx/lib" -IOS_TARGETS="aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios" -#IOS_TARGETS="x86_64-apple-ios" -IOS_ARCHS="arm64,armv7,armv7s,i386,x86_64" -#IOS_ARCHS="x86_64" +IOS_TARGETS="aarch64-apple-ios,armv7-apple-ios,i386-apple-ios,x86_64-apple-ios" +IOS_ARCHS="arm64,armv7,i386,x86_64" +#IOS_TARGETS="x86_64-apple-ios,i386-apple-ios" +#IOS_ARCHS="x86_64,i386" + + +function printStartProgress { + echo "==================" + echo "Starting" + echo $1 + echo "==================" + echo +} + +function printEndProgress { + echo + echo "+++++++++++++++++" + echo "Finished" + echo $1 + echo "+++++++++++++++++" +} + +function progress { + printStartProgress $1 + $1 + printEndProgress $1 +} cd ${SCRIPTS_PATH} -./mac.01.libindy.setup.sh -./mac.02.libindy.env.sh -./mac.03.libindy.build.sh + +progress ./mac.01.libindy.setup.sh +progress ./mac.02.libindy.env.sh +progress ./mac.03.libindy.build.sh #./mac.04.libvcx.setup.sh -source ./mac.05.libvcx.env.sh +progress 'source ./mac.05.libvcx.env.sh' cp -rf ~/OpenSSL-for-iPhone ${BASE_DIR}/.macosbuild cp -rf ~/libzmq-ios ${BASE_DIR}/.macosbuild cp -rf ~/combine-libs ${BASE_DIR}/.macosbuild @@ -30,6 +55,12 @@ if [ ! -z "$(ls -A /Users/jenkins/IOSBuilds/libvcxall/)" ]; then rm /Users/jenkins/IOSBuilds/libvcxall/* fi +# Retrieve libindy ios wrapper +#git clone https://github.com/hyperledger/indy-sdk.git +#cd indy-sdk +#git checkout tags/v1.7.0 +#cd .. +#cp -rf indy-sdk/wrappers/ios/libindy-pod/Indy ${WRAPPER_BASE} # Package for all architectures (simulator architectures included) ./mac.11.copy.static.libs.to.app.sh ./mac.12.combine.static.libs.sh libvcxall delete nodebug "${IOS_ARCHS}" diff --git a/vcx/ci/scripts/package.sh b/vcx/ci/scripts/package.sh index 7cf0a84a04..55a3fd35f2 100755 --- a/vcx/ci/scripts/package.sh +++ b/vcx/ci/scripts/package.sh @@ -1,11 +1,23 @@ #!/bin/bash +set -e OUTPUTDIR=output CURDIR=$(pwd) export PATH=${PATH}:$(pwd)/vcx/ci/scripts cd vcx/libvcx/ +echo "Updating Version in Cargo.toml file" cargo update-version -cargo test --no-default-features --features "ci" -- --test-threads=1 +echo "Updating Cargo" +if [ "$1" != "--no-test" ]; then + echo "Testing libvcx.so" + cargo test --no-default-features --features "ci" -- --test-threads=1 +fi +echo "Building libvcx.so" cargo build --no-default-features --features "ci" +echo "Updating libvcx.so File with Version" cargo update-so +echo "Creating Libvcx Debian File" cargo deb --no-build +echo "Moving Libvcx Debian File to Output Directory" cp target/debian/*.deb $CURDIR/$OUTPUTDIR + + diff --git a/vcx/ci/scripts/toml_utils.py b/vcx/ci/scripts/toml_utils.py index 2aaf732cc6..86708bdbcf 100755 --- a/vcx/ci/scripts/toml_utils.py +++ b/vcx/ci/scripts/toml_utils.py @@ -8,7 +8,7 @@ SO_FILE = 'libvcx.so' def valid_line(line): - return ('version =' in line or 'version=' in line) and ('uuid' not in line and 'rusqlite' not in line) + return ('version =' in line or 'version=' in line) and ('uuid' not in line and 'rusqlite' not in line and 'indy' not in line) # update the so file with the major minor build def update_so(src_dir, version): diff --git a/vcx/libvcx/Cargo.lock b/vcx/libvcx/Cargo.lock index 9113880c94..4577f65cb9 100644 --- a/vcx/libvcx/Cargo.lock +++ b/vcx/libvcx/Cargo.lock @@ -532,7 +532,7 @@ dependencies = [ [[package]] name = "libvcx" -version = "0.2.0" +version = "0.2.32607753" dependencies = [ "android_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/vcx/libvcx/Cargo.toml b/vcx/libvcx/Cargo.toml index d272d807e9..b1f82a1d40 100644 --- a/vcx/libvcx/Cargo.toml +++ b/vcx/libvcx/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "libvcx" -version = "0.2.0" + +version = "0.2.32607753" authors = [ "Evernym Inc." ] publish = false description = "This is the official SDK for Evernym's VCX" @@ -68,11 +69,12 @@ dirs = "1.0.4" [package.metadata.deb] maintainer = "Evernym, Inc." copyright = "2018, Evernym Inc." -depends = "$auto, libindy (=1.7.0)" + +depends = "$auto, libindy (>=1.7.0~942)" extended-description = """\ This is Evernym's SDK for managing Verifiable Credential eXchange against an Indy network. For specific instructions on building see the README in the corresponding github repo https://github.com/evernym/sdk""" section = "admin" -revision = "338ad01" +revision = "a26ad4f" priority = "optional" assets = [ ["target/debug/libvcx.so.*", "usr/lib/", "644"], diff --git a/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh b/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh index f838d9b57a..8032ba3f8c 100755 --- a/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh +++ b/vcx/libvcx/build_scripts/android/vcx/build.nondocker.sh @@ -6,6 +6,8 @@ TARGET_API=$2 CROSS_COMPILE=$3 NDK_LIB_DIR="lib" +set -e + if [ -z "${TARGET_ARCH}" ]; then echo STDERR "Missing TARGET_ARCH argument" echo STDERR "e.g. x86 or arm" @@ -92,9 +94,53 @@ if [ -z "${LIBINDY_DIR}" ] ; then fi if [ -d "${LIBINDY_DIR}/lib" ] ; then - LIBINDY_DIR="${LIBINDY_DIR}/lib" + LIBINDY_DIR="${LIBINDY_DIR}/lib" +fi + +#if [ -z "${LIBSOVTOKEN_DIR}" ] ; then +# LIBSOVTOKEN_DIR="libsovtoken" +# if [ -d "${LIBSOVTOKEN_DIR}" ] ; then +# echo "Found ${LIBSOVTOKEN_DIR}" +# elif [ -z "$8" ] ; then +# echo STDERR "Missing LIBSOVTOKEN_DIR argument and environment variable" +# echo STDERR "e.g. set LIBSOVTOKEN_DIR= for environment or libsovtoken" +# exit 1 +# else +# LIBSOVTOKEN_DIR=$8 +# fi +# if [ -d "${LIBSOVTOKEN_DIR}/${CROSS_COMPILE}" ] ; then +# LIBSOVTOKEN_DIR=${LIBSOVTOKEN_DIR}/${CROSS_COMPILE} +# fi +# export LIBSOVTOKEN_DIR=${LIBSOVTOKEN_DIR} +#fi +#if [ -d "${LIBSOVTOKEN_DIR}/lib" ] ; then +# LIBSOVTOKEN_DIR="${LIBSOVTOKEN_DIR}/lib" +#fi + +echo ${LIBNULLPAY_DIR} +if [ -z "${LIBNULLPAY_DIR}" ] ; then + LIBNULLPAY_DIR="libnullpay" + if [ -d "${LIBNULLPAY_DIR}" ] ; then + echo "Found ${LIBNULLPAY_DIR}" + elif [ -z "$9" ] ; then + echo STDERR "Missing LIBNULLPAY_DIR argument and environment variable" + echo STDERR "e.g. set LIBNULLPAY_DIR= for environment or libnullpay" + exit 1 + else + LIBNULLPAY_DIR=$9 + fi + if [ -d "${LIBNULLPAY_DIR}/${CROSS_COMPILE}" ] ; then + LIBNULLPAY_DIR=${LIBNULLPAY_DIR}/${CROSS_COMPILE} + fi + export LIBNULLPAY_DIR=${LIBNULLPAY_DIR} +fi +if [ -d "${LIBNULLPAY_DIR}/lib" ] ; then + LIBNULLPAY_DIR="${LIBNULLPAY_DIR}/lib" + echo ${LIBNULLPAY_DIR} fi + + if [ "$(uname)" == "Darwin" ]; then echo "Downloading NDK for OSX" export TOOLCHAIN_PREFIX=${WORKDIR}/toolchains/darwin @@ -125,12 +171,6 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then popd fi -#LIBVCX=${WORKDIR}/sdk/vcx/libvcx/ -#cp -rf ./../../../../../vcx/libvcx/include ${LIBVCX} -#cp -rf ./../../../../../vcx/libvcx/scripts ${LIBVCX} -#cp -rf ./../../../../../vcx/libvcx/src ${LIBVCX} -#cp -rf ./../../../../../vcx/libvcx/build.rs ${LIBVCX} -#cp -rf ./../../../../../vcx/libvcx/Cargo.toml ${LIBVCX} LIBVCX=../../../ CROSS_COMPILE_DIR=${CROSS_COMPILE} @@ -197,6 +237,7 @@ ${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 \ ${LIBINDY_DIR}/libindy.a \ +${LIBNULLPAY_DIR}/libnullpay.a \ ${TOOLCHAIN_DIR}/${CROSS_COMPILE_DIR}/${NDK_LIB_DIR}/libgnustl_shared.so \ ${OPENSSL_DIR}/lib/libssl.a \ ${OPENSSL_DIR}/lib/libcrypto.a \ diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh b/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh index 80775593a2..fe4d9cef70 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh @@ -1,5 +1,4 @@ #!/bin/sh - #1) Install Rust and rustup (https://www.rust-lang.org/install.html). #To get into the if statement below execute the following command... # mv /Users/norm/.cargo/bin/rustup /Users/norm/.cargo/bin/rustup.bak @@ -44,11 +43,15 @@ fi if [[ $RUSTUP_VERSION =~ ^'rustup ' ]]; then rustup update - rustup default 1.31.0 + rustup default 1.31.1 rustup component add rls-preview rust-analysis rust-src echo "Using rustc version $(rustc --version)" - rustup target remove aarch64-linux-android armv7-linux-androideabi arm-linux-androideabi i686-linux-android x86_64-linux-android - rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios + # rustup target remove aarch64-linux-android + # rustup target remove armv7-linux-androideabi + # rustup target remove arm-linux-androideabi + # rustup target remove i686-linux-android + # rustup target remove x86_64-linux-android + rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios RUST_TARGETS=$(rustc --print target-list|grep -i ios) if [ "$RUST_TARGETS" = "" ]; then @@ -63,8 +66,8 @@ if [[ $RUSTUP_VERSION =~ ^'rustup ' ]]; then exit 1 fi - cargo install cargo-lipo - cargo install cargo-xcode + cargo install --force cargo-lipo + cargo install --force cargo-xcode BREW_VERSION=`brew --version` if ! [[ $BREW_VERSION =~ ^'Homebrew ' ]]; then diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.03.libindy.build.sh b/vcx/libvcx/build_scripts/ios/mac/mac.03.libindy.build.sh index 7d3371d22a..b7b1834308 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.03.libindy.build.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.03.libindy.build.sh @@ -37,6 +37,7 @@ if [ "$#" -gt 0 ]; then #git checkout tags/v1.3.0 else git checkout -- libindy/Cargo.toml + git checkout -- libnullpay/Cargo.toml fi git log -1 > $WORK_DIR/hyperledger.indy-sdk.git.commit.log @@ -92,8 +93,44 @@ else cd ${BUILD_CACHE}/libindy/${LIBINDY_VERSION} curl -o ${LIBINDY_VERSION}-${LIBINDY_FILE} $LIBINDY_IOS_BUILD_URL tar -xvzf ${LIBINDY_VERSION}-${LIBINDY_FILE} + # Deletes extra folders that we don't need rm -rf __MACOSX rm ${LIBINDY_VERSION}-${LIBINDY_FILE} fi + + + ######################################################################################################################### + # Now setup libsovtoken + ######################################################################################################################### + + if [ -e ${BUILD_CACHE}/libsovtoken-ios/${LIBSOVTOKEN_VERSION}/libsovtoken/universal/libsovtoken.a ]; then + echo "libsovtoken build for ios already exist" + else + mkdir -p ${BUILD_CACHE}/libsovtoken-ios/${LIBSOVTOKEN_VERSION} + cd ${BUILD_CACHE}/libsovtoken-ios/${LIBSOVTOKEN_VERSION} + curl --insecure -o ${LIBSOVTOKEN_VERSION}-${LIBSOVTOKEN_FILE} ${LIBSOVTOKEN_IOS_BUILD_URL} + unzip ${LIBSOVTOKEN_VERSION}-${LIBSOVTOKEN_FILE} + # Deletes extra folders that we don't need + rm -rf __MACOSX + rm ${LIBSOVTOKEN_VERSION}-${LIBSOVTOKEN_FILE} + fi + + ######################################################################################################################### + # Now setup libnullpay + ######################################################################################################################### + + if [ -e ${BUILD_CACHE}/libnullpay/${LIBNULLPAY_VERSION}/libnullpay.a ]; then + echo "libnullpay build for ios already exist" + else + mkdir -p ${BUILD_CACHE}/libnullpay/${LIBNULLPAY_VERSION} + cd ${BUILD_CACHE}/libnullpay/${LIBNULLPAY_VERSION} + curl -o ${LIBNULLPAY_VERSION}-${LIBNULLPAY_FILE} $LIBNULLPAY_IOS_BUILD_URL + tar -xvzf ${LIBNULLPAY_VERSION}-${LIBNULLPAY_FILE} + + # Deletes extra folders that we don't need + rm -rf __MACOSX + rm ${LIBNULLPAY_VERSION}-${LIBNULLPAY_FILE} + fi + fi diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.06.libvcx.build.sh b/vcx/libvcx/build_scripts/ios/mac/mac.06.libvcx.build.sh index 19196361ba..7980bca135 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.06.libvcx.build.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.06.libvcx.build.sh @@ -24,7 +24,9 @@ if [ "$DEBUG_SYMBOLS" = "nodebug" ]; then sed -i .bak 's/debug = true/debug = false/' Cargo.toml fi -IOS_TARGETS="aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios" +# removing 'armv7s-apple-ios' from the master build, as its not currently +# required, just a 'nice to have' +IOS_TARGETS="aarch64-apple-ios,armv7-apple-ios,i386-apple-ios,x86_64-apple-ios" if [ ! -z "$2" ]; then IOS_TARGETS=$2 fi @@ -97,4 +99,4 @@ lipo -create $to_combine -o ./target/universal/release/libvcx.a # echo "Copying iOS target folder into directory: $(abspath "${BUILD_CACHE}")" # cp -rfp ./target ${BUILD_CACHE} -export OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR_DARWIN \ No newline at end of file +export OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR_DARWIN diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.11.copy.static.libs.to.app.sh b/vcx/libvcx/build_scripts/ios/mac/mac.11.copy.static.libs.to.app.sh index 0486e78927..3cfa6d4bf8 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.11.copy.static.libs.to.app.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.11.copy.static.libs.to.app.sh @@ -14,11 +14,11 @@ VCX_SDK=$(abspath "$VCX_SDK") LIBSSL=$WORK_DIR/OpenSSL-for-iPhone LIBZMQ=$WORK_DIR/libzmq-ios -#cp -v $INDY_SDK/libindy/target/universal/release/libindy.a $VCX_SDK/vcx/wrappers/ios/vcx/lib cp -v $VCX_SDK/vcx/libvcx/target/universal/release/libvcx.a $VCX_SDK/vcx/wrappers/ios/vcx/lib/libvcx.a.tocombine -#cp -v $LIBSSL/lib/libcrypto.a $VCX_SDK/vcx/wrappers/ios/vcx/lib -#cp -v $LIBSSL/lib/libssl.a $VCX_SDK/vcx/wrappers/ios/vcx/lib cp -v $LIBZMQ/dist/ios/lib/libzmq.a $VCX_SDK/vcx/wrappers/ios/vcx/lib/libzmq.a.tocombine cp -v $LIBZMQ/libsodium-ios/dist/ios/lib/libsodium.a $VCX_SDK/vcx/wrappers/ios/vcx/lib/libsodium.a.tocombine -#cp -v $WORK_DIR/combine-libs/libsqlite3/libsqlite3.a $VCX_SDK/vcx/wrappers/ios/vcx/lib -#cp -v $WORK_DIR/combine-libs/libminiz/libminiz.a $VCX_SDK/vcx/wrappers/ios/vcx/lib + +# sovtoken and nullpay +cp -v ${BUILD_CACHE}/libnullpay/${LIBNULLPAY_VERSION}/libnullpay.a $VCX_SDK/vcx/wrappers/ios/vcx/lib/libnullpay.a.tocombine +# TODO: libsovtoken builds need to be combined into one .a +#cp -v ${BUILD_CACHE}/libsovtoken-ios/${LIBSOVTOKEN_VERSION}/libsovtoken.a $VCX_SDK/vcx/wrappers/ios/vcx/lib/libsovtoken.a.tocombine diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.12.combine.static.libs.sh b/vcx/libvcx/build_scripts/ios/mac/mac.12.combine.static.libs.sh index 79cd002424..103942d749 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.12.combine.static.libs.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.12.combine.static.libs.sh @@ -48,7 +48,7 @@ if [ ! -z "$3" ]; then DEBUG_SYMBOLS=$3 fi -IOS_ARCHS="arm64,armv7,armv7s,i386,x86_64" +IOS_ARCHS="arm64,armv7,i386,x86_64" if [ ! -z "$4" ]; then IOS_ARCHS=$4 fi diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.13.build.cocoapod.sh b/vcx/libvcx/build_scripts/ios/mac/mac.13.build.cocoapod.sh index 0403393faf..1653992a01 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.13.build.cocoapod.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.13.build.cocoapod.sh @@ -15,7 +15,7 @@ COMBINED_LIB=$1 DATETIME=$(date +"%Y%m%d.%H%M") -IOS_ARCHS="arm64,armv7,armv7s,i386,x86_64" +IOS_ARCHS="arm64,armv7,i386,x86_64" if [ ! -z "$2" ]; then IOS_ARCHS=$2 fi @@ -26,6 +26,8 @@ echo "Building vcx.${COMBINED_LIB} wrapper for architectures: ${archs[@]}" ## IFS="$bkpIFS" cd $VCX_SDK/vcx/wrappers/ios/vcx #mv lib/libvcx.a lib/libvcx.a.original + +tar -czf ~/IOSBuilds/${COMBINED_LIB}/libvcx.a.${COMBINED_LIB}_${DATETIME}_universal.tar.gz $VCX_SDK/vcx/wrappers/ios/vcx/lib/${COMBINED_LIB}.a cp -v lib/${COMBINED_LIB}.a lib/libvcx.a xcodebuild -project vcx.xcodeproj -scheme vcx -configuration Debug CONFIGURATION_BUILD_DIR=. clean @@ -74,7 +76,7 @@ cp $WORK_DIR/hyperledger.indy-sdk.git.commit.log $VCX_SDK/vcx/wrappers/ios/vcx/t zip -r vcx.${COMBINED_LIB}_${DATETIME}_universal.zip vcx mkdir -p ~/IOSBuilds/${COMBINED_LIB} -cp $VCX_SDK/vcx/wrappers/ios/vcx/tmp/vcx.${COMBINED_LIB}_${DATETIME}_universal.zip ~/IOSBuilds/${COMBINED_LIB} +cp -v $VCX_SDK/vcx/wrappers/ios/vcx/tmp/vcx.${COMBINED_LIB}_${DATETIME}_universal.zip ~/IOSBuilds/${COMBINED_LIB} #curl --insecure -u normjarvis -X POST -F file=@./vcx.${COMBINED_LIB}_${DATETIME}_universal.zip https://kraken.corp.evernym.com/repo/ios/upload # Download the file at https://repo.corp.evernym.com/filely/ios/vcx.${COMBINED_LIB}_${DATETIME}_universal.zip diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.verify.successful.build.of.libraries.sh b/vcx/libvcx/build_scripts/ios/mac/mac.verify.successful.build.of.libraries.sh index 4fb035d829..23bd44bbb7 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.verify.successful.build.of.libraries.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.verify.successful.build.of.libraries.sh @@ -24,6 +24,9 @@ echo "-------------------------------------------------------------------------- cd $WORK_DIR/vcx-indy-sdk/libindy/target ls -al `find . -name "*.a"` echo "-----------------------------------------------------------------------------------------------------------------------------------------------" +cd $WORK_DIR/vcx-indy-sdk/libnullpay/target +ls -al `find . -name "*.a"` +echo "-----------------------------------------------------------------------------------------------------------------------------------------------" cd $START_DIR grep "error:" ./mac.06.libvcx.build.sh.out echo "-----------------------------------------------------------------------------------------------------------------------------------------------" diff --git a/vcx/libvcx/build_scripts/ios/mac/shared.functions.sh b/vcx/libvcx/build_scripts/ios/mac/shared.functions.sh index 5e7fcb6582..979b638786 100644 --- a/vcx/libvcx/build_scripts/ios/mac/shared.functions.sh +++ b/vcx/libvcx/build_scripts/ios/mac/shared.functions.sh @@ -1,9 +1,15 @@ #!/bin/sh -export LIBINDY_IOS_BUILD_URL="https://repo.sovrin.org/ios/libindy/stable/libindy-core/1.7.0/libindy.tar.gz" +export LIBSOVTOKEN_IOS_BUILD_URL="https://repo.sovrin.org/ios/libsovtoken/stable/libsovtoken_0.9.6-201811211710-4901e95_all.zip" +export LIBINDY_IOS_BUILD_URL="https://repo.sovrin.org/ios/libindy/master/libindy-core/1.7.0-934/libindy.tar.gz" +export LIBNULLPAY_IOS_BUILD_URL="https://repo.sovrin.org/ios/libnullpay/master/libnullpay-core/1.7.0-934/libnullpay.tar.gz" +export LIBSOVTOKEN_FILE=$(basename ${LIBSOVTOKEN_IOS_BUILD_URL}) +export LIBSOVTOKEN_VERSION=$(echo ${LIBSOVTOKEN_FILE} | cut -d'_' -f 2) export LIBINDY_FILE=$(basename ${LIBINDY_IOS_BUILD_URL}) export LIBINDY_VERSION=$(basename $(dirname ${LIBINDY_IOS_BUILD_URL})) +export LIBNULLPAY_FILE=$(basename ${LIBNULLPAY_IOS_BUILD_URL}) +export LIBNULLPAY_VERSION=$(basename $(dirname ${LIBNULLPAY_IOS_BUILD_URL})) export BUILD_CACHE=~/.build_libvxc/ioscache mkdir -p ${BUILD_CACHE} diff --git a/vcx/libvcx/include/vcx.h b/vcx/libvcx/include/vcx.h index 4b4680b116..450c09a419 100644 --- a/vcx/libvcx/include/vcx.h +++ b/vcx/libvcx/include/vcx.h @@ -40,6 +40,23 @@ typedef enum invalid = 2, } vcx_proof_state_t; +// Initialize sovtoken plugin +// +// #Returns +// Success +//vcx_error_t sovtoken_init(); +vcx_error_t nullpay_init(); + +// Reset libvcx to a pre-configured state, releasing/deleting any handles and freeing memory +// +// libvcx will be inoperable and must be initialized again with vcx_init_with_config +// +// #Params +// delete: specify whether wallet/pool should be deleted +// +// #Returns +// Successt(); +//vcx_error_t nullpay_init(); // Provision an agent in the agency, populate configuration and wallet for this agent. // NOTE: for synchronous call use vcx_provision_agent diff --git a/vcx/wrappers/ios/vcx/ConnectMeVcx.h b/vcx/wrappers/ios/vcx/ConnectMeVcx.h index ceb9977218..84b91e0c39 100644 --- a/vcx/wrappers/ios/vcx/ConnectMeVcx.h +++ b/vcx/wrappers/ios/vcx/ConnectMeVcx.h @@ -75,6 +75,10 @@ extern void VcxWrapperCommonNumberStringCallback(vcx_command_handle_t xcommand_h @interface ConnectMeVcx : NSObject +//- (int)initSovToken; + +- (int)initNullPay; + - (void)initWithConfig:(NSString *)config completion:(void (^)(NSError *error))completion; diff --git a/vcx/wrappers/ios/vcx/ConnectMeVcx.m b/vcx/wrappers/ios/vcx/ConnectMeVcx.m index 6513ae2a55..a3e2e68cab 100644 --- a/vcx/wrappers/ios/vcx/ConnectMeVcx.m +++ b/vcx/wrappers/ios/vcx/ConnectMeVcx.m @@ -311,6 +311,14 @@ void VcxWrapperCommonNumberStringCallback(vcx_command_handle_t xcommand_handle, @implementation ConnectMeVcx +//- (int)initSovToken { +// return sovtoken_init(); +//} + +- (int)initNullPay { + return nullpay_init(); +} + - (void)initWithConfig:(NSString *)config completion:(void (^)(NSError *error))completion { diff --git a/vcx/wrappers/ios/vcx/include/libvcx.h b/vcx/wrappers/ios/vcx/include/libvcx.h index 3152b053cd..7c962d549e 100644 --- a/vcx/wrappers/ios/vcx/include/libvcx.h +++ b/vcx/wrappers/ios/vcx/include/libvcx.h @@ -50,6 +50,10 @@ typedef struct } vcx_status_t; +/** Initialize Sovtoken & nullpay*/ +//vcx_error_t sovtoken_init(); +vcx_error_t nullpay_init(); + /** * Initialize the SDK */ diff --git a/vcx/wrappers/ios/vcx/vcx.framework/Headers/libvcx.h b/vcx/wrappers/ios/vcx/vcx.framework/Headers/libvcx.h index 7329146a8d..8937cec86d 100644 --- a/vcx/wrappers/ios/vcx/vcx.framework/Headers/libvcx.h +++ b/vcx/wrappers/ios/vcx/vcx.framework/Headers/libvcx.h @@ -49,6 +49,10 @@ typedef struct } vcx_status_t; +/** Initialize Sovtoken & nullpay*/ +//vcx_error_t sovtoken_init(); +vcx_error_t nullpay_init(); + /** * Initialize the SDK */ diff --git a/vcx/wrappers/ios/vcx/vcx.xcodeproj/project.pbxproj b/vcx/wrappers/ios/vcx/vcx.xcodeproj/project.pbxproj index f12a4103c7..14ea75e0c9 100644 --- a/vcx/wrappers/ios/vcx/vcx.xcodeproj/project.pbxproj +++ b/vcx/wrappers/ios/vcx/vcx.xcodeproj/project.pbxproj @@ -45,8 +45,6 @@ DD858CBF20A4AF7C004B3CB5 /* VcxTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = DD858CB920A4AF7B004B3CB5 /* VcxTypes.h */; }; DD858CC020A4AF7C004B3CB5 /* NSError+VcxError.h in Headers */ = {isa = PBXBuildFile; fileRef = DD858CBA20A4AF7B004B3CB5 /* NSError+VcxError.h */; }; DD858CC120A4AF7C004B3CB5 /* NSError+VcxError.m in Sources */ = {isa = PBXBuildFile; fileRef = DD858CBB20A4AF7C004B3CB5 /* NSError+VcxError.m */; }; - DDCC82A621C23D5C00413CCC /* VcxLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DDCC82A521C23D5C00413CCC /* VcxLogger.m */; }; - DDCC82A821C23D6D00413CCC /* VcxLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DDCC82A721C23D6D00413CCC /* VcxLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -129,8 +127,6 @@ DD858CBB20A4AF7C004B3CB5 /* NSError+VcxError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+VcxError.m"; sourceTree = ""; }; DD858CC220A53DCB004B3CB5 /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; }; DD858CC420A53DD7004B3CB5 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; - DDCC82A521C23D5C00413CCC /* VcxLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VcxLogger.m; sourceTree = ""; }; - DDCC82A721C23D6D00413CCC /* VcxLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VcxLogger.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -278,8 +274,6 @@ DD858CB820A4AF7B004B3CB5 /* VcxCallbacks.mm */, DD858CB720A4AF7B004B3CB5 /* VcxErrors.h */, DD858CB920A4AF7B004B3CB5 /* VcxTypes.h */, - DDCC82A521C23D5C00413CCC /* VcxLogger.m */, - DDCC82A721C23D6D00413CCC /* VcxLogger.h */, ); path = utils; sourceTree = ""; @@ -296,7 +290,6 @@ DD858C9F20A45C11004B3CB5 /* ConnectMeVcx.h in Headers */, DD2566FF209705E3002EBEBA /* vcx.h in Headers */, DD858CBD20A4AF7C004B3CB5 /* VcxErrors.h in Headers */, - DDCC82A821C23D6D00413CCC /* VcxLogger.h in Headers */, DD858CBF20A4AF7C004B3CB5 /* VcxTypes.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -520,7 +513,6 @@ DD858CBE20A4AF7C004B3CB5 /* VcxCallbacks.mm in Sources */, DD858C9E20A45C11004B3CB5 /* ConnectMeVcx.m in Sources */, DD858CC120A4AF7C004B3CB5 /* NSError+VcxError.m in Sources */, - DDCC82A621C23D5C00413CCC /* VcxLogger.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/vcx/wrappers/java/ci/android.dockerfile b/vcx/wrappers/java/ci/android.dockerfile index b4d25ad42c..fd9e9fb078 100644 --- a/vcx/wrappers/java/ci/android.dockerfile +++ b/vcx/wrappers/java/ci/android.dockerfile @@ -9,17 +9,17 @@ RUN apt-get update -y && apt-get install -y \ maven # Install Android SDK and NDK -RUN mkdir -m 777 /home/android/android-sdk-linux +RUN mkdir -m 777 -p /home/android/android-sdk-linux RUN wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip -P /home/android/android-sdk-linux RUN unzip /home/android/android-sdk-linux/tools_r25.2.3-linux.zip -d /home/android/android-sdk-linux RUN ls -al /home/android/android-sdk-linux RUN yes | .//home/android/android-sdk-linux/tools/android update sdk --no-ui RUN yes | .//home/android/android-sdk-linux/tools/bin/sdkmanager "ndk-bundle" - - RUN echo "android ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +# Todo: I thing this ARG can be removed. It is set in the Jenkins file +ARG RUST_VER=1.31.1 USER android -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.31.0 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VER} ENV PATH /home/android/.cargo/bin:$PATH diff --git a/vcx/wrappers/java/ci/publishJar.sh b/vcx/wrappers/java/ci/publishJar.sh index e014a7f46f..8414cc9d0c 100755 --- a/vcx/wrappers/java/ci/publishJar.sh +++ b/vcx/wrappers/java/ci/publishJar.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash set -e -JAR_FOLDER=artifacts/jar +JAR_FOLDER=vcx/wrappers/java/artifacts/jar JAR_VERSION=$(find ${JAR_FOLDER} -type f -name 'com.evernym-vcx-*.jar'| perl -nle 'print $& if m{(?<=vcx-)(.*)(?=.jar)}' | head -1 | awk '{print $1}') echo "Uploading .jar with version number ==> ${JAR_VERSION}" cp -v settings.xml ${JAR_FOLDER} pushd ${JAR_FOLDER} mvn -e deploy:deploy-file \ - -Durl='${mavenRepo.url}' \ - -DrepositoryId='${mavenRepo.id}' \ + -Durl="https://repo.evernym.com/artifactory/libindy-maven-local" \ + -DrepositoryId="artifactory-evernym" \ -Dversion=${JAR_VERSION} \ -Dname="vcx" \ -Dfile="com.evernym-vcx-${JAR_VERSION}.jar" \ diff --git a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/LibVcx.java b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/LibVcx.java index 0496c43a74..f2eeebe2d1 100644 --- a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/LibVcx.java +++ b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/LibVcx.java @@ -26,6 +26,12 @@ public int vcx_init_with_config(int command_handle, public int vcx_shutdown(boolean delete); public int vcx_reset(); + /** + * Sovtoken & nullpay + */ +// public int sovtoken_init(); + public int nullpay_init(); + /** * Helper API for testing purposes. */ @@ -136,7 +142,7 @@ public int vcx_init_with_config(int command_handle, */ /** Creates a credential object from the specified credentialdef handle. Populates a handle the new credential. */ - public int vcx_issuer_create_credential(int command_handle, String source_id, int cred_def_handle, String issuer_did, String credential_data, String credential_name, String price, Callback cb); + public int vcx_issuer_create_credential(int command_handle, String source_id, String cred_def_id, String issuer_did, String credential_data, String credential_name, long price, Callback cb); /** Asynchronously sends the credential offer to the connection. */ public int vcx_issuer_send_credential_offer(int command_handle, int credential_handle, int connection_handle, Callback cb); @@ -431,6 +437,7 @@ public int vcx_init_with_config(int command_handle, } catch (UnsatisfiedLinkError ex) { // Library could not be found in standard OS locations. // Call init(File file) explicitly with absolute library path. + ex.printStackTrace(); } } diff --git a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxJava.java b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxJava.java index 9303485d7b..85daf14636 100644 --- a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxJava.java +++ b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/VcxJava.java @@ -98,7 +98,7 @@ protected static boolean checkCallback(CompletableFuture future, int err) { errorCode = ErrorCode.UNKNOWN_ERROR; } } catch(Exception e) { - logger.warn(e.getLocalizedMessage()); + //TODO Log exception to the logger } if (! ErrorCode.SUCCESS.equals(errorCode)) { diff --git a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/issuer/IssuerApi.java b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/issuer/IssuerApi.java index 64854cad98..ed5152638c 100644 --- a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/issuer/IssuerApi.java +++ b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/issuer/IssuerApi.java @@ -6,29 +6,31 @@ import com.evernym.sdk.vcx.VcxJava; import com.sun.jna.Callback; +import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java9.util.concurrent.CompletableFuture; +import java.util.*; +import java9.util.concurrent.CompletableFuture; public class IssuerApi extends VcxJava.API { private static final Logger logger = LoggerFactory.getLogger("IssuerApi"); - private static Callback issuerCreateCredentialCB = new Callback() { + private static final Callback issuerCreateCredentialCB = new Callback() { // TODO: This callback and jna definition needs to be fixed for this API // it should accept connection handle as well @SuppressWarnings({"unused", "unchecked"}) - public void callback(int commandHandle, int err, int credentialHandle) { - logger.debug("callback() called with: commandHandle = [" + commandHandle + "], err = [" + err + "], credntialHandle = [" + credentialHandle + "]"); + public void callback(int commandHandle, int err, int credntialHandle) { + logger.debug("callback() called with: commandHandle = [" + commandHandle + "], err = [" + err + "], credntialHandle = [" + credntialHandle + "]"); CompletableFuture future = (CompletableFuture) removeFuture(commandHandle); if (!checkCallback(future, err)) return; - Integer result = credentialHandle; + Integer result = credntialHandle; future.complete(result); } }; public static CompletableFuture issuerCreateCredential(String sourceId, - int credentialDefHandle, + String credentialDefId, String issuerId, String credentialData, String credentialName, @@ -37,7 +39,7 @@ public static CompletableFuture issuerCreateCredential(String sourceId, ParamGuard.notNullOrWhiteSpace(sourceId, "credentialDefId"); ParamGuard.notNullOrWhiteSpace(sourceId, "SchemaId"); - logger.debug("issuerCreateCredential() called with: sourceId = [" + sourceId + "], credentialDefHandle = [" + credentialDefHandle + "], issuerId = [" + issuerId + "], credentialData = [" + credentialData + "], credentialName = [" + credentialName + "], price = [" + price + "]"); + logger.debug("issuerCreateCredential() called with: sourceId = [" + sourceId + "], credentialDefId = [" + credentialDefId + "], issuerId = [" + issuerId + "], credentialData = [" + credentialData + "], credentialName = [" + credentialName + "], price = [" + price + "]"); //TODO: Check for more mandatory params in vcx to add in PamaGuard CompletableFuture future = new CompletableFuture<>(); int issue = addFuture(future); @@ -45,11 +47,11 @@ public static CompletableFuture issuerCreateCredential(String sourceId, int result = LibVcx.api.vcx_issuer_create_credential( issue, sourceId, - credentialDefHandle, + credentialDefId, issuerId, credentialData, credentialName, - String.valueOf(price), + price, issuerCreateCredentialCB); checkResult(result); return future; @@ -89,7 +91,7 @@ public static CompletableFuture issuerSendcredentialOffer(int credentia return future; } - private static Callback issuerCredentialUpdateStateCB = new Callback() { + private static Callback issuerCredntialUpdateStateCB = new Callback() { @SuppressWarnings({"unused", "unchecked"}) public void callback(int commandHandle, int err,int state) { logger.debug("callback() called with: commandHandle = [" + commandHandle + "], err = [" + err + "], state = [" + state + "]"); @@ -99,12 +101,12 @@ public void callback(int commandHandle, int err,int state) { } }; - public static CompletableFuture issuerCredentialUpdateState(int credentialHandle) throws VcxException { + public static CompletableFuture issuerCredntialUpdateState(int credentialHandle) throws VcxException { ParamGuard.notNull(credentialHandle, "credentialHandle"); logger.debug("issuerCredntialUpdateState() called with: credentialHandle = [" + credentialHandle + "]"); CompletableFuture future = new CompletableFuture<>(); int issue = addFuture(future); - int result = LibVcx.api.vcx_issuer_credential_update_state(issue, credentialHandle, issuerCredentialUpdateStateCB); + int result = LibVcx.api.vcx_credential_update_state(issue, credentialHandle, issuerCredntialUpdateStateCB); checkResult(result); return future; } @@ -124,7 +126,7 @@ public static CompletableFuture issuerCredntialGetState(int credentialH logger.debug("issuerCredntialGetState() called with: credentialHandle = [" + credentialHandle + "]"); CompletableFuture future = new CompletableFuture<>(); int issue = addFuture(future); - int result = LibVcx.api.vcx_issuer_credential_get_state(issue, credentialHandle, issuerCredntialGetStateCB); + int result = LibVcx.api.vcx_connection_get_state(issue, credentialHandle, issuerCredntialGetStateCB); checkResult(result); return future; } diff --git a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/vcx/VcxApi.java b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/vcx/VcxApi.java index afaef8faed..5a2c95fdb8 100644 --- a/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/vcx/VcxApi.java +++ b/vcx/wrappers/java/src/main/java/com/evernym/sdk/vcx/vcx/VcxApi.java @@ -17,6 +17,20 @@ public class VcxApi extends VcxJava.API { private VcxApi() { } +// public static int initSovToken() throws VcxException { +// logger.debug("initSovToken()"); +// int result = LibVcx.api.sovtoken_init(); +// checkResult(result); +// return result; +// } + + public static int initNullPay() throws VcxException { + logger.debug("initNullPay()"); + int result = LibVcx.api.nullpay_init(); + checkResult(result); + return result; + } + private static Callback vcxIniWithConfigCB = new Callback() { @SuppressWarnings({"unused", "unchecked"}) public void callback(int commandHandle, int err) { diff --git a/vcx/wrappers/node/tsconfig.json b/vcx/wrappers/node/tsconfig.json index db69eb1143..87ccd7cdfa 100644 --- a/vcx/wrappers/node/tsconfig.json +++ b/vcx/wrappers/node/tsconfig.json @@ -12,6 +12,6 @@ "preserveConstEnums": true }, "include": [ - "./src/**/*", "test/suite3/logging.2.test.ts", "test/suite3/logging.1.test.ts" - ], + "./src/*" + ] } diff --git a/vcx/wrappers/python3/ci/package.sh b/vcx/wrappers/python3/ci/package.sh index 00703964b3..3cb219086d 100755 --- a/vcx/wrappers/python3/ci/package.sh +++ b/vcx/wrappers/python3/ci/package.sh @@ -2,16 +2,38 @@ set -e export PATH=${PATH}:$(pwd)/vcx/ci/scripts export VCX_VERSION=$(toml_utils.py vcx/libvcx/Cargo.toml) +echo "VCX_VERSION: ${VCX_VERSION}" export DIST=`pwd`/vcx/wrappers/python3/dist/ +echo "DIST: ${DIST}" export PACKAGE_NAME='python3-vcx-wrapper' -pushd vcx/wrappers/python3 +echo "PACKAGE_NAME: ${PACKAGE_NAME}" +cd vcx/wrappers/python3 python3 setup.py sdist PACKAGE=${PACKAGE_NAME}-${VCX_VERSION}.tar.gz FILELY_PACKAGE=${PACKAGE_NAME}_${VCX_VERSION}.tar.gz # Added test so that we can confirm the new package name and that it was created. +echo "Listing the Package Directory" +echo "+++++++++++++++++++" +echo +ls -al ${DIST} +echo +echo "===================" +echo +echo "Listing the Package Itself" +echo "+++++++++++++++++++" +echo +ls -al ${DIST}/${PACKAGE} +echo +echo "===================" +echo if [ ! -e ${DIST}/${PACKAGE} ]; then echo "Python Package Not Created" + echo "+++++++++++++++++++" + echo "${DIST}/${PACKAGE}" + echo + echo "===================" + echo exit 1 fi -popd +cd ../../.. mv ${DIST}/${PACKAGE} output/${FILELY_PACKAGE} diff --git a/vcx/wrappers/python3/ci/test.sh b/vcx/wrappers/python3/ci/test.sh index a7aa22b780..0cfb6872fa 100755 --- a/vcx/wrappers/python3/ci/test.sh +++ b/vcx/wrappers/python3/ci/test.sh @@ -1,3 +1,5 @@ #!/bin/bash +echo "PYTHONPATH:" +echo $PYTHONPATH cd vcx/wrappers/python3/tests -pytest -s +pytest -s \ No newline at end of file diff --git a/vcx/wrappers/python3/setup.py b/vcx/wrappers/python3/setup.py index 72c877a9c0..a2560f357c 100755 --- a/vcx/wrappers/python3/setup.py +++ b/vcx/wrappers/python3/setup.py @@ -4,9 +4,16 @@ PKG_VERSION = os.environ.get('PACKAGE_VERSION') or '0.2.0' PKG_NAME = os.environ.get('PACKAGE_NAME') or 'python3-wrapper-vcx' +def get_version(): + try: + return os.environ['VCX_VERSION'] + except KeyError: + return '0.2.0' + + setup( name=PKG_NAME, - version=PKG_VERSION, + version=get_version(), description='Python 3 wrapper for libcxs', long_description='None...for now', author='Devin Fisher, Ryan Marsh, Mark Hadley, Doug Wightman',