From 1e5512eb8e8912a0c74a9922e2c4347b429fc81c Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Wed, 26 Mar 2025 11:45:14 +0100 Subject: [PATCH] outsource vector stuff --- app/pubspec.yaml | 2 +- app/pubspec_overrides.yaml | 4 +- packages/sqlite3_vec/.gitignore | 31 --- packages/sqlite3_vec/.metadata | 33 --- packages/sqlite3_vec/CHANGELOG.md | 3 - packages/sqlite3_vec/LICENSE | 201 ------------------ packages/sqlite3_vec/README.md | 15 -- packages/sqlite3_vec/analysis_options.yaml | 35 --- packages/sqlite3_vec/android/.gitignore | 15 -- packages/sqlite3_vec/android/CMakeLists.txt | 77 ------- packages/sqlite3_vec/android/build.gradle | 55 ----- packages/sqlite3_vec/android/settings.gradle | 1 - .../android/src/main/AndroidManifest.xml | 3 - .../movenext/sqlite3_vec/Sqlite3VecPlugin.kt | 16 -- packages/sqlite3_vec/example/.gitignore | 45 ---- packages/sqlite3_vec/example/README.md | 16 -- .../sqlite3_vec/example/analysis_options.yaml | 28 --- .../example/android/app/build.gradle | 44 ---- .../android/app/src/debug/AndroidManifest.xml | 7 - .../android/app/src/main/AndroidManifest.xml | 45 ---- .../plugins/GeneratedPluginRegistrant.java | 34 --- .../sqlite3_vec_example/MainActivity.kt | 5 - .../res/drawable-v21/launch_background.xml | 12 -- .../main/res/drawable/launch_background.xml | 12 -- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../app/src/main/res/values-night/styles.xml | 18 -- .../app/src/main/res/values/styles.xml | 18 -- .../app/src/profile/AndroidManifest.xml | 7 - .../sqlite3_vec/example/android/build.gradle | 18 -- .../example/android/gradle.properties | 3 - .../gradle/wrapper/gradle-wrapper.properties | 5 - .../example/android/local.properties | 2 - .../example/android/settings.gradle | 25 --- packages/sqlite3_vec/example/lib/main.dart | 45 ---- .../sqlite3_vec/example/linux/CMakeLists.txt | 130 ----------- .../example/linux/flutter/CMakeLists.txt | 88 -------- .../.plugin_symlinks/sqlite3_flutter_libs | 1 - .../ephemeral/.plugin_symlinks/sqlite3_vec | 1 - .../flutter/generated_plugin_registrant.cc | 19 -- .../flutter/generated_plugin_registrant.h | 15 -- .../linux/flutter/generated_plugins.cmake | 25 --- .../example/linux/runner/CMakeLists.txt | 26 --- .../sqlite3_vec/example/linux/runner/main.cc | 6 - .../example/linux/runner/my_application.cc | 130 ----------- .../example/linux/runner/my_application.h | 18 -- packages/sqlite3_vec/example/pubspec.yaml | 25 --- .../example/pubspec_overrides.yaml | 4 - packages/sqlite3_vec/lib/sqlite3_vec.dart | 25 --- packages/sqlite3_vec/linux/CMakeLists.txt | 134 ------------ .../include/sqlite3_vec/sqlite3_vec_plugin.h | 26 --- .../sqlite3_vec/linux/sqlite3_vec_plugin.cc | 76 ------- .../linux/sqlite3_vec_plugin_private.h | 10 - .../linux/test/sqlite3_vec_plugin_test.cc | 31 --- packages/sqlite3_vec/pubspec.yaml | 72 ------- 58 files changed, 2 insertions(+), 1740 deletions(-) delete mode 100644 packages/sqlite3_vec/.gitignore delete mode 100644 packages/sqlite3_vec/.metadata delete mode 100644 packages/sqlite3_vec/CHANGELOG.md delete mode 100644 packages/sqlite3_vec/LICENSE delete mode 100644 packages/sqlite3_vec/README.md delete mode 100644 packages/sqlite3_vec/analysis_options.yaml delete mode 100644 packages/sqlite3_vec/android/.gitignore delete mode 100644 packages/sqlite3_vec/android/CMakeLists.txt delete mode 100644 packages/sqlite3_vec/android/build.gradle delete mode 100644 packages/sqlite3_vec/android/settings.gradle delete mode 100644 packages/sqlite3_vec/android/src/main/AndroidManifest.xml delete mode 100644 packages/sqlite3_vec/android/src/main/kotlin/me/movenext/sqlite3_vec/Sqlite3VecPlugin.kt delete mode 100644 packages/sqlite3_vec/example/.gitignore delete mode 100644 packages/sqlite3_vec/example/README.md delete mode 100644 packages/sqlite3_vec/example/analysis_options.yaml delete mode 100644 packages/sqlite3_vec/example/android/app/build.gradle delete mode 100644 packages/sqlite3_vec/example/android/app/src/debug/AndroidManifest.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/kotlin/me/movenext/sqlite3_vec_example/MainActivity.kt delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/drawable-v21/launch_background.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/drawable/launch_background.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/values-night/styles.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/main/res/values/styles.xml delete mode 100644 packages/sqlite3_vec/example/android/app/src/profile/AndroidManifest.xml delete mode 100644 packages/sqlite3_vec/example/android/build.gradle delete mode 100644 packages/sqlite3_vec/example/android/gradle.properties delete mode 100644 packages/sqlite3_vec/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/sqlite3_vec/example/android/local.properties delete mode 100644 packages/sqlite3_vec/example/android/settings.gradle delete mode 100644 packages/sqlite3_vec/example/lib/main.dart delete mode 100644 packages/sqlite3_vec/example/linux/CMakeLists.txt delete mode 100644 packages/sqlite3_vec/example/linux/flutter/CMakeLists.txt delete mode 120000 packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_flutter_libs delete mode 120000 packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_vec delete mode 100644 packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.cc delete mode 100644 packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.h delete mode 100644 packages/sqlite3_vec/example/linux/flutter/generated_plugins.cmake delete mode 100644 packages/sqlite3_vec/example/linux/runner/CMakeLists.txt delete mode 100644 packages/sqlite3_vec/example/linux/runner/main.cc delete mode 100644 packages/sqlite3_vec/example/linux/runner/my_application.cc delete mode 100644 packages/sqlite3_vec/example/linux/runner/my_application.h delete mode 100644 packages/sqlite3_vec/example/pubspec.yaml delete mode 100644 packages/sqlite3_vec/example/pubspec_overrides.yaml delete mode 100644 packages/sqlite3_vec/lib/sqlite3_vec.dart delete mode 100644 packages/sqlite3_vec/linux/CMakeLists.txt delete mode 100644 packages/sqlite3_vec/linux/include/sqlite3_vec/sqlite3_vec_plugin.h delete mode 100644 packages/sqlite3_vec/linux/sqlite3_vec_plugin.cc delete mode 100644 packages/sqlite3_vec/linux/sqlite3_vec_plugin_private.h delete mode 100644 packages/sqlite3_vec/linux/test/sqlite3_vec_plugin_test.cc delete mode 100644 packages/sqlite3_vec/pubspec.yaml diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 5e2741ff..af47f2f1 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -76,7 +76,7 @@ dependencies: sqlite3: ^2.7.5 sqlite3_flutter_libs: ^0.5.31 sqlite3_vec: - path: ../packages/sqlite3_vec + git: https://github.com/FaFre/sqlite3_vec.git text_scroll: ^0.2.0 timeago: ^3.7.0 tor: diff --git a/app/pubspec_overrides.yaml b/app/pubspec_overrides.yaml index 4b75af34..ebda4ae3 100644 --- a/app/pubspec_overrides.yaml +++ b/app/pubspec_overrides.yaml @@ -1,9 +1,7 @@ -# melos_managed_dependency_overrides: flutter_mozilla_components,sqlite3_vec,cross_cache,flutter_chat_core +# melos_managed_dependency_overrides: flutter_mozilla_components,cross_cache,flutter_chat_core dependency_overrides: flutter_mozilla_components: path: ../packages/flutter_mozilla_components - sqlite3_vec: - path: ../packages/sqlite3_vec cross_cache: path: ../../flutter_chat_ui/packages/cross_cache flutter_chat_core: diff --git a/packages/sqlite3_vec/.gitignore b/packages/sqlite3_vec/.gitignore deleted file mode 100644 index ea810a52..00000000 --- a/packages/sqlite3_vec/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.build/ -.buildlog/ -.history -.svn/ -.swiftpm/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/packages/sqlite3_vec/.metadata b/packages/sqlite3_vec/.metadata deleted file mode 100644 index 2ab4d1aa..00000000 --- a/packages/sqlite3_vec/.metadata +++ /dev/null @@ -1,33 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "17025dd88227cd9532c33fa78f5250d548d87e9a" - channel: "stable" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - - platform: android - create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - - platform: linux - create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/sqlite3_vec/CHANGELOG.md b/packages/sqlite3_vec/CHANGELOG.md deleted file mode 100644 index 41cc7d81..00000000 --- a/packages/sqlite3_vec/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.0.1 - -* TODO: Describe initial release. diff --git a/packages/sqlite3_vec/LICENSE b/packages/sqlite3_vec/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/packages/sqlite3_vec/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/sqlite3_vec/README.md b/packages/sqlite3_vec/README.md deleted file mode 100644 index 0d66fd6a..00000000 --- a/packages/sqlite3_vec/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# sqlite3_vec - -A new Flutter plugin project. - -## Getting Started - -This project is a starting point for a Flutter -[plug-in package](https://flutter.dev/to/develop-plugins), -a specialized package that includes platform-specific implementation code for -Android and/or iOS. - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev), which offers tutorials, -samples, guidance on mobile development, and a full API reference. - diff --git a/packages/sqlite3_vec/analysis_options.yaml b/packages/sqlite3_vec/analysis_options.yaml deleted file mode 100644 index 9357549d..00000000 --- a/packages/sqlite3_vec/analysis_options.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - -include: package:lint/package.yaml -# Uncomment the following section to specify additional rules. - -linter: - rules: - unawaited_futures: true - discarded_futures: true - collection_methods_unrelated_type: true - -analyzer: - plugins: - - custom_lint - exclude: - - "**.g.dart" - - "**.swagger.dart" - - "**.freezed.dart" - - "**.chopper.dart" -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options diff --git a/packages/sqlite3_vec/android/.gitignore b/packages/sqlite3_vec/android/.gitignore deleted file mode 100644 index 98c6943f..00000000 --- a/packages/sqlite3_vec/android/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.iml -.gradle -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures -.cxx diff --git a/packages/sqlite3_vec/android/CMakeLists.txt b/packages/sqlite3_vec/android/CMakeLists.txt deleted file mode 100644 index 676e27a7..00000000 --- a/packages/sqlite3_vec/android/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -# Set the project name -project(sqlite_vec) - -# Set default compiler if not provided -if(NOT CMAKE_C_COMPILER) - set(CMAKE_C_COMPILER gcc) -endif() - -# Configure Android specific settings -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - -include(FetchContent) -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") - # cmake 3.24.0 added the `DOWNLOAD_EXTRACT_TIMESTAMP` and prints an ugly warning when - # the default is used, so override it to the recommended behavior. - # We can't really ask users to use a cmake that recent, so there's this if here. - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz - DOWNLOAD_EXTRACT_TIMESTAMP NEW - ) - - FetchContent_Declare( - vec0 - URL https://github.com/asg017/sqlite-vec/archive/refs/tags/v0.1.7-alpha.2.tar.gz - DOWNLOAD_EXTRACT_TIMESTAMP NEW - ) -else() - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz - ) - - FetchContent_Declare( - vec0 - URL https://github.com/asg017/sqlite-vec/archive/refs/tags/v0.1.7-alpha.2.tar.gz - ) -endif() - -FetchContent_MakeAvailable(sqlite3) -FetchContent_MakeAvailable(vec0) - -add_custom_command( - OUTPUT ${vec0_SOURCE_DIR}/sqlite-vec.h - COMMAND make sqlite-vec.h - WORKING_DIRECTORY ${vec0_SOURCE_DIR} - COMMENT "Building sqlite-vec.h with make" -) - -add_custom_target(generate_vec_header - DEPENDS ${vec0_SOURCE_DIR}/sqlite-vec.h -) - -add_library(vec0 - SHARED - ${vec0_SOURCE_DIR}/sqlite-vec.c -) - -add_dependencies(vec0 generate_vec_header) - -# Include directories -target_include_directories(vec0 - PRIVATE - ${vec0_SOURCE_DIR} - ${sqlite3_SOURCE_DIR} -) - -# Set compile options -target_compile_options(vec0 - PRIVATE - -Wall - -Wextra - -O3 -) diff --git a/packages/sqlite3_vec/android/build.gradle b/packages/sqlite3_vec/android/build.gradle deleted file mode 100644 index dee5e766..00000000 --- a/packages/sqlite3_vec/android/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -group = "me.movenext.sqlite3_vec" -version = "1.0-SNAPSHOT" - -buildscript { - ext.kotlin_version = "1.9.22" - repositories { - google() - mavenCentral() - } - - dependencies { - classpath("com.android.tools.build:gradle:8.7.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: "com.android.library" -apply plugin: "kotlin-android" - -android { - namespace = "me.movenext.sqlite3_vec" - - compileSdk = 35 - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17 - } - - sourceSets { - main.java.srcDirs += "src/main/kotlin" - test.java.srcDirs += "src/test/kotlin" - } - - defaultConfig { - minSdk = 21 - } - - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } - } -} diff --git a/packages/sqlite3_vec/android/settings.gradle b/packages/sqlite3_vec/android/settings.gradle deleted file mode 100644 index ff6786e8..00000000 --- a/packages/sqlite3_vec/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'sqlite3_vec' diff --git a/packages/sqlite3_vec/android/src/main/AndroidManifest.xml b/packages/sqlite3_vec/android/src/main/AndroidManifest.xml deleted file mode 100644 index b3d55606..00000000 --- a/packages/sqlite3_vec/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/packages/sqlite3_vec/android/src/main/kotlin/me/movenext/sqlite3_vec/Sqlite3VecPlugin.kt b/packages/sqlite3_vec/android/src/main/kotlin/me/movenext/sqlite3_vec/Sqlite3VecPlugin.kt deleted file mode 100644 index 61c608bc..00000000 --- a/packages/sqlite3_vec/android/src/main/kotlin/me/movenext/sqlite3_vec/Sqlite3VecPlugin.kt +++ /dev/null @@ -1,16 +0,0 @@ -package me.movenext.sqlite3_vec - -import androidx.annotation.NonNull - -import io.flutter.embedding.engine.plugins.FlutterPlugin - -/** Sqlite3VecPlugin */ -class Sqlite3VecPlugin: FlutterPlugin { - override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - - } - - override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { - - } -} diff --git a/packages/sqlite3_vec/example/.gitignore b/packages/sqlite3_vec/example/.gitignore deleted file mode 100644 index 79c113f9..00000000 --- a/packages/sqlite3_vec/example/.gitignore +++ /dev/null @@ -1,45 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.build/ -.buildlog/ -.history -.svn/ -.swiftpm/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/packages/sqlite3_vec/example/README.md b/packages/sqlite3_vec/example/README.md deleted file mode 100644 index be857fb2..00000000 --- a/packages/sqlite3_vec/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# sqlite3_vec_example - -Demonstrates how to use the sqlite3_vec plugin. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/packages/sqlite3_vec/example/analysis_options.yaml b/packages/sqlite3_vec/example/analysis_options.yaml deleted file mode 100644 index 0d290213..00000000 --- a/packages/sqlite3_vec/example/analysis_options.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/packages/sqlite3_vec/example/android/app/build.gradle b/packages/sqlite3_vec/example/android/app/build.gradle deleted file mode 100644 index ca34f951..00000000 --- a/packages/sqlite3_vec/example/android/app/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" -} - -android { - namespace = "me.movenext.sqlite3_vec_example" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17 - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "me.movenext.sqlite3_vec_example" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug - } - } -} - -flutter { - source = "../.." -} diff --git a/packages/sqlite3_vec/example/android/app/src/debug/AndroidManifest.xml b/packages/sqlite3_vec/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 399f6981..00000000 --- a/packages/sqlite3_vec/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/main/AndroidManifest.xml b/packages/sqlite3_vec/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index c4163281..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/sqlite3_vec/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java deleted file mode 100644 index 903dd3b8..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.flutter.plugins; - -import androidx.annotation.Keep; -import androidx.annotation.NonNull; -import io.flutter.Log; - -import io.flutter.embedding.engine.FlutterEngine; - -/** - * Generated file. Do not edit. - * This file is generated by the Flutter tool based on the - * plugins that support the Android platform. - */ -@Keep -public final class GeneratedPluginRegistrant { - private static final String TAG = "GeneratedPluginRegistrant"; - public static void registerWith(@NonNull FlutterEngine flutterEngine) { - try { - flutterEngine.getPlugins().add(new dev.flutter.plugins.integration_test.IntegrationTestPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin integration_test, dev.flutter.plugins.integration_test.IntegrationTestPlugin", e); - } - try { - flutterEngine.getPlugins().add(new eu.simonbinder.sqlite3_flutter_libs.Sqlite3FlutterLibsPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin sqlite3_flutter_libs, eu.simonbinder.sqlite3_flutter_libs.Sqlite3FlutterLibsPlugin", e); - } - try { - flutterEngine.getPlugins().add(new me.movenext.sqlite3_vec.Sqlite3VecPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin sqlite3_vec, me.movenext.sqlite3_vec.Sqlite3VecPlugin", e); - } - } -} diff --git a/packages/sqlite3_vec/example/android/app/src/main/kotlin/me/movenext/sqlite3_vec_example/MainActivity.kt b/packages/sqlite3_vec/example/android/app/src/main/kotlin/me/movenext/sqlite3_vec_example/MainActivity.kt deleted file mode 100644 index a551b6cb..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/kotlin/me/movenext/sqlite3_vec_example/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package me.movenext.sqlite3_vec_example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/sqlite3_vec/example/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f3..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/drawable/launch_background.xml b/packages/sqlite3_vec/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f8..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/sqlite3_vec/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/values-night/styles.xml b/packages/sqlite3_vec/example/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be7..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/main/res/values/styles.xml b/packages/sqlite3_vec/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef880..00000000 --- a/packages/sqlite3_vec/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/packages/sqlite3_vec/example/android/app/src/profile/AndroidManifest.xml b/packages/sqlite3_vec/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 399f6981..00000000 --- a/packages/sqlite3_vec/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/sqlite3_vec/example/android/build.gradle b/packages/sqlite3_vec/example/android/build.gradle deleted file mode 100644 index d2ffbffa..00000000 --- a/packages/sqlite3_vec/example/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = "../build" -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/packages/sqlite3_vec/example/android/gradle.properties b/packages/sqlite3_vec/example/android/gradle.properties deleted file mode 100644 index 25971708..00000000 --- a/packages/sqlite3_vec/example/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError -android.useAndroidX=true -android.enableJetifier=true diff --git a/packages/sqlite3_vec/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/sqlite3_vec/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index c6a2952d..00000000 --- a/packages/sqlite3_vec/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip diff --git a/packages/sqlite3_vec/example/android/local.properties b/packages/sqlite3_vec/example/android/local.properties deleted file mode 100644 index 930db76c..00000000 --- a/packages/sqlite3_vec/example/android/local.properties +++ /dev/null @@ -1,2 +0,0 @@ -sdk.dir=/home/fafre/Android/Sdk -flutter.sdk=/home/fafre/development/flutter \ No newline at end of file diff --git a/packages/sqlite3_vec/example/android/settings.gradle b/packages/sqlite3_vec/example/android/settings.gradle deleted file mode 100644 index 892133c0..00000000 --- a/packages/sqlite3_vec/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.7.0" apply false - id "org.jetbrains.kotlin.android" version "1.9.22" apply false -} - -include ":app" diff --git a/packages/sqlite3_vec/example/lib/main.dart b/packages/sqlite3_vec/example/lib/main.dart deleted file mode 100644 index 7c078ef5..00000000 --- a/packages/sqlite3_vec/example/lib/main.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:sqlite3/sqlite3.dart'; -import 'package:sqlite3_vec/sqlite3_vec.dart'; - -void main() async { - WidgetsFlutterBinding.ensureInitialized(); - - Sqlite3Vec.ensureExtensionLoaded(); - - final db = sqlite3.openInMemory(); - - runApp(MyApp(db: db)); -} - -class MyApp extends StatefulWidget { - const MyApp({super.key, required this.db}); - - final Database db; - - @override - State createState() => _MyAppState(); -} - -class _MyAppState extends State { - @override - void dispose() { - widget.db.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final version = - widget - .db // - .select('SELECT vec_version() as version;') - .first['version']; - return MaterialApp( - home: Scaffold( - appBar: AppBar(title: const Text('sqlite-vec')), - body: Center(child: Text('version: $version')), - ), - ); - } -} diff --git a/packages/sqlite3_vec/example/linux/CMakeLists.txt b/packages/sqlite3_vec/example/linux/CMakeLists.txt deleted file mode 100644 index a0fedf05..00000000 --- a/packages/sqlite3_vec/example/linux/CMakeLists.txt +++ /dev/null @@ -1,130 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "sqlite3_vec_example") -# The unique GTK application identifier for this application. See: -# https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "me.movenext.sqlite3_vec") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Load bundled libraries from the lib/ directory relative to the binary. -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Define build configuration options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) - -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - -# Enable the test target. -set(include_sqlite3_vec_tests TRUE) - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) - install(FILES "${bundled_library}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endforeach(bundled_library) - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() diff --git a/packages/sqlite3_vec/example/linux/flutter/CMakeLists.txt b/packages/sqlite3_vec/example/linux/flutter/CMakeLists.txt deleted file mode 100644 index d5bd0164..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) diff --git a/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_flutter_libs b/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_flutter_libs deleted file mode 120000 index 3928549b..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_flutter_libs +++ /dev/null @@ -1 +0,0 @@ -/home/fafre/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.31/ \ No newline at end of file diff --git a/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_vec b/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_vec deleted file mode 120000 index e2d791c8..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/ephemeral/.plugin_symlinks/sqlite3_vec +++ /dev/null @@ -1 +0,0 @@ -/home/fafre/development/repos/lensai/packages/sqlite3_vec/ \ No newline at end of file diff --git a/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.cc b/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 3f44d03f..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,19 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); - sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) sqlite3_vec_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3VecPlugin"); - sqlite3_vec_plugin_register_with_registrar(sqlite3_vec_registrar); -} diff --git a/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.h b/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47b..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/sqlite3_vec/example/linux/flutter/generated_plugins.cmake b/packages/sqlite3_vec/example/linux/flutter/generated_plugins.cmake deleted file mode 100644 index db36e839..00000000 --- a/packages/sqlite3_vec/example/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - sqlite3_flutter_libs - sqlite3_vec -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/packages/sqlite3_vec/example/linux/runner/CMakeLists.txt b/packages/sqlite3_vec/example/linux/runner/CMakeLists.txt deleted file mode 100644 index e97dabc7..00000000 --- a/packages/sqlite3_vec/example/linux/runner/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the application ID. -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/packages/sqlite3_vec/example/linux/runner/main.cc b/packages/sqlite3_vec/example/linux/runner/main.cc deleted file mode 100644 index e7c5c543..00000000 --- a/packages/sqlite3_vec/example/linux/runner/main.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} diff --git a/packages/sqlite3_vec/example/linux/runner/my_application.cc b/packages/sqlite3_vec/example/linux/runner/my_application.cc deleted file mode 100644 index c5ff4301..00000000 --- a/packages/sqlite3_vec/example/linux/runner/my_application.cc +++ /dev/null @@ -1,130 +0,0 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "sqlite3_vec_example"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "sqlite3_vec_example"); - } - - gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GApplication::startup. -static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application startup. - - G_APPLICATION_CLASS(my_application_parent_class)->startup(application); -} - -// Implements GApplication::shutdown. -static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application shutdown. - - G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; - G_APPLICATION_CLASS(klass)->startup = my_application_startup; - G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - // Set the program name to the application ID, which helps various systems - // like GTK and desktop environments map this running application to its - // corresponding .desktop file. This ensures better integration by allowing - // the application to be recognized beyond its binary name. - g_set_prgname(APPLICATION_ID); - - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); -} diff --git a/packages/sqlite3_vec/example/linux/runner/my_application.h b/packages/sqlite3_vec/example/linux/runner/my_application.h deleted file mode 100644 index 72271d5e..00000000 --- a/packages/sqlite3_vec/example/linux/runner/my_application.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/packages/sqlite3_vec/example/pubspec.yaml b/packages/sqlite3_vec/example/pubspec.yaml deleted file mode 100644 index b1c7a417..00000000 --- a/packages/sqlite3_vec/example/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: sqlite3_vec_example -description: "Demonstrates how to use the sqlite3_vec plugin." - -environment: - sdk: '>=3.7.0 <4.0.0' - -dependencies: - flutter: - sdk: flutter - - sqlite3_vec: - path: ../ - sqlite3: ^2.7.5 - sqlite3_flutter_libs: ^0.5.31 - -dev_dependencies: - integration_test: - sdk: flutter - flutter_test: - sdk: flutter - - flutter_lints: ^5.0.0 - -flutter: - uses-material-design: true \ No newline at end of file diff --git a/packages/sqlite3_vec/example/pubspec_overrides.yaml b/packages/sqlite3_vec/example/pubspec_overrides.yaml deleted file mode 100644 index 2eaee419..00000000 --- a/packages/sqlite3_vec/example/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: sqlite3_vec -dependency_overrides: - sqlite3_vec: - path: .. diff --git a/packages/sqlite3_vec/lib/sqlite3_vec.dart b/packages/sqlite3_vec/lib/sqlite3_vec.dart deleted file mode 100644 index b5d05ad7..00000000 --- a/packages/sqlite3_vec/lib/sqlite3_vec.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'dart:ffi'; -import 'dart:io'; - -import 'package:sqlite3/sqlite3.dart'; - -const String _libName = 'vec0'; - -// ignore: avoid_classes_with_only_static_members better like this -class Sqlite3Vec { - static void ensureExtensionLoaded() { - final libPath = switch (Platform.operatingSystem) { - //'macos' || 'ios' => DynamicLibrary.open('$_libName.framework/$_libName'), - 'android' || 'linux' => DynamicLibrary.open('lib$_libName.so'), - //'windows' => DynamicLibrary.open('$_libName.dll'), - _ => - throw UnsupportedError( - 'Unsupported platform: ${Platform.operatingSystem}', - ), - }; - - sqlite3.ensureExtensionLoaded( - SqliteExtension.inLibrary(libPath, 'sqlite3_vec_init'), - ); - } -} diff --git a/packages/sqlite3_vec/linux/CMakeLists.txt b/packages/sqlite3_vec/linux/CMakeLists.txt deleted file mode 100644 index 6ba01d4c..00000000 --- a/packages/sqlite3_vec/linux/CMakeLists.txt +++ /dev/null @@ -1,134 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -# Project-level configuration. -set(PROJECT_NAME "sqlite3_vec") -project(${PROJECT_NAME} LANGUAGES CXX C) - -set(PLUGIN_NAME "sqlite3_vec_plugin") - -# Plugin sources -list(APPEND PLUGIN_SOURCES - "sqlite3_vec_plugin.cc" -) - -# Fetch SQLite and Vec libraries -include(FetchContent) -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz - DOWNLOAD_EXTRACT_TIMESTAMP NEW - ) - FetchContent_Declare( - vec0 - URL https://github.com/asg017/sqlite-vec/archive/refs/tags/v0.1.7-alpha.2.tar.gz - DOWNLOAD_EXTRACT_TIMESTAMP NEW - ) -else() - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz - ) - FetchContent_Declare( - vec0 - URL https://github.com/asg017/sqlite-vec/archive/refs/tags/v0.1.7-alpha.2.tar.gz - ) -endif() - -FetchContent_MakeAvailable(sqlite3) -FetchContent_MakeAvailable(vec0) - -# Generate Vec header -add_custom_command( - OUTPUT ${vec0_SOURCE_DIR}/sqlite-vec.h - COMMAND make sqlite-vec.h - WORKING_DIRECTORY ${vec0_SOURCE_DIR} - COMMENT "Building sqlite-vec.h with make" -) - -add_custom_target(generate_vec_header - DEPENDS ${vec0_SOURCE_DIR}/sqlite-vec.h -) - -# Build Vec library -add_library(vec0 - SHARED - ${vec0_SOURCE_DIR}/sqlite-vec.c -) - -add_dependencies(vec0 generate_vec_header) - -target_include_directories(vec0 - PRIVATE - ${vec0_SOURCE_DIR} - ${sqlite3_SOURCE_DIR} -) - -target_compile_options(vec0 - PRIVATE - -Wall - -Wextra - -O3 -) - -# Plugin library -add_library(${PLUGIN_NAME} SHARED - ${PLUGIN_SOURCES} -) - -apply_standard_settings(${PLUGIN_NAME}) -set_target_properties(${PLUGIN_NAME} PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) - -target_include_directories(${PLUGIN_NAME} INTERFACE - "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) -target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) -target_link_libraries(${PLUGIN_NAME} PRIVATE vec0) - -# Bundle the vec0 library -set(sqlite3_vec_bundled_libraries - "$" - PARENT_SCOPE -) - -# Tests section remains unchanged -if (${include_${PROJECT_NAME}_tests}) -if(${CMAKE_VERSION} VERSION_LESS "3.11.0") -message("Unit tests require CMake 3.11.0 or later") -else() -set(TEST_RUNNER "${PROJECT_NAME}_test") -enable_testing() - -# Add the Google Test dependency. -include(FetchContent) -FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/release-1.11.0.zip -) -# Prevent overriding the parent project's compiler/linker settings -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -# Disable install commands for gtest so it doesn't end up in the bundle. -set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE) - -FetchContent_MakeAvailable(googletest) - -# The plugin's exported API is not very useful for unit testing, so build the -# sources directly into the test binary rather than using the shared library. -add_executable(${TEST_RUNNER} - test/sqlite3_vec_plugin_test.cc - ${PLUGIN_SOURCES} -) -apply_standard_settings(${TEST_RUNNER}) -target_include_directories(${TEST_RUNNER} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -target_link_libraries(${TEST_RUNNER} PRIVATE flutter) -target_link_libraries(${TEST_RUNNER} PRIVATE PkgConfig::GTK) -target_link_libraries(${TEST_RUNNER} PRIVATE gtest_main gmock) - -# Enable automatic test discovery. -include(GoogleTest) -gtest_discover_tests(${TEST_RUNNER}) - -endif() # CMake version check -endif() # include_${PROJECT_NAME}_tests \ No newline at end of file diff --git a/packages/sqlite3_vec/linux/include/sqlite3_vec/sqlite3_vec_plugin.h b/packages/sqlite3_vec/linux/include/sqlite3_vec/sqlite3_vec_plugin.h deleted file mode 100644 index 89a85777..00000000 --- a/packages/sqlite3_vec/linux/include/sqlite3_vec/sqlite3_vec_plugin.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef FLUTTER_PLUGIN_SQLITE3_VEC_PLUGIN_H_ -#define FLUTTER_PLUGIN_SQLITE3_VEC_PLUGIN_H_ - -#include - -G_BEGIN_DECLS - -#ifdef FLUTTER_PLUGIN_IMPL -#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) -#else -#define FLUTTER_PLUGIN_EXPORT -#endif - -typedef struct _Sqlite3VecPlugin Sqlite3VecPlugin; -typedef struct { - GObjectClass parent_class; -} Sqlite3VecPluginClass; - -FLUTTER_PLUGIN_EXPORT GType sqlite3_vec_plugin_get_type(); - -FLUTTER_PLUGIN_EXPORT void sqlite3_vec_plugin_register_with_registrar( - FlPluginRegistrar* registrar); - -G_END_DECLS - -#endif // FLUTTER_PLUGIN_SQLITE3_VEC_PLUGIN_H_ diff --git a/packages/sqlite3_vec/linux/sqlite3_vec_plugin.cc b/packages/sqlite3_vec/linux/sqlite3_vec_plugin.cc deleted file mode 100644 index bea47954..00000000 --- a/packages/sqlite3_vec/linux/sqlite3_vec_plugin.cc +++ /dev/null @@ -1,76 +0,0 @@ -#include "include/sqlite3_vec/sqlite3_vec_plugin.h" - -#include -#include -#include - -#include - -#include "sqlite3_vec_plugin_private.h" - -#define SQLITE3_VEC_PLUGIN(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), sqlite3_vec_plugin_get_type(), \ - Sqlite3VecPlugin)) - -struct _Sqlite3VecPlugin { - GObject parent_instance; -}; - -G_DEFINE_TYPE(Sqlite3VecPlugin, sqlite3_vec_plugin, g_object_get_type()) - -// Called when a method call is received from Flutter. -static void sqlite3_vec_plugin_handle_method_call( - Sqlite3VecPlugin* self, - FlMethodCall* method_call) { - g_autoptr(FlMethodResponse) response = nullptr; - - const gchar* method = fl_method_call_get_name(method_call); - - if (strcmp(method, "getPlatformVersion") == 0) { - response = get_platform_version(); - } else { - response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); - } - - fl_method_call_respond(method_call, response, nullptr); -} - -FlMethodResponse* get_platform_version() { - struct utsname uname_data = {}; - uname(&uname_data); - g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); - g_autoptr(FlValue) result = fl_value_new_string(version); - return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); -} - -static void sqlite3_vec_plugin_dispose(GObject* object) { - G_OBJECT_CLASS(sqlite3_vec_plugin_parent_class)->dispose(object); -} - -static void sqlite3_vec_plugin_class_init(Sqlite3VecPluginClass* klass) { - G_OBJECT_CLASS(klass)->dispose = sqlite3_vec_plugin_dispose; -} - -static void sqlite3_vec_plugin_init(Sqlite3VecPlugin* self) {} - -static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, - gpointer user_data) { - Sqlite3VecPlugin* plugin = SQLITE3_VEC_PLUGIN(user_data); - sqlite3_vec_plugin_handle_method_call(plugin, method_call); -} - -void sqlite3_vec_plugin_register_with_registrar(FlPluginRegistrar* registrar) { - Sqlite3VecPlugin* plugin = SQLITE3_VEC_PLUGIN( - g_object_new(sqlite3_vec_plugin_get_type(), nullptr)); - - g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); - g_autoptr(FlMethodChannel) channel = - fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), - "sqlite3_vec", - FL_METHOD_CODEC(codec)); - fl_method_channel_set_method_call_handler(channel, method_call_cb, - g_object_ref(plugin), - g_object_unref); - - g_object_unref(plugin); -} diff --git a/packages/sqlite3_vec/linux/sqlite3_vec_plugin_private.h b/packages/sqlite3_vec/linux/sqlite3_vec_plugin_private.h deleted file mode 100644 index 23b3b496..00000000 --- a/packages/sqlite3_vec/linux/sqlite3_vec_plugin_private.h +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "include/sqlite3_vec/sqlite3_vec_plugin.h" - -// This file exposes some plugin internals for unit testing. See -// https://github.com/flutter/flutter/issues/88724 for current limitations -// in the unit-testable API. - -// Handles the getPlatformVersion method call. -FlMethodResponse *get_platform_version(); diff --git a/packages/sqlite3_vec/linux/test/sqlite3_vec_plugin_test.cc b/packages/sqlite3_vec/linux/test/sqlite3_vec_plugin_test.cc deleted file mode 100644 index 1d7c3c47..00000000 --- a/packages/sqlite3_vec/linux/test/sqlite3_vec_plugin_test.cc +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -#include "include/sqlite3_vec/sqlite3_vec_plugin.h" -#include "sqlite3_vec_plugin_private.h" - -// This demonstrates a simple unit test of the C portion of this plugin's -// implementation. -// -// Once you have built the plugin's example app, you can run these tests -// from the command line. For instance, for a plugin called my_plugin -// built for x64 debug, run: -// $ build/linux/x64/debug/plugins/my_plugin/my_plugin_test - -namespace sqlite3_vec { -namespace test { - -TEST(Sqlite3VecPlugin, GetPlatformVersion) { - g_autoptr(FlMethodResponse) response = get_platform_version(); - ASSERT_NE(response, nullptr); - ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); - FlValue* result = fl_method_success_response_get_result( - FL_METHOD_SUCCESS_RESPONSE(response)); - ASSERT_EQ(fl_value_get_type(result), FL_VALUE_TYPE_STRING); - // The full string varies, so just validate that it has the right format. - EXPECT_THAT(fl_value_get_string(result), testing::StartsWith("Linux ")); -} - -} // namespace test -} // namespace sqlite3_vec diff --git a/packages/sqlite3_vec/pubspec.yaml b/packages/sqlite3_vec/pubspec.yaml deleted file mode 100644 index 2595ad73..00000000 --- a/packages/sqlite3_vec/pubspec.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: sqlite3_vec -description: "A new Flutter plugin project." -version: 0.0.1 -homepage: - -environment: - sdk: '>=3.7.0 <4.0.0' - flutter: '>=3.3.0' - -dependencies: - flutter: - sdk: flutter - sqlite3: ^2.7.5 - -dev_dependencies: - flutter_test: - sdk: flutter - lint: ^2.8.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - # This section identifies this Flutter project as a plugin project. - # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) - # which should be registered in the plugin registry. This is required for - # using method channels. - # The Android 'package' specifies package in which the registered class is. - # This is required for using method channels on Android. - # The 'ffiPlugin' specifies that native code should be built and bundled. - # This is required for using `dart:ffi`. - # All these are used by the tooling to maintain consistency when - # adding or updating assets for this project. - plugin: - platforms: - android: - package: me.movenext.sqlite3_vec - pluginClass: Sqlite3VecPlugin - linux: - pluginClass: Sqlite3VecPlugin - - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # To add custom fonts to your plugin package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package