Repository navigation
[AGP 9.1.0 Migration #8] Unify add-to-app module wiring on the variant API #193717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e15544b
33f3987
8c9a54d
f668780
2c28d8f
a6be160
b8cd39b
2efbd34
d8f869e
798ac29
1366874
25550b3
eb20bbd
23ddd6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=true | ||
| flutter.hostAppProjectName=SampleApp | ||
| android.newDsl=false | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewers, Ignore this file I dont think it is worth your time. |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewers, Ignore this file I dont think it is worth your time. It is more valuable than the migrateing md file but still probalby not worth it. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,28 +194,27 @@ aliases: | |
|
|
||
| ### Add-to-app (Flutter module in a host app) | ||
|
|
||
| - Flutter no longer looks up or configures the host `:app` project from the | ||
| module. The dependency between your host's asset merging and Flutter's asset | ||
| copy is expressed through the Variant API instead of an explicit | ||
| `merge<Variant>Assets.dependsOn(...)` edge. Build scripts that reference | ||
| Flutter's `copyFlutterAssets<Variant>` tasks by name or type will break. | ||
| For example, `tasks.getByPath(":flutter:copyFlutterAssetsDebug")` will crash | ||
| your build with a `Task with path ... not found` error because the | ||
| tasks are now registered lazily and are no longer of type | ||
| `org.gradle.api.tasks.Copy`. | ||
| - `flutter.hostAppProjectName` in `gradle.properties` is now a no-op. Flutter | ||
| prints a deprecation warning naming the removal milestone. It was only used | ||
| for the host-project lookup, which no longer exists. | ||
| - Flutter maps host build types to Flutter build modes using the public | ||
| "debuggable" flag: `profile` stays `profile`, debuggable build types map to | ||
| `debug`, everything else maps to `release`. If your host has no `profile` | ||
| build type, add `matchingFallbacks`: | ||
| - The Flutter module adds its assets and native libraries to its own variants | ||
| through the Variant API. Your host app consumes them like the assets of any | ||
| Android library. Flutter does not look up or configure the host `:app` | ||
| project, and adds no `merge<Variant>Assets.dependsOn(...)` edge to it. | ||
| - `flutter.hostAppProjectName` in `gradle.properties` has no effect. If it is | ||
| set, Flutter prints a warning that says so. You can remove it. | ||
| - The Flutter module's `copyFlutterAssets<Variant>` tasks are of type | ||
| `CopyFlutterAssetsTask`, not `org.gradle.api.tasks.Copy`. Build scripts that | ||
| look them up with the `Copy` type fail. | ||
| - The Flutter build mode comes from the module variant your host build | ||
| consumes: the module's `debug` variant builds debug Flutter artifacts, | ||
| `profile` builds profile, and `release` builds release. Host `debug`, | ||
| `profile` and `release` build types consume the module variant of the same | ||
| name. For a custom host build type, AGP picks the module variant through the | ||
| build type's `matchingFallbacks`, so list the module build type you want | ||
| first: | ||
|
|
||
| ```kotlin | ||
| create("staging") { | ||
| initWith(getByName("debug")) | ||
| isDebuggable = true // staging gets debug Flutter artifacts | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is isDebuggable deleted here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was deleted on purpose, in 8c9a54d. The text it illustrated said Flutter maps host build types to build modes using the debuggable flag. That mapping ( It was also redundant in the snippet: The PR body shows the effect: a debuggable |
||
| matchingFallbacks += listOf("debug", "release") | ||
| matchingFallbacks += listOf("debug", "release") // staging gets debug Flutter artifacts | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.