Open hrach opened 1 year ago
I tried to investigate the app/build/outpus/mapping/release/configuration.txt
and it seems like the MoshiX defined rules are not picked up when you apply the realm-plugin. After dumping the inputs and outputs of app:mergeReleaseGeneratedProguardFiles
with and without applying the realm-plugin it shows that the MoshiX generated rules are not added as inputs when applying the plugin.
Without realm plugin:
> Task :app:mergeReleaseGeneratedProguardFiles
inputs:
../moshigradlecrash/app/build/generated/moshix/release/resources/META-INF/proguard/moshi-com.example.moshigradlecrash.Test.pro
outputs:
../moshigradlecrash/app/build/intermediates/generated_proguard_file/release/proguard.txt
With realm plugin:
> Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE
inputs:
outputs:
../moshigradlecrash/app/build/intermediates/generated_proguard_file/release/proguard.txt
I can't find the tasks that actually generates that output, so have a hard time tracing the dependencies. Maybe the files are attached to a task that is somehow not triggered when the new transformer pipeline is in effect. (Or maybe we somehow fail to pick up the resource files.) But the convention about putting the proguard configuration in resource/META-INF/
seems off, so wouldn't expect it to be the way to go and would think that the wiring of generated proguard rules to the mergeReleaseGeneratedProguardFiles
should be reworked to match the new transformer API in MoshiX.
As a workaround you could maybe just add the generated proguard configuration to android.buildTypes.release.proguardFiles
and add the appropriate task dependencies if you can locate the task that generates it.
How frequently does the bug occur?
Always
Description
When we combine MoshiX's Kotlin Compiler plugin with realm using transformer api, our production build misses generated JsonAdapters. Adding a custom rule for R8 adds them back. So the best guess is that realm is somehow blocking Moshi from generating custom rules or removing custom rules, tbh no idea.
Originally reported here: https://github.com/ZacSweers/MoshiX/issues/396
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
The reproduction is attached.
moshigradlecrash-full.zip
Version
10.13.3-transformer-api
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
MacOS
Build environment
Android Studio version: AS 2022.1.1 Android Build Tools version: AGP's default. Gradle version: AGP 7.4