Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use derive macros to define signals between Dart and Rust #527

Draft
wants to merge 294 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
617f698
Update wrong paths
temeddix Mar 2, 2025
d980e3f
Organize workspace `Cargo.toml`
temeddix Mar 2, 2025
9a71185
Merge pull request #526 from cunarist/cache-actions
temeddix Mar 2, 2025
91a65e7
Implement `rinf gen`, `rinf server`, and `rinf config` in Rust
temeddix Mar 2, 2025
a998df1
Generate signal class in Dart from attributes
temeddix Mar 2, 2025
71323e8
Remove debugging prints
temeddix Mar 2, 2025
67443c5
Merge branch 'cache-actions' into derive-signals
temeddix Mar 2, 2025
5764e66
Remove Protobuf files from template
temeddix Mar 2, 2025
6b2b425
Implement `rinf template` in Rust
temeddix Mar 2, 2025
7599078
Implement `build_webassembly` in Rust
temeddix Mar 2, 2025
ab07e26
Fix an error
temeddix Mar 2, 2025
8bb5c98
Organize code
temeddix Mar 2, 2025
4993814
Restore some comments
temeddix Mar 2, 2025
e46bed1
Watch Rust code to regenerate Dart files
temeddix Mar 2, 2025
07154ec
Remove unneeded function
temeddix Mar 2, 2025
ad1387c
Add a todo comment
temeddix Mar 2, 2025
cd68e59
Remove Dart binary code
temeddix Mar 2, 2025
06f9249
Restore todo comments
temeddix Mar 2, 2025
2567fb5
Organize various things
temeddix Mar 2, 2025
99b9e1a
Add clippy lint rules in proc crate too
temeddix Mar 2, 2025
e3d2c53
Add a todo comment
temeddix Mar 2, 2025
d51bd04
Add a comment
temeddix Mar 2, 2025
2f2d19a
Update docs and comments
temeddix Mar 2, 2025
385fb8c
Remove outdated doc sections
temeddix Mar 2, 2025
1160548
Add a todo comment
temeddix Mar 2, 2025
2bb17b3
Remove unused Dart dependencies
temeddix Mar 2, 2025
b85b618
Update a comment
temeddix Mar 2, 2025
82874a8
Add dummy methods to attributes
temeddix Mar 2, 2025
2a9245b
Improve doc comments
temeddix Mar 2, 2025
a920db0
Rename a module
temeddix Mar 2, 2025
2ad0407
Add a todo comment
temeddix Mar 2, 2025
ef3f0cb
Only ignore markdown files in CI
temeddix Mar 2, 2025
5629d3b
Add a todo comment
temeddix Mar 3, 2025
076c6f6
Add a todo comment
temeddix Mar 3, 2025
68c6c85
Comment out some Clippy rules temporarily
temeddix Mar 3, 2025
045ab8c
Write Rust-side message interface
temeddix Mar 3, 2025
82a6019
Fix an error inside example crate code
temeddix Mar 3, 2025
8e4f43d
Organize proc macro code
temeddix Mar 3, 2025
4d570c5
Add a todo comment
temeddix Mar 3, 2025
d4613ca
Remove old interface code
temeddix Mar 3, 2025
a4b55f0
Rename `Signal` to `SignalPiece`
temeddix Mar 3, 2025
6bfefac
Update a comment
temeddix Mar 3, 2025
f4adb39
Update a generator code
temeddix Mar 3, 2025
494f6ff
Add `rinf` prefix to symbols
temeddix Mar 3, 2025
c42b3cf
Add a todo comment
temeddix Mar 3, 2025
5c737c8
Generate extension methods in Dart
temeddix Mar 3, 2025
a48229c
Add proc macros for binary signals
temeddix Mar 3, 2025
2ed6bfe
Cache dynamic library functions
temeddix Mar 3, 2025
c05ac4d
Update a comment
temeddix Mar 3, 2025
8a42790
Remove an unused file
temeddix Mar 3, 2025
84a93a1
Add a todo comment
temeddix Mar 3, 2025
ef83d16
Write interface code in each class file
temeddix Mar 3, 2025
33cad42
Update signal variants
temeddix Mar 3, 2025
0ab3d13
Write shared code in `rinf_interface.dart`
temeddix Mar 3, 2025
fe1bfbb
Write `rustSignalHandlers`
temeddix Mar 3, 2025
5d0d9fa
Properly assign Rust signals
temeddix Mar 3, 2025
2888bcc
Use `BTree` structures for order consistency
temeddix Mar 3, 2025
220978a
Modify class file in its function
temeddix Mar 3, 2025
597d9c5
Remove an unused import
temeddix Mar 3, 2025
ba86b7e
Make `rustSignalStream` recognizable
temeddix Mar 3, 2025
36a8618
Add a todo comment
temeddix Mar 3, 2025
0849715
Organize dependencies
temeddix Mar 3, 2025
0675ad3
Remove an unneeded declaration
temeddix Mar 3, 2025
b6dbcb6
Upgrade `serde-generate`
temeddix Mar 3, 2025
116081f
Reduce indentations
temeddix Mar 3, 2025
8f4b63f
Update template code
temeddix Mar 3, 2025
80d921d
Update Dart imports
temeddix Mar 3, 2025
65e57a6
Format a proc macro code
temeddix Mar 3, 2025
3ecc571
Fix string manipulation in proc macro
temeddix Mar 3, 2025
25ee4ab
Generate code
temeddix Mar 3, 2025
61d94a9
Fix compile error on the web
temeddix Mar 3, 2025
55d995a
Apply latest Flutter template to the example app
temeddix Mar 3, 2025
f418101
Merge branch 'main' into derive-signals
temeddix Mar 3, 2025
01274f1
Organize code
temeddix Mar 3, 2025
e9ae14d
Improve Python script
temeddix Mar 3, 2025
52791eb
Organize docs
temeddix Mar 8, 2025
60f4675
Add a todo comment
temeddix Mar 8, 2025
c586bb5
Replace a deprecated Dart statement
temeddix Mar 8, 2025
fbb760f
Make generated code work on all platforms
temeddix Mar 8, 2025
bc595a3
Remove Flutter build folder from CI caching
temeddix Mar 8, 2025
c736ad3
Fix Flutter package conflicts
temeddix Mar 8, 2025
e454fb8
Apply macOS builds
temeddix Mar 8, 2025
f76e525
Apply iOS builds
temeddix Mar 8, 2025
03b6eaf
Format a markdown file
temeddix Mar 8, 2025
dd9716b
Update a comment
temeddix Mar 8, 2025
5f4cde2
Remove external todo comments again
temeddix Mar 9, 2025
44a6dbf
Update example app description
temeddix Mar 9, 2025
5770f03
Organize GitHub CI
temeddix Mar 9, 2025
c24a04a
Update a dependency of example app
temeddix Mar 9, 2025
4eae533
Fix CI
temeddix Mar 9, 2025
dfcd78d
Revert "Fix CI"
temeddix Mar 9, 2025
79a5952
Add todo comments
temeddix Mar 9, 2025
01a2649
Make a generated Dart method private
temeddix Mar 9, 2025
847e8ef
Simplify generated code
temeddix Mar 9, 2025
de6571b
Use `distributed_slice` to call extern Rust function
temeddix Mar 9, 2025
112a485
Re-export `bincode` items
temeddix Mar 9, 2025
3b12e47
Clarify NDK version in example app
temeddix Mar 9, 2025
3074337
Organize OS interface code in Dart
temeddix Mar 9, 2025
feae5a7
Remove warnings
temeddix Mar 9, 2025
aa507bc
Dynamically lookup for Dart signal sending symbols
temeddix Mar 9, 2025
7f42cf2
Organize Git ignore files
temeddix Mar 9, 2025
03e1759
Format template `.gitignore` file
temeddix Mar 9, 2025
ae83b0b
Use `bincode` 2.0
temeddix Mar 9, 2025
4d6b8e9
Remove unnecessary files after generation
temeddix Mar 9, 2025
0b9a70d
Update imports
temeddix Mar 9, 2025
bbdb2db
Revert "Use `bincode` 2.0"
temeddix Mar 9, 2025
537ea13
Format a proc macro
temeddix Mar 9, 2025
be4e6bf
Use Rust 2024 edition
temeddix Mar 9, 2025
beca5b0
Remove a todo comment
temeddix Mar 9, 2025
7e29c4c
Remove an unneeded `unsafe` keyword
temeddix Mar 9, 2025
5dceba3
Use the name `AppError` and `SetupError` for errors
temeddix Mar 10, 2025
814f899
Remove `thiserror`
temeddix Mar 10, 2025
e3639c4
Organize code
temeddix Mar 10, 2025
a44cc6e
Update publishing CI
temeddix Mar 10, 2025
e17729b
Make crates publishable
temeddix Mar 10, 2025
c08352d
Organize Python automation script
temeddix Mar 10, 2025
a3db198
Organize Python code
temeddix Mar 10, 2025
dbd0c20
Fix `run_subprocess` Python function
temeddix Mar 10, 2025
00ab4e9
Organize Python workspace
temeddix Mar 10, 2025
07f1b23
Copy server command to clipboard
temeddix Mar 10, 2025
1d3e295
Remove a comment
temeddix Mar 10, 2025
5d36c8d
Separate the CLI crate
temeddix Mar 10, 2025
00cee84
Add a doc guide
temeddix Mar 10, 2025
4d7b5ea
Update CI
temeddix Mar 10, 2025
188a75d
Upgrade resolver in template workspace
temeddix Mar 10, 2025
9b82766
Avoid a warning
temeddix Mar 10, 2025
75c60a8
Update CLI help sentences
temeddix Mar 10, 2025
2924894
Fix a typo
temeddix Mar 10, 2025
20df202
Remove debugging code
temeddix Mar 10, 2025
10a4de9
Activate `derive` feature of `serde`
temeddix Mar 10, 2025
509b43a
Fix linting errors on `wasm32-unknown-unknown`
temeddix Mar 10, 2025
abeab00
Remove a todo comment
temeddix Mar 10, 2025
a6e3032
Organize `Mutex`-related code
temeddix Mar 10, 2025
6866b2c
Directly import things from crate root
temeddix Mar 10, 2025
3ce19f0
Organize the sample crate
temeddix Mar 10, 2025
d42a2b0
Organize traits
temeddix Mar 10, 2025
a502a52
Fix errors on the web
temeddix Mar 10, 2025
6a04cee
Rename an internal trait `GuardRecovery`
temeddix Mar 10, 2025
b5a627d
Organize imports
temeddix Mar 10, 2025
bcb5d48
Add a todo item
temeddix Mar 10, 2025
beab548
Update a comment
temeddix Mar 10, 2025
657b7e9
Organize results and imports in CLI crate
temeddix Mar 10, 2025
0f4a305
Remove warnings
temeddix Mar 10, 2025
5c9e207
Ban all `unwrap` or `expect`s
temeddix Mar 10, 2025
ce14a15
Organize `ReflectionModule` variant
temeddix Mar 10, 2025
3f47040
Organize `PubConfig` error variant
temeddix Mar 10, 2025
140928e
Remove some finished todo comments
temeddix Mar 10, 2025
36d6936
Organize imports
temeddix Mar 10, 2025
c1d230b
Organize imports in proc macros
temeddix Mar 10, 2025
60510a9
Remove a todo comment
temeddix Mar 10, 2025
c929e76
Organize code
temeddix Mar 11, 2025
26478a3
Organize error messages
temeddix Mar 11, 2025
cf3842e
Organize error variants
temeddix Mar 11, 2025
4aa98de
Organize `SetupError` messages and conversions
temeddix Mar 11, 2025
ea2d4e2
Remove an unused `AppError` variant
temeddix Mar 11, 2025
2d397af
Organize error codes
temeddix Mar 11, 2025
fa80e9c
Add a comment
temeddix Mar 11, 2025
4b6e7c1
Use `derive` feature of `clap` for type safety
temeddix Mar 11, 2025
e63ec27
Organize CLI code
temeddix Mar 11, 2025
1bd4a96
Remove unneeded code
temeddix Mar 11, 2025
6247bb4
Remove unneeded blank lines
temeddix Mar 11, 2025
98d598d
Organize imports
temeddix Mar 11, 2025
e986323
Remove unnecessary borrowing
temeddix Mar 11, 2025
cd7a634
Remove a todo comment
temeddix Mar 11, 2025
b0046b2
Improve a CLI message
temeddix Mar 11, 2025
2fbd1d5
Update a todo comment
temeddix Mar 11, 2025
059bb56
Add a comment
temeddix Mar 11, 2025
868168a
Add a todo comment
temeddix Mar 11, 2025
5735c14
Try specifying Rust targets in CI
temeddix Mar 11, 2025
7c55580
Revert "Try specifying Rust targets in CI"
temeddix Mar 11, 2025
99a0898
Update the automation script help output
temeddix Mar 15, 2025
20091b5
Use `uv` in CI
temeddix Mar 15, 2025
d25a571
Add a todo comment
temeddix Mar 17, 2025
828d15a
Use two spaces for indentation in Rust
temeddix Mar 26, 2025
fcbba4c
Fix a todo comment
temeddix Mar 26, 2025
857b399
Organize interface Dart code
temeddix Mar 26, 2025
db7e705
Update comments
temeddix Mar 26, 2025
f53d7b3
Solve a todo comment
temeddix Mar 26, 2025
a32d796
Deny wildcard imports with Clippy
temeddix Mar 26, 2025
a6c6e08
Import from crate if possible
temeddix Mar 26, 2025
b58c5a9
Fix an import error
temeddix Mar 26, 2025
b67d208
Fix an import error
temeddix Mar 26, 2025
ee9c3b7
Use `eprintln!` when appropriate
temeddix Mar 26, 2025
05a9ce3
Format Rust code after applying Rust template
temeddix Mar 26, 2025
e975254
Use `Self` in error methods
temeddix Mar 26, 2025
433878f
Add a todo comment
temeddix Mar 26, 2025
334b49c
Use two spaces for indentations in quote macro
temeddix Mar 26, 2025
9892b0c
Organize quote code
temeddix Mar 26, 2025
e6e90ef
Organize some strings in Rust
temeddix Mar 26, 2025
87a1f2d
Write a migration requirement
temeddix Mar 26, 2025
5161e2c
Use flexible version for `serde`
temeddix Mar 26, 2025
c886c50
Enforce all signals types to have signal on all fields
temeddix Mar 26, 2025
678e9b3
Change `pub extern` to `extern`
temeddix Mar 26, 2025
2a2ca3a
Remove a todo comment
temeddix Mar 26, 2025
9177b11
Reduce duplicated code
temeddix Mar 26, 2025
a310462
Add a doc comment
temeddix Mar 26, 2025
eba0afa
Update license files
temeddix Mar 26, 2025
e24ed78
Improve type safety of nested signals
temeddix Mar 26, 2025
9130498
Fix a typo
temeddix Mar 26, 2025
66fb6f1
Remove a todo comment
temeddix Mar 26, 2025
fe4cca3
Properly use Rinf config and generate to `bindings`
temeddix Mar 26, 2025
433d673
Remove a todo comment
temeddix Mar 26, 2025
f6b26f4
Remove a todo comment
temeddix Mar 26, 2025
838c1a7
Add a todo comment
temeddix Mar 26, 2025
bdee92e
Organize Python scripts
temeddix Mar 26, 2025
ba116ca
Remove an unneeded import
temeddix Mar 27, 2025
9313e0f
Organize code
temeddix Mar 27, 2025
c0099e8
Add doc comments on generated methods and fields
temeddix Mar 27, 2025
6f852c9
Clarify a sentence
temeddix Mar 27, 2025
ac3ed24
Fix the output from `rinf config`
temeddix Mar 27, 2025
208e725
Organize config field names and update docs
temeddix Mar 27, 2025
ba3a885
Create the test module
temeddix Mar 27, 2025
f60eeb8
Run unit tests in CI
temeddix Mar 27, 2025
428b10c
Organize CI items
temeddix Mar 27, 2025
46fc9ab
Format the CI YAML file
temeddix Mar 27, 2025
9401ddf
Fix CI
temeddix Mar 27, 2025
6827919
Try breaking the unit test
temeddix Mar 27, 2025
10b678d
Revert "Try breaking the unit test"
temeddix Mar 27, 2025
ed6eb31
Organize the signal trait code
temeddix Mar 27, 2025
be6d6c8
Organize signal trait impls
temeddix Mar 28, 2025
26845e9
Write unit test with complex types
temeddix Mar 28, 2025
d10ce40
Write upgrading section
temeddix Mar 28, 2025
3ecc732
Temporarily relieve Dart analysis options
temeddix Mar 28, 2025
e832599
Merge pull request #539 from cunarist/tests-in-example-app
temeddix Mar 28, 2025
920ede8
Make the test safer
temeddix Mar 28, 2025
17590a7
Merge branch 'main' into derive-signals
temeddix Mar 28, 2025
2a4961f
Add a todo comment
temeddix Mar 28, 2025
131b855
Use all major collection types in the complex signal test
temeddix Mar 28, 2025
6d175de
Use `Box<T>` inside complex types
temeddix Mar 28, 2025
8695ea1
Remove some comments
temeddix Mar 28, 2025
498b895
Remove unneeded code in the test
temeddix Mar 28, 2025
37a6875
Do not create actors in the test code
temeddix Mar 28, 2025
e1a9d09
Rename a Rust function in the example app
temeddix Mar 28, 2025
f36c312
Add a todo comment
temeddix Mar 28, 2025
b2e73f0
Improve code readability
temeddix Mar 28, 2025
f47954a
Remove an unneeded derive
temeddix Mar 29, 2025
815940a
Collect doc comments on signal structs
temeddix Mar 29, 2025
b5dfa5f
Make the generated `StreamController` private
temeddix Mar 29, 2025
3693709
Fix a minor bug
temeddix Mar 29, 2025
9aac68c
Ban signal structs with bad names
temeddix Mar 29, 2025
6852261
Warn properly when Rust syntax is invalid
temeddix Mar 29, 2025
dd42b21
Organize CLI outputs
temeddix Mar 29, 2025
3899c9f
Organize CLI outputs further
temeddix Mar 29, 2025
d8674bd
Organize file watching code
temeddix Mar 29, 2025
d4812c4
Organize code
temeddix Mar 29, 2025
951f0d7
Watch Rust code in crates specified in the config
temeddix Mar 29, 2025
153fd1b
Make each signal type a trait
temeddix Mar 29, 2025
1c55484
Update doc comments
temeddix Mar 29, 2025
3ce7b7d
Check the signal name for strictly
temeddix Mar 29, 2025
c94cea9
Apply the actor model to the example app
temeddix Mar 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions .github/workflows/example_app.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Verify that the example app works properly.
name: example-app
name: Example App

