From e14cb9b21d8ad10c983642b1a95f2790f7717386 Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Thu, 12 Sep 2024 19:48:34 +0200 Subject: [PATCH] Add gitignore --- packages/op-sqlite/.gitignore | 43 +++++++++++++++++++ packages/op-sqlite/android/build.gradle | 15 +------ .../opsqlite/PowersyncOpSqliteModule.kt | 19 ++++++++ .../opsqlite/PowersyncOpSqlitePackage.kt | 19 ++++++++ .../PowersyncOpSqlitePackage.kt | 12 ------ 5 files changed, 82 insertions(+), 26 deletions(-) create mode 100644 packages/op-sqlite/.gitignore create mode 100644 packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqliteModule.kt create mode 100644 packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqlitePackage.kt delete mode 100644 packages/op-sqlite/android/src/main/java/com/powersyncopsqlite/PowersyncOpSqlitePackage.kt diff --git a/packages/op-sqlite/.gitignore b/packages/op-sqlite/.gitignore new file mode 100644 index 00000000..112a485e --- /dev/null +++ b/packages/op-sqlite/.gitignore @@ -0,0 +1,43 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +example/.cxx/ +*.keystore +!debug.keystore diff --git a/packages/op-sqlite/android/build.gradle b/packages/op-sqlite/android/build.gradle index 07f7a6cb..9e154a93 100644 --- a/packages/op-sqlite/android/build.gradle +++ b/packages/op-sqlite/android/build.gradle @@ -50,6 +50,7 @@ android { targetSdkVersion safeExtGet('targetSdkVersion', 34) versionCode 1 versionName "1.0" + buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()) externalNativeBuild { cmake { @@ -85,20 +86,6 @@ android { path "CMakeLists.txt" } } - - sourceSets.main { - java { - if (isNewArchitectureEnabled()) { - srcDirs += [ - "src/turbo", - // This is needed to build Kotlin project with NewArch enabled - "${project.buildDir}/generated/source/codegen/java" - ] - } else { - srcDirs += ["src/legacy"] - } - } - } } repositories { diff --git a/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqliteModule.kt b/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqliteModule.kt new file mode 100644 index 00000000..565d2042 --- /dev/null +++ b/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqliteModule.kt @@ -0,0 +1,19 @@ +package com.powersync.opsqlite + +import com.facebook.react.bridge.Promise +import com.facebook.react.bridge.ReactApplicationContext +import com.powersyncopsqlite.NativePowersyncOpSqliteSpec + +class PowersyncOpSqliteModule(context: ReactApplicationContext) : ReactContextBaseJavaModule(context) { + override fun getName(): String = NAME + + @ReactMethod + fun foo(a: Double, b: Double, promise: Promise) { + // Use the implementation instance to execute the function. + implementation.foo(a, b, promise) + } + + companion object { + const val NAME = "PowersyncOpSqlite" + } +} \ No newline at end of file diff --git a/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqlitePackage.kt b/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqlitePackage.kt new file mode 100644 index 00000000..d0d7b3bf --- /dev/null +++ b/packages/op-sqlite/android/src/main/java/com/powersync/opsqlite/PowersyncOpSqlitePackage.kt @@ -0,0 +1,19 @@ +package com.powersync.opsqlite; + +import android.view.View +import com.facebook.react.ReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.uimanager.ReactShadowNode +import com.facebook.react.uimanager.ViewManager + +class PowersyncOpSqlitePackage : ReactPackage { + + override fun createViewManagers( + reactContext: ReactApplicationContext + ): MutableList>> = mutableListOf() + + override fun createNativeModules( + reactContext: ReactApplicationContext + ): MutableList = listOf(PowersyncOpSqliteModule(reactContext)).toMutableList() +} \ No newline at end of file diff --git a/packages/op-sqlite/android/src/main/java/com/powersyncopsqlite/PowersyncOpSqlitePackage.kt b/packages/op-sqlite/android/src/main/java/com/powersyncopsqlite/PowersyncOpSqlitePackage.kt deleted file mode 100644 index b0b230ff..00000000 --- a/packages/op-sqlite/android/src/main/java/com/powersyncopsqlite/PowersyncOpSqlitePackage.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.powersyncopsqlite; - -import com.facebook.react.TurboReactPackage -import com.facebook.react.bridge.NativeModule -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.module.model.ReactModuleInfoProvider - -class CalculatorPackage : TurboReactPackage() { - override fun getModule(name: String?, reactContext: ReactApplicationContext): NativeModule? = null - - override fun getReactModuleInfoProvider(): ReactModuleInfoProvider? = null -} \ No newline at end of file