Skip to content

Conversation

@Berstanio
Copy link
Contributor

@Berstanio Berstanio commented Apr 6, 2022

I reordered r8 task and validator task so that the validator runs first.
For the moment I didn't changes variable/task names, because it was just a POC. I will do this later.
This currently uses d8, to try to use r8 just replace here and in the sdk publisher all occurence of "d8.jar" with "r8.jar" and adjust line 266 in Proguard.java to use the proguard config. In the moe-core the proguard configs needs to be adjusted that 1. "-ignorewarn" isn't used and 2. "-keepcompanionclasses" needs to be removed.
But r8 will currently fail with a NPE. It seems to be because of the processing of the moe-core.jar, but I don't know why nor have I found some way yet to print debug infos.

Related pr's are: multi-os-engine/moe-sdk-publisher#4, multi-os-engine/moe-tools-classvalidator#2, multi-os-engine/moe-core#4, multi-os-engine/moe-tools_master#3 and multi-os-engine/manifest#2
This fixes multi-os-engine/multi-os-engine#171

@Berstanio
Copy link
Contributor Author

Berstanio commented Apr 7, 2022

r8 fails when the resolve of the super class of "java.lang.Object" returns null. Adding three simple null checks to r8 solves the issue.
https://github.com/Berstanio/r8/commits/main
Currently r8 strips to much, but this should be fixable.
However when I disable shrinking, the App just doesn't start correctly.
//EDIT: Okay, for some reason "-dontoptimize" and "-dontshrink" still strips attributes. Now that I have fixed it, a test app runs fine!

@Berstanio Berstanio changed the title POC use d8 for dexing and backporting Use r8 for dexing and backporting (MOE 1.x) May 23, 2022
@Berstanio Berstanio changed the base branch from moe-1.9.1 to moe-master July 21, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate the possibility of using D8/R8/L8 as shirnking & desugaring tool

2 participants