on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "**.html"
pull_request:
paths-ignore:
- "**.md"
- "**.html"
workflow_dispatch:

concurrency:
Expand All @@ -27,21 +25,21 @@ concurrency:
jobs:
build:
name: ${{ matrix.runner }} / ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}-latest
strategy:
fail-fast: false # Important
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]
runner: [ubuntu, windows, macos]
target: [android, web] # On all platforms
include:
# Specify targets for each platform
- runner: ubuntu-latest
- runner: ubuntu
target: linux
- runner: windows-latest
- runner: windows
target: windows
- runner: macos-latest
- runner: macos
target: macos
- runner: macos-latest
- runner: macos
target: ios

steps:
Expand All @@ -50,6 +48,20 @@ jobs:
with:
submodules: true

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
target
~/.pub-cache
key: >
${{ matrix.runner }}-${{ matrix.target }}
${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }}
restore-keys: |
${{ matrix.runner }}-${{ matrix.target }}
${{ matrix.runner }}

- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
Expand All @@ -71,17 +83,14 @@ jobs:
distribution: "zulu"
java-version: "17"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install the Python environment manager
uses: astral-sh/setup-uv@v5

- name: Install the CLI tool
working-directory: rust_crate/
run: cargo install --path ./
run: cargo install --path rust_crate_cli

