forked from zoff99/ToxAndroidRefImpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
764 lines (628 loc) · 37.9 KB
/
circle.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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
machine:
timezone:
Europe/Berlin
java:
version: oraclejdk8
environment:
MAKEFLAGS: "j4"
# --- Android build ---
_toolchain_: "/home/ubuntu/c-toxcore/toolchains/"
_s_: "/home/ubuntu/c-toxcore/src/"
CF2: " -ftree-vectorize "
CF3: " -funsafe-math-optimizations -ffast-math "
# ---- arm -----
AND_TOOLCHAIN_ARCH: "arm"
AND_TOOLCHAIN_ARCH2: "arm-linux-androideabi"
AND_PATH: "/home/ubuntu/nasm_inst/bin:$_toolchain_/arm-linux-androideabi/bin:$PATH"
AND_PKG_CONFIG_PATH: "$_toolchain_/arm-linux-androideabi/sysroot/usr/lib/pkgconfig"
AND_CC: "$_toolchain_/arm-linux-androideabi/bin/arm-linux-androideabi-clang"
AND_GCC: "$_toolchain_/arm-linux-androideabi/bin/arm-linux-androideabi-gcc"
AND_CXX: "$_toolchain_/arm-linux-androideabi/bin/arm-linux-androideabi-clang++"
AND_READELF: "$_toolchain_/arm-linux-androideabi/bin/arm-linux-androideabi-readelf"
AND_ARTEFACT_DIR: "arm"
# ---- x86 -----
AND_TOOLCHAIN_ARCH_X86: "x86"
AND_TOOLCHAIN_ARCH2_X86: "x86"
AND_PATH_X86: "/home/ubuntu/nasm_inst/bin:$_toolchain_/x86/bin:$PATH"
AND_PKG_CONFIG_PATH_X86: "$_toolchain_/x86/sysroot/usr/lib/pkgconfig"
AND_CC_X86: "$_toolchain_/x86/bin/i686-linux-android-clang"
AND_GCC_X86: "$_toolchain_/x86/bin/i686-linux-android-gcc"
AND_CXX_X86: "$_toolchain_/x86/bin/i686-linux-android-clang++"
AND_READELF_X86: "$_toolchain_/x86/bin/i686-linux-android-readelf"
AND_ARTEFACT_DIR_X86: "x86"
# --- Android build ---
# c-toxcore version
AND_CTOXCORE_VERSION: "zoff99/toxcore_v0.2.3__toxav_h264_002"
# c-toxcore repo url
# AND_CTOXCORE_URL: "https://github.com/TokTok/c-toxcore"
AND_CTOXCORE_URL: "https://github.com/zoff99/c-toxcore_team"
_SDK_: /usr/local/android-sdk-linux/
_JAVA_OPTIONS: "-Xms512m -Xmx1024m"
JAVA_OPTS: "-Xms512m -Xmx1024m"
GRADLE_OPTS: '-Xmx512m -Dorg.gradle.jvmargs="-Xmx1700m -XX:+HeapDumpOnOutOfMemoryError -XX:MaxPermSize=1700m"'
CLASS_P: com.zoffcc.applications.trifa
START_INTENT_P: com.zoffcc.applications.trifa.StartMainActivityWrapper
ZEMU_: "appemu23"
EMU_: "appemu21"
XEMU_: "appemu10"
Zsdpath: "/sdcard"
sdpath: "/storage/sdcard"
Xsdpath: "/mnt/sdcard"
###### custom 2 ######
GRADLE_HOME: ~/g/gradle-custom
PATH: ~/g/gradle-custom/bin:/home/ubuntu/nasm_inst/bin:$PATH
#
# GRADLE_CUSTOM_VERSION -> [0, 1]
# GRADLE_CUSTOM_VNUM -> what version?
#
GRADLE_CUSTOM_VERSION: 0
GRADLE_CUSTOM_VNUM: 3.1
# ANDROID_DAILY_OVERRIDE: "d349fb0bfb70be0d783e6c79454a5ceb276095ed"
###### custom 2 ######
dependencies:
pre:
- sudo apt-get update
- sudo apt-get install clang
- sudo apt-get install build-essential libtool autotools-dev automake checkinstall check yasm
- sudo apt-get install pkg-config
- sudo apt-get install astyle ; exit 0
# ------------ network_test requires that "localhost" resolves to ::1 ------------
- sudo bash -c "echo '::1 localhost ipv6-localhost ipv6-loopback' >> /etc/hosts" # ipv6 localhost entry
# ------------ network_test requires that "localhost" resolves to ::1 ------------
- java -version ; exit 0
- gcc --version ; exit 0
- clang --version ; exit 0
- astyle --version ; exit 0
### ----- check code style ------
- cd .. ; cp -av ToxAndroidRefImpl ./astyle_check/
- cd ../astyle_check/ ; ls -al ./astyle/astylerc
- cd ../astyle_check/ ;
SOURCES=`find android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa -name '*.java'|sort`;
astyle -n --options=./astyle/astylerc jni-c-toxcore/jni-c-toxcore.c $SOURCES ; exit 0
- cd ../astyle_check/ ; git --no-pager diff
- cd ../astyle_check/ ; git diff | cat > $CIRCLE_ARTIFACTS/astyle_check.patch 2>&1
### ----- check code style ------
- mkdir -p /home/ubuntu/c-toxcore # workaround :-)
#- find / -name sdkmanager
- sudo apt-get install xdotool > /dev/null 2> /dev/null
- sudo apt-get install telnet > /dev/null 2> /dev/null
- sudo apt-get install x11-utils > /dev/null 2> /dev/null
- sudo apt-get install xvkbd > /dev/null 2> /dev/null
- sudo apt-get install qrencode > /dev/null 2> /dev/null
- sudo apt-get install p7zip-full
- echo y | android update sdk --no-ui --all --filter "tools"
- android list sdk --all | grep -i tools
- android list sdk --all --extended
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter build-tools-23.0.3
- echo y | android update sdk --no-ui --all --filter build-tools-24.0.2
- echo y | android update sdk --no-ui --all --filter build-tools-24.0.3
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.2
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.3
- echo y | android update sdk --no-ui --all --filter android-16 ; exit 0
- echo y | android update sdk --no-ui --all --filter android-21
- echo y | android update sdk --no-ui --all --filter android-23
- echo y | android update sdk --no-ui --all --filter android-24
- echo y | android update sdk --no-ui --all --filter android-25
- echo y | android update sdk --no-ui --all --filter platform-tools
- echo y | android update sdk --no-ui --all --filter extra-android-m2repository > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter extra-google-m2repository > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter extra-android-support > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter extra-android-support > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-21
- echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-23 > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-addon-google_apis-google-23 > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter addon-google_apis-google-23 > /dev/null 2> /dev/null
- echo y | android update sdk --no-ui --all --filter "tools"
# - echo y | android update sdk --no-ui
- $ANDROID_HOME/tools/bin/sdkmanager --list --verbose
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3"
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27"
# -- why is this not just called "cmake" ? --
- cmake_pkg_name=$($ANDROID_HOME/tools/bin/sdkmanager --list --verbose|grep -i cmake| tail -n 1 | cut -d \| -f 1 |tr -d " ");
echo y | $ANDROID_HOME/tools/bin/sdkmanager "$cmake_pkg_name"
# -- why is this not just called "cmake" ? --
#- echo y | $ANDROID_HOME/tools/bin/sdkmanager --update
# echo y | android update sdk --no-ui --all --filter "tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository"
# echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- echo ${ANDROID_HOME} ; exit 0
- ls -al "${ANDROID_HOME}/licenses" ; exit 0
- mkdir -p "${ANDROID_HOME}/licenses" ;
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license" ;
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "${ANDROID_HOME}/licenses/android-sdk-preview-license" ;
echo -e "\nd975f751698a77b662f1254ddbeed3901e976f5a" > "${ANDROID_HOME}/licenses/intel-android-extra-license"
- gradle -v # display gradle version
- if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then cd ~ ; wget 'https://services.gradle.org/distributions/gradle-'"$GRADLE_CUSTOM_VNUM"'-bin.zip' ; fi
- if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then mkdir ~/g ; cd ~/g ; unzip ~/gradle-"$GRADLE_CUSTOM_VNUM"-bin.zip ; fi
- if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then cd ~/g ; mv -v ./gradle-"$GRADLE_CUSTOM_VNUM" ./gradle-custom ; fi
- gradle -v # display gradle version
compile:
override:
# --- generic build ---
- curl -s http://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o android-ndk-r13b-linux-x86_64.zip
# --- verfiy NDK package ---
- echo '3524d7f8fca6dc0d8e7073a7ab7f76888780a22841a6641927123146c3ffd29c android-ndk-r13b-linux-x86_64.zip' > android-ndk-r13b-linux-x86_64.zip.sha256
- sha256sum -c android-ndk-r13b-linux-x86_64.zip.sha256
# --- verfiy NDK package ---
- unzip android-ndk-r13b-linux-x86_64.zip
- mv -v /home/ubuntu/ToxAndroidRefImpl/android-ndk-r13b /home/ubuntu/android-ndk
- mkdir -p $CIRCLE_ARTIFACTS/android/libs/armeabi/
- mkdir -p $CIRCLE_ARTIFACTS/android/libs/x86/
# --- generic build ---
- echo 'if [ "$CIRCLE_BRANCH""x" == "zoff99/maven_artefactx" ]; then exit 0 ; else echo "full build" ; fi' > ~/_fullb1 ; chmod a+rx ~/_fullb1
# --- Android build ---
- echo 'export ARTEFACT_DIR="$AND_ARTEFACT_DIR";export PATH="$AND_PATH";export PKG_CONFIG_PATH="$AND_PKG_CONFIG_PATH";export READELF="$AND_READELF";export GCC="$AND_GCC";export CC="$AND_CC";export CXX="$AND_CXX";export CPPFLAGS="";export LDFLAGS="";export TOOLCHAIN_ARCH="$AND_TOOLCHAIN_ARCH";export TOOLCHAIN_ARCH2="$AND_TOOLCHAIN_ARCH2"' > ~/pp
- chmod u+x ~/pp
- rm -Rf "$_s_"
- mkdir -p "$_s_"
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- mkdir -p $CIRCLE_ARTIFACTS/android/$ARTEFACT_DIR
- . ~/pp;mkdir -p "$PKG_CONFIG_PATH"
- . ~/pp;/home/ubuntu/android-ndk/build/tools/make_standalone_toolchain.py --arch "$TOOLCHAIN_ARCH" --install-dir "$_toolchain_"/arm-linux-androideabi --api 12 --force
# -- nasm --
- cd; mkdir -p nasm_build ; mkdir -p /home/ubuntu/nasm_inst/
- cd; cd nasm_build; git clone http://repo.or.cz/nasm.git
- cd; cd nasm_build; cd nasm; git checkout nasm-2.13.03
- cd; cd nasm_build; cd nasm; ./autogen.sh
- cd; cd nasm_build; cd nasm; ./configure --prefix=/home/ubuntu/nasm_inst/
- cd; cd nasm_build; cd nasm; make -j4
# seems man pages are not always built. but who needs those
- cd; cd nasm_build; cd nasm; touch nasm.1
- cd; cd nasm_build; cd nasm; touch ndisasm.1
- cd; cd nasm_build; cd nasm; make install
- ls -alR /home/ubuntu/nasm_inst/ ; exit 0
- export PATH=/home/ubuntu/nasm_inst/bin:$PATH
- type -a nasm
- nasm --version
# -- nasm --
# --- LIBAV ---
- . ~/pp;cd $_s_;git clone https://github.com/libav/libav
- . ~/pp;cd $_s_/libav/;git checkout v12.3
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";
$_s_/libav/configure
--prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr
--target-os=android
--arch=armv7te
--cross-prefix=arm-linux-androideabi-
--enable-cross-compile
--disable-devices --disable-programs
--disable-doc --disable-avdevice --disable-avformat
--disable-swscale
--disable-avfilter --disable-network --disable-everything
--disable-bzlib
--disable-libxcb-shm
--disable-libxcb-xfixes
--enable-parser=h264
--enable-runtime-cpudetect
--enable-gpl --enable-decoder=h264
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
# --- LIBAV ---
# --- x264 ---
- . ~/pp;cd $_s_;git clone git://git.videolan.org/x264.git
- . ~/pp;cd $_s_/x264/;git checkout stable
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";
$_s_/x264/configure
--host=arm-linux
--prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr
--cross-prefix=arm-linux-androideabi-
--disable-opencl
--enable-pic
--enable-static --disable-avs --disable-cli
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
# --- x264 ---
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.3.0 https://github.com/yasm/yasm.git
- . ~/pp;cd $_s_/yasm/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;$_s_/yasm/configure --prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr --disable-shared --disable-soname-versions --host=arm-linux-androideabi --with-sysroot="$_toolchain_"/arm-linux-androideabi/sysroot
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.7.0 https://github.com/webmproject/libvpx.git
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";$_s_/libvpx/configure
--prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr
--sdk-path=/home/ubuntu/android-ndk
--disable-examples
--disable-unit-tests
--target=armv7-android-gcc
--size-limit=16384x16384
--enable-onthefly-bitpacking
--enable-runtime-cpu-detect
--enable-realtime-only
--enable-multi-res-encoding
--enable-temporal-denoising
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/arm-linux-androideabi/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/libvpx.zip *
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.3-rc https://github.com/xiph/opus.git
- . ~/pp;cd $_s_/opus/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 ";export CFLAGS=" -g -O3 $CF2 ";$_s_/opus/configure --prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr --disable-shared --disable-soname-versions --host=arm-linux-androideabi --with-sysroot="$_toolchain_"/arm-linux-androideabi/sysroot
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/arm-linux-androideabi/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/opus.zip *
- . ~/pp;cd $_s_;git clone --depth=1 --branch=1.0.13 https://github.com/jedisct1/libsodium.git
- . ~/pp;cd $_s_/libsodium/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 ";export CFLAGS=" -g -O3 ";$_s_/libsodium/configure --prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr --disable-shared --disable-soname-versions --host=arm-linux-androideabi --with-sysroot="$_toolchain_"/arm-linux-androideabi/sysroot --disable-pie
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/arm-linux-androideabi/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/libsodium.zip *
# --- get wanted c-toxcore version ---
# ---- git does not clone into existing dir. why? --> so use workaround here ---
- cd ~/ ; git clone "$AND_CTOXCORE_URL" ~/tmp111
- cd ~/ ; ls -al c-toxcore/
- cd ~/ ; mv -v ~/tmp111/.??* c-toxcore/
- cd ~/ ; mv -v ~/tmp111/* c-toxcore/
- cd ~/ ; ls -al ~/tmp111/
- cd ~/ ; rm -Rf ~/tmp111
# ---- git does not clone into existing dir. why? --> so use workaround here ---
- cd ~/c-toxcore/ ; git checkout "$AND_CTOXCORE_VERSION"
- ls -al ~
- ls -al ~/c-toxcore/
# --- get wanted c-toxcore version ---
# --- disable H264 ---
- cd ~/c-toxcore/toxav/ ; cat rtp.c |grep 'define DISABLE_H264_ENCODER_FEATURE'
- cd ~/c-toxcore/toxav/ ; sed -i -e 'sm#define DISABLE_H264_ENCODER_FEATURE.*m#define DISABLE_H264_ENCODER_FEATURE 1m' rtp.c
- cd ~/c-toxcore/toxav/ ; cat rtp.c |grep 'define DISABLE_H264_ENCODER_FEATURE'
# --- disable H264 ---
- . ~/pp;cd ~/c-toxcore/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;~/c-toxcore/configure
CFLAGS="-O3 -g -Wall -Wextra -funwind-tables -Wl,--no-merge-exidx-entries"
--prefix="$_toolchain_"/arm-linux-androideabi/sysroot/usr
--disable-soname-versions --host=arm-linux-androideabi
--with-sysroot="$_toolchain_"/arm-linux-androideabi/sysroot
--disable-testing --disable-rt
- . ~/pp;cd ~/build/;export V=2;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/arm-linux-androideabi/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/c-toxcore.zip *
- find / -name 'cpu-features*' 2>/dev/null ; exit 0
- . ~/pp;cd jni-c-toxcore/; find .. -name 'cpu-features*' 2>/dev/null ; exit 0
# --- filter_audio ---
- . ~/pp;cd jni-c-toxcore/filter_audio; make clean; make
- . ~/pp;cd jni-c-toxcore/filter_audio; ls -hal
# --- filter_audio ---
- . ~/pp;cd jni-c-toxcore/; export V=2;$GCC -O3 -g -shared -Wall -Wextra
-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function
-funwind-tables -Wl,--no-merge-exidx-entries -Wl,-soname,libjni-c-toxcore.so
jni-c-toxcore.c -o libjni-c-toxcore.so
-std=gnu99 -I/usr/local/include/
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libtoxcore.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libtoxencryptsave.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libtoxav.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libvpx.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libopus.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libx264.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libavcodec.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libavutil.a
"$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/libsodium.a
./filter_audio/libfilteraudio.a
coffeecatch.c coffeejni.c
-lm /home/ubuntu/android-ndk/sources/android/cpufeatures/cpu-features.c
- . ~/pp;cd jni-c-toxcore/; ls -al
#- . ~/pp;cd jni-c-toxcore/; $STRIP -d libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -d libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -a libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -A libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; cp -av libjni-c-toxcore.so $CIRCLE_ARTIFACTS/android/libs/armeabi/
# --------- use current jni code on this branch ---------
- if [ "$CIRCLE_BRANCH""x" == "zoff99/dev003x" ]; then cd jni-c-toxcore/; cp -av libjni-c-toxcore.so ../android-refimpl-app/app/nativelibs/armeabi-v7a/ ; fi
# --------- use current jni code on this branch ---------
# --- Android build ---
# --- Android x86 build ---
- echo 'export ARTEFACT_DIR="$AND_ARTEFACT_DIR_X86";export PATH="$AND_PATH_X86";export PKG_CONFIG_PATH="$AND_PKG_CONFIG_PATH_X86";export READELF="$AND_READELF_X86";export GCC="$AND_GCC_X86";export CC="$AND_CC_X86";export CXX="$AND_CXX_X86";export CPPFLAGS="";export LDFLAGS="";export TOOLCHAIN_ARCH="$AND_TOOLCHAIN_ARCH_X86";export TOOLCHAIN_ARCH2="$AND_TOOLCHAIN_ARCH2_X86"' > ~/pp
- chmod u+x ~/pp
- rm -Rf "$_s_"
- mkdir -p "$_s_"
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- mkdir -p $CIRCLE_ARTIFACTS/android/"$ARTEFACT_DIR"
- . ~/pp;mkdir -p "$PKG_CONFIG_PATH"
- . ~/pp;/home/ubuntu/android-ndk/build/tools/make_standalone_toolchain.py --arch "$TOOLCHAIN_ARCH" --install-dir "$_toolchain_"/"$TOOLCHAIN_ARCH2" --api 12 --force
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.3.0 https://github.com/yasm/yasm.git
- . ~/pp;cd $_s_/yasm/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;$_s_/yasm/configure --prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr --disable-shared --disable-soname-versions --host="$TOOLCHAIN_ARCH2" --with-sysroot="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
# --- LIBAV ---
- . ~/pp;cd $_s_;git clone https://github.com/libav/libav
- . ~/pp;cd $_s_/libav/;git checkout v12.3
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";
$_s_/libav/configure
--prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr
--target-os=android
--arch=x86
--cross-prefix=i686-linux-android-
--enable-cross-compile
--disable-devices --disable-programs
--disable-doc --disable-avdevice --disable-avformat
--disable-swscale
--disable-avfilter --disable-network --disable-everything
--disable-bzlib
--disable-libxcb-shm
--disable-libxcb-xfixes
--enable-parser=h264
--enable-runtime-cpudetect
--enable-gpl --enable-decoder=h264
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
# --- LIBAV ---
# --- x264 ---
- . ~/pp;cd $_s_;git clone git://git.videolan.org/x264.git
- . ~/pp;cd $_s_/x264/;git checkout stable
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";
$_s_/x264/configure
--host=i686-linux-android
--prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr
--cross-prefix=i686-linux-android-
--disable-opencl
--enable-pic
--enable-static --disable-avs --disable-cli
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
# --- x264 ---
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.7.0 https://github.com/webmproject/libvpx.git
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
# --force-target=x86-android-gcc --disable-ssse3 --disable-sse4_1 --disable-avx2 --disable-examples --sdk-path=/Downloads/android-ndk-r9d/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 $CF3 ";export CFLAGS=" -g -O3 $CF2 $CF3 ";$_s_/libvpx/configure --prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr
--disable-ssse3 --disable-sse4_1 --disable-avx2 --disable-examples --disable-unit-tests
--sdk-path=/home/ubuntu/android-ndk --target=x86-android-gcc
--size-limit=16384x16384
--enable-realtime-only
--enable-multi-res-encoding
--enable-temporal-denoising
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/"$TOOLCHAIN_ARCH2"/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/libvpx.zip *
- . ~/pp;cd $_s_;git clone --depth=1 --branch=v1.3-rc https://github.com/xiph/opus.git
- . ~/pp;cd $_s_/opus/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 $CF2 ";export CFLAGS=" -g -O3 $CF2 ";$_s_/opus/configure --prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr --disable-shared --disable-soname-versions --host="$TOOLCHAIN_ARCH2" --with-sysroot="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/"$TOOLCHAIN_ARCH2"/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/opus.zip *
- . ~/pp;cd $_s_;git clone --depth=1 --branch=1.0.13 https://github.com/jedisct1/libsodium.git
- . ~/pp;cd $_s_/libsodium/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;export CXXFLAGS=" -g -O3 ";export CFLAGS=" -g -O3 ";$_s_/libsodium/configure --prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr --disable-shared --disable-soname-versions --host="$TOOLCHAIN_ARCH2" --with-sysroot="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot --disable-pie
- . ~/pp;cd ~/build/;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/"$TOOLCHAIN_ARCH2"/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/libsodium.zip *
# --- get wanted c-toxcore version ---
# ---- git does not clone into existing dir. why? --> so use workaround here ---
- cd ~/ ; git clone "$AND_CTOXCORE_URL" ~/tmp111
- cd ~/ ; ls -al c-toxcore/
- mkdir -p ~/tc_save
- cd ~/ ; mv -v c-toxcore/toolchains ~/tc_save/
- cd ~/ ; rm -Rf c-toxcore/ ; mkdir c-toxcore/
- cd ~/ ; mv -v ~/tc_save/toolchains c-toxcore/
- cd ~/ ; mv -v ~/tmp111/.??* c-toxcore/
- cd ~/ ; mv -v ~/tmp111/* c-toxcore/
- cd ~/ ; ls -al ~/tmp111/
- cd ~/ ; rm -Rf ~/tmp111
# ---- git does not clone into existing dir. why? --> so use workaround here ---
- cd ~/c-toxcore/ ; git checkout "$AND_CTOXCORE_VERSION"
- ls -al ~
- ls -al ~/c-toxcore/
# --- get wanted c-toxcore version ---
# --- disable H264 ---
- cd ~/c-toxcore/toxav/ ; cat rtp.c |grep 'define DISABLE_H264_ENCODER_FEATURE'
- cd ~/c-toxcore/toxav/ ; sed -i -e 'sm#define DISABLE_H264_ENCODER_FEATURE.*m#define DISABLE_H264_ENCODER_FEATURE 1m' rtp.c
- cd ~/c-toxcore/toxav/ ; cat rtp.c |grep 'define DISABLE_H264_ENCODER_FEATURE'
# --- disable H264 ---
- . ~/pp;cd ~/c-toxcore/;autoreconf -fi
- . ~/pp;rm -Rf ~/build/
- . ~/pp;mkdir -p ~/build/
- . ~/pp;cd ~/build/;~/c-toxcore/configure
CFLAGS="-O3 -g -funwind-tables -Wall -Wextra -Wl,--no-merge-exidx-entries"
--prefix="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr
--disable-soname-versions --host="$TOOLCHAIN_ARCH2"
--with-sysroot="$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot
--disable-testing --disable-rt
- . ~/pp;cd ~/build/;export V=2;make -j4
- . ~/pp;cd ~/build/;make install
- . ~/pp;cd ~/build/;make clean
- rm -Rf /home/ubuntu/install_dest/ ; mkdir -p /home/ubuntu/install_dest/
- . ~/pp;cd ~/build/;make DESTDIR=/home/ubuntu/install_dest/ install
- cd /home/ubuntu/install_dest/ ; cd home/ubuntu/c-toxcore/toolchains/"$TOOLCHAIN_ARCH2"/sysroot/ ; zip -r $CIRCLE_ARTIFACTS/android/c-toxcore.zip *
- find / -name 'cpu-features*' 2>/dev/null ; exit 0
- . ~/pp;cd jni-c-toxcore/; find .. -name 'cpu-features*' 2>/dev/null ; exit 0
# --- filter_audio ---
- . ~/pp;cd jni-c-toxcore/filter_audio; make clean; make
- . ~/pp;cd jni-c-toxcore/filter_audio; ls -hal
# --- filter_audio ---
- . ~/pp;cd jni-c-toxcore/; export V=2;$GCC -O3 -g -shared -Wall -Wextra
-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function
-funwind-tables -Wl,--no-merge-exidx-entries -Wl,-soname,libjni-c-toxcore.so
jni-c-toxcore.c -o libjni-c-toxcore.so
-std=gnu99 -I/usr/local/include/
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libtoxcore.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libtoxencryptsave.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libtoxav.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libvpx.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libopus.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libx264.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libavcodec.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libavutil.a
"$_toolchain_"/"$TOOLCHAIN_ARCH2"/sysroot/usr/lib/libsodium.a
./filter_audio/libfilteraudio.a
coffeecatch.c coffeejni.c
-lm /home/ubuntu/android-ndk/sources/android/cpufeatures/cpu-features.c
- . ~/pp;cd jni-c-toxcore/; ls -al
#- . ~/pp;cd jni-c-toxcore/; $STRIP -d libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -d libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -a libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; $READELF -A libjni-c-toxcore.so
- . ~/pp;cd jni-c-toxcore/; cp -av libjni-c-toxcore.so $CIRCLE_ARTIFACTS/android/libs/"$TOOLCHAIN_ARCH"/
# --------- use current jni code on this branch ---------
- if [ "$CIRCLE_BRANCH""x" == "zoff99/dev003x" ]; then cd jni-c-toxcore/; cp -av libjni-c-toxcore.so ../android-refimpl-app/app/nativelibs/x86/ ; fi
# --------- use current jni code on this branch ---------
# --- Android x86 build ---
# --------- GRADLE -------------
# - cd android-refimpl-app/ ; if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then gradle wrapper --no-daemon --gradle-version "$GRADLE_CUSTOM_VNUM" --info ; else gradle wrapper --no-daemon --info ; fi ; exit 0
- cd android-refimpl-app/ ; chmod a+rx ./gradlew
- . ~/_fullb1;cd android-refimpl-app/gwitness ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk'; rm -Rf gwit ; ../gradlew build --info
- . ~/_fullb1;ls -al /home/ubuntu/android-ndk
- . ~/_fullb1;cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk' ; ./gradlew :app:dependencies
- . ~/_fullb1;cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk' ; ./gradlew :app:build --max-workers=1 --stacktrace --no-daemon || ./gradlew :app:build --stacktrace --no-daemon # first build may FAIL
- . ~/_fullb1;cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk' ; ./gradlew -q calculateChecksums 2> /dev/null|grep -v 'android-refimpl-app:library:'
- . ~/_fullb1;cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk' ; ./gradlew -q calculateChecksums 2> /dev/null|grep -v 'android-refimpl-app:library:' > $CIRCLE_ARTIFACTS/android/calculateChecksums.txt
# --------- GRADLE -------------
# --------- bintray artefact -------------
- cd jni-c-toxcore/; mkdir -p ../android-refimpl-app/jnilib/src/main/jniLibs/armeabi-v7a/
- cd jni-c-toxcore/; cp -av $CIRCLE_ARTIFACTS/android/libs/armeabi/libjni-c-toxcore.so ../android-refimpl-app/jnilib/src/main/jniLibs/armeabi-v7a/
- cd jni-c-toxcore/; mkdir -p ../android-refimpl-app/jnilib/src/main/jniLibs/x86/
- cd jni-c-toxcore/; cp -av $CIRCLE_ARTIFACTS/android/libs/x86/libjni-c-toxcore.so ../android-refimpl-app/jnilib/src/main/jniLibs/x86/
- cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk'; ./gradlew :jnilib:dependencies
- cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk'; ./gradlew :jnilib:build --max-workers=1 --stacktrace --no-daemon || ./gradlew :jnilib:build --stacktrace --no-daemon # first build may FAIL
- cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk'; ./gradlew :jnilib:install --info; exit 0
- if [ "$CIRCLE_BRANCH""x" == "zoff99/maven_artefactx" ]; then cd android-refimpl-app/ ; export ANDROID_NDK_HOME='/home/ubuntu/android-ndk'; ./gradlew :jnilib:bintrayUpload --info; exit 0 ; fi
- find ~/.m2/repository -type f -exec ls -al {} \; ; exit 0
# --------- bintray artefact -------------
# --------- show generated aar file -----------
- cd android-refimpl-app/ ; ls -al jnilib/build/outputs/aar/ ; exit 0
- cd android-refimpl-app/ ; find ./ -name '*.aar' ; exit 0
- unzip -t /home/ubuntu/.m2/repository/com/zoffcc/applications/trifajni/trifa-jni-lib/1.*/trifa-jni-lib-1.*.aar ; exit 0
- sha256sum /home/ubuntu/.m2/repository/com/zoffcc/applications/trifajni/trifa-jni-lib/1.*/trifa-jni-lib-1.*.aar ; exit 0
- cat /home/ubuntu/.m2/repository/com/zoffcc/applications/trifajni/trifa-jni-lib/1.*/trifa-jni-lib-1.*.pom ; exit 0
- cat /home/ubuntu/.m2/repository/com/zoffcc/applications/trifajni/trifa-jni-lib/maven-metadata-local.xml ; exit 0
- cd android-refimpl-app/ ; unzip -t ./jnilib/build/outputs/aar/trifa-jni-lib-release.aar ; exit 0
- cd android-refimpl-app/ ; sha256sum ./jnilib/build/outputs/aar/trifa-jni-lib-release.aar ; exit 0
- cd android-refimpl-app/ ; cp -av ./jnilib/build/outputs/aar/trifa-jni-lib-release.aar $CIRCLE_ARTIFACTS/
# --------- show generated aar file -----------
# --- save lint output ---
- cd android-refimpl-app/ ; find . -name '*lint-report*' -exec ls -al {} \; ; exit 0
- cd android-refimpl-app/ ; cp -av ./app/lint-report.html $CIRCLE_ARTIFACTS/ ; exit 0
- cd android-refimpl-app/ ; cp -av ./app/lint-report.xml $CIRCLE_ARTIFACTS/ ; exit 0
- cd android-refimpl-app/ ; cp -av ./lint-report.txt $CIRCLE_ARTIFACTS/ ; exit 0
# --- save lint output ---
# ----------- show generated apk file -----------
- . ~/_fullb1;cd android-refimpl-app/ ; ls -al app/build/outputs/apk/ ; exit 0
- . ~/_fullb1;cd android-refimpl-app/ ; find ./ -name '*.apk' ; exit 0
- . ~/_fullb1;mkdir -p app/build/outputs/apk/
- . ~/_fullb1;cd android-refimpl-app/ ; cp -av ./app/build/outputs/apk/app-release-unsigned.apk ../app/build/outputs/apk/
# ----------- show generated apk file -----------
# ----------- make zipfile for builds [for download-dependencies.sh] -----------
#- . f;mkdir -p ~/and_stud_prj/app/libs/
#- . f;cp -av app/libs/tox*jar ~/and_stud_prj/app/libs/
#- . f;mkdir -p ~/and_stud_prj/app/src/main/jniLibs/
#- . f;cp -av app/src/main/jniLibs/* ~/and_stud_prj/app/src/main/jniLibs/
#- . f;cd ~/and_stud_prj/ ; zip -r $CIRCLE_ARTIFACTS/supplement.zip *
# ----------- make zipfile for builds [for download-dependencies.sh] -----------
- . ~/_fullb1;zip -d app/build/outputs/apk/app-release-unsigned.apk META-INF/\* # remove signature !!
- . ~/_fullb1;cp -av app/build/outputs/apk/app-release-unsigned.apk ~/app.apk ;
cd ~/ ;
echo xxxxxxrm -f ~/.android/debug.keystore ;
ls -al ~/.android/debug.keystore ;
if [ ! -f ~/.android/debug.keystore ]; then echo "*** generating new signer key ***" ;
echo "*** generating new signer key ***";
echo "*** generating new signer key ***";
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -keyalg RSA -keysize 2048 -validity 10000 -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US" ;
fi ;
ls -al ~/ ;
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android -sigalg SHA1withRSA -digestalg SHA1 -sigfile CERT -signedjar app-signed.apk app.apk androiddebugkey ;
ls -al ~/ ;
$_SDK_/build-tools/23.0.3/zipalign -v 4 app-signed.apk app-signed-aligned.apk ;
ls -al ~/ ;
pwd ;
ls -al ;
cp -av app-signed-aligned.apk $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}.apk || exit 1
## also make apk files with different names for each build (for individual downloads)
- . ~/_fullb1;cp -av $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}.apk $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}_circleci_$CIRCLE_SHA1.apk
## qr code to scan with your phone to directly download the apk file (for convenience)
- . ~/_fullb1;qrencode -o $CIRCLE_ARTIFACTS/QR_apk.png 'https://circle-artifacts.com/gh/'${CIRCLE_PROJECT_USERNAME}'/'${CIRCLE_PROJECT_REPONAME}'/'${CIRCLE_BUILD_NUM}'/artifacts/'${CIRCLE_NODE_INDEX}'/tmp/'`basename $CIRCLE_ARTIFACTS`'/'"${CIRCLE_PROJECT_REPONAME}_circleci_$CIRCLE_SHA1.apk" ; exit 0
## qr code to go directly to the aritfacts (to scan with phone)
- . ~/_fullb1;qrencode -o $CIRCLE_ARTIFACTS/QR_artifacts.png 'https://circleci.com/gh/'${CIRCLE_PROJECT_USERNAME}'/'${CIRCLE_PROJECT_REPONAME}'/'${CIRCLE_BUILD_NUM}'#artifacts' ; exit 0
pre:
- mksdcard -l e 180M sdcard.img
- echo 'mtools_skip_check=1' > ~/.mtoolsrc
- android list targets
#
- if [ "$EMU_" == "appemu23" ]; then echo "no" | android create avd -n appemu23 -f -t android-23 --abi armeabi-v7a --skin "WXGA720" ; fi
- if [ "$EMU_" == "appemu23" ]; then cat ~/.android/avd/appemu23.avd/config.ini ; fi
#
- if [ "$EMU_" == "appemu21" ]; then echo "no" | android create avd -n appemu21 -f -t android-21 --abi armeabi-v7a --skin "WXGA720" ; fi
- if [ "$EMU_" == "appemu21" ]; then cat ~/.android/avd/appemu21.avd/config.ini ; fi
#
- if [ "$EMU_" == "appemu10" ]; then echo "no" | android create avd -n appemu10 -f -t android-10 --abi armeabi --skin "WQVGA432" ; fi
- if [ "$EMU_" == "appemu10" ]; then cat ~/.android/avd/appemu10.avd/config.ini ; fi
#
- echo "$EMU_"
- echo "$sdpath"
test:
override:
- ls -alR "$_toolchain_"/arm-linux-androideabi/sysroot/usr/lib/
- . ~/_fullb1;emulator -avd "$EMU_" -sdcard sdcard.img -no-audio:
background: true
parallel: true
- . ~/_fullb1;circle-android wait-for-boot
- . ~/_fullb1;sleep 210 # let the emulator settle down first
- . ~/_fullb1;adb shell input keyevent 82 # remove lock screen on emulator
- . ~/_fullb1;sleep 10
- . ~/_fullb1;import -window root $CIRCLE_ARTIFACTS/capture_emulator_running.png
- . ~/_fullb1;adb shell "cat /proc/meminfo" ; exit 0
- . ~/_fullb1;adb shell ls -al / ; exit 0
- . ~/_fullb1;adb shell ls -al /storage/ ; exit 0
- . ~/_fullb1;adb shell ls -al /sdcard/ ; exit 0
- . ~/_fullb1;adb install ~/app-signed-aligned.apk
- . ~/_fullb1;adb logcat -v time > $CIRCLE_ARTIFACTS/adb_out.txt 2>&1 :
background: true
- . ~/_fullb1;sleep 60 # let the emulator settle down first
- . ~/_fullb1;adb shell am start -n $CLASS_P/$START_INTENT_P
- . ~/_fullb1;sleep 60
- . ~/_fullb1;sleep 120 # wait to be sure the app has started fully
- . ~/_fullb1;sleep 120 # wait a bit more
- . ~/_fullb1;died_count=`cat $CIRCLE_ARTIFACTS/adb_out.txt|grep 'Process. '"$CLASS_P"', PID.'|wc -l|tr -d ' '` ; if [ $died_count -gt 0 ]; then echo "app crashed"; exit 1; fi
- . ~/_fullb1;import -window root $CIRCLE_ARTIFACTS/capture_app_running.png # get proof that the app is running
- . ~/_fullb1;adb shell screencap -p | sed 's/\r$//' > $CIRCLE_ARTIFACTS/capture_app_running_2.png
# ----- CI artifact cleanup -----
- . ~/_fullb1;mkdir -p $CIRCLE_ARTIFACTS/other/
- . ~/_fullb1;mv -v $CIRCLE_ARTIFACTS/adb_out.txt $CIRCLE_ARTIFACTS/other/ ; exit 0
- . ~/_fullb1;mv -v $CIRCLE_ARTIFACTS/stderr*.txt $CIRCLE_ARTIFACTS/other/ ; exit 0
- . ~/_fullb1;mv -v $CIRCLE_ARTIFACTS/stdout*.txt $CIRCLE_ARTIFACTS/other/ ; exit 0
# ----- CI artifact cleanup -----