Skip to content

Commit ae7bbec

Browse files
Update Android packaging script
1 parent f1b5e3c commit ae7bbec

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ set(PDF2HTMLEX_RESOURCE
221221
install (FILES ${PDF2HTMLEX_RESOURCE} DESTINATION share/pdf2htmlEX)
222222
install (FILES pdf2htmlEX.1 DESTINATION share/man/man1)
223223

224+
if (ANDROID)
225+
SET(CMAKE_INSTALL_PREFIX "built")
226+
endif()
227+
224228
## tests:
225229

226230
set(PDF2HTMLEX_PATH ${CMAKE_BINARY_DIR}/pdf2htmlEX)

android/app/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ android {
44
compileSdkVersion 28
55
defaultConfig {
66
applicationId "com.viliussutkus89.pdf2htmlex"
7-
minSdkVersion 5
7+
// x86_64 min level 21
8+
// x86 min level 16
9+
// libfontforge/gutils/fsys.c uses getpwent, which is avail from api 26
10+
minSdkVersion 26
811
targetSdkVersion 28
912
versionCode 1
1013
versionName "1.0"

build_android.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ if [ ! -d "$LIB" ]; then
1717
mkdir --parents --verbose $LIB/lib/src/main
1818

1919
ln --symbolic --verbose $APP/gradle $LIB/gradle
20-
# Do I need this?
21-
ln --symbolic --verbose $APP/android.iml $LIB/android.iml
2220
ln --symbolic --verbose $APP/build.gradle $LIB/build.gradle
2321
ln --symbolic --verbose $APP/gradle.properties $LIB/gradle.properties
2422
ln --symbolic --verbose $APP/gradlew $LIB/gradlew
@@ -53,18 +51,22 @@ fi
5351

5452
cd $LIB
5553
./gradlew assemble
56-
for build_type_and_abi in $THIRD_PARTY_DIR/built/cmake/*/*/
57-
do
54+
for build_type in $THIRD_PARTY_DIR/built/cmake/*; do
55+
for build_type_and_abi in $build_type/*; do
5856
echo "Building LIB: $build_type_and_abi"
5957
cmake --build $build_type_and_abi
6058
done
6159

6260
cd $APP
6361
./gradlew assemble
64-
for build_type_and_abi in $THIRD_PARTY_DIR/.externalNativeBuild/cmake/*/*/
65-
do
66-
echo "Building APP: $build_type_and_abi"
67-
cmake --build $build_type_and_abi
68-
#@TODO:
69-
cmake --build $build_type_and_abi --target install
62+
for build_type in $APP/app/.externalNativeBuild/cmake/*; do
63+
for build_type_and_abi in $build_type/*; do
64+
cmake --build $build_type_and_abi --target install
65+
66+
mkdir $build_type_and_abi/built/sample_pdfs
67+
cp -v $BASEDIR/test/browser_tests/*.pdf $build_type_and_abi/built/sample_pdfs/
68+
tar -cf $build_type_and_abi/pdf2htmlEX.tar --directory $build_type_and_abi built
69+
tar --list -f $build_type_and_abi/pdf2htmlEX.tar
70+
echo "$build_type_and_abi/pdf2htmlEX.tar is ready!"
71+
done
7072
done

0 commit comments

Comments
 (0)