- name: Prepare a Flutter app for testing
run: python automate prepare-example-app
run: uv run automate prepare-example-app

- name: Build the example app
if: matrix.target == 'linux'
Expand Down Expand Up @@ -116,3 +125,11 @@ jobs:
run: |
rinf wasm --release
flutter build web --verbose

- name: Run unit tests
if: >
matrix.target == 'linux'
|| matrix.target == 'windows'
|| matrix.target == 'macos'
working-directory: flutter_package/example/
run: flutter test
17 changes: 10 additions & 7 deletions .github/workflows/publication.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Publish packages online.
# This is performed only when a new Git tag
# with version information is added.
name: publication
name: Publication

# With default Git settings, Unix-like systems use LF (`\n`) for new lines,
# while Windows uses CRLF (`\r\n`) in local repositories.
Expand Down Expand Up @@ -54,12 +54,15 @@ jobs:
# Save the `crates.io` API token at
# `GitHub repo - Settings - Security - Secrets and variables - Actions`.

- name: Check the Rust crate
working-directory: rust_crate/
run: cargo publish --dry-run
- name: Check Rust crates
run: |
cargo publish --dry-run --manifest-path rust_crate_proc/Cargo.toml
cargo publish --dry-run --manifest-path rust_crate_command/Cargo.toml
cargo publish --dry-run --manifest-path rust_crate/Cargo.toml
- name: Publish the Rust crate
working-directory: rust_crate/
- name: Publish Rust crates
run: |
cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
cargo publish
cargo publish --manifest-path rust_crate_proc/Cargo.toml
cargo publish --manifest-path rust_crate_command/Cargo.toml
cargo publish --manifest-path rust_crate/Cargo.toml
26 changes: 21 additions & 5 deletions .github/workflows/quality_control.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Confirm that the code and configuration files
# are correctly formatted and analyzed.
name: quality-control
name: Quality Control

