bugsnag / bugsnag-android-gradle-plugin

Gradle plugin for BugSnag which uploads ProGuard, DexGuard and NDK mapping files, and sends build notifications
https://docs.bugsnag.com/build-integrations/gradle/
MIT License
70 stars 38 forks source link

Remove previous files from intermediate build directory #318

Closed fractalwrench closed 4 years ago

fractalwrench commented 4 years ago

Goal

Removes previous files from an intermediate build directory, which could cause erroneous uploads if a SO file had been moved on the filesystem. Additionally this changeset prevents libunity.so, libil2cpp.so, and libmain.so from being

Changeset

The gradle plugin copies SO files to an intermediate build directory to take advantage of gradle's task caching.

If a build occured, an SO file was removed/renamed in the project, and then another build occurred, the removed/renamed SO file incorrectly remains in the build directory and is uploaded. The fix for this is to clear out the directory when running the task, which is done for both the Unity/NDK generation tasks.

Additionally, the BugsnagGenerateNdkSoMappingTask tries to generate NDK mapping files for libunity/libmain/libil2cpp, which have been ignored to avoid spamming the build log with the following warning:

Bugsnag: Skipping upload of empty/invalid mapping file: intermediates/bugsnag/soMappings/ndk/armeabi-v7a/libunity.so.gz

Testing

Manually verified that no warning is present in the build log, and that only the relevant files are copied to the intermediate directory on a build that uses cache.