1
0
forked from ErnyTech/JTDLib

Added travis

This commit is contained in:
Andrea Cavalli 2020-08-18 14:40:21 +02:00
parent 8358590c36
commit d312a6d855
3 changed files with 99 additions and 0 deletions

35
travis/linux.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash -e
cd src/main/jni
mkdir $TRAVIS_BUILD_DIR/out
export TD_SRC_DIR=${PWD}/td
export TD_BIN_DIR=${PWD}/jtdlib/td
export JAVA_SRC_DIR=$(dirname `pwd`)/java
cd jtdlib
mkdir jnibuild || true
mkdir build || true
echo "TD_SRC_DIR=${TD_SRC_DIR}"
echo "TD_BIN_DIR=${TD_BIN_DIR}"
echo "JAVA_SRC_DIR=${JAVA_SRC_DIR}"
cd jnibuild
#export OPENSSL_ROOT_DIR=/snap/gitkraken/143/lib/x86_64-linux-gnu
#export JAVA_HOME=/usr/lib/jvm/java-1.13.0-openjdk-amd64
#export JAVA_INCLUDE_PATH=/usr/lib/jvm/java-1.13.0-openjdk-amd64/include/
cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} ${TD_SRC_DIR}
cmake --build . --target install -- -j1
cd ../../../../../
#mvn install -X
cd src/main/jni/jtdlib/build
cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DCMAKE_INSTALL_PREFIX:PATH=.. ..
cmake --build . --target install -- -j1
cd ..
#rm -r jnibuild
#rm -r build
rm -r td
[ -e ../bin ] && rm -r ../bin
mkdir ../bin
mv docs ../bin
mv bin/libtdjni.so $TRAVIS_BUILD_DIR/out

1
travis/mac.sh Normal file
View File

@ -0,0 +1 @@

63
travis/win.sh Normal file
View File

@ -0,0 +1,63 @@
#!/bin/bash
# Build deps
choco install gperf
choco install strawberryperl
choco install jdk11 -params 'installdir=c:\\java11'
# openssl
mkdir $TRAVIS_BUILD_DIR/openssl-root
git clone https://github.com/openssl/openssl.git -b OpenSSL_1_1_1-stable
cd openssl
perl Configure enable-static-engine enable-capieng no-ssl2 -utf-8 VC-WIN64A --prefix=$TRAVIS_BUILD_DIR/openssl-root --openssldir=$TRAVIS_BUILD_DIR/openssl-root no-shared
nmake
nmake install
cd ..
# zlib
mkdir $TRAVIS_BUILD_DIR/zlib-root
git clone https://github.com/madler/zlib.git -b v1.2.11
cd zlib
cmake -DCMAKE_INSTALL_PREFIX:PATH=$TRAVIS_BUILD_DIR/zlib-root -DSKIP_BUILD_EXAMPLES=ON .
cmake --build . --target install
cd ..
ls $TRAVIS_BUILD_DIR/openssl-root
ls $TRAVIS_BUILD_DIR/zlib-root
# Dirs
cd src/main/jni
export TD_SRC_DIR=${PWD}/td
export TD_BIN_DIR=${PWD}/jtdlib/td
export JAVA_SRC_DIR=$(dirname `pwd`)/java
cd jtdlib
mkdir build
mkdir jnibuild
echo "TD_SRC_DIR=${TD_SRC_DIR}"
echo "TD_BIN_DIR=${TD_BIN_DIR}"
echo "JAVA_SRC_DIR=${JAVA_SRC_DIR}"
mkdir $TRAVIS_BUILD_DIR/out
cd jnibuild
# Setup env
export JAVA_HOME="c:\\java11"
# Build
cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR\vcpkg\scripts\buildsystems\vcpkg.cmake ${TD_SRC_DIR}
cmake --build . --target install -- -j4
cd ../../../../../
#mvn install -X
cd src/main/jni/jtdlib/build
cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DCMAKE_INSTALL_PREFIX:PATH=.. -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR\vcpkg\scripts\buildsystems\vcpkg.cmake ..
cmake --build . --target install -- -j4
cd ..
rm -r td
# Copy artifacts
cp bin/libtdjni.dll $TRAVIS_BUILD_DIR/out