Giter VIP home page Giter VIP logo

methodremapper's Introduction

MethodRemapper

MethodRemapper is simple Java library and Gradle plugin to rename methods in classes during the build. All needed is a mapping configuration. The mappings will be applied to the owning class of the method, as well as all classes that inherit from these classes.

Installation

Add the Gradle plugin to your build script:

plugins {
    id 'blue.lapis.methodremapper' version '0.1.3'
}

Tasks

Name Description
remap Remaps the input JAR using the supplied mapping configuration.

Configuration

remap {
    // The task to remap the output JAR from (by default: `jar` task)
    inputTask = tasks.jar
    // OR: The input JAR to remap
    inputJar = project.file('myinput.jar')

    // OPTIONAL: The output for the remapped JAR (will replace inputJar by default)
    outputJar = project.file('myoutput.jar')

    // The path to the configuration file (`remap.txt` in resource folder by default)
    config = project.file('myconfig.txt')
}

Mappings

The mappings configuration is a simple text file consisting out of 3 parts for a mapping, each separated by a single space on each line:

  • The full qualified class name of the owning class in internal format, e.g. java/lang/Object
  • The method name and descriptor of the source method
  • The new method name

Example: java/lang/Object toString()Ljava/lang/Object; asString
Full example: https://github.com/LapisBlue/Pore/blob/master/src/main/resources/remap.txt

Java API

The Gradle plugin is a good example how to use the remapper in other applications.

Javadocs: https://jd.lapis.blue/methodremapper/

Dependency

MethodRemapper is available as Maven dependency on jCenter.

Gradle (recommended)

repositories {
    jcenter()
}

dependencies {
    compile 'blue.lapis.methodremapper:remapper:0.2'
}

Maven

<repositories>
    <repository>
        <name>jcenter</name>
        <url>http://jcenter.bintray.com</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>blue.lapis.methodremapper</groupId>
        <artifactId>remapper</artifactId>
        <version>0.2</version>
    </dependency>
</dependencies>

methodremapper's People

Contributors

stephan-gh 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.