Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cach30verfl0w/react-native-rust-plugin
Gradle Plugin for compatibility between Rust Code and TypeScript Code for Android
https://github.com/cach30verfl0w/react-native-rust-plugin
Last synced: about 2 months ago
JSON representation
Gradle Plugin for compatibility between Rust Code and TypeScript Code for Android
- Host: GitHub
- URL: https://github.com/cach30verfl0w/react-native-rust-plugin
- Owner: Cach30verfl0w
- License: apache-2.0
- Created: 2023-10-30T19:20:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-06T16:52:58.000Z (about 1 year ago)
- Last Synced: 2023-11-07T00:34:32.577Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 673 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Native Rust Plugin
Gradle Plugin for compatibility between Rust Code and TypeScript Code for Android. For this plugin, you need to have Cargo and the Android NDK (Native Development Kit) installed.## Dependencies
This project uses the following dependencies:
| Name | Author | License |
|-|-|-
| [antlr4](https://github.com/antlr/antlr4) | [Antlr Project](https://github.com/antlr) | [BSD-3 Clause License](https://github.com/antlr/antlr4/blob/dev/LICENSE.txt) |
| [Java Annotations](https://github.com/JetBrains/java-annotations) | [JetBrains](https://github.com/JetBrains) | [Apache-2.0 License](https://github.com/JetBrains/java-annotations/blob/master/LICENSE.txt) |
| [Night Config (Toml)](https://github.com/TheElectronWill/night-config) | [TheElectronWill](https://github.com/TheElectronWill) | [GNU Lesser General Public License 3.0](https://github.com/TheElectronWill/night-config/blob/master/LICENSE) |## Configuration
You can configure the plugin with the `react-native-rust` section in your `build.gradle`. The following code shows an example (In the `rustBaseFolder` you can create cargo projects):
```groovy
react-native-rust {
basePackage = "com.user.example"
rustBaseFolder = "src/main/rust"
androidApiVersion = 33 as Byte
cargoFile = file("%CARGO_PATH%") // Optional, defaulted to cargo executable
ndkFolder = file("%NDK_FOLDER%") // Optional, defaulted to NDK_HOME env variablemodule('rust-module-name') // Add module to list
}
```After the configuration, you can run three tasks:
- `javaCodeGen` - Generate Java-side Code by the Rust code in the projects
- `cargoCompile` - Compile all Rust projects in base folder
- `nativeBundle` - Move all rust library files to the `src/main/jniLibs` folder