Status Update
Comments
xa...@google.com <xa...@google.com> #2
Because the new variant API runs before the current task creation, we cannot expose a TaskProvider
on the new Variant API.
Instead I propose the API looks like this:
androidComponents {
onVariant(...) { v ->
v.onPreBuild { task ->
}
}
}
onPreBuild
would register a callback that will be executed later when the pre build tasks are added. In the future it is possible that the prebuild tasks would only be created if onPreBuild
is called.
task
could be either the TaskProvider
or the Task
(basically this would be called from inside the task configuration.
jl...@google.com <jl...@google.com>
je...@google.com <je...@google.com>
to...@gmail.com <to...@gmail.com> #3
Yes. This would help. From my perspective, it is the same as TaskProvider, just another mechanism for the same thing.
je...@google.com <je...@google.com> #4
WIP : Change-Id: I33ddcc4a6ad1302b6e67123a14eb17933d91877e
je...@google.com <je...@google.com>
an...@google.com <an...@google.com> #5
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Iguana | 2023.2.1 Canary 11
- Android Gradle Plugin 8.3.0-alpha11
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
I basically don't need to do any transformation with any build artifact. I want to run dependency verification before the variant starts to build for production build, like if there is no SNAPSHOT dependency for example.
So I want to connect this task just before any build related to the variant happens.
I'm currently using BaseVariant.assembleProvider to hook up my task.
This os currently not possible with new API