Skip to content

Commit 555d9e5

Browse files
Add initial iOS core registration
1 parent 272c194 commit 555d9e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4528
-562
lines changed

demos/example-capacitor/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@
1919
"preview": "vite preview"
2020
},
2121
"dependencies": {
22-
"@capacitor/android": "^6.0.0",
22+
"@capacitor/android": "^7.0.0",
2323
"@capacitor/core": "latest",
24-
"@capacitor/ios": "^6.0.0",
24+
"@capacitor/ios": "^7.0.0",
2525
"@capacitor/splash-screen": "latest",
2626
"@journeyapps/wa-sqlite": "^1.3.1",
2727
"@powersync/react": "workspace:*",
2828
"@powersync/web": "workspace:*",
29+
"@powersync/capacitor": "workspace:*",
2930
"react": "^18.2.0",
3031
"react-dom": "^18.2.0",
3132
"react-router-dom": "^6.23.0"
3233
},
3334
"devDependencies": {
34-
"@capacitor/cli": "^6.0.0",
35+
"@capacitor/cli": "^7.0.0",
3536
"@swc/core": "~1.6.0",
3637
"@types/node": "^20.12.12",
3738
"@types/react": "^18.3.2",

packages/capacitor/.gitignore

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# node files
2+
dist
3+
node_modules
4+
5+
# iOS files
6+
Pods
7+
Podfile.lock
8+
Package.resolved
9+
Build
10+
xcuserdata
11+
/.build
12+
/Packages
13+
xcuserdata/
14+
DerivedData/
15+
.swiftpm/configuration/registries.json
16+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
17+
.netrc
18+
19+
20+
# macOS files
21+
.DS_Store
22+
23+
24+
25+
# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
26+
27+
# Built application files
28+
*.apk
29+
*.ap_
30+
31+
# Files for the ART/Dalvik VM
32+
*.dex
33+
34+
# Java class files
35+
*.class
36+
37+
# Generated files
38+
bin
39+
gen
40+
out
41+
42+
# Gradle files
43+
.gradle
44+
build
45+
46+
# Local configuration file (sdk path, etc)
47+
local.properties
48+
49+
# Proguard folder generated by Eclipse
50+
proguard
51+
52+
# Log Files
53+
*.log
54+
55+
# Android Studio Navigation editor temp files
56+
.navigation
57+
58+
# Android Studio captures folder
59+
captures
60+
61+
# IntelliJ
62+
*.iml
63+
.idea
64+
65+
# Keystore files
66+
# Uncomment the following line if you do not want to check your keystore files in.
67+
#*.jks
68+
69+
# External native build folder generated in Android Studio 2.2 and later
70+
.externalNativeBuild
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = 'PowersyncCapacitor'
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.license = package['license']
10+
s.homepage = package['repository']['url']
11+
s.author = package['author']
12+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13+
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14+
s.dependency "SQLCipher", "~> 4.0"
15+
s.public_header_files = 'ios/Sources/CPowerSyncPlugin/include/*.h'
16+
s.ios.deployment_target = '14.0'
17+
s.dependency 'Capacitor'
18+
s.swift_version = '5.1'
19+
s.dependency "powersync-sqlite-core", "~> 0.4.4"
20+
s.xcconfig = {
21+
'OTHER_CFLAGS' => '$(inherited) -DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1',
22+
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/SQLCipher"'
23+
}
24+
end

packages/capacitor/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# powersync
2+
3+
Adds PowerSync support
4+
5+
## Install
6+
7+
```bash
8+
npm install powersync
9+
npx cap sync
10+
```
11+
12+
## API
13+
14+
<docgen-index>
15+
16+
* [`echo(...)`](#echo)
17+
18+
</docgen-index>
19+
20+
<docgen-api>
21+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
22+
23+
### echo(...)
24+
25+
```typescript
26+
echo(options: { value: string; }) => Promise<{ value: string; }>
27+
```
28+
29+
| Param | Type |
30+
| ------------- | ------------------------------- |
31+
| **`options`** | <code>{ value: string; }</code> |
32+
33+
**Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
34+
35+
--------------------
36+
37+
</docgen-api>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
ext {
2+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6+
powerSyncCoreVersion = project.hasProperty('powerSyncCoreVersion') ? rootProject.ext.powerSyncCoreVersion : '0.4.4'
7+
}
8+
9+
buildscript {
10+
repositories {
11+
google()
12+
mavenCentral()
13+
}
14+
dependencies {
15+
classpath 'com.android.tools.build:gradle:8.7.2'
16+
}
17+
}
18+
19+
apply plugin: 'com.android.library'
20+
21+
android {
22+
namespace "com.powersync.capacitor"
23+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
24+
defaultConfig {
25+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
26+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
27+
versionCode 1
28+
versionName "1.0"
29+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30+
}
31+
buildTypes {
32+
release {
33+
minifyEnabled false
34+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35+
}
36+
}
37+
lintOptions {
38+
abortOnError false
39+
}
40+
compileOptions {
41+
sourceCompatibility JavaVersion.VERSION_21
42+
targetCompatibility JavaVersion.VERSION_21
43+
}
44+
}
45+
46+
repositories {
47+
google()
48+
mavenCentral()
49+
}
50+
51+
52+
dependencies {
53+
implementation fileTree(dir: 'libs', include: ['*.jar'])
54+
implementation project(':capacitor-android')
55+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
56+
implementation "com.powersync:powersync-sqlite-core:$powerSyncCoreVersion"
57+
testImplementation "junit:junit:$junitVersion"
58+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
59+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
60+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
org.gradle.jvmargs=-Xmx1536m
13+
14+
# When configured, Gradle will run in incubating parallel mode.
15+
# This option should only be used with decoupled projects. More details, visit
16+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17+
# org.gradle.parallel=true
18+
19+
# AndroidX package structure to make it clearer which packages are bundled with the
20+
# Android operating system, and which are packaged with your app's APK
21+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
22+
android.useAndroidX=true
23+
org.gradle.java.home=/opt/homebrew/opt/openjdk@21/
42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)