Skip to content
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

[MSHADE-391] Do not write modified class files for no-op relocations #95

Closed
wants to merge 4 commits into from

Commits on May 23, 2021

  1. [MSHADE-391] Do not write modified class files for no-op relocations

    Also, rename method 'DefaultShader.shadeSingleJar' to 'shadeJarEntry' in
    order to reflect what it actually does: It does *not* shade a JAR but a
    JAR entry, i.e. not a "single JAR" but rather a single file.
    kriegaex committed May 23, 2021
    Configuration menu
    Copy the full SHA
    c755ad4 View commit details
    Browse the repository at this point in the history
  2. [MSHADE-391] Add integration test

    Test src/it/projects/MSHADE-391_noRelocationKeepOriginalClasses shades
    two dependencies, relocating one of them. For the non-relocated one, it
    compares pre-calculated MD5 checksums to the actual ones in the uber
    JAR, making sure that they are identical. The test will fail in Maven
    Shade 3.2.4 or older, but pass with the changes made in MSHADE-391.
    kriegaex committed May 23, 2021
    Configuration menu
    Copy the full SHA
    626b2eb View commit details
    Browse the repository at this point in the history

Commits on May 24, 2021

  1. [MSHADE-391] drop the threadlocal in favor of a remapper instance per…

    … visitor to host the state in the visitor
    rmannibucau committed May 24, 2021
    Configuration menu
    Copy the full SHA
    50e101f View commit details
    Browse the repository at this point in the history
  2. [MSHADE-391] Refactor previous commit @50e101fe

    There was some suboptimal naming: We had class names
      - Relocator,
      - SimpleRelocator,
      - Relocators,
      - DefaultRelocators.
    
    That was a bit too much of '*Relocator(s)', and the plural was not nice
    either. We are actually dealing with one mapper (interface), the default
    implementation of which happens to own a list of relocators. We now have
      - Relocator,
      - SimpleRelocator,
      - PackageMapper,
      - DefaultPackageMapper.
    
    I also changed PackageMapper.map to have two boolean parameters now,
    even though the first one is always true in current use cases. But I
    wanted the method signature to more clearly describe what the boolean
    parameters do. Before there was just 'boolean clazz', which does not
    communicate anything to the caller. Now we have the method signature
    
    String map(String entityName, boolean mapPaths, boolean mapPackages)
    
    which is better in this respect. Also, 'entityName' is a clearer
    than just 'name'. Despite the interface being private, I also added
    Javadoc to this method, because it is a crucial one for understanding
    how class relocation and entity name mapping work.
    
    Test case DefaultShaderTest.testNoopWhenNotRelocated was refactored to
    be a bit more readable and also to explicitly test that the byte code
    for a relocated class has actually changed and not only its path within
    the uber JAR has been adjusted. I also renamed the helper method
    'areEquals' to 'areEqual'.
    kriegaex committed May 24, 2021
    Configuration menu
    Copy the full SHA
    d49970e View commit details
    Browse the repository at this point in the history