-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix "Task not found" failures when using DexGuard #452
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending review comments + manual testing
CHANGELOG.md
Outdated
@@ -6,6 +6,9 @@ | |||
* Address task dependency warning when using APK splits | |||
[#412](https://github.com/bugsnag/bugsnag-android-gradle-plugin/pull/412) | |||
|
|||
* Fix "Task with name *** not found" errors when using custom build variants and DexGuard | |||
[]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a link
val taskName = getDexguardAabTaskName(variant) | ||
project.tasks.named(taskName).configure { dexguardTask -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd make sense to keep this configure block as otherwise I think this change could trigger eager configuration of the task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that makes the order of apply plugin
significant - the Dexguard plugin must be applied before BAGP otherwise the Dexguard task doesn't exist when we look it up here - also resulting in a Task not found
exception.
By specifying the task by name rather than by reference we only resolve it at the end of configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved this much more correctly by postponing the Dexguard task lookup using generateProguardTaskProvider.configure
.
… attempting to register tasks
a429bb6
to
ee141a9
Compare
Goal
Fix #444 where builds with custom variants and DexGuard could fail with a "Task not found" error where limited build flavours where configured for DexGuard.
Design
Check for variant level DexGuard configurations and if they exist: check each variant is configured in DexGuard before attempting to create an upload task for that variant.
Testing
Manually tested with a known failing project.