on:
push:
Expand Down Expand Up @@ -42,17 +42,16 @@ jobs:
run: rustup component add clippy

- name: Install the CLI tool
working-directory: rust_crate/
run: cargo install --path ./
run: cargo install --path rust_crate_cli

- name: Fetch Flutter dependencies
run: |
flutter pub get --directory flutter_package/
flutter pub get --directory flutter_package/cargokit/build_tool

- name: Generate message files
- name: Generate signal files
working-directory: flutter_package/example/
run: rinf message
run: rinf gen

# Targets are basically combinations of
# web/native and debug/release.
Expand Down Expand Up @@ -85,6 +84,23 @@ jobs:
- name: Check if the code has changed
run: git diff --exit-code

script:
name: python-script
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install the Python environment manager
uses: astral-sh/setup-uv@v5

- name: Run Pyright
run: uv run pyright

- name: Run Ruff
run: uv run ruff check .

config:
name: configuration-files
runs-on: ubuntu-latest
Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/test_app.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Verify that the app build works as intended
# when utilizing the code inside the repository.
name: test-app
name: Test App

on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "**.html"
pull_request:
paths-ignore:
- "**.md"
- "**.html"
workflow_dispatch:

concurrency:
Expand All @@ -28,21 +26,21 @@ concurrency:
jobs:
build:
name: ${{ matrix.runner }} / ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}-latest
strategy:
fail-fast: false # Important
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]
runner: [ubuntu, windows, macos]
target: [android, web] # On all platforms
include:
# Specify targets for each platform
- runner: ubuntu-latest
- runner: ubuntu
target: linux
- runner: windows-latest
- runner: windows
target: windows
- runner: macos-latest
- runner: macos
target: macos
- runner: macos-latest
- runner: macos
target: ios

