{"id":24480894,"url":"https://github.com/randogoth/rust-to-flutter","last_synced_at":"2025-03-14T18:18:20.918Z","repository":{"id":272002232,"uuid":"915238615","full_name":"randogoth/rust-to-flutter","owner":"randogoth","description":"bash script to cross compile a Rust library to mobile targets and copy the binaries into the correct Flutter directories","archived":false,"fork":false,"pushed_at":"2025-01-19T19:05:15.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T20:19:48.533Z","etag":null,"topics":["cargo","cross-compilation","flutter","ndk","rename","rust"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/randogoth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-11T10:29:13.000Z","updated_at":"2025-01-19T19:05:18.000Z","dependencies_parsed_at":"2025-01-19T20:19:34.340Z","dependency_job_id":null,"html_url":"https://github.com/randogoth/rust-to-flutter","commit_stats":null,"previous_names":["randogoth/rust-to-flutter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Frust-to-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Frust-to-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Frust-to-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Frust-to-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randogoth","download_url":"https://codeload.github.com/randogoth/rust-to-flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243624103,"owners_count":20321029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cross-compilation","flutter","ndk","rename","rust"],"created_at":"2025-01-21T11:17:38.490Z","updated_at":"2025-03-14T18:18:20.913Z","avatar_url":"https://github.com/randogoth.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Rust to Flutter Build Script\n\nThis script compiles a Rust library for both Android and iOS and copies the generated libraries to the appropriate Flutter project directories.\n\n#### Features:\n- Installs missing cross-compilation targets.\n- Compiles Rust for Android.\n- Conditionally compiles Rust for iOS if running on macOS.\n- Optionally includes `x86` and `x86_64` Android/iOS targets using the `-x` flag.\n- Automatically cleans the build directory before compiling.\n- Copies `.so` (Android) and `.dylib` (iOS) files to the Flutter project.\n\n#### Usage:\n1. Ensure the following are installed:\n   - `cargo-ndk`: Install via `cargo install cargo-ndk`.\n   - Android NDK (set `ANDROID_NDK_HOME` or `ANDROID_SDK_ROOT`).\n   - Rust toolchains for iOS targets if compiling on macOS.\n\n2. Run the script:\n   ```bash\n   ./rust_to_flutter.sh [-x] \u003cpath_to_rust_project\u003e \u003cpath_to_flutter_project\u003e\n   ```\n\n   - The optional `-x` flag includes `x86` and `x86_64` targets for Android.\n\n#### Examples:\n- Standard build for Android and (on macOS) iOS:\n   ```bash\n   ./rust_to_flutter.sh ./rust_project ./flutter_project\n   ```\n- Include `x86` and `x86_64` targets for Android:\n   ```bash\n   ./rust_to_flutter.sh -x ./rust_project ./flutter_project\n   ```\n\n#### Notes:\n- Android libraries are copied to `android/app/src/main/jniLibs/\u003carch\u003e`.\n- iOS libraries are copied to the `ios` directory.\n\n#### Additional Information:\n- iOS compilation is skipped automatically if the script is not running on macOS.\n- The script checks for missing Rust cross-compilation targets and installs them as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandogoth%2Frust-to-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandogoth%2Frust-to-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandogoth%2Frust-to-flutter/lists"}