Coder Social home page Coder Social logo

bulksecuritygeneratorprojectv2 / lahwran__renamer-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lahwran/renamer-maven-plugin

0.0 0.0 0.0 21 KB

[unmaintained] a "simple" maven plugin to use javassist to rename classes

Java 100.00%

lahwran__renamer-maven-plugin's Introduction

renamer-maven-plugin

This plugin provides two goals:


  • rename: renames the classes produced by the compile step, using dependencies as static references (defaults to dynamic renames)

  • rename-dependencies: extracts dependency jars to the classes directory and renames them, allowing renaming of dependencies.

both goals are intended to be run at the process-classes phase.

Configuration arguments


  • refereceArtifacts: artifacts to include in dependency processing. Uses same selection format as the shade plugin's artifactSet. In rename-dependencies, these artifacts are included in the output, and in rename, they are searched in static reference processing for classes to rename.

  • renames: a list of renames.

The renames section

The renames section is quite powerful. you can use it to rename by package name or by class name. it takes a list of rename arguments, each of which has the following subarguments:

  • from: a regex specifying what should be renamed. Is matched on the whole name, as if "^%s$" % from was used. Any groups used are available in the to expansion.

  • to: a regex expansion specifying what to rename to. \1-style group references are expanded (though this has not been tested, so if it breaks, please notify me).

  • dynamic: a boolean indicating whether to do a dynamic rename or a static rename. the difference is rather subtle, and will only have a significant effect with dependencies or very large rename lists: dynamic renames are evaluation per reference to a class found in the bytecode; static renames are evaluated before the renamer executes, by searching the source tree for classes. dynamic renames rename all references, whereas static renames only rename references to classes in the source tree or included dependencies. dynamic names are also marginally slower, but this will only have a significant effect on very large source trees with many renames in place. Defaults to "true".

  • packageOnly: a boolean indicating whether to process the pattern in this rename as a package name or as a class name. the difference is that for package names, the regex is matched on everything leading up to the class name, and a class rename is run on the whole name. Defaults to "true".

Examples

rename-dependencies:

  <plugin>
    <groupId>net.lahwran</groupId>
    <artifactId>renamer-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
      <execution>
        <phase>process-classes</phase>
        <goals>
          <goal>rename-dependencies</goal>
        </goals>
        <configuration>
          <refereceArtifacts>
            <includes>
              <include>net.minecraft:minecraft</include>         
            </includes>
          </refereceArtifacts>
          <renames>
            <rename>
              <from></from>
              <to>deobf</to>
            </rename>
          </renames>
        </configuration>
      </execution>
    </executions>
  </plugin>

rename:

  <plugin>
    <groupId>net.lahwran</groupId>
    <artifactId>renamer-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
      <execution>
        <phase>process-classes</phase>
        <goals>
          <goal>rename</goal>
        </goals>
        <configuration>
          <refereceArtifacts>
            <includes>
              <include>net.minecraft:minecraft-deobf</include>         
            </includes>
          </refereceArtifacts>
          <renames>
            <rename>
              <from>deobf</from>
              <to></to>
            </rename>
          </renames>
        </configuration>
      </execution>
    </executions>
  </plugin>

Todo

  • doesn't delete empty directories after execution
  • could use a maven repo somewhere
  • rename-dependencies requires a separate artifact for each renamed dependency, would be better if it simply renamed dependencies before the compile stage

lahwran__renamer-maven-plugin's People

Contributors

lahwran avatar yetanotherx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.