steps:
Expand All @@ -51,6 +49,20 @@ jobs:
with:
submodules: true

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
target
~/.pub-cache
key: >
${{ matrix.runner }}-${{ matrix.target }}
${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }}
restore-keys: |
${{ matrix.runner }}-${{ matrix.target }}
${{ matrix.runner }}

- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
Expand All @@ -72,17 +84,14 @@ jobs:
distribution: "zulu"
java-version: "17"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install the Python environment manager
uses: astral-sh/setup-uv@v5

- name: Install the CLI tool
working-directory: rust_crate/
run: cargo install --path ./
run: cargo install --path rust_crate_cli

- name: Prepare a Flutter app for testing
run: python automate prepare-test-app
run: uv run automate prepare-test-app

- name: Build the example app
if: matrix.target == 'linux'
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/user_app.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Verify that the documentation steps function as intended
# when users utilize released versions
# instead of the code from the repository.
name: user-app
name: User App

on:
workflow_dispatch:
Expand All @@ -11,21 +11,21 @@ on:
jobs:
build:
name: ${{ matrix.runner }} / ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}-latest
strategy:
fail-fast: false # Important
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]
runner: [ubuntu, windows, macos]
target: [android, web] # On all platforms
include:
# Specify targets for each platform
- runner: ubuntu-latest
- runner: ubuntu
target: linux
- runner: windows-latest
- runner: windows
target: windows
- runner: macos-latest
- runner: macos
target: macos
- runner: macos-latest
- runner: macos
target: ios

