Skip to content

Commit 3e87a2c

Browse files
authored
Merge pull request #9 from artoolkitx/phil-android-build
Android build fixes.
2 parents 05057bf + 498054d commit 3e87a2c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ depends/macos/Frameworks/opencv2.framework
5656
depends/android/artoolkitx
5757
artoolkitX.for.iOS.v*.dmg
5858
artoolkitX.for.macOS.v*.dmg
59+
artoolkitx-*-Android.zip
60+
artoolkitx-*-Windows.zip
5961

6062
# Build files
6163
Linux/build/

Android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ android {
1818
//abiFilters 'arm64-v8a'
1919
}
2020
}
21+
archivesBaseName = "artoolkitx-calib-camera-v$versionName"
2122
}
2223
buildTypes {
2324
release {

build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ then
8484
CPUS=`/usr/bin/nproc`
8585
TAR='/bin/tar'
8686
# Identify Linux OS. Sets useful variables: ID, ID_LIKE, VERSION, NAME, PRETTY_NAME.
87-
source /etc/os-release
87+
#source /etc/os-release
8888
# Windows Subsystem for Linux identifies itself as 'Linux'. Additional test required.
8989
if grep -qE "(Microsoft|WSL)" /proc/version &> /dev/null ; then
9090
OS='Windows'
@@ -207,7 +207,7 @@ if [ $BUILD_ANDROID ] ; then
207207
cd "${OURDIR}"
208208
if [ ! -d "depends/android/include/opencv2" ] ; then
209209
curl --location "https://github.com/artoolkitx/opencv/releases/download/4.6.0/opencv-4.6.0-dev-artoolkitx-android.tgz" -o opencv2.tgz
210-
tar xzf opencv2.tgz --strip-components=1 -C depends/android
210+
tar xzf opencv2.tgz --strip-components=1 --warning=no-unknown-keyword -C depends/android
211211
rm opencv2.tgz
212212
fi
213213
# If artoolkitx folder is not a symlink, fetch artoolkitx from latest build into a location where the build can find it.
@@ -220,7 +220,8 @@ if [ $BUILD_ANDROID ] ; then
220220
fi
221221

222222
# Make the version number available to Gradle.
223-
sed -E -i "" -e "s/versionCode [0-9]+/versionCode ${VERSION_INT}/" -e "s/versionName \"[0-9\.]+\"/versionName \"${VERSION}\"/" Android/app/build.gradle
223+
sed -E -i.bak -e "s/versionCode [0-9]+/versionCode ${VERSION_INT}/" -e "s/versionName \"[0-9\.]+\"/versionName \"${VERSION}\"/" Android/app/build.gradle
224+
rm -f Android/app/build.gradle.bak
224225

225226
(cd "${OURDIR}/Android"
226227
echo "Building Android project"

0 commit comments

Comments
 (0)