-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
275 lines (272 loc) · 13.4 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
---
python: '3.6'
language: cpp
jobs:
include:
- os: linux
dist: xenial
env: BUILD=linux
- os: osx
osx_image: xcode11.5
env: BUILD=osx
- os: linux
dist: xenial
env: BUILD=android
- os: osx
osx_image: xcode11.5
env: BUILD=ios
env:
global:
- secure: RNbJ4k1F1YVL9sgG5w77eK55S+pLIV9TTKGPTmcR+BKjFM5DX7FgLH9xsV60n3rXfwoMUizFO5/AoFrHr7h/F+HpPa5rR+3b61LAHTJ9wCB/nbmbmgqIhlzVcAjWy0kwiLZh1zCS4g/yr3q8uCbgRWhQBCGEciAeuS4PYjK8T8GazOS1ic4CeDDRbOUPFkjoLQzGj5tM7DkaAqORFau0gtKfnpK4Qfc4HMZy28kSq0d8BQSl9V6t0Yj6jtHcIxO9TJqdvHOKALDqWltisnzShHcOPvgn2aV1b3qKz/dl5tQaWDGQPcdkXiK5e67DOVoswEJ5fDKGC+ptIUJYU+e+7cnx51O2qdDAwGxCsozN+8DY/LMVspraMvDvC9kBTNM6hHXRcbv8GiISKigq+yjfSQ7WqNoWYEO18mgN/UcJT3HUI4j2EDj8ZTt73/6s6f/DrT4SU7grQVp0MNR6GD8e8prpY49vjZRaz1sTH/xIdKHNpVLnuUHz8+SEevFxCkA9+dywFu6TbamNZpRfg650VhQjiSSOKOwN5GmR1m92SQ8abkzFfedtlufdcwNOPdmA0/xmXizmZTbXXyRkDKfIccKVxiI2miSO4JTS0nUzufdHvH0Sx2/Jz3DBJVbWZU2Wpoq74AX+x0mJiWsldnbvKeNOJArsHB45+PbmgMNP/2k=
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main'
keyurl: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- g++-9
- clang++-10
- clang-format-10
- libasound2-dev
- libfreetype6-dev
- libxcb-xkb-dev
- libxcb-xinerama0-dev
- libxcb-render-util0-dev
- libxcb-icccm4-dev
- libxcb-shm0-dev
- libxcb-image0-dev
- libxcb-keysyms1-dev
- libgl1-mesa-dev
- libegl1-mesa-dev
- libdbus-1-dev
- libgtk-3-dev
- libglib2.0-dev
coverity_scan:
project:
name: lemourin/libcloudstorage
description: Build submitted via Travis CI
notification_email: pawel.wegner95@gmail.com
build_command_prepend: cov-configure --comptype gcc --compiler gcc-9 --template && mkdir build-coverity && cd build-coverity && CXX=g++-9 CC=gcc-9 cmake .. -DCMAKE_PREFIX_PATH=$PWD/../contrib/x86_64-linux-gnu
build_command: make -j 4
branch_pattern: coverity
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- |
if [ "$BUILD" = "linux" ]; then
for i in $(find test src bin examples -type f \( -regex '.*\.\(h\|cpp\|c\)$' ! -regex 'test/googletest/.*$' \)); do
clang-format-10 $i | diff - $i > /dev/null
if [ $? -ne 0 ]; then
echo "$i not formatted"
exit 1
fi
done
set -e
cd contrib
wget -nc https://github.com/lemourin/libcloudstorage/releases/download/1.9/x86_64-linux-gnu.tar.gz
tar xf x86_64-linux-gnu.tar.gz
./change-prefix.sh /home/lemourin/Projects/libcloudstorage/contrib/x86_64-linux-gnu $PWD/x86_64-linux-gnu
wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-x86_64.sh
chmod +x cmake-3.17.3-Linux-x86_64.sh
./cmake-3.17.3-Linux-x86_64.sh --skip-license --prefix=$PWD/x86_64-linux-gnu
export PATH="$PWD/x86_64-linux-gnu/bin:$PATH"
cd ..
fi
- |
if [ "$BUILD" = "osx" ]; then
cd contrib &&
wget -nc https://github.com/lemourin/libcloudstorage/releases/download/1.9/x86_64-darwin-macos.tar.gz &&
tar xf x86_64-darwin-macos.tar.gz &&
sed -i.bak "s/x86_64-linux-gnu/x86_64-darwin-macos/g" change-prefix.sh &&
./change-prefix.sh /Users/lemourin/Projects/libcloudstorage/contrib/x86_64-darwin-macos $PWD/x86_64-darwin-macos &&
cd ..
fi
- |
if [ "$BUILD" = "android" ]; then
mkdir AndroidSdk &&
cd AndroidSdk &&
export ANDROID_ABI=x86 &&
export ANDROID_MIN_API_LEVEL=21 &&
export ANDROID_HOME=$PWD &&
export ANDROID_NDK_ROOT=$PWD/android-ndk-r21d &&
wget -nc https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip &&
unzip android-ndk-r21d-linux-x86_64.zip &&
mkdir cmdline-tools &&
cd cmdline-tools &&
wget -nc https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip &&
unzip commandlinetools-linux-6609375_latest.zip &&
yes | ./tools/bin/sdkmanager "platforms;android-$ANDROID_MIN_API_LEVEL" &&
cd ../.. &&
cd contrib &&
wget https://github.com/lemourin/libcloudstorage/releases/download/1.9/i686-linux-android$ANDROID_MIN_API_LEVEL.tar.gz &&
tar xf i686-linux-android$ANDROID_MIN_API_LEVEL.tar.gz &&
sed -i "s/x86_64-linux-gnu/i686-linux-android$ANDROID_MIN_API_LEVEL/g" change-prefix.sh &&
./change-prefix.sh /home/lemourin/Projects/libcloudstorage/contrib/i686-linux-android$ANDROID_MIN_API_LEVEL $PWD/i686-linux-android$ANDROID_MIN_API_LEVEL &&
wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-x86_64.sh &&
chmod +x cmake-3.17.3-Linux-x86_64.sh &&
./cmake-3.17.3-Linux-x86_64.sh --skip-license --prefix=$PWD/i686-linux-android$ANDROID_MIN_API_LEVEL &&
export PATH="$PWD/i686-linux-android$ANDROID_MIN_API_LEVEL/bin:$PATH" &&
cd ..
fi
- |
if [ "$BUILD" = "ios" ]; then
cd contrib &&
wget -nc https://github.com/lemourin/libcloudstorage/releases/download/1.9/ios.tar.gz &&
tar xf ios.tar.gz &&
sed -i.bak "s/x86_64-linux-gnu/ios/g" change-prefix.sh &&
./change-prefix.sh /Users/lemourin/Projects/libcloudstorage/contrib/ios $PWD/ios &&
cd ..
fi
script:
- mkdir build
- cd build
- |
if [ "$BUILD" = "linux" ]; then
set -e
export PKG_CONFIG_PATH=$PWD/../contrib/x86_64-linux-gnu/lib/pkgconfig
CONTRIB_PATH=$PWD/../contrib/x86_64-linux-gnu/lib
SYSTEM_PATH=/usr/lib/x86_64-linux-gnu
CXXFLAGS="-Wall -Wextra -O2 -fsanitize=address"
LDFLAGS="-static-libasan -fsanitize=address"
CC=gcc-9
CXX=g++-9
cmake .. -DCMAKE_FIND_ROOT_PATH=$CONTRIB_PATH/../ -DBUILD_SHARED_LIBS=0 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc"
make -j 4
make test CXXFLAGS=-Wno-sign-compare -j 4
strip bin/cloudbrowser/cloudbrowser
mv bin/cloudbrowser/cloudbrowser bin/cloudbrowser/cloudbrowser-linux
cd ..
fi
- |
if [ "$BUILD" = "osx" ]; then
export PKG_CONFIG_LIBDIR=$PWD/../contrib/x86_64-darwin-macos/lib/pkgconfig &&
CONTRIB_PATH=$PWD/../contrib/x86_64-darwin-macos/lib &&
cmake .. -DCMAKE_FIND_ROOT_PATH=$CONTRIB_PATH/../ -DBUILD_SHARED_LIBS=0 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DCMAKE_BUILD_TYPE=Release &&
make -j 4 &&
make -j 4 test &&
strip bin/cloudbrowser/cloudbrowser &&
cd bin/cloudbrowser &&
mkdir -p "Cloud Browser.app/Contents/MacOS" &&
mkdir -p "Cloud Browser.app/Contents/Resources" &&
mkdir cloud.iconset &&
sips -z 16 16 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_16x16.png &&
sips -z 32 32 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_16x16@2x.png &&
sips -z 32 32 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_32x32.png &&
sips -z 64 64 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_32x32@2x.png &&
sips -z 128 128 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_128x128.png &&
sips -z 256 256 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_128x128@2x.png &&
sips -z 256 256 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_256x256.png &&
sips -z 512 512 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_256x256@2x.png &&
sips -z 512 512 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_512x512.png &&
sips -z 1024 1024 ../../../bin/cloudbrowser/resources/cloud.png --out cloud.iconset/icon_512x512@2x.png &&
iconutil -c icns cloud.iconset -o "Cloud Browser.app/Contents/Resources/cloud.icns" &&
mv cloudbrowser "Cloud Browser.app/Contents/MacOS" &&
cat > "Cloud Browser.app/Contents/Info.plist" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>cloudbrowser</string>
<key>CFBundleIdentifier</key>
<string>org.videolan.cloudbrowser</string>
<key>CFBundleName</key>
<string>Cloud Browser</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIconFile</key>
<string>cloud</string>
</dict>
</plist>
EOF
[ $? -eq 0 ] &&
brew install graphicsmagick imagemagick &&
npm install create-dmg -g &&
create-dmg "Cloud Browser.app" || true &&
mv "Cloud Browser Undefined.dmg" cloudbrowser.dmg &&
cd ../../../
fi
- |
if [ "$BUILD" = "android" ]; then
CONTRIB_PATH=$PWD/../contrib/i686-linux-android$ANDROID_MIN_API_LEVEL/lib
export PKG_CONFIG_LIBDIR=$CONTRIB_PATH/pkgconfig
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH=$CONTRIB_PATH/.. \
-DQt5Core_DIR=$CONTRIB_PATH/cmake/Qt5Core \
-DQt5Quick_DIR=$CONTRIB_PATH/cmake/Qt5Quick \
-DQt5Gui_DIR=$CONTRIB_PATH/cmake/Qt5Gui \
-DQt5QmlModels_DIR=$CONTRIB_PATH/cmake/Qt5QmlModels \
-DQt5Qml_DIR=$CONTRIB_PATH/cmake/Qt5Qml \
-DQt5Network_DIR=$CONTRIB_PATH/cmake/Qt5Network \
-DQt5Widgets_DIR=$CONTRIB_PATH/cmake/Qt5Widgets \
-DQt5Svg_DIR=$CONTRIB_PATH/cmake/Qt5Svg \
-DQt5AndroidExtras_DIR=$CONTRIB_PATH/cmake/Qt5AndroidExtras \
-DQt5QuickControls2_DIR=$CONTRIB_PATH/cmake/Qt5QuickControls2 \
-DQt5QmlWorkerScript_DIR=$CONTRIB_PATH/cmake/Qt5QmlWorkerScript \
-DQt5WebView_FOUND=FALSE \
-DBUILD_SHARED_LIBS=0 \
-DBUILD_TESTING=0 \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=$ANDROID_ABI \
-DANDROID_NATIVE_API_LEVEL=$ANDROID_MIN_API_LEVEL &&
make -j 4
fi
- |
if [ "$BUILD" = "ios" ]; then
CONTRIB_PATH=$PWD/../contrib/ios/lib
export PKG_CONFIG_LIBDIR=$CONTRIB_PATH/pkgconfig
cmake .. \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_FIND_ROOT_PATH=$CONTRIB_PATH/.. \
-DCMAKE_MACOSX_BUNDLE=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_FLAGS="-fembed-bitcode" \
-DCMAKE_C_FLAGS="-fembed-bitcode" \
-DQt5WebView_FOUND=FALSE \
-DQt5Core_DIR=$CONTRIB_PATH/cmake/Qt5Core \
-DQt5Quick_DIR=$CONTRIB_PATH/cmake/Qt5Quick \
-DQt5Gui_DIR=$CONTRIB_PATH/cmake/Qt5Gui \
-DQt5QmlModels_DIR=$CONTRIB_PATH/cmake/Qt5QmlModels \
-DQt5Qml_DIR=$CONTRIB_PATH/cmake/Qt5Qml \
-DQt5Network_DIR=$CONTRIB_PATH/cmake/Qt5Network \
-DQt5Widgets_DIR=$CONTRIB_PATH/cmake/Qt5Widgets \
-DQt5Svg_DIR=$CONTRIB_PATH/cmake/Qt5Svg \
-DQt5QuickControls2_DIR=$CONTRIB_PATH/cmake/Qt5QuickControls2 \
-DQt5QmlWorkerScript_DIR=$CONTRIB_PATH/cmake/Qt5QmlWorkerScript \
-DQt5FontDatabaseSupport_DIR=$CONTRIB_PATH/cmake/Qt5FontDatabaseSupport \
-DQt5GraphicsSupport_DIR=$CONTRIB_PATH/cmake/Qt5GraphicsSupport \
-DQt5ClipboardSupport_DIR=$CONTRIB_PATH/cmake/Qt5ClipboardSupport \
-DQt5EventDispatcherSupport_DIR=$CONTRIB_PATH/cmake/Qt5EventDispatcherSupport \
-DQt5PacketProtocol_DIR=$CONTRIB_PATH/cmake/Qt5PacketProtocol &&
make -j 4
fi
deploy:
- provider: releases
overwrite: true
api_key:
secure: FKvjbAn/91TRlQMOYO3Bsfx3IYe+BEAkjS/EGfEiR7WKh0Xz2c6HzDucKuNq0MuPPh8ddQO+szVWwSJXMG2brXQtKuRPdPARGLOiR3R8+F2UAnQ6o3AVoXcpZCVYgqZzg4gz8I7+LhL+48UKhNykU4DT3ahtL9kAmMmBbI4sl84WEwSxw7QHMKD8y/fVskyBYOzg1uT1sbmiupy0oErJyi+s8faYLcVPmremWZeJL5pra76+xjO9siriIscOKPONknKu7w2s7AeVHdW4VEmkc4iLVUpz0xsUWaoIaX16smkVtz3pE34UBigO1JyJPqYO+c2CNDqXOJwN+xx1GIqL65vColrZB9IkRdfa0chmIy6c05ZvDpyZtNwOBqImBx6kod34URpz+kwwKK+9a56HcDrXYUZ+Knmcm/4t6LSH51QksjLLxqnI2wqDvmohUkyo3cZfPw8bBB0c7NRwVDNStQLxKnsXfZ8H58uYd3XhERGn2/D13JX0VvRb8lUMwSWsLADng1oLfe8ITiD46NzdUwOCgcS3NYlM51l8q6D00QMlzCqDGJeFI/lFR2a4o5xhXYkx3Dn5cAj6D1i+O0WLSDLOP7ILIuNKP5E5msTvvpuslaUMM/oEwLl0WnVkRpSKSxLBAi5bQL3xQo64PO9oCvnC/37sa/0NCdfiI99nXfE=
file: "build/bin/cloudbrowser/cloudbrowser-linux"
skip_cleanup: true
on:
tags: true
condition: $BUILD = linux
- provider: releases
overwrite: true
api_key:
secure: FKvjbAn/91TRlQMOYO3Bsfx3IYe+BEAkjS/EGfEiR7WKh0Xz2c6HzDucKuNq0MuPPh8ddQO+szVWwSJXMG2brXQtKuRPdPARGLOiR3R8+F2UAnQ6o3AVoXcpZCVYgqZzg4gz8I7+LhL+48UKhNykU4DT3ahtL9kAmMmBbI4sl84WEwSxw7QHMKD8y/fVskyBYOzg1uT1sbmiupy0oErJyi+s8faYLcVPmremWZeJL5pra76+xjO9siriIscOKPONknKu7w2s7AeVHdW4VEmkc4iLVUpz0xsUWaoIaX16smkVtz3pE34UBigO1JyJPqYO+c2CNDqXOJwN+xx1GIqL65vColrZB9IkRdfa0chmIy6c05ZvDpyZtNwOBqImBx6kod34URpz+kwwKK+9a56HcDrXYUZ+Knmcm/4t6LSH51QksjLLxqnI2wqDvmohUkyo3cZfPw8bBB0c7NRwVDNStQLxKnsXfZ8H58uYd3XhERGn2/D13JX0VvRb8lUMwSWsLADng1oLfe8ITiD46NzdUwOCgcS3NYlM51l8q6D00QMlzCqDGJeFI/lFR2a4o5xhXYkx3Dn5cAj6D1i+O0WLSDLOP7ILIuNKP5E5msTvvpuslaUMM/oEwLl0WnVkRpSKSxLBAi5bQL3xQo64PO9oCvnC/37sa/0NCdfiI99nXfE=
file: "build/bin/cloudbrowser/cloudbrowser.dmg"
skip_cleanup: true
on:
tags: true
condition: $BUILD = osx