This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
131 lines (120 loc) · 6.82 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
language: java
os:
- linux
- osx
dist: trusty
osx_image: xcode9.2
sudo: true
env:
global:
- LD_LIBRARY_PATH=/usr/local/lib
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get install build-essential libtool autotools-dev automake libmicrohttpd-dev bsdmainutils;
sudo apt-get install libcurl4-gnutls-dev libjson-c-dev;
curl -sSL https://ftp.gnu.org/gnu/nettle/nettle-3.2.tar.gz | tar -zxv;
cd nettle-3.2 && autoconf && ./configure && make && sudo make install && cd ..;
curl -sSL https://github.com/libuv/libuv/archive/v1.8.0.tar.gz | tar -zxv;
cd libuv-1.8.0 && ./autogen.sh && ./configure && make && sudo make install && cd ..;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install -v libtool automake libmicrohttpd pkgconfig;
brew install -v curl nettle libuv;
brew upgrade json-c;
fi
install:
- git clone https://github.com/Storj/libstorj.git
- cd libstorj && ./autogen.sh && CFLAGS="-std=gnu11" ./configure && make && sudo make install && cd ..
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
jdk_switcher use oraclejdk8;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export JAVA_HOME=$(/usr/libexec/java_home);
fi
- ./gradlew build --info
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
- "$HOME/Library/Caches/Homebrew"
before_deploy:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64;
cd libstorj;
make clean;
cd depends;
sed -i -e 's#ftp://ftp.gnutls.org#https://www.gnupg.org/ftp#g' packages/gnutls.mk;
sed -i -e 's#lib"#lib -D_WIN32_WINNT=0x0600 -DNCRYPT_PAD_PKCS1_FLAG=2 -DNCRYPT_SHA1_ALGORITHM=BCRYPT_SHA1_ALGORITHM -DNCRYPT_SHA256_ALGORITHM=BCRYPT_SHA256_ALGORITHM -DCERT_NCRYPT_KEY_HANDLE_TRANSFER_PROP_ID=99"#g' packages/gnutls.mk;
make HOST="x86_64-w64-mingw32" BUILD_DLL=1;
cd ..;
PKG_CONFIG_LIBDIR="$(pwd)/depends/build/x86_64-w64-mingw32/lib/pkgconfig" CFLAGS="-I$(pwd)/depends/build/x86_64-w64-mingw32/include -L$(pwd)/depends/build/x86_64-w64-mingw32/lib -DSTORJDLL -std=gnu11" ./configure --host=x86_64-w64-mingw32 --prefix=$(pwd)/depends/build/x86_64-w64-mingw32;
make;
cd ..;
wget https://github.com/ojdkbuild/ojdkbuild/releases/download/1.8.0.161-1/java-1.8.0-openjdk-1.8.0.161-1.b14.ojdkbuild.windows.x86_64.zip;
unzip java-1.8.0-openjdk-1.8.0.161-1.b14.ojdkbuild.windows.x86_64.zip;
mv java-1.8.0-openjdk-1.8.0.161-1.b14.ojdkbuild.windows.x86_64 jdk;
x86_64-w64-mingw32-g++ -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -I./jdk/include -I./jdk/include/win32 -I./libstorj/src -I./libstorj/depends/build/x86_64-w64-mingw32/include -shared -static-libgcc -static-libstdc++ -o storj-java.dll ./src/main/cpp/storj-java.cpp -L./libstorj/src/.libs -L./libstorj/depends/build/x86_64-w64-mingw32/lib -lstorj -ljson-c -luv -lcurl -lnettle;
cd build/libs/jni/shared/;
mv ../../../../storj-java.dll .;
cp ../../../../libstorj/src/.libs/libstorj-2.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libcurl-4.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libgmp-10.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libgnutls-30.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libhogweed-4.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libjson-c-3.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libnettle-6.dll .;
cp ../../../../libstorj/depends/build/x86_64-w64-mingw32/bin/libuv-1.dll .;
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll .;
zip java-libstorj-$TRAVIS_TAG-win64-dlls.zip *.dll;
cp /usr/local/lib/libstorj.so.2 .;
cp /usr/local/lib/libuv.so.1 .;
cp /usr/local/lib/libnettle.so.6 .;
cp /lib/x86_64-linux-gnu/libjson-c.so.2 .;
cp /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 .;
cp /usr/lib/x86_64-linux-gnu/librtmp.so.0 .;
cp /usr/lib/x86_64-linux-gnu/libgnutls.so.26 .;
tar -zcf java-libstorj-$TRAVIS_TAG-linux64-so.tar.gz *.so*;
cd ../../../../;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cd build/libs/jni/shared/;
cp /usr/local/lib/libstorj.2.dylib .;
cp /usr/lib/libcurl.4.dylib .;
cp /usr/local/opt/nettle/lib/libnettle.6.dylib .;
cp /usr/local/opt/json-c/lib/libjson-c.2.dylib .;
cp /usr/local/opt/libuv/lib/libuv.1.dylib .;
chmod 666 *.dylib;
install_name_tool -id libstorj.2.dylib libstorj.2.dylib;
install_name_tool -id libcurl.4.dylib libcurl.4.dylib;
install_name_tool -id libnettle.6.dylib libnettle.6.dylib;
install_name_tool -id libjson-c.2.dylib libjson-c.2.dylib;
install_name_tool -id libuv.1.dylib libuv.1.dylib;
install_name_tool -change /usr/local/lib/libstorj.2.dylib libstorj.2.dylib libstorj-java.dylib;
install_name_tool -change /usr/lib/libcurl.4.dylib libcurl.4.dylib libstorj-java.dylib;
install_name_tool -change /usr/local/opt/json-c/lib/libjson-c.2.dylib libjson-c.2.dylib libstorj-java.dylib;
install_name_tool -change /usr/local/opt/nettle/lib/libnettle.6.dylib libnettle.6.dylib libstorj-java.dylib;
install_name_tool -change /usr/local/opt/libuv/lib/libuv.1.dylib libuv.1.dylib libstorj-java.dylib;
install_name_tool -change /usr/lib/libcurl.4.dylib libcurl.4.dylib libstorj.2.dylib;
install_name_tool -change /usr/local/opt/json-c/lib/libjson-c.2.dylib libjson-c.2.dylib libstorj.2.dylib;
install_name_tool -change /usr/local/opt/nettle/lib/libnettle.6.dylib libnettle.6.dylib libstorj.2.dylib;
install_name_tool -change /usr/local/opt/libuv/lib/libuv.1.dylib libuv.1.dylib libstorj.2.dylib;
tar -zcf java-libstorj-$TRAVIS_TAG-macos-dylibs.tar.gz *.dylib;
cd ../../../../;
fi
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: Wpf4gHvS0iK9JunMtMSPakfAvewOhbRzpcFahuPEMyGIrWajDXPcI1YtS6ADGajdae52BNg+dLdO7nANJbo3AEEPc/sEtBnD0hIs47hPub4JLfh1Oa+hqAn12MQPf3oxJi9zcPtn06ANN2ND3Q6J4ioVlS26gpcb1moKnY24r0C36JYVqx6mUZJa5Koo2hU1X3lbv+Ul5OnLTZ7pBYkjCKJ9tt6tMgm0ASwmR3wp9dpXpIsuTdEGwtoOwDDAIDng1ra82H++1MExZVvZnAPbYoYBGaODQBZCfNZNHI/8ruKnJBDQuEBO6Xg8BLEEN91ucLdyyTFU120uNZAFcWZnJOvbHZuPqdki5iNphJ2ic4Whye7i0H3NKyxPXjv9IEfOxO87/k+l4XPWalDSpuIBZPhyhPR+4h7Ly+B5itR+q5dtxLUV53Hx80zSxpxm0yN5VS8RuwOfBNMWQANax3V6lATSqyQ89k04P/1D4d5uXEoCrIlhRp8pA2zLKdGPW8lIN36NPN2BFBWyur0FrMwKrj5dduJKuNMJgAa8wuEmauciwKz7VoBowl7/7EzcCzuSFHbNcSAZApyhQUpmVgXIBDW4QtPkhW3Y6EQzfPp5z+OkBQOd9LGb8mJ34pKTtwLUlV1jYRVPb8rD8+cGLIbkDHYDANy+IIoHrbOwWc6jhiE=
file:
- build/libs/libstorj-java-$TRAVIS_TAG.jar
- build/libs/jni/shared/java-libstorj-$TRAVIS_TAG-win64-dlls.zip
- build/libs/jni/shared/java-libstorj-$TRAVIS_TAG-linux64-so.tar.gz
- build/libs/jni/shared/java-libstorj-$TRAVIS_TAG-macos-dylibs.tar.gz
on:
repo: storj/java-libstorj
tags: true