diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index e93a64df..ba2b3d77 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -61,12 +61,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install shorthand CLI tool - run: cargo install --path shorthand/ - - - name: Create a Flutter app for testing - run: flutter create test_app - - name: Setup Ninja and GTK3 toolchain (Only Linux target) if: matrix.target == 'linux' run: | @@ -80,52 +74,60 @@ jobs: distribution: "zulu" java-version: "11" + - name: Install the CLI tool + working-directory: rust_crate/ + run: cargo install --path ./ + + - name: Create a Flutter app for testing + working-directory: flutter_ffi_plugin/ + run: flutter create test_app + - name: Fetch Flutter dependencies - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: flutter pub get - name: Add this framework as a dependency - working-directory: test_app/ - run: dart pub add "rust_in_flutter:{'path':'../'}" + working-directory: flutter_ffi_plugin/test_app/ + run: dart pub add "rinf:{'path':'../'}" - name: Apply Rust template - working-directory: test_app/ - run: rifs template + working-directory: flutter_ffi_plugin/test_app/ + run: rinf template - name: Generate message files - working-directory: test_app/ - run: rifs message + working-directory: flutter_ffi_plugin/test_app/ + run: rinf message - name: Build the example app if: matrix.target == 'linux' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: flutter build linux - name: Build the example app if: matrix.target == 'android' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: | flutter build apk flutter build appbundle - name: Build the example app if: matrix.target == 'windows' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: flutter build windows - name: Build the example app if: matrix.target == 'macos' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: flutter build macos - name: Build the example app if: matrix.target == 'ios' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: flutter build ios --no-codesign - name: Build the example app if: matrix.target == 'web' - working-directory: test_app/ + working-directory: flutter_ffi_plugin/test_app/ run: | - rifs wasm --release + rinf wasm --release flutter build web diff --git a/.github/workflows/formatting_test.yaml b/.github/workflows/formatting_test.yaml index 6daaef0f..f2abbb53 100644 --- a/.github/workflows/formatting_test.yaml +++ b/.github/workflows/formatting_test.yaml @@ -39,20 +39,20 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install shorthand CLI tool - working-directory: shorthand/ - run: cargo install --path ./ - - name: Install Clippy run: rustup component add clippy + - name: Install the CLI tool + working-directory: rust_crate/ + run: cargo install --path ./ + - name: Fetch Flutter dependencies - working-directory: example/ + working-directory: flutter_ffi_plugin/example/ run: flutter pub get - name: Generate message files - working-directory: example/ - run: rifs message + working-directory: flutter_ffi_plugin/example/ + run: rinf message - name: Check for any errors run: | diff --git a/.gitignore b/.gitignore index c6787f64..29423fe5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,5 @@ build/ target/ # Others -**/*.lock +*.lock /documentation/site/ diff --git a/.metadata b/.metadata deleted file mode 100644 index 19ba21e9..00000000 --- a/.metadata +++ /dev/null @@ -1,42 +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. - -version: - revision: 796c8ef79279f9c774545b3771238c3098dbefab - channel: stable - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - platform: android - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - platform: ios - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - platform: linux - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - platform: macos - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - platform: windows - create_revision: 796c8ef79279f9c774545b3771238c3098dbefab - base_revision: 796c8ef79279f9c774545b3771238c3098dbefab - - # 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/.pubignore b/.pubignore deleted file mode 100644 index b64dc156..00000000 --- a/.pubignore +++ /dev/null @@ -1,10 +0,0 @@ -# Remove unnecessary content -# when publishing the package to pub.dev - -/automate/ -/documentation/ -/shorthand/ -/target/ -/Cargo.toml - -*.lock diff --git a/Cargo.toml b/Cargo.toml index b760df34..a01594a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["./example/native/*", "./shorthand"] +members = ["./flutter_ffi_plugin/example/native/*", "./rust_crate"] resolver = "2" diff --git a/README.md b/README.md index 8169ab77..e00e6dd5 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ -# Rust-In-Flutter +# Rinf: Rust in Flutter -[![Pub Version](https://img.shields.io/pub/v/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Popularity](https://img.shields.io/pub/popularity/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Points](https://img.shields.io/pub/points/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![GitHub Stars](https://img.shields.io/github/stars/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/stargazers) -[![Build Test](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml/badge.svg)](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) -[![GitHub License](https://img.shields.io/github/license/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/blob/main/LICENSE) +[![Pub Version](https://img.shields.io/pub/v/rinf)](https://pub.dev/packages/rinf) +[![Pub Popularity](https://img.shields.io/pub/popularity/rinf)](https://pub.dev/packages/rinf) +[![Pub Points](https://img.shields.io/pub/points/rinf)](https://pub.dev/packages/rinf) +[![GitHub Stars](https://img.shields.io/github/stars/cunarist/rinf)](https://github.com/cunarist/rinf/stargazers) +[![Build Test](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml/badge.svg)](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml?query=branch%3Amain) +[![GitHub License](https://img.shields.io/github/license/cunarist/rinf)](https://github.com/cunarist/rinf/blob/main/LICENSE) **Rust as your Flutter backend, Flutter as your Rust frontend** -![Preview](https://github.com/cunarist/rust-in-flutter/assets/66480156/ae82aad9-02f9-4a1e-93f9-69907511baf8) +![Preview](https://github.com/cunarist/rinf/assets/66480156/ae82aad9-02f9-4a1e-93f9-69907511baf8) This is a production-ready framework for creating beautiful and performant cross-platform apps using Flutter and Rust with batteries fully included. Simply add this framework to your app project, and you're all set to write Flutter and Rust together! ## 🎮 Demo -Visit the [demo](https://rif-demo.cunarist.com/) running on the web to experience the smoothness and delightfulness that comes from the combination of Flutter and Rust. You can also dive into the [example code](https://github.com/cunarist/rust-in-flutter/tree/main/example). +Visit the [demo](https://rinf-demo.cunarist.com/) running on the web to experience the smoothness and delightfulness that comes from the combination of Flutter and Rust. You can also dive into the [example code](https://github.com/cunarist/rinf/tree/main/flutter_ffi_plugin/example). ## 🖥️ Platform Support -All platforms available with Flutter are [tested](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) and supported. Challenging build settings are automatically handled by this framework. +All platforms available with Flutter are [tested](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml?query=branch%3Amain) and supported. Challenging build settings are automatically handled by this framework. - ✅ Linux: Tested and supported - ✅ Android: Tested and supported @@ -34,7 +34,7 @@ All platforms available with Flutter are [tested](https://github.com/cunarist/ru - **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries. - **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with. - **Low-level control**: Though the hard things are kept beneath the surface, you are free to modify the underlying logic such as concurrency or debugging features. There is no hidden mechanism that prevents your understanding. -- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rust-in-flutter/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized. +- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rinf/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized. - **Efficient**: No memory copy when sending native data, no hidden threads and web workers with memory overhead. This is a really thin wrapper around Dart and Rust. - **Scalable**: You are able to use an arbitrary number of Rust library crates as you want, perhaps including ones that you've already been working on. - **Logical API**: You declare RESTful messages, not functions for APIs, which provides greater stability. Requesting from Dart and responsing from Rust, as well as streaming from Rust to Dart is possible. Messages are type-safe and flexible because it's powered by the well-known [Protobuf](https://protobuf.dev/) serialization. You also have the ability to send large binary data from Rust to Dart without any memory copy. @@ -57,10 +57,10 @@ Rust has garnered a devoted following, being [the most loved programming languag ## 📖 Documentation -Check out the [documentation](https://rif-docs.cunarist.com) for everything you need to know about how to use this thing. +Check out the [documentation](https://rinf-docs.cunarist.com) for everything you need to know about how to use this thing. ## 👥 Contributors We appreciate your contribution to the development of this project! We're always open to discussions and pull requests, so please do not hesitate to leave your ideas or opinions at our GitHub repository. -[![GitHub contributors (via allcontributors.org)](https://contrib.rocks/image?repo=cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/graphs/contributors) +[![GitHub contributors (via allcontributors.org)](https://contrib.rocks/image?repo=cunarist/rinf)](https://github.com/cunarist/rinf/graphs/contributors) diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index 10b0dc75..00000000 --- a/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'rust_in_flutter' diff --git a/automate/__main__.py b/automate/__main__.py index 32fd5a45..2d4f55be 100644 --- a/automate/__main__.py +++ b/automate/__main__.py @@ -1,6 +1,5 @@ import os import sys -import re def exit(): @@ -40,25 +39,31 @@ def remove_files_in_folder(directory: str, prefix: str): # Temporarily add `ffi` package # because `flutter_rust_bridge_codegen` wants it, # though the generated code doesn't use it. + os.chdir("./flutter_ffi_plugin/") command = "dart pub add ffi" os.system(command) + os.chdir("../") # Delete previous bridge files. - remove_files_in_folder("./example/native/hub/src/bridge", "bridge") - remove_files_in_folder("./lib/src", "bridge") + remove_files_in_folder( + "./flutter_ffi_plugin/example/native/hub/src/bridge", "bridge" + ) + remove_files_in_folder("./flutter_ffi_plugin/lib/src", "bridge") # Generate bridge files. command = "flutter_rust_bridge_codegen" - command += " --rust-input ./example/native/hub/src/bridge/api.rs" - command += " --rust-output ./example/native/hub/src/bridge/bridge_generated.rs" - command += " --dart-output ./lib/src/bridge_generated.dart" - command += " --dart-decl-output ./lib/src/bridge_definitions.dart" + command += " --rust-input ./flutter_ffi_plugin/example/native/hub/src/bridge/api.rs" + command += " --rust-output ./flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.rs" + command += " --dart-output ./flutter_ffi_plugin/lib/src/bridge_generated.dart" + command += ( + " --dart-decl-output ./flutter_ffi_plugin/lib/src/bridge_definitions.dart" + ) command += " --class-name Bridge" command += " --wasm" os.system(command) # Remove an unnecessary root import. - filepath = "./example/native/hub/src/lib.rs" + filepath = "./flutter_ffi_plugin/example/native/hub/src/lib.rs" with open(filepath, mode="r", encoding="utf8") as file: lines = file.readlines() for turn, line in enumerate(lines): @@ -68,7 +73,7 @@ def remove_files_in_folder(directory: str, prefix: str): file.write("".join(lines)) # Modify some code. - directory_path = "./lib/src/" + directory_path = "./flutter_ffi_plugin/lib/src/" search_string = "package:flutter_rust_bridge/flutter_rust_bridge.dart" replace_string = "bridge_engine/exports.dart" replace_string_in_files(directory_path, search_string, replace_string) @@ -88,7 +93,7 @@ def remove_files_in_folder(directory: str, prefix: str): replace_string = "" replace_string_in_files(directory_path, search_string, replace_string) - directory_path = "./example/native/hub/src/bridge" + directory_path = "./flutter_ffi_plugin/example/native/hub/src/bridge" search_string = "flutter_rust_bridge::" replace_string = "crate::bridge::bridge_engine::" replace_string_in_files(directory_path, search_string, replace_string) @@ -111,13 +116,15 @@ def remove_files_in_folder(directory: str, prefix: str): os.system(command) # Remove temporarily added `ffi` package. + os.chdir("./flutter_ffi_plugin/") command = "dart pub remove ffi" os.system(command) + os.chdir("../") elif sys.argv[1] == "cargokit-update": print("Updating CargoKit...") command = "git subtree pull" - command += " --prefix cargokit" + command += " --prefix flutter_ffi_plugin/cargokit" command += " https://github.com/irondash/cargokit.git" command += " main" command += " --squash" diff --git a/documentation/docs/applying-template.md b/documentation/docs/applying-template.md index d8b4c2aa..d4e2e8f7 100644 --- a/documentation/docs/applying-template.md +++ b/documentation/docs/applying-template.md @@ -5,13 +5,13 @@ First of all, add this framework to your Flutter project. ```bash -flutter pub add rust_in_flutter +flutter pub add rinf ``` Then, simply run this in the command-line from your Flutter project's directory. ```bash -rifs template +rinf template ``` After running the command, you'll have new files and folders as your starter Rust template. @@ -48,7 +48,7 @@ After running the command, you'll have new files and folders as your starter Rus Be aware that the message code in Dart and Rust doesn't exist yet. You need to generate message code from the `.proto` files in the `./messages` folder. To do this, run the following command: ```bash -rifs message +rinf message ``` Don't forget to read the guides in `./native/README.md` first. Various comments are written in the actual code to help you understand the whole structure. Also, you might want to remove `sample_crate` in production. diff --git a/documentation/docs/contribution.md b/documentation/docs/contribution.md index a22f0b0a..a8374e29 100644 --- a/documentation/docs/contribution.md +++ b/documentation/docs/contribution.md @@ -4,4 +4,4 @@ We appreciate your contribution to the development of this project! We're always open to discussions and pull requests, so please do not hesitate to leave your ideas or opinions at our GitHub repository. -[![GitHub contributors (via allcontributors.org)](https://contrib.rocks/image?repo=cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/graphs/contributors) +[![GitHub contributors (via allcontributors.org)](https://contrib.rocks/image?repo=cunarist/rinf)](https://github.com/cunarist/rinf/graphs/contributors) diff --git a/documentation/docs/frequently-asked-questions.md b/documentation/docs/frequently-asked-questions.md index 1b6e768b..80887a44 100644 --- a/documentation/docs/frequently-asked-questions.md +++ b/documentation/docs/frequently-asked-questions.md @@ -2,7 +2,7 @@ ### Where should I ask for help? -If you encounter any problems, feel free to visit [the discussions page](https://github.com/cunarist/rust-in-flutter/discussions) and open a Q&A thread for assistance. +If you encounter any problems, feel free to visit [the discussions page](https://github.com/cunarist/rinf/discussions) and open a Q&A thread for assistance. ### Where should I use Rust? @@ -14,7 +14,7 @@ Data being sent between Dart and Rust are basically bytes arrays, represented as ### Where are the library files generated from Rust crates? -All build settings of Rust-In-Flutter ensures that all library files compiled from Rust crates are properly included in the final build, ready to be distributed. Therefore you do not need to worry about bundling library files. +All build settings of Rinf ensures that all library files compiled from Rust crates are properly included in the final build, ready to be distributed. Therefore you do not need to worry about bundling library files. ### Android app build has failed. What should I do? @@ -27,7 +27,7 @@ Add that line to `./android/app/build.gradle` file: ```gradle .. android { - namespace "com.cunarist.rust_in_flutter_example" + namespace "com.cunarist.rinf_example" compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion // <------ THIS LINE @@ -72,11 +72,11 @@ cargo: ### Is it safe enough to pass secret parameters between Dart and Rust? -It is completely safe to pass secret parameters between Dart and Rust. Some other Rust GUI frameworks use HTTP or websockets to communicate between GUI and Rust, which is quite insecure. However, that's not the case for Rust-In-Flutter because messages are passed within the Flutter app's process. This is not only secure but also performant because message passing is a zero-copy operation on the memory. Please note that while it is hard to reverse-engineer compiled native binaries to search for secret keys or params, it is generally not recommended to hardcode sensitive information in the application itself. This caution applies to this framework as well as any other distributed binaries. +It is completely safe to pass secret parameters between Dart and Rust. Some other Rust GUI frameworks use HTTP or websockets to communicate between GUI and Rust, which is quite insecure. However, that's not the case for Rinf because messages are passed within the Flutter app's process. This is not only secure but also performant because message passing is a zero-copy operation on the memory. Please note that while it is hard to reverse-engineer compiled native binaries to search for secret keys or params, it is generally not recommended to hardcode sensitive information in the application itself. This caution applies to this framework as well as any other distributed binaries. ### How do I use well-known types in Protobuf? -When using well-known Protobuf types like `Timestamp` in your Dart project, it may be necessary to compile them manually if they are not automatically generated by the `rifs message` command. Here's a step-by-step guide on how to do it: +When using well-known Protobuf types like `Timestamp` in your Dart project, it may be necessary to compile them manually if they are not automatically generated by the `rinf message` command. Here's a step-by-step guide on how to do it: #### 1. Create a Proto File @@ -101,7 +101,7 @@ Open your terminal and navigate to the root directory of your Dart project. Then protoc --dart_out=./lib/messages google/protobuf/timestamp.proto ``` -Be sure to compile to `./lib/messages` because `rifs message` compiles everything into there. +Be sure to compile to `./lib/messages` because `rinf message` compiles everything into there. #### 3. Integrate Generated Files diff --git a/documentation/docs/index.md b/documentation/docs/index.md index 3ae3d208..74f2153a 100644 --- a/documentation/docs/index.md +++ b/documentation/docs/index.md @@ -1,11 +1,11 @@ # About -[![Pub Version](https://img.shields.io/pub/v/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Popularity](https://img.shields.io/pub/popularity/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Points](https://img.shields.io/pub/points/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![GitHub Stars](https://img.shields.io/github/stars/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/stargazers) -[![Build Test](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml/badge.svg)](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) -[![GitHub License](https://img.shields.io/github/license/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/blob/main/LICENSE) +[![Pub Version](https://img.shields.io/pub/v/rinf)](https://pub.dev/packages/rinf) +[![Pub Popularity](https://img.shields.io/pub/popularity/rinf)](https://pub.dev/packages/rinf) +[![Pub Points](https://img.shields.io/pub/points/rinf)](https://pub.dev/packages/rinf) +[![GitHub Stars](https://img.shields.io/github/stars/cunarist/rinf)](https://github.com/cunarist/rinf/stargazers) +[![Build Test](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml/badge.svg)](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml?query=branch%3Amain) +[![GitHub License](https://img.shields.io/github/license/cunarist/rinf)](https://github.com/cunarist/rinf/blob/main/LICENSE) **Rust as your Flutter backend, Flutter as your Rust frontend** @@ -15,11 +15,11 @@ This is a production-ready framework for creating beautiful and performant cross ## 🎮 Demo -Visit the [demo](https://rif-demo.cunarist.com/) running on the web to experience the smoothness and delightfulness that comes from the combination of Flutter and Rust. You can also dive into the [example code](https://github.com/cunarist/rust-in-flutter/tree/main/example). +Visit the [demo](https://rinf-demo.cunarist.com/) running on the web to experience the smoothness and delightfulness that comes from the combination of Flutter and Rust. You can also dive into the [example code](https://github.com/cunarist/rinf/tree/main/flutter_ffi_plugin/example). ## 🖥️ Platform Support -All platforms available with Flutter are [tested](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) and supported. Challenging build settings are automatically handled by this framework. +All platforms available with Flutter are [tested](https://github.com/cunarist/rinf/actions/workflows/build_test.yaml?query=branch%3Amain) and supported. Challenging build settings are automatically handled by this framework. - ✅ Linux: Tested and supported - ✅ Android: Tested and supported @@ -34,7 +34,7 @@ All platforms available with Flutter are [tested](https://github.com/cunarist/ru - **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries. - **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with. - **Low-level control**: Though the hard things are kept beneath the surface, you are free to modify the underlying logic such as concurrency or debugging features. There is no hidden mechanism that prevents your understanding. -- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rust-in-flutter/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized. +- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rinf/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized. - **Efficient**: No memory copy when sending native data, no hidden threads and web workers with memory overhead. This is a really thin wrapper around Dart and Rust. - **Scalable**: You are able to use an arbitrary number of Rust library crates as you want, perhaps including ones that you've already been working on. - **Logical API**: You declare RESTful messages, not functions for APIs, which provides greater stability. Requesting from Dart and responsing from Rust, as well as streaming from Rust to Dart is possible. Messages are type-safe and flexible because it's powered by the well-known [Protobuf](https://protobuf.dev/) serialization. You also have the ability to send large binary data from Rust to Dart without any memory copy. diff --git a/documentation/docs/running-and-building.md b/documentation/docs/running-and-building.md index 6bf66394..9dbb5ee9 100644 --- a/documentation/docs/running-and-building.md +++ b/documentation/docs/running-and-building.md @@ -23,14 +23,14 @@ You need to manually build webassembly module from Rust before running or buildi To serve the web application: ```bash -rifs wasm --release +rinf wasm --release flutter run --release # Choose a browser ``` To build the optimized release version of the web application: ```bash -rifs wasm --release +rinf wasm --release flutter build web ``` diff --git a/documentation/docs/rust-resource-api.md b/documentation/docs/rust-resource-api.md index 2583f59f..6750f751 100644 --- a/documentation/docs/rust-resource-api.md +++ b/documentation/docs/rust-resource-api.md @@ -6,7 +6,7 @@ Each `.proto` file located in `./messages` and its subfolders is treated as a Ru Each Rust resource will be assigned a unique `ID` on code generation, which is inserted into the `resource` field of `RustRequest` and `RustSignal` to distinguish which Rust resource that the message is trying to talk about. -When you generate message code using the `rifs message` command, the resulting Dart and Rust modules' names and subpaths will precisely correspond to those of the `.proto` files. +When you generate message code using the `rinf message` command, the resulting Dart and Rust modules' names and subpaths will precisely correspond to those of the `.proto` files. - `./messages`: `.proto` input files - `./lib/messages`: `.dart` output files diff --git a/documentation/docs/shorthand-command.md b/documentation/docs/shorthand-command.md index dffe0aac..6f4f67e5 100644 --- a/documentation/docs/shorthand-command.md +++ b/documentation/docs/shorthand-command.md @@ -1,15 +1,15 @@ # Shorthand Command -Now install the shorthand command tool to easily execute Rust-In-Flutter commands in the CLI. +Now install the shorthand command tool to easily execute Rinf commands in the CLI. ```bash -cargo install rifs +cargo install rinf ``` -After you've installed `rifs`, which stands for 'Rust-In-Flutter Shorthand', you can use this tool to execute any command provided by this framework. Actual commands will be introduced in the upcoming sections. +After you've installed `rinf`, which stands for 'Rinf Shorthand', you can use this tool to execute any command provided by this framework. Actual commands will be introduced in the upcoming sections. ```bash -rifs ... +rinf ... ``` -> All the commands of this framework can originally be executed with `dart run rust_in_flutter ...`. However, this is quite long and cumbersome to write over and over again. That's why this framework provides a shorthand command tool. +> All the commands of this framework can originally be executed with `dart run rinf ...`. However, this is quite long and cumbersome to write over and over again. That's why this framework provides a shorthand command tool. diff --git a/documentation/docs/writing-code.md b/documentation/docs/writing-code.md index 535f3462..cbaff56c 100644 --- a/documentation/docs/writing-code.md +++ b/documentation/docs/writing-code.md @@ -4,7 +4,7 @@ Let's say that you want to make a new button that sends an array of numbers and a string from Dart to Rust to perform some calculation on it. You can follow these steps to understand how to send a request and wait for the response. -Let's start from our [default example](https://github.com/cunarist/rust-in-flutter/tree/main/example). +Let's start from our [default example](https://github.com/cunarist/rinf/tree/main/flutter_ffi_plugin/example). Create a new `.proto` file in `./messages` that represents the new Rust resource. @@ -28,7 +28,7 @@ message ReadResponse { Next, generate Dart and Rust message code from `.proto` files. ```bash -rifs message +rinf message ``` Create a button widget in Dart that accepts the user input. @@ -51,7 +51,7 @@ child: Column( ```dart // lib/main.dart ... -import 'package:rust_in_flutter/rust_in_flutter.dart'; +import 'package:rinf/rinf.dart'; import 'package:example_app/messages/tutorial_resource.pb.dart' as tutorialResource; ... @@ -146,7 +146,7 @@ Finally, when you receive a response from Rust in Dart, you can do anything with ```dart // lib/main.dart ... -import 'package:rust_in_flutter/rust_in_flutter.dart'; +import 'package:rinf/rinf.dart'; import 'package:example_app/messages/tutorial_resource.pb.dart' as tutorialResource; ... @@ -178,7 +178,7 @@ You can extend this RESTful API pattern and create hundreds and thousands of end Let's say that you want to send increasing numbers every second from Rust to Dart. In this case, it would be inefficient for Dart to send requests repeatedly. This is where streaming is needed. -Let's start from our [default example](https://github.com/cunarist/rust-in-flutter/tree/main/example). +Let's start from our [default example](https://github.com/cunarist/rinf/tree/main/flutter_ffi_plugin/example). Define the Rust resource and message schema. @@ -194,7 +194,7 @@ message StateSignal { int32 current_number = 1; } Generate Dart and Rust message code from `.proto` files. ```bash -rifs message +rinf message ``` Define an async Rust function that runs forever, sending numbers to Dart every second. @@ -244,7 +244,7 @@ Finally, receive the signals in Dart with `StreamBuilder`, filter them by resour ```dart // lib/main.dart ... -import 'package:rust_in_flutter/rust_in_flutter.dart'; +import 'package:rinf/rinf.dart'; import 'package:example_app/messages/increasing_number.pb.dart' as increasingNumbers; ... @@ -277,7 +277,7 @@ We've seen how to pass `RustRequest`, `RustResponse`, and `RustSignal` between D ### Field `resource` -This is an integer pointing to a virtual Rust resource that suits your app's design. Always provide `ID` of some message module generated by `rifs message`. +This is an integer pointing to a virtual Rust resource that suits your app's design. Always provide `ID` of some message module generated by `rinf message`. ### Field `operation` diff --git a/documentation/mkdocs.yml b/documentation/mkdocs.yml index 3459efb0..7dceb4b7 100644 --- a/documentation/mkdocs.yml +++ b/documentation/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: RIF Docs +site_name: Rinf Docs theme: name: material diff --git a/flutter_ffi_plugin/CHANGELOG.md b/flutter_ffi_plugin/CHANGELOG.md new file mode 120000 index 00000000..04c99a55 --- /dev/null +++ b/flutter_ffi_plugin/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/flutter_ffi_plugin/LICENSE b/flutter_ffi_plugin/LICENSE new file mode 120000 index 00000000..ea5b6064 --- /dev/null +++ b/flutter_ffi_plugin/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/flutter_ffi_plugin/README.md b/flutter_ffi_plugin/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/flutter_ffi_plugin/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/android/.gitignore b/flutter_ffi_plugin/android/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from android/.gitignore rename to flutter_ffi_plugin/android/.gitignore diff --git a/android/build.gradle b/flutter_ffi_plugin/android/build.gradle old mode 100644 new mode 100755 similarity index 97% rename from android/build.gradle rename to flutter_ffi_plugin/android/build.gradle index 6864c513..0c9c179b --- a/android/build.gradle +++ b/flutter_ffi_plugin/android/build.gradle @@ -1,6 +1,6 @@ // The Android Gradle Plugin builds the native code with the Android NDK. -group 'com.cunarist.rust_in_flutter' +group 'com.cunarist.rinf' version '1.0' buildscript { diff --git a/flutter_ffi_plugin/android/settings.gradle b/flutter_ffi_plugin/android/settings.gradle new file mode 100755 index 00000000..9f78a940 --- /dev/null +++ b/flutter_ffi_plugin/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'rinf' diff --git a/android/src/main/AndroidManifest.xml b/flutter_ffi_plugin/android/src/main/AndroidManifest.xml old mode 100644 new mode 100755 similarity index 65% rename from android/src/main/AndroidManifest.xml rename to flutter_ffi_plugin/android/src/main/AndroidManifest.xml index 811c6b5b..77797ba3 --- a/android/src/main/AndroidManifest.xml +++ b/flutter_ffi_plugin/android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="com.cunarist.rinf"> diff --git a/bin/rust_in_flutter.dart b/flutter_ffi_plugin/bin/rinf.dart old mode 100644 new mode 100755 similarity index 96% rename from bin/rust_in_flutter.dart rename to flutter_ffi_plugin/bin/rinf.dart index 27a76580..9cbf60cc --- a/bin/rust_in_flutter.dart +++ b/flutter_ffi_plugin/bin/rinf.dart @@ -5,7 +5,7 @@ import 'dart:convert'; Future main(List args) async { if (args.length == 0) { print("No operation is provided."); - print("Use `rifs --help` to see all available operations."); + print("Use `rinf --help` to see all available operations."); return; } switch (args[0]) { @@ -28,7 +28,7 @@ Future main(List args) async { break; case "--help": case "-h": - print("Usage: rifs [arguments]"); + print("Usage: rinf [arguments]"); print("Arguments:"); print(" -h, --help Shows this usage information."); print(" template Applies Rust template to current project."); @@ -38,7 +38,7 @@ Future main(List args) async { print(" -r, --release Builds in release mode."); default: print("No such operation is available."); - print("Use `rifs --help` to see all available operations."); + print("Use `rinf --help` to see all available operations."); } } @@ -52,7 +52,7 @@ Future _applyRustTemplate({bool onlyBridge = false}) async { if (packageConfig == null) { return; } - final packageName = 'rust_in_flutter'; + final packageName = 'rinf'; final package = packageConfig.packages.firstWhere( (p) => p.name == packageName, ); @@ -125,7 +125,7 @@ $guideSectionTitle This project leverages Flutter for GUI and Rust for the backend logic, utilizing the capabilities of the -[Rust-In-Flutter](https://pub.dev/packages/rust_in_flutter) framework. +[Rinf](https://pub.dev/packages/rinf) framework. To run and build this app, you need to have [Flutter SDK](https://docs.flutter.dev/get-started/install), @@ -141,10 +141,10 @@ protoc --version flutter doctor ``` -You also need to have the CLI tool for Rust-In-Flutter ready. +You also need to have the CLI tool for Rinf ready. ```bash -cargo install rifs +cargo install rinf ``` Messages sent between Dart and Rust are implemented using Protobuf. @@ -153,7 +153,7 @@ or made changes to the `.proto` files in the `./messages` directory, run the following command: ```bash -rifs message +rinf message ``` Now you can run and build this app just like any other Flutter projects. @@ -163,7 +163,7 @@ flutter run ``` For detailed instructions on writing Rust and Flutter together, -please refer to Rust-In-Flutter's [documentation](https://rif-docs.cunarist.com). +please refer to Rinf's [documentation](https://rinf-docs.cunarist.com). '''; readmeSplitted.add(text); } @@ -175,14 +175,14 @@ please refer to Rust-In-Flutter's [documentation](https://rif-docs.cunarist.com) // Modify `./lib/main.dart` await Process.run('dart', ['format', './lib/main.dart']); var mainText = await mainFile.readAsString(); - if (!mainText.contains('package:rust_in_flutter/rust_in_flutter.dart')) { + if (!mainText.contains('package:rinf/rinf.dart')) { final lines = mainText.split("\n"); final lastImportIndex = lines.lastIndexWhere( (line) => line.startsWith('import '), ); lines.insert( lastImportIndex + 1, - "import 'package:rust_in_flutter/rust_in_flutter.dart';", + "import 'package:rinf/rinf.dart';", ); mainText = lines.join("\n"); } @@ -192,10 +192,10 @@ please refer to Rust-In-Flutter's [documentation](https://rif-docs.cunarist.com) 'main() async {', ); } - if (!mainText.contains('RustInFlutter.ensureInitialized()')) { + if (!mainText.contains('Rinf.ensureInitialized()')) { mainText = mainText.replaceFirst( 'main() async {', - 'main() async { await RustInFlutter.ensureInitialized();', + 'main() async { await Rinf.ensureInitialized();', ); } await mainFile.writeAsString(mainText); diff --git a/flutter_ffi_plugin/cargokit/.github/workflows/check_and_lint.yml b/flutter_ffi_plugin/cargokit/.github/workflows/check_and_lint.yml new file mode 100755 index 00000000..9c3dab6f --- /dev/null +++ b/flutter_ffi_plugin/cargokit/.github/workflows/check_and_lint.yml @@ -0,0 +1,26 @@ +on: + pull_request: + push: + branches: + - main + +name: Check and Lint + +jobs: + Flutter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v1 + - name: Pub Get + run: dart pub get --no-precompile + working-directory: build_tool + - name: Dart Format + run: dart format . --output=none --set-exit-if-changed + working-directory: build_tool + - name: Analyze + run: dart analyze + working-directory: build_tool + - name: Test + run: dart test + working-directory: build_tool diff --git a/flutter_ffi_plugin/cargokit/.github/workflows/test_example_plugin_build.yml b/flutter_ffi_plugin/cargokit/.github/workflows/test_example_plugin_build.yml new file mode 100755 index 00000000..70c8101c --- /dev/null +++ b/flutter_ffi_plugin/cargokit/.github/workflows/test_example_plugin_build.yml @@ -0,0 +1,82 @@ +on: + pull_request: + push: + branches: + - main + +name: Test Example Plugin + +jobs: + Build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + build_mode: + - debug + - profile + - release + env: + EXAMPLE_DIR: "a b/hello_rust_ffi_plugin/example" + CARGOKIT_VERBOSE: 1 + steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Setup Repository + shell: bash + run: | + mkdir "a b" # Space is intentional + cd "a b" + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + # "advanced" branch has extra iOS flavor and uses rust nightly for release builds + git clone -b advanced https://github.com/irondash/hello_rust_ffi_plugin + cd hello_rust_ffi_plugin + git subtree pull --prefix cargokit https://github.com/irondash/cargokit.git ${{ steps.extract_branch.outputs.branch }} --squash + - uses: subosito/flutter-action@v1 + with: + channel: "stable" + - name: Install GTK + if: (matrix.os == 'ubuntu-latest') + run: sudo apt-get update && sudo apt-get install libgtk-3-dev + - name: Install ninja-build + if: (matrix.os == 'ubuntu-latest') + run: sudo apt-get update && sudo apt-get install ninja-build + - name: Build Linux (${{ matrix.build_mode }}) + if: matrix.os == 'ubuntu-latest' + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: flutter build linux --${{ matrix.build_mode }} -v + - name: Build macOS (${{ matrix.build_mode }}) + if: matrix.os == 'macos-latest' + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: flutter build macos --${{ matrix.build_mode }} -v + - name: Build iOS (${{ matrix.build_mode }}) + if: matrix.os == 'macos-latest' + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: flutter build ios --${{ matrix.build_mode }} --no-codesign -v + - name: Build iOS (${{ matrix.build_mode }}) - flavor1 + if: matrix.os == 'macos-latest' + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: flutter build ios --flavor flavor1 --${{ matrix.build_mode }} --no-codesign -v + - name: Build Windows (${{ matrix.build_mode }}) + if: matrix.os == 'windows-latest' + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: flutter build windows --${{ matrix.build_mode }} -v + - name: Build Android (${{ matrix.build_mode }}) + shell: bash + working-directory: ${{ env.EXAMPLE_DIR }} + run: | + export JAVA_HOME=$JAVA_HOME_11_X64 + flutter build apk --${{ matrix.build_mode }} -v + diff --git a/flutter_ffi_plugin/cargokit/.gitignore b/flutter_ffi_plugin/cargokit/.gitignore new file mode 100755 index 00000000..cf7bb868 --- /dev/null +++ b/flutter_ffi_plugin/cargokit/.gitignore @@ -0,0 +1,4 @@ +target +.dart_tool +*.iml +!pubspec.lock diff --git a/cargokit/LICENSE b/flutter_ffi_plugin/cargokit/LICENSE old mode 100644 new mode 100755 similarity index 100% rename from cargokit/LICENSE rename to flutter_ffi_plugin/cargokit/LICENSE diff --git a/cargokit/README b/flutter_ffi_plugin/cargokit/README old mode 100644 new mode 100755 similarity index 100% rename from cargokit/README rename to flutter_ffi_plugin/cargokit/README diff --git a/cargokit/build_pod.sh b/flutter_ffi_plugin/cargokit/build_pod.sh similarity index 91% rename from cargokit/build_pod.sh rename to flutter_ffi_plugin/cargokit/build_pod.sh index 0dfd9615..f42e7667 100755 --- a/cargokit/build_pod.sh +++ b/flutter_ffi_plugin/cargokit/build_pod.sh @@ -54,5 +54,5 @@ done # Make a symlink from built framework to phony file, which will be used as input to # build script. This should force rebuild (podspec currently doesn't support alwaysOutOfDate # attribute on custom build phase) -ln -Fs "$OBJROOT/XCBuildData/build.db" "${BUILT_PRODUCTS_DIR}/cargokit_phony" -ln -Fs "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${BUILT_PRODUCTS_DIR}/cargokit_phony_out" \ No newline at end of file +ln -fs "$OBJROOT/XCBuildData/build.db" "${BUILT_PRODUCTS_DIR}/cargokit_phony" +ln -fs "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${BUILT_PRODUCTS_DIR}/cargokit_phony_out" diff --git a/cargokit/build_tool/README.md b/flutter_ffi_plugin/cargokit/build_tool/README.md old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/README.md rename to flutter_ffi_plugin/cargokit/build_tool/README.md diff --git a/cargokit/build_tool/analysis_options.yaml b/flutter_ffi_plugin/cargokit/build_tool/analysis_options.yaml old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/analysis_options.yaml rename to flutter_ffi_plugin/cargokit/build_tool/analysis_options.yaml diff --git a/cargokit/build_tool/bin/build_tool.dart b/flutter_ffi_plugin/cargokit/build_tool/bin/build_tool.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/bin/build_tool.dart rename to flutter_ffi_plugin/cargokit/build_tool/bin/build_tool.dart diff --git a/cargokit/build_tool/lib/build_tool.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/build_tool.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/build_tool.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/build_tool.dart diff --git a/cargokit/build_tool/lib/src/android_environment.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/android_environment.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/android_environment.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/android_environment.dart diff --git a/cargokit/build_tool/lib/src/artifacts_provider.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/artifacts_provider.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/artifacts_provider.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/artifacts_provider.dart diff --git a/cargokit/build_tool/lib/src/build_cmake.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/build_cmake.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/build_cmake.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/build_cmake.dart diff --git a/cargokit/build_tool/lib/src/build_gradle.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/build_gradle.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/build_gradle.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/build_gradle.dart diff --git a/cargokit/build_tool/lib/src/build_pod.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/build_pod.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/build_pod.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/build_pod.dart diff --git a/cargokit/build_tool/lib/src/build_tool.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/build_tool.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/build_tool.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/build_tool.dart diff --git a/cargokit/build_tool/lib/src/builder.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/builder.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/builder.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/builder.dart diff --git a/cargokit/build_tool/lib/src/cargo.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/cargo.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/cargo.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/cargo.dart diff --git a/cargokit/build_tool/lib/src/crate_hash.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/crate_hash.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/crate_hash.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/crate_hash.dart diff --git a/cargokit/build_tool/lib/src/environment.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/environment.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/environment.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/environment.dart diff --git a/cargokit/build_tool/lib/src/logging.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/logging.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/logging.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/logging.dart diff --git a/cargokit/build_tool/lib/src/options.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/options.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/options.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/options.dart diff --git a/cargokit/build_tool/lib/src/precompile_binaries.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/precompile_binaries.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/precompile_binaries.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/precompile_binaries.dart diff --git a/cargokit/build_tool/lib/src/rustup.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/rustup.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/rustup.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/rustup.dart diff --git a/cargokit/build_tool/lib/src/target.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/target.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/target.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/target.dart diff --git a/cargokit/build_tool/lib/src/util.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/util.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/util.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/util.dart diff --git a/cargokit/build_tool/lib/src/verify_binaries.dart b/flutter_ffi_plugin/cargokit/build_tool/lib/src/verify_binaries.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/lib/src/verify_binaries.dart rename to flutter_ffi_plugin/cargokit/build_tool/lib/src/verify_binaries.dart diff --git a/flutter_ffi_plugin/cargokit/build_tool/pubspec.lock b/flutter_ffi_plugin/cargokit/build_tool/pubspec.lock new file mode 100755 index 00000000..343bdd36 --- /dev/null +++ b/flutter_ffi_plugin/cargokit/build_tool/pubspec.lock @@ -0,0 +1,453 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" + source: hosted + version: "64.0.0" + adaptive_number: + dependency: transitive + description: + name: adaptive_number + sha256: "3a567544e9b5c9c803006f51140ad544aedc79604fd4f3f2c1380003f97c1d77" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + args: + dependency: "direct main" + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + collection: + dependency: "direct main" + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: "direct main" + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" + source: hosted + version: "1.6.3" + crypto: + dependency: "direct main" + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + ed25519_edwards: + dependency: "direct main" + description: + name: ed25519_edwards + sha256: "6ce0112d131327ec6d42beede1e5dfd526069b18ad45dcf654f15074ad9276cd" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + github: + dependency: "direct main" + description: + name: github + sha256: "9966bc13bf612342e916b0a343e95e5f046c88f602a14476440e9b75d2295411" + url: "https://pub.dev" + source: hosted + version: "9.17.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + hex: + dependency: "direct main" + description: + name: hex + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + http: + dependency: "direct main" + description: + name: http + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: "direct dev" + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: "direct main" + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" + source: hosted + version: "0.12.16" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: "direct main" + description: + name: path + sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + source_span: + dependency: "direct main" + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: "direct dev" + description: + name: test + sha256: "9b0dd8e36af4a5b1569029949d50a52cb2a2a2fdaa20cebb96e6603b9ae241f9" + url: "https://pub.dev" + source: hosted + version: "1.24.6" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + test_core: + dependency: transitive + description: + name: test_core + sha256: "4bef837e56375537055fdbbbf6dd458b1859881f4c7e6da936158f77d61ab265" + url: "https://pub.dev" + source: hosted + version: "0.5.6" + toml: + dependency: "direct main" + description: + name: toml + sha256: "157c5dca5160fced243f3ce984117f729c788bb5e475504f3dbcda881accee44" + url: "https://pub.dev" + source: hosted + version: "0.14.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + version: + dependency: "direct main" + description: + name: version + sha256: "2307e23a45b43f96469eeab946208ed63293e8afca9c28cd8b5241ff31c55f55" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0fae432c85c4ea880b33b497d32824b97795b04cdaa74d270219572a1f50268d" + url: "https://pub.dev" + source: hosted + version: "11.9.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + yaml: + dependency: "direct main" + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.0 <4.0.0" diff --git a/cargokit/build_tool/pubspec.yaml b/flutter_ffi_plugin/cargokit/build_tool/pubspec.yaml old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/pubspec.yaml rename to flutter_ffi_plugin/cargokit/build_tool/pubspec.yaml diff --git a/cargokit/build_tool/test/builder_test.dart b/flutter_ffi_plugin/cargokit/build_tool/test/builder_test.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/test/builder_test.dart rename to flutter_ffi_plugin/cargokit/build_tool/test/builder_test.dart diff --git a/cargokit/build_tool/test/cargo_test.dart b/flutter_ffi_plugin/cargokit/build_tool/test/cargo_test.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/test/cargo_test.dart rename to flutter_ffi_plugin/cargokit/build_tool/test/cargo_test.dart diff --git a/cargokit/build_tool/test/options_test.dart b/flutter_ffi_plugin/cargokit/build_tool/test/options_test.dart old mode 100644 new mode 100755 similarity index 100% rename from cargokit/build_tool/test/options_test.dart rename to flutter_ffi_plugin/cargokit/build_tool/test/options_test.dart diff --git a/cargokit/cmake/cargokit.cmake b/flutter_ffi_plugin/cargokit/cmake/cargokit.cmake old mode 100644 new mode 100755 similarity index 100% rename from cargokit/cmake/cargokit.cmake rename to flutter_ffi_plugin/cargokit/cmake/cargokit.cmake diff --git a/cargokit/cmake/resolve_symlinks.ps1 b/flutter_ffi_plugin/cargokit/cmake/resolve_symlinks.ps1 old mode 100644 new mode 100755 similarity index 100% rename from cargokit/cmake/resolve_symlinks.ps1 rename to flutter_ffi_plugin/cargokit/cmake/resolve_symlinks.ps1 diff --git a/cargokit/docs/architecture.md b/flutter_ffi_plugin/cargokit/docs/architecture.md old mode 100644 new mode 100755 similarity index 100% rename from cargokit/docs/architecture.md rename to flutter_ffi_plugin/cargokit/docs/architecture.md diff --git a/cargokit/docs/precompiled_binaries.md b/flutter_ffi_plugin/cargokit/docs/precompiled_binaries.md old mode 100644 new mode 100755 similarity index 100% rename from cargokit/docs/precompiled_binaries.md rename to flutter_ffi_plugin/cargokit/docs/precompiled_binaries.md diff --git a/cargokit/gradle/plugin.gradle b/flutter_ffi_plugin/cargokit/gradle/plugin.gradle old mode 100644 new mode 100755 similarity index 100% rename from cargokit/gradle/plugin.gradle rename to flutter_ffi_plugin/cargokit/gradle/plugin.gradle diff --git a/cargokit/run_build_tool.cmd b/flutter_ffi_plugin/cargokit/run_build_tool.cmd old mode 100644 new mode 100755 similarity index 100% rename from cargokit/run_build_tool.cmd rename to flutter_ffi_plugin/cargokit/run_build_tool.cmd diff --git a/cargokit/run_build_tool.sh b/flutter_ffi_plugin/cargokit/run_build_tool.sh similarity index 99% rename from cargokit/run_build_tool.sh rename to flutter_ffi_plugin/cargokit/run_build_tool.sh index 909fe54b..8bf9abed 100755 --- a/cargokit/run_build_tool.sh +++ b/flutter_ffi_plugin/cargokit/run_build_tool.sh @@ -82,4 +82,4 @@ if [ $exit_code == 253 ]; then "$DART" pub get --no-precompile "$DART" compile kernel bin/build_tool_runner.dart "$DART" bin/build_tool_runner.dill "$@" -fi \ No newline at end of file +fi diff --git a/example/.gitignore b/flutter_ffi_plugin/example/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/.gitignore rename to flutter_ffi_plugin/example/.gitignore diff --git a/example/Cargo.toml b/flutter_ffi_plugin/example/Cargo.toml old mode 100644 new mode 100755 similarity index 100% rename from example/Cargo.toml rename to flutter_ffi_plugin/example/Cargo.toml diff --git a/example/README.md b/flutter_ffi_plugin/example/README.md old mode 100644 new mode 100755 similarity index 76% rename from example/README.md rename to flutter_ffi_plugin/example/README.md index 482e2ccd..bb76c098 --- a/example/README.md +++ b/flutter_ffi_plugin/example/README.md @@ -1,12 +1,12 @@ # Example App -Demonstrates how to use the Rust-In-Flutter framework. +Demonstrates how to use the Rinf framework. ## Using Rust Inside Flutter This project leverages Flutter for GUI and Rust for the backend logic, utilizing the capabilities of the -[Rust-In-Flutter](https://pub.dev/packages/rust_in_flutter) framework. +[Rinf](https://pub.dev/packages/rinf) framework. To run and build this app, you need to have [Flutter SDK](https://docs.flutter.dev/get-started/install), @@ -22,10 +22,10 @@ protoc --version flutter doctor ``` -You also need to have the CLI tool for Rust-In-Flutter ready. +You also need to have the CLI tool for Rinf ready. ```bash -cargo install rifs +cargo install rinf ``` Messages sent between Dart and Rust are implemented using Protobuf. @@ -34,7 +34,7 @@ or made changes to the `.proto` files in the `./messages` directory, run the following command: ```bash -rifs message +rinf message ``` Now you can run and build this app just like any other Flutter projects. @@ -44,4 +44,4 @@ flutter run ``` For detailed instructions on writing Rust and Flutter together, -please refer to Rust-In-Flutter's [documentation](https://rif-docs.cunarist.com). +please refer to Rinf's [documentation](https://rinf-docs.cunarist.com). diff --git a/example/android/.gitignore b/flutter_ffi_plugin/example/android/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/android/.gitignore rename to flutter_ffi_plugin/example/android/.gitignore diff --git a/example/android/app/build.gradle b/flutter_ffi_plugin/example/android/app/build.gradle old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/build.gradle rename to flutter_ffi_plugin/example/android/app/build.gradle diff --git a/example/android/app/src/debug/AndroidManifest.xml b/flutter_ffi_plugin/example/android/app/src/debug/AndroidManifest.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/debug/AndroidManifest.xml rename to flutter_ffi_plugin/example/android/app/src/debug/AndroidManifest.xml diff --git a/example/android/app/src/main/AndroidManifest.xml b/flutter_ffi_plugin/example/android/app/src/main/AndroidManifest.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/AndroidManifest.xml rename to flutter_ffi_plugin/example/android/app/src/main/AndroidManifest.xml diff --git a/example/android/app/src/main/kotlin/com/example/rust_in_flutter_example/MainActivity.kt b/flutter_ffi_plugin/example/android/app/src/main/kotlin/com/example/rinf_example/MainActivity.kt old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/kotlin/com/example/rust_in_flutter_example/MainActivity.kt rename to flutter_ffi_plugin/example/android/app/src/main/kotlin/com/example/rinf_example/MainActivity.kt diff --git a/example/android/app/src/main/res/drawable-v21/launch_background.xml b/flutter_ffi_plugin/example/android/app/src/main/res/drawable-v21/launch_background.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/drawable-v21/launch_background.xml rename to flutter_ffi_plugin/example/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/flutter_ffi_plugin/example/android/app/src/main/res/drawable/launch_background.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/drawable/launch_background.xml rename to flutter_ffi_plugin/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/flutter_ffi_plugin/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to flutter_ffi_plugin/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/flutter_ffi_plugin/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to flutter_ffi_plugin/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to flutter_ffi_plugin/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/values-night/styles.xml b/flutter_ffi_plugin/example/android/app/src/main/res/values-night/styles.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/values-night/styles.xml rename to flutter_ffi_plugin/example/android/app/src/main/res/values-night/styles.xml diff --git a/example/android/app/src/main/res/values/styles.xml b/flutter_ffi_plugin/example/android/app/src/main/res/values/styles.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/main/res/values/styles.xml rename to flutter_ffi_plugin/example/android/app/src/main/res/values/styles.xml diff --git a/example/android/app/src/profile/AndroidManifest.xml b/flutter_ffi_plugin/example/android/app/src/profile/AndroidManifest.xml old mode 100644 new mode 100755 similarity index 100% rename from example/android/app/src/profile/AndroidManifest.xml rename to flutter_ffi_plugin/example/android/app/src/profile/AndroidManifest.xml diff --git a/example/android/build.gradle b/flutter_ffi_plugin/example/android/build.gradle old mode 100644 new mode 100755 similarity index 100% rename from example/android/build.gradle rename to flutter_ffi_plugin/example/android/build.gradle diff --git a/example/android/gradle.properties b/flutter_ffi_plugin/example/android/gradle.properties old mode 100644 new mode 100755 similarity index 100% rename from example/android/gradle.properties rename to flutter_ffi_plugin/example/android/gradle.properties diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/flutter_ffi_plugin/example/android/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to flutter_ffi_plugin/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/example/android/settings.gradle b/flutter_ffi_plugin/example/android/settings.gradle old mode 100644 new mode 100755 similarity index 100% rename from example/android/settings.gradle rename to flutter_ffi_plugin/example/android/settings.gradle diff --git a/example/ios/.gitignore b/flutter_ffi_plugin/example/ios/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/ios/.gitignore rename to flutter_ffi_plugin/example/ios/.gitignore diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/flutter_ffi_plugin/example/ios/Flutter/AppFrameworkInfo.plist old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Flutter/AppFrameworkInfo.plist rename to flutter_ffi_plugin/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/example/ios/Flutter/Debug.xcconfig b/flutter_ffi_plugin/example/ios/Flutter/Debug.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Flutter/Debug.xcconfig rename to flutter_ffi_plugin/example/ios/Flutter/Debug.xcconfig diff --git a/example/ios/Flutter/Release.xcconfig b/flutter_ffi_plugin/example/ios/Flutter/Release.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Flutter/Release.xcconfig rename to flutter_ffi_plugin/example/ios/Flutter/Release.xcconfig diff --git a/example/ios/Podfile b/flutter_ffi_plugin/example/ios/Podfile old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Podfile rename to flutter_ffi_plugin/example/ios/Podfile diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.pbxproj old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcodeproj/project.pbxproj rename to flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to flutter_ffi_plugin/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter_ffi_plugin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to flutter_ffi_plugin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/flutter_ffi_plugin/example/ios/Runner.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to flutter_ffi_plugin/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_ffi_plugin/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to flutter_ffi_plugin/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/flutter_ffi_plugin/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to flutter_ffi_plugin/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/example/ios/Runner/AppDelegate.swift b/flutter_ffi_plugin/example/ios/Runner/AppDelegate.swift old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/AppDelegate.swift rename to flutter_ffi_plugin/example/ios/Runner/AppDelegate.swift diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to flutter_ffi_plugin/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/flutter_ffi_plugin/example/ios/Runner/Base.lproj/LaunchScreen.storyboard old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to flutter_ffi_plugin/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/flutter_ffi_plugin/example/ios/Runner/Base.lproj/Main.storyboard old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Base.lproj/Main.storyboard rename to flutter_ffi_plugin/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/example/ios/Runner/Info.plist b/flutter_ffi_plugin/example/ios/Runner/Info.plist old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Info.plist rename to flutter_ffi_plugin/example/ios/Runner/Info.plist diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/flutter_ffi_plugin/example/ios/Runner/Runner-Bridging-Header.h old mode 100644 new mode 100755 similarity index 100% rename from example/ios/Runner/Runner-Bridging-Header.h rename to flutter_ffi_plugin/example/ios/Runner/Runner-Bridging-Header.h diff --git a/example/ios/RunnerTests/RunnerTests.swift b/flutter_ffi_plugin/example/ios/RunnerTests/RunnerTests.swift old mode 100644 new mode 100755 similarity index 100% rename from example/ios/RunnerTests/RunnerTests.swift rename to flutter_ffi_plugin/example/ios/RunnerTests/RunnerTests.swift diff --git a/example/lib/main.dart b/flutter_ffi_plugin/example/lib/main.dart old mode 100644 new mode 100755 similarity index 94% rename from example/lib/main.dart rename to flutter_ffi_plugin/example/lib/main.dart index d32d4a27..4d26fbec --- a/example/lib/main.dart +++ b/flutter_ffi_plugin/example/lib/main.dart @@ -1,12 +1,12 @@ import 'dart:ui'; import 'package:flutter/material.dart'; -import 'package:rust_in_flutter/rust_in_flutter.dart'; +import 'package:rinf/rinf.dart'; import 'package:example_app/messages/counter_number.pb.dart' as counterNumber; import 'package:example_app/messages/mandelbrot.pb.dart' as mandelbrot; void main() async { // Wait for Rust initialization to be completed first. - await RustInFlutter.ensureInitialized(); + await Rinf.ensureInitialized(); runApp(const MyApp()); } @@ -21,7 +21,7 @@ class _MyAppState extends State { final _appLifecycleListener = AppLifecycleListener( onExitRequested: () async { // Terminate Rust tasks before closing the Flutter app. - await RustInFlutter.ensureFinalized(); + await Rinf.ensureFinalized(); return AppExitResponse.exit; }, ); @@ -35,7 +35,7 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - title: 'RIF Example', + title: 'Rinf Example', theme: ThemeData( useMaterial3: true, brightness: MediaQuery.platformBrightnessOf(context), @@ -71,7 +71,7 @@ class _MyHomePageState extends State { operation: RustOperation.Read, message: requestMessage.writeToBuffer(), ); - // Use `requestToRust` from `rust_in_flutter.dart` + // Use `requestToRust` from `rinf.dart` // to send the request to Rust and get the response. final rustResponse = await requestToRust(rustRequest); if (rustResponse.successful) { @@ -95,7 +95,7 @@ class _MyHomePageState extends State { // and rebuilds the widget accordingly. StreamBuilder( // Receive signals from Rust - // with `rustBroadcaster` from `rust_in_flutter.dart`, + // with `rustBroadcaster` from `rinf.dart`, // For better performance, filter signals // by checking the `resource` field with the `where` method. // This approach allows the builder to rebuild its widget diff --git a/example/linux/.gitignore b/flutter_ffi_plugin/example/linux/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/linux/.gitignore rename to flutter_ffi_plugin/example/linux/.gitignore diff --git a/example/linux/CMakeLists.txt b/flutter_ffi_plugin/example/linux/CMakeLists.txt old mode 100644 new mode 100755 similarity index 99% rename from example/linux/CMakeLists.txt rename to flutter_ffi_plugin/example/linux/CMakeLists.txt index ec5ad8c3..5bbe8fdf --- a/example/linux/CMakeLists.txt +++ b/flutter_ffi_plugin/example/linux/CMakeLists.txt @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "example_app") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.cunarist.rust_in_flutter") +set(APPLICATION_ID "com.cunarist.rinf") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/example/linux/flutter/CMakeLists.txt b/flutter_ffi_plugin/example/linux/flutter/CMakeLists.txt old mode 100644 new mode 100755 similarity index 100% rename from example/linux/flutter/CMakeLists.txt rename to flutter_ffi_plugin/example/linux/flutter/CMakeLists.txt diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/flutter_ffi_plugin/example/linux/flutter/generated_plugin_registrant.cc old mode 100644 new mode 100755 similarity index 100% rename from example/linux/flutter/generated_plugin_registrant.cc rename to flutter_ffi_plugin/example/linux/flutter/generated_plugin_registrant.cc diff --git a/example/linux/flutter/generated_plugin_registrant.h b/flutter_ffi_plugin/example/linux/flutter/generated_plugin_registrant.h old mode 100644 new mode 100755 similarity index 100% rename from example/linux/flutter/generated_plugin_registrant.h rename to flutter_ffi_plugin/example/linux/flutter/generated_plugin_registrant.h diff --git a/example/linux/flutter/generated_plugins.cmake b/flutter_ffi_plugin/example/linux/flutter/generated_plugins.cmake old mode 100644 new mode 100755 similarity index 97% rename from example/linux/flutter/generated_plugins.cmake rename to flutter_ffi_plugin/example/linux/flutter/generated_plugins.cmake index 54cc5a88..7ba6a806 --- a/example/linux/flutter/generated_plugins.cmake +++ b/flutter_ffi_plugin/example/linux/flutter/generated_plugins.cmake @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - rust_in_flutter + rinf ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/example/linux/main.cc b/flutter_ffi_plugin/example/linux/main.cc old mode 100644 new mode 100755 similarity index 100% rename from example/linux/main.cc rename to flutter_ffi_plugin/example/linux/main.cc diff --git a/example/linux/my_application.cc b/flutter_ffi_plugin/example/linux/my_application.cc old mode 100644 new mode 100755 similarity index 100% rename from example/linux/my_application.cc rename to flutter_ffi_plugin/example/linux/my_application.cc diff --git a/example/linux/my_application.h b/flutter_ffi_plugin/example/linux/my_application.h old mode 100644 new mode 100755 similarity index 100% rename from example/linux/my_application.h rename to flutter_ffi_plugin/example/linux/my_application.h diff --git a/example/macos/.gitignore b/flutter_ffi_plugin/example/macos/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/macos/.gitignore rename to flutter_ffi_plugin/example/macos/.gitignore diff --git a/example/macos/Flutter/Flutter-Debug.xcconfig b/flutter_ffi_plugin/example/macos/Flutter/Flutter-Debug.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Flutter/Flutter-Debug.xcconfig rename to flutter_ffi_plugin/example/macos/Flutter/Flutter-Debug.xcconfig diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/flutter_ffi_plugin/example/macos/Flutter/Flutter-Release.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Flutter/Flutter-Release.xcconfig rename to flutter_ffi_plugin/example/macos/Flutter/Flutter-Release.xcconfig diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/flutter_ffi_plugin/example/macos/Flutter/GeneratedPluginRegistrant.swift old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Flutter/GeneratedPluginRegistrant.swift rename to flutter_ffi_plugin/example/macos/Flutter/GeneratedPluginRegistrant.swift diff --git a/example/macos/Podfile b/flutter_ffi_plugin/example/macos/Podfile old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Podfile rename to flutter_ffi_plugin/example/macos/Podfile diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/flutter_ffi_plugin/example/macos/Runner.xcodeproj/project.pbxproj old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner.xcodeproj/project.pbxproj rename to flutter_ffi_plugin/example/macos/Runner.xcodeproj/project.pbxproj diff --git a/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_ffi_plugin/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to flutter_ffi_plugin/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter_ffi_plugin/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to flutter_ffi_plugin/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/flutter_ffi_plugin/example/macos/Runner.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner.xcworkspace/contents.xcworkspacedata rename to flutter_ffi_plugin/example/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_ffi_plugin/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to flutter_ffi_plugin/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/macos/Runner/AppDelegate.swift b/flutter_ffi_plugin/example/macos/Runner/AppDelegate.swift old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/AppDelegate.swift rename to flutter_ffi_plugin/example/macos/Runner/AppDelegate.swift diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to flutter_ffi_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/example/macos/Runner/Base.lproj/MainMenu.xib b/flutter_ffi_plugin/example/macos/Runner/Base.lproj/MainMenu.xib old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Base.lproj/MainMenu.xib rename to flutter_ffi_plugin/example/macos/Runner/Base.lproj/MainMenu.xib diff --git a/example/macos/Runner/Configs/AppInfo.xcconfig b/flutter_ffi_plugin/example/macos/Runner/Configs/AppInfo.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Configs/AppInfo.xcconfig rename to flutter_ffi_plugin/example/macos/Runner/Configs/AppInfo.xcconfig diff --git a/example/macos/Runner/Configs/Debug.xcconfig b/flutter_ffi_plugin/example/macos/Runner/Configs/Debug.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Configs/Debug.xcconfig rename to flutter_ffi_plugin/example/macos/Runner/Configs/Debug.xcconfig diff --git a/example/macos/Runner/Configs/Release.xcconfig b/flutter_ffi_plugin/example/macos/Runner/Configs/Release.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Configs/Release.xcconfig rename to flutter_ffi_plugin/example/macos/Runner/Configs/Release.xcconfig diff --git a/example/macos/Runner/Configs/Warnings.xcconfig b/flutter_ffi_plugin/example/macos/Runner/Configs/Warnings.xcconfig old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Configs/Warnings.xcconfig rename to flutter_ffi_plugin/example/macos/Runner/Configs/Warnings.xcconfig diff --git a/example/macos/Runner/DebugProfile.entitlements b/flutter_ffi_plugin/example/macos/Runner/DebugProfile.entitlements old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/DebugProfile.entitlements rename to flutter_ffi_plugin/example/macos/Runner/DebugProfile.entitlements diff --git a/example/macos/Runner/Info.plist b/flutter_ffi_plugin/example/macos/Runner/Info.plist old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Info.plist rename to flutter_ffi_plugin/example/macos/Runner/Info.plist diff --git a/example/macos/Runner/MainFlutterWindow.swift b/flutter_ffi_plugin/example/macos/Runner/MainFlutterWindow.swift old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/MainFlutterWindow.swift rename to flutter_ffi_plugin/example/macos/Runner/MainFlutterWindow.swift diff --git a/example/macos/Runner/Release.entitlements b/flutter_ffi_plugin/example/macos/Runner/Release.entitlements old mode 100644 new mode 100755 similarity index 100% rename from example/macos/Runner/Release.entitlements rename to flutter_ffi_plugin/example/macos/Runner/Release.entitlements diff --git a/example/macos/RunnerTests/RunnerTests.swift b/flutter_ffi_plugin/example/macos/RunnerTests/RunnerTests.swift old mode 100644 new mode 100755 similarity index 100% rename from example/macos/RunnerTests/RunnerTests.swift rename to flutter_ffi_plugin/example/macos/RunnerTests/RunnerTests.swift diff --git a/example/messages/counter_number.proto b/flutter_ffi_plugin/example/messages/counter_number.proto old mode 100644 new mode 100755 similarity index 100% rename from example/messages/counter_number.proto rename to flutter_ffi_plugin/example/messages/counter_number.proto diff --git a/example/messages/mandelbrot.proto b/flutter_ffi_plugin/example/messages/mandelbrot.proto old mode 100644 new mode 100755 similarity index 100% rename from example/messages/mandelbrot.proto rename to flutter_ffi_plugin/example/messages/mandelbrot.proto diff --git a/example/messages/sample_folder/deeper_folder/deeper_resource.proto b/flutter_ffi_plugin/example/messages/sample_folder/deeper_folder/deeper_resource.proto old mode 100644 new mode 100755 similarity index 100% rename from example/messages/sample_folder/deeper_folder/deeper_resource.proto rename to flutter_ffi_plugin/example/messages/sample_folder/deeper_folder/deeper_resource.proto diff --git a/example/messages/sample_folder/sample_resource.proto b/flutter_ffi_plugin/example/messages/sample_folder/sample_resource.proto old mode 100644 new mode 100755 similarity index 100% rename from example/messages/sample_folder/sample_resource.proto rename to flutter_ffi_plugin/example/messages/sample_folder/sample_resource.proto diff --git a/example/native/README.md b/flutter_ffi_plugin/example/native/README.md old mode 100644 new mode 100755 similarity index 80% rename from example/native/README.md rename to flutter_ffi_plugin/example/native/README.md index ba1f566a..f3b821fd --- a/example/native/README.md +++ b/flutter_ffi_plugin/example/native/README.md @@ -1,6 +1,6 @@ # Rust Crates -This folder contains Rust crates. Entry point of the Rust logic is the `hub` library crate. These crates are integrated and compiled into the Flutter app by [Rust-In-Flutter](https://github.com/cunarist/rust-in-flutter) framework. +This folder contains Rust crates. Entry point of the Rust logic is the `hub` library crate. These crates are integrated and compiled into the Flutter app by [Rinf](https://github.com/cunarist/rinf) framework. - Do NOT change the name of the `hub` crate. Compilation presets expect the entry library crate to be located at `./native/hub`. - Do NOT modify the `bridge` module inside `./native/hub/src` unless you know what you're doing. diff --git a/example/native/hub/Cargo.toml b/flutter_ffi_plugin/example/native/hub/Cargo.toml old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/Cargo.toml rename to flutter_ffi_plugin/example/native/hub/Cargo.toml diff --git a/example/native/hub/src/bridge/api.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/api.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/api.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/api.rs diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/BUILD.gn b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/BUILD.gn old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/BUILD.gn rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/BUILD.gn diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/README.md b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/README.md old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/README.md rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/README.md diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/analyze_snapshot_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/analyze_snapshot_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/analyze_snapshot_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/analyze_snapshot_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/bin/dart_io_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/bin/dart_io_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/bin/dart_io_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/bin/dart_io_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.c b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.c old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.c rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.c diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_api_dl.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_embedder_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_embedder_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_embedder_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_embedder_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_native_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_native_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_native_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_native_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_tools_api.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_tools_api.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_tools_api.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_tools_api.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/dart_version.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_version.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/dart_version.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/dart_version.h diff --git a/example/native/hub/src/bridge/bridge_engine/dart_api/internal/dart_api_dl_impl.h b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/internal/dart_api_dl_impl.h old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/dart_api/internal/dart_api_dl_impl.h rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/dart_api/internal/dart_api_dl_impl.h diff --git a/example/native/hub/src/bridge/bridge_engine/ffi/io.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/io.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/ffi/io.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/io.rs diff --git a/example/native/hub/src/bridge/bridge_engine/ffi/mod.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/mod.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/ffi/mod.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/mod.rs diff --git a/example/native/hub/src/bridge/bridge_engine/ffi/web.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/web.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/ffi/web.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/ffi/web.rs diff --git a/example/native/hub/src/bridge/bridge_engine/handler.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/handler.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/handler.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/handler.rs diff --git a/example/native/hub/src/bridge/bridge_engine/into_into_dart.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/into_into_dart.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/into_into_dart.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/into_into_dart.rs diff --git a/example/native/hub/src/bridge/bridge_engine/macros.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/macros.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/macros.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/macros.rs diff --git a/example/native/hub/src/bridge/bridge_engine/mod.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/mod.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/mod.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/mod.rs diff --git a/example/native/hub/src/bridge/bridge_engine/rust2dart.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/rust2dart.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/rust2dart.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/rust2dart.rs diff --git a/example/native/hub/src/bridge/bridge_engine/support.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/support.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/support.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/support.rs diff --git a/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/mod.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/mod.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/mod.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/mod.rs diff --git a/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/transfer.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/transfer.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/transfer.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/transfer.rs diff --git a/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/worker.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/worker.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/worker.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_engine/wasm_bindgen_src/worker.rs diff --git a/example/native/hub/src/bridge/bridge_generated.io.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.io.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_generated.io.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.io.rs diff --git a/example/native/hub/src/bridge/bridge_generated.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_generated.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.rs diff --git a/example/native/hub/src/bridge/bridge_generated.web.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.web.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/bridge_generated.web.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/bridge_generated.web.rs diff --git a/example/native/hub/src/bridge/mod.rs b/flutter_ffi_plugin/example/native/hub/src/bridge/mod.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/bridge/mod.rs rename to flutter_ffi_plugin/example/native/hub/src/bridge/mod.rs diff --git a/example/native/hub/src/lib.rs b/flutter_ffi_plugin/example/native/hub/src/lib.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/lib.rs rename to flutter_ffi_plugin/example/native/hub/src/lib.rs diff --git a/example/native/hub/src/sample_functions.rs b/flutter_ffi_plugin/example/native/hub/src/sample_functions.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/sample_functions.rs rename to flutter_ffi_plugin/example/native/hub/src/sample_functions.rs diff --git a/example/native/hub/src/web_alias.rs b/flutter_ffi_plugin/example/native/hub/src/web_alias.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/web_alias.rs rename to flutter_ffi_plugin/example/native/hub/src/web_alias.rs diff --git a/example/native/hub/src/with_request.rs b/flutter_ffi_plugin/example/native/hub/src/with_request.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/hub/src/with_request.rs rename to flutter_ffi_plugin/example/native/hub/src/with_request.rs diff --git a/example/native/sample_crate/Cargo.toml b/flutter_ffi_plugin/example/native/sample_crate/Cargo.toml old mode 100644 new mode 100755 similarity index 100% rename from example/native/sample_crate/Cargo.toml rename to flutter_ffi_plugin/example/native/sample_crate/Cargo.toml diff --git a/example/native/sample_crate/src/lib.rs b/flutter_ffi_plugin/example/native/sample_crate/src/lib.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/sample_crate/src/lib.rs rename to flutter_ffi_plugin/example/native/sample_crate/src/lib.rs diff --git a/example/native/sample_crate/src/mandelbrot.rs b/flutter_ffi_plugin/example/native/sample_crate/src/mandelbrot.rs old mode 100644 new mode 100755 similarity index 100% rename from example/native/sample_crate/src/mandelbrot.rs rename to flutter_ffi_plugin/example/native/sample_crate/src/mandelbrot.rs diff --git a/example/pubspec.yaml b/flutter_ffi_plugin/example/pubspec.yaml old mode 100644 new mode 100755 similarity index 97% rename from example/pubspec.yaml rename to flutter_ffi_plugin/example/pubspec.yaml index ff2c07ae..007e0ac1 --- a/example/pubspec.yaml +++ b/flutter_ffi_plugin/example/pubspec.yaml @@ -1,5 +1,5 @@ name: example_app -description: Demonstrates how to use the rust_in_flutter plugin. +description: Demonstrates how to use the rinf plugin. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: "none" # Remove this line if you wish to publish to pub.dev @@ -31,9 +31,9 @@ dependencies: flutter: sdk: flutter - rust_in_flutter: + rinf: # When depending on this package from a real application you should use: - # rust_in_flutter: ^x.y.z + # rinf: ^x.y.z # See https://dart.dev/tools/pub/dependencies#version-constraints # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. diff --git a/example/web/favicon.png b/flutter_ffi_plugin/example/web/favicon.png old mode 100644 new mode 100755 similarity index 100% rename from example/web/favicon.png rename to flutter_ffi_plugin/example/web/favicon.png diff --git a/example/web/icons/Icon-192.png b/flutter_ffi_plugin/example/web/icons/Icon-192.png old mode 100644 new mode 100755 similarity index 100% rename from example/web/icons/Icon-192.png rename to flutter_ffi_plugin/example/web/icons/Icon-192.png diff --git a/example/web/icons/Icon-512.png b/flutter_ffi_plugin/example/web/icons/Icon-512.png old mode 100644 new mode 100755 similarity index 100% rename from example/web/icons/Icon-512.png rename to flutter_ffi_plugin/example/web/icons/Icon-512.png diff --git a/example/web/icons/Icon-maskable-192.png b/flutter_ffi_plugin/example/web/icons/Icon-maskable-192.png old mode 100644 new mode 100755 similarity index 100% rename from example/web/icons/Icon-maskable-192.png rename to flutter_ffi_plugin/example/web/icons/Icon-maskable-192.png diff --git a/example/web/icons/Icon-maskable-512.png b/flutter_ffi_plugin/example/web/icons/Icon-maskable-512.png old mode 100644 new mode 100755 similarity index 100% rename from example/web/icons/Icon-maskable-512.png rename to flutter_ffi_plugin/example/web/icons/Icon-maskable-512.png diff --git a/example/web/index.html b/flutter_ffi_plugin/example/web/index.html old mode 100644 new mode 100755 similarity index 100% rename from example/web/index.html rename to flutter_ffi_plugin/example/web/index.html diff --git a/example/web/manifest.json b/flutter_ffi_plugin/example/web/manifest.json old mode 100644 new mode 100755 similarity index 100% rename from example/web/manifest.json rename to flutter_ffi_plugin/example/web/manifest.json diff --git a/example/windows/.gitignore b/flutter_ffi_plugin/example/windows/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from example/windows/.gitignore rename to flutter_ffi_plugin/example/windows/.gitignore diff --git a/example/windows/CMakeLists.txt b/flutter_ffi_plugin/example/windows/CMakeLists.txt old mode 100644 new mode 100755 similarity index 100% rename from example/windows/CMakeLists.txt rename to flutter_ffi_plugin/example/windows/CMakeLists.txt diff --git a/example/windows/flutter/CMakeLists.txt b/flutter_ffi_plugin/example/windows/flutter/CMakeLists.txt old mode 100644 new mode 100755 similarity index 100% rename from example/windows/flutter/CMakeLists.txt rename to flutter_ffi_plugin/example/windows/flutter/CMakeLists.txt diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/flutter_ffi_plugin/example/windows/flutter/generated_plugin_registrant.cc old mode 100644 new mode 100755 similarity index 100% rename from example/windows/flutter/generated_plugin_registrant.cc rename to flutter_ffi_plugin/example/windows/flutter/generated_plugin_registrant.cc diff --git a/example/windows/flutter/generated_plugin_registrant.h b/flutter_ffi_plugin/example/windows/flutter/generated_plugin_registrant.h old mode 100644 new mode 100755 similarity index 100% rename from example/windows/flutter/generated_plugin_registrant.h rename to flutter_ffi_plugin/example/windows/flutter/generated_plugin_registrant.h diff --git a/example/windows/flutter/generated_plugins.cmake b/flutter_ffi_plugin/example/windows/flutter/generated_plugins.cmake old mode 100644 new mode 100755 similarity index 97% rename from example/windows/flutter/generated_plugins.cmake rename to flutter_ffi_plugin/example/windows/flutter/generated_plugins.cmake index a6a1dec4..c9dc3a7d --- a/example/windows/flutter/generated_plugins.cmake +++ b/flutter_ffi_plugin/example/windows/flutter/generated_plugins.cmake @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - rust_in_flutter + rinf ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/example/windows/runner/CMakeLists.txt b/flutter_ffi_plugin/example/windows/runner/CMakeLists.txt old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/CMakeLists.txt rename to flutter_ffi_plugin/example/windows/runner/CMakeLists.txt diff --git a/example/windows/runner/Runner.rc b/flutter_ffi_plugin/example/windows/runner/Runner.rc old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/Runner.rc rename to flutter_ffi_plugin/example/windows/runner/Runner.rc diff --git a/example/windows/runner/flutter_window.cpp b/flutter_ffi_plugin/example/windows/runner/flutter_window.cpp old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/flutter_window.cpp rename to flutter_ffi_plugin/example/windows/runner/flutter_window.cpp diff --git a/example/windows/runner/flutter_window.h b/flutter_ffi_plugin/example/windows/runner/flutter_window.h old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/flutter_window.h rename to flutter_ffi_plugin/example/windows/runner/flutter_window.h diff --git a/example/windows/runner/main.cpp b/flutter_ffi_plugin/example/windows/runner/main.cpp old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/main.cpp rename to flutter_ffi_plugin/example/windows/runner/main.cpp diff --git a/example/windows/runner/resource.h b/flutter_ffi_plugin/example/windows/runner/resource.h old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/resource.h rename to flutter_ffi_plugin/example/windows/runner/resource.h diff --git a/example/windows/runner/resources/app_icon.ico b/flutter_ffi_plugin/example/windows/runner/resources/app_icon.ico old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/resources/app_icon.ico rename to flutter_ffi_plugin/example/windows/runner/resources/app_icon.ico diff --git a/example/windows/runner/runner.exe.manifest b/flutter_ffi_plugin/example/windows/runner/runner.exe.manifest old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/runner.exe.manifest rename to flutter_ffi_plugin/example/windows/runner/runner.exe.manifest diff --git a/example/windows/runner/utils.cpp b/flutter_ffi_plugin/example/windows/runner/utils.cpp old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/utils.cpp rename to flutter_ffi_plugin/example/windows/runner/utils.cpp diff --git a/example/windows/runner/utils.h b/flutter_ffi_plugin/example/windows/runner/utils.h old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/utils.h rename to flutter_ffi_plugin/example/windows/runner/utils.h diff --git a/example/windows/runner/win32_window.cpp b/flutter_ffi_plugin/example/windows/runner/win32_window.cpp old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/win32_window.cpp rename to flutter_ffi_plugin/example/windows/runner/win32_window.cpp diff --git a/example/windows/runner/win32_window.h b/flutter_ffi_plugin/example/windows/runner/win32_window.h old mode 100644 new mode 100755 similarity index 100% rename from example/windows/runner/win32_window.h rename to flutter_ffi_plugin/example/windows/runner/win32_window.h diff --git a/ios/Classes/rust_in_flutter.c b/flutter_ffi_plugin/ios/Classes/rinf.c old mode 100644 new mode 100755 similarity index 76% rename from ios/Classes/rust_in_flutter.c rename to flutter_ffi_plugin/ios/Classes/rinf.c index d850f883..aa301db2 --- a/ios/Classes/rust_in_flutter.c +++ b/flutter_ffi_plugin/ios/Classes/rinf.c @@ -1,3 +1,3 @@ // Relative import to be able to reuse the C sources. // See the comment in ../{projectName}}.podspec for more information. -#include "../../src/rust_in_flutter.c" +#include "../../src/rinf.c" diff --git a/ios/rust_in_flutter.podspec b/flutter_ffi_plugin/ios/rinf.podspec old mode 100644 new mode 100755 similarity index 93% rename from ios/rust_in_flutter.podspec rename to flutter_ffi_plugin/ios/rinf.podspec index 1872b37a..837dccba --- a/ios/rust_in_flutter.podspec +++ b/flutter_ffi_plugin/ios/rinf.podspec @@ -1,9 +1,9 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint rust_in_flutter.podspec` to validate before publishing. +# Run `pod lib lint rinf.podspec` to validate before publishing. # Pod::Spec.new do |s| - s.name = 'rust_in_flutter' + s.name = 'rinf' s.version = '0.1.0' s.summary = 'Summary' s.description = 'Description' diff --git a/lib/rust_in_flutter.dart b/flutter_ffi_plugin/lib/rinf.dart old mode 100644 new mode 100755 similarity index 96% rename from lib/rust_in_flutter.dart rename to flutter_ffi_plugin/lib/rinf.dart index bcc003cc..10891ab4 --- a/lib/rust_in_flutter.dart +++ b/flutter_ffi_plugin/lib/rinf.dart @@ -14,13 +14,13 @@ export 'src/exports.dart' show RustSignal; /// Listens to a stream from Rust and broadcasts the data in Dart. /// You can see the usage example at -/// https://pub.dev/packages/rust_in_flutter/example. +/// https://pub.dev/packages/rinf/example. final rustBroadcaster = StreamController.broadcast(); final _responseBroadcaster = StreamController.broadcast(); final _requestIdGenerator = _IdGenerator(); /// Contains basic functionalities of this framework. -class RustInFlutter { +class Rinf { /// Makes sure that the Rust side is ready. /// Don't forget to call this function in the `main` function of Dart. static Future ensureInitialized() async { @@ -63,7 +63,7 @@ class RustInFlutter { /// If the Rust doesn't respond for 60 seconds, /// this function will return a failed `RustResponse` object. /// You can see the usage example at -/// https://pub.dev/packages/rust_in_flutter/example. +/// https://pub.dev/packages/rinf/example. Future requestToRust(RustRequest rustRequest) async { final id = _requestIdGenerator.generateId(); final requestUnique = RustRequestUnique(id: id, request: rustRequest); diff --git a/lib/src/bridge_definitions.dart b/flutter_ffi_plugin/lib/src/bridge_definitions.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_definitions.dart rename to flutter_ffi_plugin/lib/src/bridge_definitions.dart diff --git a/lib/src/bridge_engine/basic.dart b/flutter_ffi_plugin/lib/src/bridge_engine/basic.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/basic.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/basic.dart diff --git a/lib/src/bridge_engine/exports.dart b/flutter_ffi_plugin/lib/src/bridge_engine/exports.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/exports.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/exports.dart diff --git a/lib/src/bridge_engine/ffi.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/ffi.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi.dart diff --git a/lib/src/bridge_engine/ffi/dart_cobject.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/dart_cobject.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/ffi/dart_cobject.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi/dart_cobject.dart diff --git a/lib/src/bridge_engine/ffi/dart_native_api.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/dart_native_api.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/ffi/dart_native_api.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi/dart_native_api.dart diff --git a/lib/src/bridge_engine/ffi/io.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/io.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/ffi/io.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi/io.dart diff --git a/lib/src/bridge_engine/ffi/stub.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/stub.dart old mode 100644 new mode 100755 similarity index 98% rename from lib/src/bridge_engine/ffi/stub.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi/stub.dart index a419e6d8..1a4af4a7 --- a/lib/src/bridge_engine/ffi/stub.dart +++ b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/stub.dart @@ -11,7 +11,7 @@ export 'io.dart' if (dart.library.html) 'web.dart' NativePortType, PlatformPointer, OpaqueTypeFinalizer; -import 'package:rust_in_flutter/src/bridge_engine/isolate.dart' show SendPort; +import 'package:rinf/src/bridge_engine/isolate.dart' show SendPort; /// This class, together with its subclasses, are only for internal usage. /// Usually it should not be used by normal users. diff --git a/lib/src/bridge_engine/ffi/web.dart b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/web.dart old mode 100644 new mode 100755 similarity index 98% rename from lib/src/bridge_engine/ffi/web.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/ffi/web.dart index ebdb7905..fc63f820 --- a/lib/src/bridge_engine/ffi/web.dart +++ b/flutter_ffi_plugin/lib/src/bridge_engine/ffi/web.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'dart:html'; -import 'package:rust_in_flutter/src/bridge_engine/exports.dart'; +import 'package:rinf/src/bridge_engine/exports.dart'; export 'package:js/js.dart'; import 'package:js/js_util.dart'; export 'package:js/js_util.dart' show promiseToFuture, getProperty; diff --git a/lib/src/bridge_engine/helpers.dart b/flutter_ffi_plugin/lib/src/bridge_engine/helpers.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/helpers.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/helpers.dart diff --git a/lib/src/bridge_engine/isolate.dart b/flutter_ffi_plugin/lib/src/bridge_engine/isolate.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/isolate.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/isolate.dart diff --git a/lib/src/bridge_engine/isolate/io.dart b/flutter_ffi_plugin/lib/src/bridge_engine/isolate/io.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/isolate/io.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/isolate/io.dart diff --git a/lib/src/bridge_engine/isolate/stub.dart b/flutter_ffi_plugin/lib/src/bridge_engine/isolate/stub.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/isolate/stub.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/isolate/stub.dart diff --git a/lib/src/bridge_engine/isolate/web.dart b/flutter_ffi_plugin/lib/src/bridge_engine/isolate/web.dart old mode 100644 new mode 100755 similarity index 98% rename from lib/src/bridge_engine/isolate/web.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/isolate/web.dart index b19e846c..44a9202c --- a/lib/src/bridge_engine/isolate/web.dart +++ b/flutter_ffi_plugin/lib/src/bridge_engine/isolate/web.dart @@ -7,7 +7,7 @@ import 'dart:async'; import 'dart:html' as html; import 'dart:html' hide MessagePort; -import 'package:rust_in_flutter/src/bridge_engine/ffi/web.dart'; +import 'package:rinf/src/bridge_engine/ffi/web.dart'; typedef MessagePort = PortLike; diff --git a/lib/src/bridge_engine/load.dart b/flutter_ffi_plugin/lib/src/bridge_engine/load.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/load.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/load.dart diff --git a/lib/src/bridge_engine/load/load.io.dart b/flutter_ffi_plugin/lib/src/bridge_engine/load/load.io.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/load/load.io.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/load/load.io.dart diff --git a/lib/src/bridge_engine/load/load.web.dart b/flutter_ffi_plugin/lib/src/bridge_engine/load/load.web.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/load/load.web.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/load/load.web.dart diff --git a/lib/src/bridge_engine/platform_independent.dart b/flutter_ffi_plugin/lib/src/bridge_engine/platform_independent.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/platform_independent.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/platform_independent.dart diff --git a/lib/src/bridge_engine/typed_data.dart b/flutter_ffi_plugin/lib/src/bridge_engine/typed_data.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/typed_data.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/typed_data.dart diff --git a/lib/src/bridge_engine/typed_data/io.dart b/flutter_ffi_plugin/lib/src/bridge_engine/typed_data/io.dart old mode 100644 new mode 100755 similarity index 98% rename from lib/src/bridge_engine/typed_data/io.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/typed_data/io.dart index 4222ea9f..5b481f99 --- a/lib/src/bridge_engine/typed_data/io.dart +++ b/flutter_ffi_plugin/lib/src/bridge_engine/typed_data/io.dart @@ -2,7 +2,7 @@ export 'dart:typed_data' hide Int64List, Uint64List; import 'dart:collection'; import 'dart:typed_data' as $data; -import 'package:rust_in_flutter/src/bridge_engine/exports.dart'; +import 'package:rinf/src/bridge_engine/exports.dart'; abstract class _TypedList extends ListMixin { List get inner; diff --git a/lib/src/bridge_engine/typed_data/web.dart b/flutter_ffi_plugin/lib/src/bridge_engine/typed_data/web.dart old mode 100644 new mode 100755 similarity index 98% rename from lib/src/bridge_engine/typed_data/web.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/typed_data/web.dart index f9e45966..4fcbaec1 --- a/lib/src/bridge_engine/typed_data/web.dart +++ b/flutter_ffi_plugin/lib/src/bridge_engine/typed_data/web.dart @@ -7,7 +7,7 @@ import 'package:js/js_util.dart'; import 'dart:typed_data' hide Int64List, Uint64List; -import 'package:rust_in_flutter/src/bridge_engine/helpers.dart' +import 'package:rinf/src/bridge_engine/helpers.dart' show UnmodifiableTypedListException; export 'dart:typed_data' hide Int64List, Uint64List; diff --git a/lib/src/bridge_engine/utils.dart b/flutter_ffi_plugin/lib/src/bridge_engine/utils.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_engine/utils.dart rename to flutter_ffi_plugin/lib/src/bridge_engine/utils.dart diff --git a/lib/src/bridge_generated.dart b/flutter_ffi_plugin/lib/src/bridge_generated.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_generated.dart rename to flutter_ffi_plugin/lib/src/bridge_generated.dart diff --git a/lib/src/bridge_generated.io.dart b/flutter_ffi_plugin/lib/src/bridge_generated.io.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_generated.io.dart rename to flutter_ffi_plugin/lib/src/bridge_generated.io.dart diff --git a/lib/src/bridge_generated.web.dart b/flutter_ffi_plugin/lib/src/bridge_generated.web.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/bridge_generated.web.dart rename to flutter_ffi_plugin/lib/src/bridge_generated.web.dart diff --git a/lib/src/exports.dart b/flutter_ffi_plugin/lib/src/exports.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/exports.dart rename to flutter_ffi_plugin/lib/src/exports.dart diff --git a/lib/src/ffi.dart b/flutter_ffi_plugin/lib/src/ffi.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/ffi.dart rename to flutter_ffi_plugin/lib/src/ffi.dart diff --git a/lib/src/ffi_web.dart b/flutter_ffi_plugin/lib/src/ffi_web.dart old mode 100644 new mode 100755 similarity index 100% rename from lib/src/ffi_web.dart rename to flutter_ffi_plugin/lib/src/ffi_web.dart diff --git a/linux/CMakeLists.txt b/flutter_ffi_plugin/linux/CMakeLists.txt old mode 100644 new mode 100755 similarity index 89% rename from linux/CMakeLists.txt rename to flutter_ffi_plugin/linux/CMakeLists.txt index afdacb1f..61897ca5 --- a/linux/CMakeLists.txt +++ b/flutter_ffi_plugin/linux/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10) # Project-level configuration. -set(PROJECT_NAME "rust_in_flutter") +set(PROJECT_NAME "rinf") project(${PROJECT_NAME} LANGUAGES CXX) # Invoke the build for native code shared with the other target platforms. @@ -14,10 +14,10 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DI # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. -set(rust_in_flutter_bundled_libraries +set(rinf_bundled_libraries # Defined in ../src/CMakeLists.txt. # This can be changed to accommodate different builds. - $ + $ PARENT_SCOPE ) diff --git a/windows/rust.cmake b/flutter_ffi_plugin/linux/rust.cmake old mode 100644 new mode 100755 similarity index 93% rename from windows/rust.cmake rename to flutter_ffi_plugin/linux/rust.cmake index b192ac7a..e4cf45a2 --- a/windows/rust.cmake +++ b/flutter_ffi_plugin/linux/rust.cmake @@ -14,7 +14,7 @@ include("../cargokit/cmake/cargokit.cmake") apply_cargokit(${BINARY_NAME} ${CMAKE_SOURCE_DIR}/../native/hub hub "") set( - rust_in_flutter_bundled_libraries + rinf_bundled_libraries "${${BINARY_NAME}_cargokit_lib}" PARENT_SCOPE ) \ No newline at end of file diff --git a/macos/Classes/rust_in_flutter.c b/flutter_ffi_plugin/macos/Classes/rinf.c old mode 100644 new mode 100755 similarity index 76% rename from macos/Classes/rust_in_flutter.c rename to flutter_ffi_plugin/macos/Classes/rinf.c index d850f883..aa301db2 --- a/macos/Classes/rust_in_flutter.c +++ b/flutter_ffi_plugin/macos/Classes/rinf.c @@ -1,3 +1,3 @@ // Relative import to be able to reuse the C sources. // See the comment in ../{projectName}}.podspec for more information. -#include "../../src/rust_in_flutter.c" +#include "../../src/rinf.c" diff --git a/macos/rust_in_flutter.podspec b/flutter_ffi_plugin/macos/rinf.podspec old mode 100644 new mode 100755 similarity index 93% rename from macos/rust_in_flutter.podspec rename to flutter_ffi_plugin/macos/rinf.podspec index 6a77821f..4db43051 --- a/macos/rust_in_flutter.podspec +++ b/flutter_ffi_plugin/macos/rinf.podspec @@ -1,9 +1,9 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint rust_in_flutter.podspec` to validate before publishing. +# Run `pod lib lint rinf.podspec` to validate before publishing. # Pod::Spec.new do |s| - s.name = 'rust_in_flutter' + s.name = 'rinf' s.version = '0.1.0' s.summary = 'Summary' s.description = 'Description' diff --git a/pubspec.yaml b/flutter_ffi_plugin/pubspec.yaml old mode 100644 new mode 100755 similarity index 97% rename from pubspec.yaml rename to flutter_ffi_plugin/pubspec.yaml index b5070b03..a66f4802 --- a/pubspec.yaml +++ b/flutter_ffi_plugin/pubspec.yaml @@ -1,7 +1,7 @@ -name: rust_in_flutter +name: rinf description: '"Rust as your Flutter backend, Flutter as your Rust frontend"' version: 4.11.8 -repository: https://github.com/cunarist/rust-in-flutter +repository: https://github.com/cunarist/rinf environment: sdk: ">=3.0.5 <4.0.0" diff --git a/flutter_ffi_plugin/src/CMakeLists.txt b/flutter_ffi_plugin/src/CMakeLists.txt new file mode 100755 index 00000000..171a523b --- /dev/null +++ b/flutter_ffi_plugin/src/CMakeLists.txt @@ -0,0 +1,17 @@ +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +project(rinf_library VERSION 0.0.1 LANGUAGES C) + +add_library(rinf SHARED + "rinf.c" +) + +set_target_properties(rinf PROPERTIES + PUBLIC_HEADER rinf.h + OUTPUT_NAME "rinf" +) + +target_compile_definitions(rinf PUBLIC DART_SHARED_LIB) diff --git a/src/rust_in_flutter.c b/flutter_ffi_plugin/src/rinf.c old mode 100644 new mode 100755 similarity index 96% rename from src/rust_in_flutter.c rename to flutter_ffi_plugin/src/rinf.c index 38d2e642..ba4b399b --- a/src/rust_in_flutter.c +++ b/flutter_ffi_plugin/src/rinf.c @@ -1,4 +1,4 @@ -#include "rust_in_flutter.h" +#include "rinf.h" // A very short-lived native function. // diff --git a/src/rust_in_flutter.h b/flutter_ffi_plugin/src/rinf.h old mode 100644 new mode 100755 similarity index 100% rename from src/rust_in_flutter.h rename to flutter_ffi_plugin/src/rinf.h diff --git a/windows/.gitignore b/flutter_ffi_plugin/windows/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from windows/.gitignore rename to flutter_ffi_plugin/windows/.gitignore diff --git a/windows/CMakeLists.txt b/flutter_ffi_plugin/windows/CMakeLists.txt old mode 100644 new mode 100755 similarity index 90% rename from windows/CMakeLists.txt rename to flutter_ffi_plugin/windows/CMakeLists.txt index 976b91dc..341f06ba --- a/windows/CMakeLists.txt +++ b/flutter_ffi_plugin/windows/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.14) # Project-level configuration. -set(PROJECT_NAME "rust_in_flutter") +set(PROJECT_NAME "rinf") project(${PROJECT_NAME} LANGUAGES CXX) # Invoke the build for native code shared with the other target platforms. @@ -15,10 +15,10 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DI # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. -set(rust_in_flutter_bundled_libraries +set(rinf_bundled_libraries # Defined in ../src/CMakeLists.txt. # This can be changed to accommodate different builds. - $ + $ PARENT_SCOPE ) diff --git a/linux/rust.cmake b/flutter_ffi_plugin/windows/rust.cmake old mode 100644 new mode 100755 similarity index 93% rename from linux/rust.cmake rename to flutter_ffi_plugin/windows/rust.cmake index b192ac7a..e4cf45a2 --- a/linux/rust.cmake +++ b/flutter_ffi_plugin/windows/rust.cmake @@ -14,7 +14,7 @@ include("../cargokit/cmake/cargokit.cmake") apply_cargokit(${BINARY_NAME} ${CMAKE_SOURCE_DIR}/../native/hub hub "") set( - rust_in_flutter_bundled_libraries + rinf_bundled_libraries "${${BINARY_NAME}_cargokit_lib}" PARENT_SCOPE ) \ No newline at end of file diff --git a/shorthand/Cargo.toml b/rust_crate/Cargo.toml similarity index 65% rename from shorthand/Cargo.toml rename to rust_crate/Cargo.toml index 3512bb8a..b9da008b 100644 --- a/shorthand/Cargo.toml +++ b/rust_crate/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "rifs" +name = "rinf" version = "4.11.8" edition = "2021" license = "MIT" description = "Rust as your Flutter backend, Flutter as your Rust frontend" -repository = "https://github.com/cunarist/rust-in-flutter" +repository = "https://github.com/cunarist/rinf" diff --git a/rust_crate/README.md b/rust_crate/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/rust_crate/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/shorthand/src/main.rs b/rust_crate/src/main.rs similarity index 92% rename from shorthand/src/main.rs rename to rust_crate/src/main.rs index e6bf9da6..2dd67032 100644 --- a/shorthand/src/main.rs +++ b/rust_crate/src/main.rs @@ -12,7 +12,7 @@ fn main() { let mut command = Command::new("dart"); #[cfg(target_family = "wasm")] let mut command = Command::new("exit"); - command.args(["run", "rust_in_flutter"]); + command.args(["run", "rinf"]); command.args(&dart_command_args); // Execute the command diff --git a/shorthand/README.md b/shorthand/README.md deleted file mode 100644 index 299b4d2a..00000000 --- a/shorthand/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# RIFS - -[![Pub Version](https://img.shields.io/pub/v/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Popularity](https://img.shields.io/pub/popularity/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![Pub Points](https://img.shields.io/pub/points/rust_in_flutter)](https://pub.dev/packages/rust_in_flutter) -[![GitHub Stars](https://img.shields.io/github/stars/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/stargazers) -[![Build Test](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml/badge.svg)](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) -[![GitHub License](https://img.shields.io/github/license/cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/blob/main/LICENSE) - -**A command-line tool for simplifying the use of Rust-In-Flutter** - -![Preview](https://github.com/cunarist/rust-in-flutter/assets/66480156/ae82aad9-02f9-4a1e-93f9-69907511baf8) - -This is a production-ready framework for creating beautiful and performant cross-platform apps using Flutter and Rust with batteries fully included. Simply add this framework to your app project, and you're all set to write Flutter and Rust together! - -## 🎮 Demo - -Visit the [demo](https://rif-demo.cunarist.com/) running on the web to experience the smoothness and delightfulness that comes from the combination of Flutter and Rust. You can also dive into the [example code](https://github.com/cunarist/rust-in-flutter/tree/main/example). - -## 🖥️ Platform Support - -All platforms available with Flutter are [tested](https://github.com/cunarist/rust-in-flutter/actions/workflows/build_test.yaml?query=branch%3Amain) and supported. Challenging build settings are automatically handled by this framework. - -- ✅ Linux: Tested and supported -- ✅ Android: Tested and supported -- ✅ Windows: Tested and supported -- ✅ macOS: Tested and supported -- ✅ iOS: Tested and supported -- ✅ Web: Tested and supported - -## 🎁 Benefits - -- **Truly easy**: It only takes about about a minute or two to fully setup your app. No other solution provides this level of convenience. -- **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries. -- **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with. -- **Low-level control**: Though the hard things are kept beneath the surface, you are free to modify the underlying logic such as concurrency or debugging features. There is no hidden mechanism that prevents your understanding. -- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rust-in-flutter/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized. -- **Efficient**: No memory copy when sending native data, no hidden threads and web workers with memory overhead. This is a really thin wrapper around Dart and Rust. -- **Scalable**: You are able to use an arbitrary number of Rust library crates as you want, perhaps including ones that you've already been working on. -- **Logical API**: You declare RESTful messages, not functions for APIs, which provides greater stability. Requesting from Dart and responsing from Rust, as well as streaming from Rust to Dart is possible. Messages are type-safe and flexible because it's powered by the well-known [Protobuf](https://protobuf.dev/) serialization. You also have the ability to send large binary data from Rust to Dart without any memory copy. -- **File-based messages**: No more headaches from extremely big API code files that hinders readability. Even defining hundereds and thousands of API endpoints between Dart and Rust is easy and clean. -- **Async interaction**: Rust operations will never block Flutter's main thread because they are spawned in a separate thread pool. -- **Convenient debugging**: All the debugging functionalities are provided by default, without the need for dealing with browsers or mobile emulators. Also, the whole Rust logic is automatically restarted on Dart's hot restart. -- **Reliable**: This framework simply provides a connection between Dart and Rust without complex code generation mechanism. Each component is backed by big communities, which is especially important for ensuring safety. - -## 🐦 Why Use Flutter? - -While Rust is a powerful language for high-performance native programming, its ecosystem for building graphical user interfaces is far from being mature. Though Rust already has some GUI frameworks, they don't compete with extensive support and smooth development experience that Flutter provides. It's only Flutter that compiles to all 6 major platforms from a single codebase. - -Flutter is a powerful and versatile framework that has gained immense popularity for building cross-platform applications with stunning user interfaces. It provides declarative pattern, beautiful widgets, hot reload, convenient debugging tools, and dedicated packages for user interfaces right out-of-the-box. - -## 🦀 Why Use Rust? - -While Dart excels as an amazing object-oriented language for GUI apps, its non-native garbage collection may not always meet demanding performance requirements, and it may lack advanced data manipulation packages. This is where Rust steps in, offering an incredible speed advantage of roughly [2~40 times faster](https://programming-language-benchmarks.vercel.app/dart-vs-rust) than Dart, alongside the ability to leverage multiple threads and various crates that get the job done. - -Rust has garnered a devoted following, being [the most loved programming language](https://survey.stackoverflow.co/2022#section-most-loved-dreaded-and-wanted-programming-scripting-and-markup-languages) on Stack Overflow. Its native performance, thanks to the zero-cost abstraction philosophy, ensures high productivity. Many developers foresee Rust potentially replacing C++ in the future. Rust's simplicity, memory safety, superior performance in various scenarios, vibrant community, and robust tooling support contribute to its growing popularity. - -## 📖 Documentation - -Check out the [documentation](https://rif-docs.cunarist.com) for everything you need to know about how to use this thing. - -## 👥 Contributors - -We appreciate your contribution to the development of this project! We're always open to discussions and pull requests, so please do not hesitate to leave your ideas or opinions at our GitHub repository. - -[![GitHub contributors (via allcontributors.org)](https://contrib.rocks/image?repo=cunarist/rust-in-flutter)](https://github.com/cunarist/rust-in-flutter/graphs/contributors) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 020f52e1..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(rust_in_flutter_library VERSION 0.0.1 LANGUAGES C) - -add_library(rust_in_flutter SHARED - "rust_in_flutter.c" -) - -set_target_properties(rust_in_flutter PROPERTIES - PUBLIC_HEADER rust_in_flutter.h - OUTPUT_NAME "rust_in_flutter" -) - -target_compile_definitions(rust_in_flutter PUBLIC DART_SHARED_LIB)