Modifying string constants as part of relocating packages
Shadow Version
2.0.2
Gradle Version
4.3
In a java agent we are developing we are trying to relocate the aspectjrt and aspectjweaver packages but it looks impossible because aspectj weaver uses string constants to test if a class is an aspect. something like that:
public final static UnresolvedType ASPECT_ANNOTATION = UnresolvedType.forSignature("Lorg/aspectj/lang/annotation/Aspect;"
I've tried various suggestions like exclusion of some packages but nothing worked. The aspectj project lead suggested that "It seems reasonably robust to modify Lorg/aspectj/lang prefixed strings to Lshadow/org/aspectj/lang"
My question is if that seems reasonable to implements something like that as part of shadow plugin? or what would be the correct way to hook into the plugin and implement that as a gradle task?
Thank you
Related to #232.
You can declare a const and refer to it; the string const could be relocated.
private static final TYPE = "foo.Bar".
public static final UnresolvedType U_TYPE = UnresolvedType.forSignature("foo.Bar".replace(".", "/"));