Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container && matrix.container || '' }}
name: ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'apple-xcframework' && matrix.name != 'android-aar' && ( matrix.name != 'macos' || matrix.arch != 'x86_64' ) && ' + test' || ''}}
name: ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.arch != 'armeabi-v7a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'apple-xcframework' && matrix.name != 'android-aar' && ( matrix.name != 'macos' || matrix.arch != 'x86_64' ) && ' + test' || ''}}
timeout-minutes: 20
strategy:
fail-fast: false
Expand Down Expand Up @@ -49,6 +49,10 @@ jobs:
arch: arm64-v8a
name: android
make: PLATFORM=android ARCH=arm64-v8a
- os: ubuntu-22.04
arch: armeabi-v7a
name: android
make: PLATFORM=android ARCH=armeabi-v7a
- os: ubuntu-22.04
arch: x86_64
name: android
Expand Down Expand Up @@ -161,7 +165,7 @@ jobs:
security delete-keychain build.keychain

- name: android setup test environment
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a' && matrix.arch != 'armeabi-v7a'
run: |

echo "::group::enable kvm group perms"
Expand Down Expand Up @@ -192,7 +196,7 @@ jobs:
echo "::endgroup::"

- name: android test sqlite-sync
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a' && matrix.arch != 'armeabi-v7a'
uses: reactivecircus/android-emulator-runner@v2.34.0
with:
api-level: 26
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ else ifeq ($(PLATFORM),macos)
STRIP = strip -x -S $@
else ifeq ($(PLATFORM),android)
ifndef ARCH # Set ARCH to find Android NDK's Clang compiler, the user should set the ARCH
$(error "Android ARCH must be set to ARCH=x86_64 or ARCH=arm64-v8a")
$(error "Android ARCH must be set to ARCH=x86_64, ARCH=arm64-v8a, or ARCH=armeabi-v7a")
endif
ifndef ANDROID_NDK # Set ANDROID_NDK path to find android build tools; e.g. on MacOS: export ANDROID_NDK=/Users/username/Library/Android/sdk/ndk/25.2.9519653
$(error "Android NDK must be set")
Expand All @@ -97,11 +97,17 @@ else ifeq ($(PLATFORM),android)

ifneq (,$(filter $(ARCH),arm64 arm64-v8a))
override ARCH := aarch64
ANDROID_ABI := android26
else ifeq ($(ARCH),armeabi-v7a)
override ARCH := armv7a
ANDROID_ABI := androideabi26
else
ANDROID_ABI := android26
endif

OPENSSL := $(BIN)/../sysroot/usr/include/openssl
CC = $(BIN)/$(ARCH)-linux-android26-clang
CURL_CONFIG = --host $(ARCH)-$(HOST)-android26 --with-openssl=$(BIN)/../sysroot/usr LIBS="-lssl -lcrypto" AR=$(BIN)/llvm-ar AS=$(BIN)/llvm-as CC=$(CC) CXX=$(BIN)/$(ARCH)-linux-android26-clang++ LD=$(BIN)/ld RANLIB=$(BIN)/llvm-ranlib STRIP=$(BIN)/llvm-strip
CC = $(BIN)/$(ARCH)-linux-$(ANDROID_ABI)-clang
CURL_CONFIG = --host $(ARCH)-linux-$(ANDROID_ABI) --with-openssl=$(BIN)/../sysroot/usr LIBS="-lssl -lcrypto" AR=$(BIN)/llvm-ar AS=$(BIN)/llvm-as CC=$(CC) CXX=$(BIN)/$(ARCH)-linux-$(ANDROID_ABI)-clang++ LD=$(BIN)/ld RANLIB=$(BIN)/llvm-ranlib STRIP=$(BIN)/llvm-strip
TARGET := $(DIST_DIR)/cloudsync.so
LDFLAGS += -shared -lcrypto -lssl
STRIP = $(BIN)/llvm-strip --strip-unneeded $@
Expand Down Expand Up @@ -202,7 +208,7 @@ $(OPENSSL):
git clone https://github.com/openssl/openssl.git $(CURL_DIR)/src/openssl

cd $(CURL_DIR)/src/openssl && \
./Configure android-$(if $(filter aarch64,$(ARCH)),arm64,$(ARCH)) \
./Configure android-$(if $(filter aarch64,$(ARCH)),arm64,$(if $(filter armv7a,$(ARCH)),arm,$(ARCH))) \
--prefix=$(BIN)/../sysroot/usr \
no-shared no-unit-test \
-D__ANDROID_API__=26 && \
Expand Down Expand Up @@ -353,14 +359,18 @@ $(DIST_DIR)/%.xcframework: $(LIB_NAMES)

xcframework: $(DIST_DIR)/CloudSync.xcframework

AAR_ARM = packages/android/src/main/jniLibs/arm64-v8a/
AAR_ARM64 = packages/android/src/main/jniLibs/arm64-v8a/
AAR_ARM = packages/android/src/main/jniLibs/armeabi-v7a/
AAR_X86 = packages/android/src/main/jniLibs/x86_64/
AAR_USR = $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(HOST)-x86_64/sysroot/usr/
AAR_CLEAN = rm -rf $(CURL_DIR)/android $(AAR_USR)bin/openssl $(AAR_USR)include/openssl $(AAR_USR)lib/libssl.a $(AAR_USR)lib/libcrypto.a $(AAR_USR)lib/ossl-modules
aar:
mkdir -p $(AAR_ARM) $(AAR_X86)
mkdir -p $(AAR_ARM64) $(AAR_ARM) $(AAR_X86)
$(AAR_CLEAN)
$(MAKE) clean && $(MAKE) PLATFORM=android ARCH=arm64-v8a
mv $(DIST_DIR)/cloudsync.so $(AAR_ARM64)
$(AAR_CLEAN)
$(MAKE) clean && $(MAKE) PLATFORM=android ARCH=armeabi-v7a
mv $(DIST_DIR)/cloudsync.so $(AAR_ARM)
$(AAR_CLEAN)
$(MAKE) clean && $(MAKE) PLATFORM=android ARCH=x86_64
Expand All @@ -386,7 +396,7 @@ help:
@echo " linux (default on Linux)"
@echo " macos (default on macOS - can be compiled with native network support)"
@echo " windows (default on Windows)"
@echo " android (needs ARCH to be set to x86_64 or arm64-v8a and ANDROID_NDK to be set)"
@echo " android (needs ARCH to be set to x86_64, arm64-v8a, or armeabi-v7a and ANDROID_NDK to be set)"
@echo " ios (only on macOS - can be compiled with native network support)"
@echo " ios-sim (only on macOS - can be compiled with native network support)"
@echo ""
Expand Down
2 changes: 1 addition & 1 deletion src/cloudsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern "C" {
#endif

#define CLOUDSYNC_VERSION "0.8.56"
#define CLOUDSYNC_VERSION "0.8.57"

int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);

Expand Down