File tree 4 files changed +68
-17
lines changed
4 files changed +68
-17
lines changed Original file line number Diff line number Diff line change 30
30
outputs :
31
31
matrix : ${{ steps.setup-matrix.outputs.matrix }}
32
32
33
+ samples :
34
+ # The type of runner that the job will run on
35
+ runs-on : ${{ matrix.os }}
36
+
37
+ strategy :
38
+ fail-fast : false
39
+ matrix :
40
+ os :
41
+ - ubuntu-latest
42
+ - macos-latest
43
+ - windows-latest
44
+ sample :
45
+ - samples/app
46
+ - samples/library
47
+
48
+ steps :
49
+ # Checks-out your repository under $GITHUB_WORKSPACE for the job.
50
+ - uses : actions/checkout@v2
51
+
52
+ - name : Setup Rust
53
+ run : |
54
+ rustup toolchain install stable
55
+ rustup target add x86_64-linux-android
56
+ rustup target add x86_64-unknown-linux-gnu
57
+ rustup target add aarch64-linux-android
58
+
59
+ - name : Setup Java 11
60
+ uses : actions/setup-java@v2
61
+ with :
62
+ distribution : ' temurin'
63
+ java-version : 11
64
+ cache : ' gradle'
65
+
66
+ - name : ${{ matrix.sample }}
67
+ run : |
68
+ ./gradlew -p ${{ matrix.sample }} :assembleDebug --info --warning-mode all
69
+
33
70
android_unversioned_tests :
34
71
# The type of runner that the job will run on
35
72
runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change @@ -496,7 +496,28 @@ $ ls -al build/local-repo/org/mozilla/rust-android-gradle/org.mozilla.rust-andro
496
496
build/local-repo/org/mozilla/rust-android-gradle/org.mozilla.rust-android-gradle.gradle.plugin/0.4.0/org.mozilla.rust-android-gradle.gradle.plugin-0.4.0.pom
497
497
```
498
498
499
- # Testing Local changes
499
+ ## Sample projects
500
+
501
+ The easiest way to get started is to run the sample projects. The sample projects have dependency
502
+ substitutions configured so that changes made to ` plugin/ ` are reflected in the sample projects
503
+ immediately.
504
+
505
+ ```
506
+ $ ./gradlew -p samples/library :assembleDebug
507
+ ...
508
+ $ file samples/library/build/outputs/aar/library-debug.aar
509
+ samples/library/build/outputs/aar/library-debug.aar: Zip archive data, at least v1.0 to extract
510
+ ```
511
+
512
+ ```
513
+ $ ./gradlew -p samples/app :assembleDebug
514
+ ...
515
+ $ file samples/app/build/outputs/apk/debug/app-debug.apk
516
+ samples/app/build/outputs/apk/debug/app-debug.apk: Zip archive data, at least v?[0] to extract
517
+ ```
518
+
519
+ ## Testing Local changes
520
+
500
521
An easy way to locally test changes made in this plugin is to simply add this to your project's ` settings.gradle ` :
501
522
502
523
``` gradle
@@ -545,17 +566,6 @@ Publishing artifact build/publish-generated-resources/pom.xml
545
566
Activating plugin org.mozilla.rust-android-gradle.rust-android version 0.8.1
546
567
```
547
568
548
- ## Sample projects
549
-
550
- To run the sample projects:
551
-
552
- ```
553
- $ ./gradlew -p samples/library :assembleDebug
554
- ...
555
- $ ls -al samples/library/build/outputs/aar/library-debug.aar
556
- -rw-r--r-- 1 nalexander staff 8926315 18 Sep 10:22 samples/library/build/outputs/aar/library-debug.aar
557
- ```
558
-
559
569
## Real projects
560
570
561
571
To test in a real project, use the local Maven repository in your ` build.gradle ` , like:
Original file line number Diff line number Diff line change 1
1
buildscript {
2
- ext. agp_version = ' 4.1 .0'
2
+ ext. agp_version = ' 7.0 .0'
3
3
repositories {
4
4
google()
5
5
maven {
@@ -17,6 +17,8 @@ apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
17
17
18
18
android {
19
19
compileSdkVersion 27
20
+ ndkVersion " 23.1.7779620"
21
+
20
22
defaultConfig {
21
23
applicationId " com.nishtahir.androidrust"
22
24
minSdkVersion 21
@@ -31,17 +33,17 @@ android {
31
33
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
32
34
}
33
35
}
34
- ndkVersion " 20.1.5948944"
35
36
}
36
37
37
38
cargo {
38
39
module = " ../rust"
39
- targets = [" arm " , " x86 " , " x86_64" , " arm64" ]
40
+ targets = [" x86_64" , " arm64" ]
40
41
libname = " rust"
41
42
}
42
43
43
44
repositories {
44
45
google()
46
+ mavenCentral()
45
47
}
46
48
47
49
dependencies {
Original file line number Diff line number Diff line change 1
1
buildscript {
2
+ ext. agp_version = ' 7.0.0'
2
3
repositories {
3
4
google()
4
5
maven {
@@ -16,6 +17,7 @@ apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
16
17
17
18
android {
18
19
compileSdkVersion 27
20
+ ndkVersion " 23.1.7779620"
19
21
20
22
defaultConfig {
21
23
minSdkVersion 21
@@ -24,7 +26,6 @@ android {
24
26
versionName " 1.0"
25
27
26
28
testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
27
-
28
29
}
29
30
buildTypes {
30
31
release {
@@ -36,7 +37,7 @@ android {
36
37
37
38
cargo {
38
39
module = " ../rust"
39
- targets = [" arm " , " x86 " , " x86_64" , " arm64" ]
40
+ targets = [" x86_64" , " arm64" ]
40
41
libname = " rust"
41
42
42
43
features {
@@ -52,6 +53,7 @@ cargo {
52
53
53
54
repositories {
54
55
google()
56
+ mavenCentral()
55
57
}
56
58
57
59
dependencies {
You can’t perform that action at this time.
0 commit comments