mirror of
https://github.com/ErnyTech-Archive/JTDLib
synced 2024-09-05 14:06:00 +02:00
Initial porting to travis-ci
This commit is contained in:
parent
339ca80745
commit
241359a679
22
.travis.yml
Normal file
22
.travis.yml
Normal file
@ -0,0 +1,22 @@
|
||||
language: generic
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
- windows
|
||||
osx_image: xcode10.1
|
||||
|
||||
deploy:
|
||||
provider: pages
|
||||
skip-cleanup: true
|
||||
github-token: $GITHUB_TOKEN
|
||||
keep-history: true
|
||||
local-dir: out
|
||||
repo: ErnyTech/JTDLib-Pages
|
||||
on:
|
||||
branch: master
|
||||
|
||||
script:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash travis/linux.sh; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash travis/mac.sh; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then bash travis/win.sh; fi
|
25
travis/linux.sh
Normal file
25
travis/linux.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build deps
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install gcc-8 g++-8 make gperf openjdk-8-jdk cmake libssl-dev
|
||||
|
||||
# Dirs
|
||||
cd src/main/jni
|
||||
mkdir build
|
||||
mkdir $TRAVIS_BUILD_DIR/out
|
||||
cd build
|
||||
|
||||
# Setup env
|
||||
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac))))
|
||||
export CC=/usr/bin/gcc-8
|
||||
export CXX=/usr/bin/g++-8
|
||||
|
||||
# Build
|
||||
cmake -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=. ..
|
||||
cmake --build . --target install
|
||||
|
||||
# Copy artifacts
|
||||
cp -rf * $TRAVIS_BUILD_DIR/out
|
22
travis/mac.sh
Normal file
22
travis/mac.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build deps
|
||||
brew update
|
||||
brew upgrade
|
||||
brew install gperf
|
||||
|
||||
# Dirs
|
||||
cd src/main/jni
|
||||
mkdir build
|
||||
mkdir $TRAVIS_BUILD_DIR/out
|
||||
cd build
|
||||
|
||||
# Setup env
|
||||
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac))))
|
||||
|
||||
# Build
|
||||
cmake -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ ..
|
||||
cmake --build . --target install
|
||||
|
||||
# Copy artifacts
|
||||
cp bin/libtdjni.dylib $TRAVIS_BUILD_DIR/out
|
29
travis/win.sh
Normal file
29
travis/win.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Vcpkg
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
powershell .\bootstrap-vcpkg.bat
|
||||
powershell .\vcpkg integrate install
|
||||
powershell .\vcpkg install zlib:x64-windows-static openssl:x64-windows-static
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
||||
# Build deps
|
||||
choco install gperf
|
||||
choco install jdk8 -params 'installdir=c:\\java8'
|
||||
|
||||
# Dirs
|
||||
cd src/main/jni
|
||||
mkdir build
|
||||
mkdir $TRAVIS_BUILD_DIR/out
|
||||
cd build
|
||||
|
||||
# Setup env
|
||||
export JAVA_HOME="c:\\java8"
|
||||
|
||||
# Build
|
||||
cmake -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=. -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR\vcpkg\scripts\buildsystems\vcpkg.cmake ..
|
||||
cmake --build . --target install
|
||||
|
||||
# Copy artifacts
|
||||
cp bin/libtdjni.dll $TRAVIS_BUILD_DIR/out
|
Loading…
Reference in New Issue
Block a user