Skip to content

Commit 4aeb732

Browse files
authored
Merge pull request #24 from powersync-ja/android-prefab
Custom prefab build for Android
2 parents 408ee30 + 9e03137 commit 4aeb732

File tree

22 files changed

+146
-52
lines changed

22 files changed

+146
-52
lines changed

.cargo/config.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,26 @@ rustflags = [
5252
"-C", "link-arg=-mmacosx-version-min=10.13",
5353
]
5454

55+
56+
# For Android, it is important to set the soname.
57+
# Otherwise, the linker hardcodes the path in the lib,
58+
# which breaks loading.
59+
[target.aarch64-linux-android]
60+
rustflags = [
61+
"-C", "link-arg=-Wl,-soname,libpowersync.so",
62+
]
63+
64+
[target.armv7-linux-androideabi]
65+
rustflags = [
66+
"-C", "link-arg=-Wl,-soname,libpowersync.so",
67+
]
68+
69+
[target.x86_64-linux-android]
70+
rustflags = [
71+
"-C", "link-arg=-Wl,-soname,libpowersync.so",
72+
]
73+
74+
[target.i686-linux-android]
75+
rustflags = [
76+
"-C", "link-arg=-Wl,-soname,libpowersync.so",
77+
]

.github/workflows/android.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
on:
22
push:
3-
tags:
4-
- "*"
53
name: "android"
64
jobs:
75
build:
@@ -17,10 +15,6 @@ jobs:
1715
distribution: "temurin"
1816
java-version: "17"
1917

20-
- uses: nttld/setup-ndk@v1
21-
with:
22-
ndk-version: r26
23-
2418
- name: Validate Gradle wrapper
2519
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
2620

.github/workflows/ios.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
on:
22
push:
3-
tags:
4-
- "*"
53
name: "ios"
64
jobs:
75
build:

.github/workflows/linux.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
on:
22
push:
3-
tags:
4-
- "*"
53
workflow_dispatch:
64
name: "linux"
75
jobs:

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ jobs:
4545
distribution: "temurin"
4646
java-version: "17"
4747

48-
- uses: nttld/setup-ndk@v1
49-
with:
50-
ndk-version: r26
51-
5248
- name: Setup
5349
run: |
5450
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu

.github/workflows/wasm.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
name: "linux"
4+
jobs:
5+
build_wasm:
6+
name: Basic WASM build
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
submodules: true
12+
13+
- name: Install Rust Nightly
14+
uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: nightly-2024-05-18
17+
components: rust-src
18+
19+
- name: Build WASM bytecode
20+
run: RUSTFLAGS="--emit=llvm-bc -C linker=/bin/true" cargo build -p powersync_loadable --profile wasm --no-default-features --features "powersync_core/static powersync_core/omit_load_extension sqlite_nostd/static sqlite_nostd/omit_load_extension" -Z build-std=panic_abort,core,alloc --target wasm32-unknown-emscripten

.github/workflows/windows.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
on:
22
push:
3-
tags:
4-
- "*"
53
name: "windows"
64
jobs:
75
build_windows:

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inherits = "release"
2525
lto = false
2626

2727
[workspace.package]
28-
version = "0.2.0"
28+
version = "0.2.1"
2929
edition = "2021"
3030
authors = ["JourneyApps"]
3131
keywords = ["sqlite", "powersync"]

RELEASING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Bump the version number in these places:
55
1. Cargo.toml
66
2. powersync-sqlite-core.podspec.
77
3. android/build.gradle.kts
8-
4. build-pod.sh - CFBundleVersion and CFBundleShortVersionString.
9-
5. `cargo build` to update Cargo.lock
8+
4. android/src/prefab/prefab.json
9+
5. build-pod.sh - CFBundleVersion and CFBundleShortVersionString.
10+
6. `cargo build` to update Cargo.lock
1011

1112
Create a tag:
1213

0 commit comments

Comments
 (0)