-
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
Add BUILD_UUID to app bundle manifests #153
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.
I left one comment inline, otherwise I believe this should work for the common case. We should verify in an example app running AGP 3.3.0, and one running AGP 3.0.1, which won't have App Bundles. We should also test whether this fix works with DexGuard - I'm not sure that it will as currently implemented.
This approach is not ideal in the long-term as it effectively doubles the amount of IO each task needs to perform, regardless of whether App Bundles are actually being used. If other manifest locations are added to the build folder in future, then this will become even more of a problem. Also I think this approach is likely to make it harder to make this task incremental, which has been scheduled in the past.
If we can verify that the plugin works for the above scenarios then I'm happy to approve as a short-term solution, with the caveat that we should revisit the design at a later date.
src/main/groovy/com/bugsnag/android/gradle/BugsnagManifestTask.groovy
Outdated
Show resolved
Hide resolved
I've made a change to the approach so that either the merged manifest, the bundle manifest or both are written to depending on which tasks are in the Gradle task graph for each variant. This has also been tested with an app running AGP 3.3.0, and one running AGP 3.0.1 Tasks left to do:
|
// Get the Bugsnag API key | ||
apiKey = getApiKey(metaDataTags, ns) | ||
if (!apiKey) { | ||
project.logger.warn("Could not find apiKey in '$BugsnagPlugin.API_KEY_TAG' <meta-data> tag in your AndroidManifest.xml or in your gradle config") |
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.
I believe we've recently changed this to throw an exception in #151
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.
I haven't changed this block of code, only the line numbers have changed. https://github.com/bugsnag/bugsnag-android-gradle-plugin/blob/master/src/main/groovy/com/bugsnag/android/gradle/BugsnagVariantOutputTask.groovy#L74
Maybe you mean this which changed in #151?
https://github.com/bugsnag/bugsnag-android-gradle-plugin/blob/master/src/main/groovy/com/bugsnag/android/gradle/BugsnagMultiPartUploadTask.groovy#L43
src/main/groovy/com/bugsnag/android/gradle/BugsnagVariantOutputTask.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/com/bugsnag/android/gradle/BugsnagVariantOutputTask.groovy
Outdated
Show resolved
Hide resolved
I believe the mazerunner tests are failing as the fixture's gradle wrapper has been updated, which seems to alter the order in which requests are sent. Setting it back to the previous version passes the scenarios, and the failing scenarios appear to be in the wrong order when inspecting the |
I've reverted the gradle and AGP version changes in the maze fixture. |
I'm happy to approve this as a short-term fix with the caveat that this has been tested to work with DexGuard. We should create a ticket to address previous concerns I've raised about this general approach at a later date. |
I've tested this with DexGuard, deobfuscation is working. |
Goal
Add a Build UUID to app bundle manifests.
The Build UUID currently only gets added when generating APKs directly without using app bundles.
Changeset
Tests
Made sure that the mazerunner tests pass.
Manual tests:
bundleDebug
Gradle task contains the Build UUID in the manifest in the app bundleassembleDebug
Gradle task contains the Build UUID in the manifest in the APK