@op-engineering/op-sqlite 14.1.0 → 14.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +38 -11
- package/cpp/DBHostObject.h +4 -0
- package/cpp/PreparedStatementHostObject.h +4 -0
- package/cpp/bridge.h +4 -0
- package/cpp/utils.h +4 -0
- package/package.json +1 -1
- /package/android/src/main/{jniLibs → libcrsqlite}/arm64-v8a/libcrsqlite.so +0 -0
- /package/android/src/main/{jniLibs → libcrsqlite}/armeabi-v7a/libcrsqlite.so +0 -0
- /package/android/src/main/{jniLibs → libcrsqlite}/x86/libcrsqlite.so +0 -0
- /package/android/src/main/{jniLibs → libcrsqlite}/x86_64/libcrsqlite.so +0 -0
- /package/android/src/main/{jniLibs → libsqlitevec}/arm64-v8a/libsqlite_vec.so +0 -0
- /package/android/src/main/{jniLibs → libsqlitevec}/armeabi-v7a/libsqlite_vec.so +0 -0
- /package/android/src/main/{jniLibs → libsqlitevec}/x86/libsqlite_vec.so +0 -0
- /package/android/src/main/{jniLibs → libsqlitevec}/x86_64/libsqlite_vec.so +0 -0
package/android/build.gradle
CHANGED
|
@@ -37,19 +37,37 @@ def useSqliteVec = false
|
|
|
37
37
|
def enableRtree = false
|
|
38
38
|
def tokenizers = []
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
// On the example app, the package.json is located at the root of the project
|
|
41
|
+
// On the user app, the package.json is located at the root of the node_modules directory
|
|
42
|
+
def isUserApp = rootDir.absolutePath.contains("node_modules")
|
|
43
|
+
def packageJsonFile
|
|
44
|
+
|
|
45
|
+
if (isUserApp) {
|
|
46
|
+
// Start from the root + 1 level up (to avoid detecting the op-sqlite/package.json) and traverse upwards to find the first package.json
|
|
47
|
+
File currentDir = new File("$rootDir/../")
|
|
48
|
+
packageJsonFile = null
|
|
49
|
+
|
|
50
|
+
// Try to find package.json by traversing upwards
|
|
51
|
+
while (currentDir != null) {
|
|
52
|
+
File potential = new File(currentDir, "package.json")
|
|
53
|
+
if (potential.exists()) {
|
|
54
|
+
packageJsonFile = potential
|
|
55
|
+
break
|
|
56
|
+
}
|
|
57
|
+
currentDir = currentDir.parentFile
|
|
58
|
+
}
|
|
46
59
|
} else {
|
|
47
|
-
|
|
48
|
-
packageJson = new JsonSlurper().parseText(packageJsonFile.text)
|
|
60
|
+
packageJsonFile = new File("$rootDir/../package.json")
|
|
49
61
|
}
|
|
50
62
|
|
|
63
|
+
|
|
64
|
+
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
|
|
65
|
+
|
|
51
66
|
def opsqliteConfig = packageJson["op-sqlite"]
|
|
67
|
+
|
|
52
68
|
if(opsqliteConfig) {
|
|
69
|
+
println "[OP-SQLITE] Detected op-sqlite config from package.json at: " + packageJsonFile.absolutePath
|
|
70
|
+
|
|
53
71
|
useSQLCipher = opsqliteConfig["sqlcipher"]
|
|
54
72
|
useCRSQLite = opsqliteConfig["crsqlite"]
|
|
55
73
|
useSqliteVec = opsqliteConfig["sqliteVec"]
|
|
@@ -177,7 +195,7 @@ android {
|
|
|
177
195
|
// def tokenizerInitStrings = 0
|
|
178
196
|
def tokenizersHeaderPath = 0
|
|
179
197
|
if (!tokenizers.isEmpty()) {
|
|
180
|
-
def sourceDir =
|
|
198
|
+
def sourceDir = isUserApp ? file("$rootDir/../../../c_sources") : file("$rootDir/../c_sources")
|
|
181
199
|
def destDir = file("$buildscript.sourceFile.parentFile/c_sources")
|
|
182
200
|
copy {
|
|
183
201
|
from sourceDir
|
|
@@ -236,6 +254,15 @@ android {
|
|
|
236
254
|
srcDirs += 'src/paper/java'
|
|
237
255
|
// }
|
|
238
256
|
}
|
|
257
|
+
jniLibs {
|
|
258
|
+
srcDirs = []
|
|
259
|
+
if (useCRSQLite) {
|
|
260
|
+
srcDirs += 'src/main/libcrsqlite'
|
|
261
|
+
}
|
|
262
|
+
if (useSqliteVec) {
|
|
263
|
+
srcDirs += 'src/main/libsqlitevec'
|
|
264
|
+
}
|
|
265
|
+
}
|
|
239
266
|
}
|
|
240
267
|
}
|
|
241
268
|
|
|
@@ -253,7 +280,7 @@ dependencies {
|
|
|
253
280
|
}
|
|
254
281
|
}
|
|
255
282
|
|
|
256
|
-
|
|
283
|
+
tasks.register('prepareHeaders', Copy) {
|
|
257
284
|
from('../cpp')
|
|
258
285
|
include "**/*.h"
|
|
259
286
|
into "${project.buildDir}/headers/op-sqlite/op-engineering_op-sqlite/"
|
|
@@ -263,7 +290,7 @@ task prepareHeaders(type: Copy) {
|
|
|
263
290
|
preBuild.dependsOn(prepareHeaders)
|
|
264
291
|
|
|
265
292
|
// Resolves "LOCAL_SRC_FILES points to a missing file, Check that libfb.so exists or that its path is correct".
|
|
266
|
-
tasks.
|
|
293
|
+
tasks.configureEach { task ->
|
|
267
294
|
if (task.name.contains("configureCMakeDebug")) {
|
|
268
295
|
rootProject.getTasksByName("packageReactNdkDebugLibs", true).forEach {
|
|
269
296
|
task.dependsOn(it)
|
package/cpp/DBHostObject.h
CHANGED
package/cpp/bridge.h
CHANGED
package/cpp/utils.h
CHANGED
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|