@op-engineering/op-sqlite 10.0.0-tokenizers-beta5 → 10.0.0-tokenizers-beta7

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.
@@ -168,14 +168,17 @@ android {
168
168
  // def tokenizerInitStrings = 0
169
169
  def tokenizersHeaderPath = 0
170
170
  if (!tokenizers.isEmpty()) {
171
- // Scan user directories for .h and .cpp files
172
171
  def sourceDir = isInsideNodeModules ? file("$rootDir/../../../c_sources") : file("$rootDir/../c_sources")
173
- sourceFiles = fileTree(dir: sourceDir, include: ["**/*.cpp", "**/*.h"])
174
- // sourceFiles = fileTree(dir: sourceDir, include: ["**/*.cpp"])
175
- .files
176
- .join(";") // Join paths with `;` for CMake
177
- tokenizersHeaderPath = isInsideNodeModules ? "../../../c_sources/tokenizers.h" : "../example/c_sources/tokenizers.h"
178
- println("tokenizers header path $tokenizersHeaderPath")
172
+ def destDir = file("$buildscript.sourceFile.parentFile/c_sources")
173
+ copy {
174
+ from sourceDir
175
+ into destDir
176
+ include "**/*.cpp", "**/*.h"
177
+ }
178
+ sourceFiles = fileTree(dir: destDir, include: ["**/*.cpp", "**/*.h"]).files.join(";")
179
+ tokenizersHeaderPath = "../c_sources/tokenizers.h"
180
+ println("tokenizers header path $tokenizersHeaderPath")
181
+
179
182
  }
180
183
 
181
184
  cppFlags "-O2", "-fexceptions", "-DONANDROID"
package/op-sqlite.podspec CHANGED
@@ -83,18 +83,26 @@ Pod::Spec.new do |s|
83
83
 
84
84
  # Set the path to the `c_sources` directory based on environment
85
85
  if is_user_app
86
- c_sources_dir = File.join("..", "..", "..", "..", "c_sources")
86
+ c_sources_dir = File.join("..", "..", "..", "c_sources")
87
87
  else
88
88
  c_sources_dir = File.join("example", "c_sources")
89
89
  end
90
+
90
91
 
91
92
  if tokenizers.any?
92
- generate_tokenizers_header_file(tokenizers, File.join(c_sources_dir, "tokenizers.h"), is_user_app)
93
+ FileUtils.cp_r(c_sources_dir, __dir__)
94
+ # generate_tokenizers_header_file(tokenizers, File.join(c_sources_dir, "tokenizers.h"), is_user_app)
95
+ # puts "Current directory: #{__dir__}"
96
+ # c_sources_dir_output = Dir.glob(File.join(c_sources_dir, "**/*.{h,cpp}"))
97
+
98
+ # puts "c_sources_dir: #{c_sources_dir_output}"
99
+
100
+ # # Add all .h and .c files from the `c_sources` directory
101
+ source_files += Dir.glob(File.join("c_sources", "**/*.{h,cpp}"))
102
+ # source_files += ["../../c_sources/tokenizers.h", "../../c_sources/tokenizers.cpp"]
103
+ # puts "Source files: #{source_files}"
93
104
  end
94
105
 
95
- # Add all .h and .c files from the `c_sources` directory
96
- source_files += Dir.glob(File.join(c_sources_dir, "**/*.{h,cpp}"))
97
-
98
106
  # Assign the collected source files to `s.source_files`
99
107
  s.source_files = source_files
100
108
 
@@ -187,7 +195,7 @@ Pod::Spec.new do |s|
187
195
  if tokenizers.any? then
188
196
  log_message.call("[OP_SQLITE] Tokenizers enabled: #{tokenizers}")
189
197
  if is_user_app then
190
- other_cflags += " -DTOKENIZERS_HEADER_PATH=\\\"../../../../c_sources/tokenizers.h\\\""
198
+ other_cflags += " -DTOKENIZERS_HEADER_PATH=\\\"../c_sources/tokenizers.h\\\""
191
199
  else
192
200
  other_cflags += " -DTOKENIZERS_HEADER_PATH=\\\"../example/c_sources/tokenizers.h\\\""
193
201
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "10.0.0-tokenizers-beta5",
3
+ "version": "10.0.0-tokenizers-beta7",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",