@@ -30,7 +30,9 @@ Add `androidRust` configuration
30
30
31
31
``` kotlin
32
32
androidRust {
33
- path = file(" src/rust_library" ) // path to your rust library
33
+ module(" rust-library" ) {
34
+ path = file(" src/rust_library" )
35
+ }
34
36
}
35
37
```
36
38
@@ -40,28 +42,54 @@ This is the list of some additional flags that can be configured:
40
42
41
43
``` kotlin
42
44
androidRust {
43
- path = file(" src/rust_library" )
44
-
45
- // default rust profile
46
- profile = " release"
47
-
48
- // default abi targets
49
- targets = setOf (" arm" , " arm64" )
50
-
51
45
// MSRV, plugin will update rust if installed version is lower than requested
52
46
minimumSupportedRustVersion = " 1.62.1"
53
-
54
- // "debug" build type specific configuration
55
- buildType(" debug" ) {
56
- // use "dev" profile in rust
57
- profile = " dev"
47
+
48
+ module(" rust-library" ) {
49
+ // path to your rust library
50
+ path = file(" src/rust_library" )
51
+
52
+ // default rust profile
53
+ profile = " release"
54
+
55
+ // default abi targets
56
+ targets = setOf (" arm" , " arm64" )
57
+
58
+ // "debug" build type specific configuration
59
+ buildType(" debug" ) {
60
+ // use "dev" profile in rust
61
+ profile = " dev"
62
+ }
63
+
64
+ // "release" build type specific configuration
65
+ buildType(" release" ) {
66
+ // run rust tests before build
67
+ runTests = true
68
+
69
+ // build all supported abi versions
70
+ targets = setOf (" arm" , " arm64" , " x86" , " x86_64" )
71
+ }
58
72
}
59
73
60
- // "release" build type specific configuration
61
- buildType(" release" ) {
62
- // build all supported abi versions
63
- targets = setOf (" arm" , " arm64" , " x86" , " x86_64" )
74
+ // more than one library can be added
75
+ module(" additional-library" ) {
76
+ // ...
64
77
}
65
78
}
66
79
```
67
80
81
+ # Development support
82
+
83
+ Plugin will check for a magic property ` android.injected.build.abi ` set by Android Studio when
84
+ running application on device. This will limit ABI targets to only required by the device and
85
+ should speedup development quite a bit.
86
+
87
+ In theory this should behave the same as a built-in support for the NdkBuild / CMake.
88
+
89
+ # Goals
90
+ - Building multiple rust libraries with ease
91
+ - Allow builds to be configurable for common scenarios
92
+
93
+ # Non-goals
94
+ - Supporting all Gradle versions
95
+ - Allow builds to be configurable for exotic scenarios
0 commit comments