steps:
Expand All @@ -34,6 +34,20 @@ jobs:
with:
submodules: true

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
target
~/.pub-cache
key: >
${{ matrix.runner }}-${{ matrix.target }}
${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }}
restore-keys: |
${{ matrix.runner }}-${{ matrix.target }}
${{ matrix.runner }}

- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
Expand All @@ -55,17 +69,14 @@ jobs:
distribution: "zulu"
java-version: "17"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install the Python environment manager
uses: astral-sh/setup-uv@v5

- name: Install the CLI tool
working-directory: rust_crate/
run: cargo install rinf
run: cargo install rinf_cli

- name: Prepare a Flutter app for testing
run: python automate prepare-user-app
run: uv run automate prepare-user-app

- name: Build the example app
if: matrix.target == 'linux'
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ migrate_working_dir/
build/

# Rust related
.cargo/
target/
/.cargo/
/target/

# Others
*.lock
Expand Down
4 changes: 3 additions & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
max_width = 80 # This matches the maximum line length used in Dart
style_edition = "2024"
max_width = 80
tab_spaces = 2
13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[workspace]
members = ["./flutter_package/example/native/*", "./rust_crate"]
resolver = "2"
resolver = "3"
members = [
"flutter_package/example/native/*",
"rust_crate",
"rust_crate_cli",
"rust_crate_proc",
]

[patch.crates-io]
rinf = { path = "./rust_crate" }
rinf = { path = "rust_crate" }
rinf_cli = { path = "rust_crate_cli" }
rinf_proc = { path = "rust_crate_proc" }
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Cunarist
Copyright (c) 2025 Cunarist

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading