Commit 2ce2488
feat(android): ship the app and plugin gradle files with the CLI
The gradle build scripts used to live only in the android runtime, so any
fix to them had to wait for a runtime release. This bundles the app-level
gradle files in `vendor/gradle-app` and copies them over the ones the
runtime lays down when the platform is added, the same way the plugin
build already uses `vendor/gradle-plugin`.
- `vendor/gradle-app` holds `build.gradle`, `settings.gradle`,
`app/build.gradle`, `app/gradle.properties` and the `app/gradle-helpers`.
They are copied on top of the runtime files in `createProject`, so the
runtime keeps providing everything that is not part of the overlay.
- `--no-override-runtime-gradle-files` opts out and keeps the runtime files.
- The directory the files come from is resolved through
`getGradleFilesPath`, which already understands an
`android.gradleFilesPackageName` config key so the files can later be
provided by an npm package instead of the bundled copy.
- The CLI now interpolates `__PACKAGE__` (android namespace) and
`USER_PROJECT_ROOT` in the copied files, and honours
`android.gradleVersion` by rewriting the gradle wrapper.
- `--gradleArgs` becomes an array option, so it can be passed several
times, and a single value may hold several space separated arguments.
Arguments listed in `android.gradleArgs` are passed too, before the
command line ones. Both app and plugin builds go through the same merge.
- Both app and plugin gradle invocations now get `-PcompileSdk`,
`-PtargetSdk`, `-PbuildToolsVersion`, `-PgenerateTypings`, `-PprojectRoot`
and `-PappBuildPath` (the last two also as `-D` so `settings.gradle` can
read them before project properties exist).
- A debug build is signed when the `--key-store-*` options are passed,
which is needed for system app builds.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 2f9f2e0 commit 2ce2488
29 files changed
Lines changed: 2489 additions & 148 deletions
File tree
- docs/man_pages/project/testing
- lib
- contracts
- data
- definitions
- services
- android
- test
- services
- android
- vendor
- gradle-app
- app
- gradle-helpers
- gradle-plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
576 | 582 | | |
577 | 583 | | |
578 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
182 | 201 | | |
183 | 202 | | |
184 | 203 | | |
| |||
0 commit comments