Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alpha] Kotlin Multiplatform SDK #1

Merged
merged 155 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 154 commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
a36a7f0
init: kmm with shiftUI
Manrich121 Dec 3, 2023
a6f0574
init: kmm with composeApp and shared module
Manrich121 Dec 3, 2023
9dfd2c6
init: kmm with composeApp and shared library module
Manrich121 Dec 3, 2023
641182b
init: ktor in kmm
Manrich121 Dec 4, 2023
d9f8649
init: sqldelight android working
Manrich121 Dec 5, 2023
0802bb3
init: sqldelight android working
Manrich121 Dec 5, 2023
2c38a84
wip: iosApp depends on two frameworks
Manrich121 Dec 7, 2023
687735b
wip: create samples directory with complete gradle project includeBui…
Manrich121 Dec 8, 2023
1fdcb53
wip: loading powersync slqite extension
Manrich121 Dec 8, 2023
3adb675
wip: try linking local framework
Manrich121 Dec 11, 2023
42f978e
wip: try pod linkOnly
Manrich121 Dec 11, 2023
c6a5b23
works: loading powersync-sqlite-core extension in iOS, using linkOnly…
Manrich121 Dec 12, 2023
fffe5c4
chore: add cache properties for native iosSim
Manrich121 Dec 14, 2023
5f6c3a7
chore: clean up and rename namespace
Manrich121 Jan 8, 2024
56594d4
wip: implement common API
Manrich121 Jan 8, 2024
de0aed8
wip: crud classses and interfaces
Manrich121 Jan 9, 2024
e03513b
wip: sync stream implementation
Manrich121 Jan 10, 2024
20dfe48
wip: powersync DB and connector
Manrich121 Jan 11, 2024
52c6b80
wip: Connecting to powersync instance using SupabaseConnector
Manrich121 Jan 12, 2024
1f00ae2
wip: bucketStorage implementation
Manrich121 Jan 15, 2024
dd32bfb
wip: bucketStorage replace JsonNames with SerialName
Manrich121 Jan 15, 2024
024e629
wip: Enable async DB ops. Update iOS sqlite version to 3.38.5. Fix iO…
Manrich121 Jan 17, 2024
00c1302
wip: crud upload impl
Manrich121 Jan 22, 2024
6e0a437
wip: crud upload impl
Manrich121 Jan 22, 2024
cf5f585
wip: watch queries and flows
Manrich121 Jan 23, 2024
d7b2569
init: watched queries
Manrich121 Jan 24, 2024
8333b3a
clean-up demo app PS integration
Manrich121 Jan 24, 2024
f999581
polish: Compose UI
Manrich121 Jan 24, 2024
cff85b9
fix: sqlite version on iOS. Add retry logic for streamRequest
Manrich121 Jan 24, 2024
408c8ac
wip: PowerSync dialect
Manrich121 Jan 26, 2024
bec6fc6
init: PowerSync dialect using BNF working
Manrich121 Jan 26, 2024
c5e4823
chore: project clean-up and bump android deps
Manrich121 Jan 29, 2024
8340c91
revert: PowerSyncDialect using BNF, rather do simple `functionType` o…
Manrich121 Jan 30, 2024
7080d05
wip: update BucketStorage implementation to use SQLDelight generated …
Manrich121 Jan 30, 2024
3441e09
revert: creating internal tables as these class with powersync_init
Manrich121 Jan 30, 2024
6cbfaeb
chore: bump powersync-sqlite-core version 0.1.5
Manrich121 Jan 30, 2024
eca9b84
wip: nexus publish config
Manrich121 Jan 30, 2024
ccdcdca
wip: nexus publish config
Manrich121 Jan 30, 2024
01b2396
wip: update publish targets
Manrich121 Jan 30, 2024
b9359cc
wip: update run targets
Manrich121 Jan 30, 2024
9b244e0
wip: add foobar test and publication id
Manrich121 Jan 30, 2024
66c5792
wip: add back unit test task in gh action
Manrich121 Jan 30, 2024
2df7287
wip: update sona nexus URL
Manrich121 Jan 30, 2024
1ee1922
wip: add android debug deploy task to gh action
Manrich121 Jan 30, 2024
333cbd5
wip: add missing publishLibraryVariants
Manrich121 Jan 30, 2024
de5f135
Testing the old url again
wessels2 Jan 31, 2024
0dc58c1
Reverted the nexus and snapshot urls
wessels2 Jan 31, 2024
08ede1d
chore: rename packages to com.powersync
Manrich121 Jan 31, 2024
f4598f8
try: use sonatype staging profile, username and password
Manrich121 Jan 31, 2024
382f063
Merge branch 'init-kmp' of https://github.com/powersync-ja/powersync-…
Manrich121 Jan 31, 2024
44cf6d4
try: useStaging in nexusPublish
Manrich121 Jan 31, 2024
67bfd71
chore: improve API with builder pattern
Manrich121 Jan 31, 2024
7029c44
chore: bump KMP 1.9.22 and related deps
Manrich121 Feb 1, 2024
4427298
fix: use recommended gradle/actions/setup-gradle + run approach
Manrich121 Feb 1, 2024
71c13d1
more tweaks to nexus publish tasks
Manrich121 Feb 1, 2024
8d75ce8
wip: use com.vanniktech.maven.publish for publishing
Manrich121 Feb 1, 2024
fdc603a
remove unused convention-plugins
Manrich121 Feb 1, 2024
b05780d
feature: added gradle-plugin for bundling and publishing to Sonatype …
Manrich121 Feb 8, 2024
dfecaec
chore: pull supabase-todolist and move hello-powersync app into demos…
Manrich121 Feb 8, 2024
4507bb9
chore: clean up sonatype plugin and extension
Manrich121 Feb 8, 2024
d3bac25
improve: remove hardcoded config from SupabaseConnector, this is done…
Manrich121 Feb 8, 2024
1400463
wip: watch crud queries to trigger upload
Manrich121 Feb 8, 2024
3fd91f9
chore: bump version 0.0.1-alpha+1
Manrich121 Feb 8, 2024
e249557
clean-up
Manrich121 Feb 13, 2024
c12dab8
wip: outline readme docs
Manrich121 Feb 13, 2024
b6ab6a2
improve: watch queries via powersync now extracts 'ps_data__' table n…
Manrich121 Feb 14, 2024
6e42181
improve: sqlite-amalgamation is not downloaded and sqlite3.def is bui…
Manrich121 Feb 14, 2024
e64999d
wip: add tableUpdates to SQLiteDrive and implement in platform specif…
Manrich121 Feb 15, 2024
3295dc1
wip: jni bindings
Manrich121 Feb 16, 2024
d464bf0
wip: JNI binding for update hook to sharedFlow
Manrich121 Feb 19, 2024
223c3b2
code clean-up
Manrich121 Feb 19, 2024
84898ed
wip: Setup KMMBridge, test gh action
Manrich121 Feb 19, 2024
3fff021
wip: kmmbridge gh action, use gradle helper function
Manrich121 Feb 19, 2024
d047931
wip: kmmbridge gh action, use version 0.0.1-ALPHA1
Manrich121 Feb 19, 2024
eb011fb
wip: kmmbridge gh action, use version 0.0.1-ALPHA
Manrich121 Feb 19, 2024
cb38a3c
add `iosX64` target
Manrich121 Feb 19, 2024
ddd3b99
wip: kmmbridge gh action, add signing keys to env
Manrich121 Feb 19, 2024
39c8de7
wip: add siging to allshared module
Manrich121 Feb 19, 2024
3f6ee71
wip: try disabling signing for allshared
Manrich121 Feb 19, 2024
8fe21bd
wip: try pass gradle params for signing
Manrich121 Feb 19, 2024
1912529
wip: disable signing for gh action
Manrich121 Feb 19, 2024
9aa82e0
wip: import gpg
Manrich121 Feb 19, 2024
007a10a
try: gpg keys again
Manrich121 Feb 19, 2024
07a99a4
try: specifying module name
Manrich121 Feb 19, 2024
65aa8a8
try: single line gradle_params
Manrich121 Feb 19, 2024
0c3508b
try: single line gradle_params
Manrich121 Feb 19, 2024
523df87
Init readmes
benitav Feb 19, 2024
aeaf01a
Add supported targets
benitav Feb 19, 2024
651788b
wip: rename swift framework module to 'powersync-swift'
Manrich121 Feb 20, 2024
a7cf786
rename gh action
Manrich121 Feb 20, 2024
68907c0
rename framework and spm module
Manrich121 Feb 20, 2024
974d220
use notifyListeners when reporting table updates. Update powersyncswi…
Manrich121 Feb 20, 2024
f0bf9f1
fix: watching of working
Manrich121 Feb 20, 2024
c9a082f
clean-up
Manrich121 Feb 20, 2024
14089df
wip: clean-up readme's
Manrich121 Feb 20, 2024
465a090
Merge branch 'init-kmp' of https://github.com/powersync-ja/powersync-…
Manrich121 Feb 20, 2024
65e37fc
wip: use TimestampVersionManager for swift framework
Manrich121 Feb 20, 2024
4a9f719
Revert to using LIBRARY_VERSION
Manrich121 Feb 20, 2024
233e16c
fix: github publishing from local
Manrich121 Feb 20, 2024
b4cae87
revert: only use setupGithubRepository gradle task
Manrich121 Feb 21, 2024
a5489d2
rename connectors artifact-id
Manrich121 Feb 21, 2024
5a6d006
fix: github publishing should not throw error if gradle props are not…
Manrich121 Feb 21, 2024
66115f4
hello-powersync: Use BuildKonfig plugin to load Supabase credentials …
Manrich121 Feb 21, 2024
c45a2bf
chore: clean-up compiler warnings
Manrich121 Feb 21, 2024
c900fcd
Replace SqliteDriver extensions with wrapping class PsSqliteDriver to…
Manrich121 Feb 21, 2024
805fdc8
Merge branch 'alpha-readme' of https://github.com/powersync-ja/powers…
Manrich121 Feb 21, 2024
ff7265b
upgrade: supabase-todo app
Manrich121 Feb 22, 2024
8ac1514
wip: supabase-todo using SDK from github
Manrich121 Feb 22, 2024
51ff890
wip: supabase-todo supabase connected
Manrich121 Feb 22, 2024
bf80909
wip: supabase-todo github repo config nou also uses `local.properties`
Manrich121 Feb 22, 2024
dfc1797
wip: supabase-todo supabase edit item
Manrich121 Feb 22, 2024
7aab880
wip: supabase-todo supabase ios
Manrich121 Feb 22, 2024
d4d9ecf
Revert localmaven config
Manrich121 Feb 22, 2024
4a6326c
wip: supabase-todo update ios bundle_id
Manrich121 Feb 22, 2024
756f78c
chore: hello-powersync rename users to customers
Manrich121 Feb 22, 2024
0c4b8c0
fix: supabase-todo update item query
Manrich121 Feb 22, 2024
7c502fc
chore: hello-powersync move user login to local.properties
Manrich121 Feb 22, 2024
a58ca8d
Readme updates
benitav Feb 22, 2024
1248b88
Merge branch 'init-kmp' of github.com:powersync-ja/powersync-kotlin i…
benitav Feb 22, 2024
da282a0
Some fixes
benitav Feb 22, 2024
1e2de76
wip: supabase-todo supabase ios use write transactions
Manrich121 Feb 22, 2024
c7f9805
Merge branch 'init-kmp' of https://github.com/powersync-ja/powersync-…
Manrich121 Feb 22, 2024
0bd5a02
fix: variable name
Feb 23, 2024
8254a0a
fix: variable name
Feb 23, 2024
da68a15
Readme polishes
benitav Feb 23, 2024
7c76fc8
Merge branch 'init-kmp' of github.com:powersync-ja/powersync-kotlin i…
benitav Feb 23, 2024
379fb55
Polishes
benitav Feb 23, 2024
5465509
More readme updates
benitav Feb 23, 2024
9ac8095
wip: transaction commit hook
Manrich121 Feb 23, 2024
c40596d
Merge branch 'init-kmp' of https://github.com/powersync-ja/powersync-…
Manrich121 Feb 23, 2024
3969e98
fix: table updates are now only reported once a transaction is committed
Manrich121 Feb 23, 2024
ab0634a
wip: publish to sonatype gh action
Manrich121 Feb 26, 2024
6515147
wip: rename build and test gh action
Manrich121 Feb 26, 2024
4246ab2
clean-up merge conflics in root README.md
Manrich121 Feb 26, 2024
a6f0e20
wip: publish to sonatype gh action, add github token property
Manrich121 Feb 26, 2024
e066a7d
wip: publish to sonatype gh action, add github token property
Manrich121 Feb 26, 2024
85e1e9b
wip: publish to sonatype gh action, missing quotes in gradle properties
Manrich121 Feb 26, 2024
a44481d
Merge branch 'main' of https://github.com/powersync-ja/powersync-kotl…
Manrich121 Feb 27, 2024
7c31901
chore: add `connectors` readme.md
Manrich121 Feb 27, 2024
6862483
chore: update `core` module's README.md
Manrich121 Feb 27, 2024
bc3d412
PowerSyncCredentials.kt `user_id` is optional
Manrich121 Feb 27, 2024
ea2cf1d
chore: use actions/checkout@4
Manrich121 Feb 27, 2024
d88aee9
chore: use actions/cache@4
Manrich121 Feb 27, 2024
4fa5f1f
update readme.md
Manrich121 Feb 27, 2024
a18943d
fix: null `user_id` when steam is connected
Manrich121 Feb 27, 2024
34f749b
fix: add try/catch around `login` to supabase in demo apps
Manrich121 Feb 27, 2024
6f7b3b3
remove convenience tables for 'sqlite_master' and 'sqlite_sequence'
Manrich121 Feb 27, 2024
2b8f7b1
chore: use newer version of Sqlite 3.45
Manrich121 Feb 27, 2024
0669106
Update readme: limitations and future work
benitav Feb 27, 2024
4428bef
fix: add null check and warning when loading local.properties
Manrich121 Feb 29, 2024
cfa009f
Merge branch 'init-kmp' of https://github.com/powersync-ja/powersync-…
Manrich121 Feb 29, 2024
61e2196
review feedback: Refactor SupabaseConnector to `com.powersync.connect…
Manrich121 Feb 29, 2024
1274e68
feature: add reporting of table updates as flow to PsInternalDatabase
Manrich121 Feb 29, 2024
0127046
fix: PsSqlDriver.fireTableUpdates should copy pendingUpdates outside …
Manrich121 Feb 29, 2024
7389d4c
CR feedback: remove sqlite_sequence from Powersync.sq and JWT decode …
Manrich121 Mar 4, 2024
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
72 changes: 38 additions & 34 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to central
name: Deploy to Sonatype

on: workflow_dispatch

Expand All @@ -13,40 +13,44 @@ jobs:
strategy:
matrix:
include:
- target: publishIosArm64PublicationToSonatypeRepository
- target: publishAllPublicationsToSonatypeRepository
os: macos-latest
- target: publishAndroidReleasePublicationToSonatypeRepository
os: ubuntu-latest
- target: publishKotlinMultiplatformPublicationToSonatypeRepository
os: ubuntu-latest
# FIXME: Our custom gradle plugin does not currently setup platform specific tasks
# - target: publishIosArm64PublicationToSonatypeRepository
# os: macos-latest
# - target: publishAndroidDebugPublicationToSonatypeRepository
# os: ubuntu-latest
# - target: publishAndroidReleasePublicationToSonatypeRepository
# os: ubuntu-latest
# - target: publishKotlinMultiplatformPublicationToSonatypeRepository
# os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Gradle publish
uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f
with:
arguments: |
${{ matrix.target }}
closeSonatypeStagingRepository
-Psigning.gnupg.passphrase='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}'
-Psigning.gnupg.keyName='${{secrets.OSSRH_GPG_SECRET_KEY_ID}}'
-PsonatypeUsername='${{secrets.OSSRH_USERNAME}}'
-PsonatypePassword='${{secrets.OSSRH_PASSWORD}}'
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Gradle publish
run: |
./gradlew \
${{ matrix.target }} \
-PGITHUB_PUBLISH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
-PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
-PcentralPortal.username="${{secrets.SONATYPE_USERNAME}}" \
-PcentralPortal.password="${{secrets.SONATYPE_PASSWORD}}"

27 changes: 13 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle
name: Gradle build & test

on:
push:
Expand All @@ -24,15 +17,17 @@ jobs:
include:
- target: iosSimulatorArm64Test
os: macos-latest
- target: jvmTest
- target: testDebugUnitTest
os: ubuntu-latest
- target: testReleaseUnitTest
os: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.konan
Expand All @@ -42,7 +37,11 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f
with:
arguments: ${{ matrix.target }}
run: |
./gradlew \
${{ matrix.target }} \
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/publish-swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish iOS Swift
on:
workflow_dispatch:
# TODO: Uncomment this if we want to publish on merge to main
# push:
# branches:
# - "main"

jobs:
call-kmmbridge-publish:
permissions:
contents: write
packages: write
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected]
with:
jvmVersion: 17
versionBaseProperty: LIBRARY_VERSION
publishTask: kmmBridgePublish
secrets:
gradle_params: -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" -PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" -PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}"
# PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }}
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
*.iml
.gradle
/local.properties
**/build/
xcuserdata
!src/**/build/
local.properties
.idea
.fleet
.DS_Store
/build
/captures
captures
.externalNativeBuild
.cxx
local.properties
**/.cxx
*.xcodeproj/*
**/.swiftpm
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings
Pods/
24 changes: 24 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version:5.3
import PackageDescription

let packageName = "powersyncswift"

let package = Package(
name: packageName,
platforms: [
.iOS(.v13)
],
products: [
.library(
name: packageName,
targets: [packageName]
),
],
targets: [
.binaryTarget(
name: packageName,
path: "./powersyncswift/build/XCFrameworks/debug/\(packageName).xcframework"
)
,
]
)
Loading
Loading