Skip to content
Draft
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
7 changes: 7 additions & 0 deletions .changeset/tough-eggs-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@powersync/react-native': patch
'@powersync/capacitor': patch
'@powersync/node': patch
---

Android: Bundle PowerSync SQLite core extension with package instead of downloading it as a Gradle dependency.
2 changes: 1 addition & 1 deletion demos/example-capacitor/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion demos/example-capacitor/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.0'
classpath 'com.android.tools.build:gradle:9.3.2'
classpath 'com.google.gms:google-services:4.4.4'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
6 changes: 3 additions & 3 deletions demos/example-capacitor/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/.pnpm/@capacitor+android@8.3.4_@capacitor+core@8.3.4/node_modules/@capacitor/android/capacitor')
project(':capacitor-android').projectDir = new File('../node_modules/.pnpm/@capacitor+android@8.5.1_@capacitor+core@8.5.1/node_modules/@capacitor/android/capacitor')

include ':capacitor-community-sqlite'
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/.pnpm/@capacitor-community+sqlite@8.1.0_@capacitor+core@8.3.4/node_modules/@capacitor-community/sqlite/android')
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/.pnpm/@capacitor-community+sqlite@8.1.1_@capacitor+core@8.5.1/node_modules/@capacitor-community/sqlite/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../node_modules/.pnpm/@capacitor+splash-screen@8.0.1_@capacitor+core@8.3.4/node_modules/@capacitor/splash-screen/android')
project(':capacitor-splash-screen').projectDir = new File('../node_modules/.pnpm/@capacitor+splash-screen@8.0.2_@capacitor+core@8.5.1/node_modules/@capacitor/splash-screen/android')

include ':powersync-capacitor'
project(':powersync-capacitor').projectDir = new File('../node_modules/@powersync/capacitor/android')
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 3 additions & 3 deletions demos/example-capacitor/ios/App/CapApp-SPM/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ let package = Package(
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.3.4"),
.package(name: "CapacitorCommunitySqlite", path: "../../../node_modules/.pnpm/@capacitor-community+sqlite@8.1.0_@capacitor+core@8.3.4/node_modules/@capacitor-community/sqlite"),
.package(name: "CapacitorSplashScreen", path: "../../../node_modules/.pnpm/@capacitor+splash-screen@8.0.1_@capacitor+core@8.3.4/node_modules/@capacitor/splash-screen"),
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.5.1"),
.package(name: "CapacitorCommunitySqlite", path: "../../../node_modules/.pnpm/@capacitor-community+sqlite@8.1.1_@capacitor+core@8.5.1/node_modules/@capacitor-community/sqlite"),
.package(name: "CapacitorSplashScreen", path: "../../../node_modules/.pnpm/@capacitor+splash-screen@8.0.2_@capacitor+core@8.5.1/node_modules/@capacitor/splash-screen"),
.package(name: "PowersyncCapacitor", path: "../../../node_modules/@powersync/capacitor")
],
targets: [
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"version": "1.0.0",
"private": true,
"description": "monorepo for PowerSync JavaScript SDKs",
"main": "index.js",
"scripts": {
"scripts": {
"reset:repo": "tsc -b scripts && node scripts/dist/reset-repo.js",
"build:packages": "pnpm run --filter {./packages/**} -r build",
"build:packages:prod": "pnpm run --filter {./packages/**} -r build:prod",
Expand Down
1 change: 1 addition & 0 deletions packages/capacitor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DerivedData/
# Built application files
*.apk
*.ap_
android/core

# Files for the ART/Dalvik VM
*.dex
Expand Down
2 changes: 1 addition & 1 deletion packages/capacitor/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/build
.cxx
.cxx
14 changes: 7 additions & 7 deletions packages/capacitor/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ext {
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
powerSyncCoreVersion = project.hasProperty('powerSyncCoreVersion') ? rootProject.ext.powerSyncCoreVersion : '0.5.3'
}

buildscript {
Expand Down Expand Up @@ -33,10 +32,16 @@ android {
prefab true
}

sourceSets {
main {
jniLibs.srcDirs += ["core/jniLibs"]
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
Expand All @@ -55,11 +60,6 @@ repositories {


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "com.powersync:powersync-sqlite-core:$powerSyncCoreVersion"
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
}

This file was deleted.

This file was deleted.

6 changes: 4 additions & 2 deletions packages/capacitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"unpkg": "dist/plugin.js",
"files": [
"android/src/main/",
"android/core/",
"android/build.gradle",
"android/proguard-rules.pro",
"dist/",
Expand Down Expand Up @@ -51,15 +52,16 @@
"scripts": {
"verify": "pnpm verify:ios && pnpm verify:android && pnpm verify:web",
"verify:ios": "cd example-app && pnpm install && cd ios/App && xcodebuild -project App.xcodeproj -scheme App -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest'",
"verify:android": "cd android && ./gradlew clean build test && cd ..",
"verify:android": "pnpm prepare:core && cd android && ./gradlew clean build test && cd ..",
"verify:web": "pnpm build",
"lint": "pnpm eslint && pnpm prettier -- --check && pnpm swiftlint -- lint",
"fmt": "pnpm eslint -- --fix && pnpm prettier -- --write && pnpm swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api PowerSyncPlugin --output-readme README.md --output-json dist/docs.json",
"build": "pnpm clean && pnpm docgen && tsc && rollup -c rollup.config.mjs",
"prepare:core": "node ../../tools/download-core.js capacitor",
"build": "pnpm clean && pnpm prepare:core && pnpm docgen && tsc && rollup -c rollup.config.mjs",
"build:prod": "pnpm build",
"clean": "rimraf ./dist",
"watch": "tsc --watch",
Expand Down
142 changes: 0 additions & 142 deletions packages/node/download_core.js

This file was deleted.

5 changes: 2 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
"files": [
"lib",
"dist",
"download_core.js",
"src"
],
"scripts": {
"prepare:core": "node download_core.js",
"build": " pnpm prepare:core && tsc -b",
"prepare:core": "node ../../tools/download-core.js node",
"build": "pnpm prepare:core && tsc -b",
"build:prod": "pnpm prepare:core && tsc -b",
"clean": "rm -rf lib dist tsconfig.tsbuildinfo",
"watch": "tsc -b -w",
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android/core/
2 changes: 1 addition & 1 deletion packages/react-native/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build/
.gradle/
.gradle/
9 changes: 6 additions & 3 deletions packages/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ def supportsNamespace() {
android {
if (supportsNamespace()) {
namespace "com.powersync.opsqlite"
}

sourceSets {
main {
sourceSets {
main {
if (supportsNamespace()) {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}

jniLibs.srcDirs += ["core/jniLibs"]
}
}

Expand Down Expand Up @@ -88,7 +92,6 @@ repositories {
def kotlin_version = getExtOrDefault("kotlinVersion")

dependencies {
implementation 'com.powersync:powersync-sqlite-core:0.5.3'
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
Expand Down
Loading
Loading