Skip to content

Commit ddd71d3

Browse files
committed
chore: Updated README.md
1 parent 5249ce1 commit ddd71d3

2 files changed

Lines changed: 36 additions & 17 deletions

File tree

README.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,39 @@ https://plugins.gradle.org/plugin/io.github.MatrixDev.android-rust
77

88
# Usage
99

10-
Add dependencies to the root `build.gradle.kts` file
10+
Add dependencies to the root `settings.gradle.kts` file:
1111

1212
```kotlin
13-
buildscript {
14-
repositories {
15-
maven("https://plugins.gradle.org/m2/")
16-
}
13+
repositories {
14+
// ...
15+
maven("https://plugins.gradle.org/m2/")
16+
}
17+
```
1718

18-
dependencies {
19-
classpath("io.github.MatrixDev.android-rust:plugin:0.5.0")
20-
}
19+
Add dependency record to `libs.versions.toml` file:
20+
21+
```toml
22+
[plugins]
23+
android-rust = { id = "io.github.MatrixDev.android-rust", version = "0.5.0" }
24+
```
25+
26+
Add dependencies to the root `build.gradle.kts` file:
27+
28+
```kotlin
29+
plugins {
30+
alias(libs.plugins.android.rust) apply false
2131
}
2232
```
2333

24-
Add plugin to the module's `build.gradle.kts` file
34+
Add plugin to the module's `build.gradle.kts` file:
2535

2636
```kotlin
2737
plugins {
28-
id("io.github.MatrixDev.android-rust")
38+
alias(libs.plugins.android.rust)
2939
}
3040
```
3141

32-
Add `androidRust` configuration
42+
Add `androidRust` configuration:
3343

3444
```kotlin
3545
androidRust {
@@ -47,7 +57,7 @@ This is the list of some additional flags that can be configured:
4757
androidRust {
4858
// MSRV, plugin will update rust if installed version is lower than requested
4959
minimumSupportedRustVersion = "1.62.1"
50-
60+
5161
module("rust-library") {
5262
// path to your rust library
5363
path = file("src/rust_library")
@@ -81,29 +91,38 @@ androidRust {
8191
}
8292
```
8393

94+
# AGP Version Compatibility
95+
96+
| Plugin Version | AGP Version | Status |
97+
|----------------|-------------|-----------------------------|
98+
| 0.6.0 | 9.0+ | Active development |
99+
| 0.5.0 | 7.x – 8.x | Maintained (bug fixes only) |
84100

85101
# Development support
102+
86103
Plugin will check for a magic property `android.injected.build.abi` set by Android Studio when
87104
running application on device. This will limit ABI targets to only required by the device and
88105
should speedup development quite a bit.
89106

90107
In theory this should behave the same as a built-in support for the NdkBuild / CMake.
91108

92-
93109
# Goals
110+
94111
- Building multiple rust libraries with ease
95112
- Allow builds to be configurable for common scenarios
96113

97-
98114
# Non-goals
115+
99116
- Supporting all Gradle versions
100117
- Allow builds to be configurable for exotic scenarios
101118

102-
103119
# IDE Enviroment PATH Workaround
104-
On some systems (notably MacOS) gradle task might fail to locate rust binaries. At this moment there are multiple issues/discussions for both gradle and IntelliJ IDEs.
120+
121+
On some systems (notably MacOS) gradle task might fail to locate rust binaries. At this moment there
122+
are multiple issues/discussions for both gradle and IntelliJ IDEs.
105123

106124
To solve this problem cargo path can be provided in `local.properties` file:
125+
107126
```properties
108127
sdk.dir=...
109128
cargo.bin=/Users/{user}/.cargo/bin/

example/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ google-material = "com.google.android.material:material:1.13.0"
1414
[plugins]
1515
android-application = { id = "com.android.application", version.ref = "agp" }
1616
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
17-
android-rust = { id = "io.github.MatrixDev.android-rust" }
17+
android-rust = { id = "io.github.MatrixDev.android-rust", version = "0.5.0" }

0 commit comments

Comments
 (0)