Code Monkey home page Code Monkey logo

jexpose's Introduction

jexpose

This project can expose class graph inside of jar. It has the honour of providing jar infomation to dubbo2.js to generate typescript code.

It is designed to just exposing the matching class files, and will merge fields inherit from ancestor classes. It does not using reflection but reading bytecode within class files, the reason of this strategy is the original language planed to be used to write this project is typescript, used java temporarily since the asm package is ready to use.

After this choc was completed, the typescript version jar-exposer is working in progress and maybe completed in future someday :-]

jexpose -entry com.qianmi -entry-jar /w/qm/uc.jar -lib /w/qm/uc/dependencies -provider-suffix Provider -exclude ".*Score.*"
Option Meaning
entry the entry point to start our exposing
entry-jar path of target jar
lib path of directory which is comprise of dependencies of target jar
provider-suffix suffix of provider name
include regexp for including files
exclude regexp for excluding files
is_filename_match = (provider-suffix(filename) || include(filename)) && !exclude(filename)

After exposing, jexpose will produce a json file, content of it looks like:

{
  "classes": {
    "com.hsiaosiyuan.ServiceProvider": { ... }
    ...
  },
  "providers": [
    "com.hsiaosiyuan.ServiceProvider"
  ]
}

How to use

PROJ_ROOT refers to the root directory of your project.

  1. First, you'll build your project, use mvn package to produce your target jar which is located at PROJ_ROOT/target/xxx.jar

  2. Second, you'll collect your project' dependencies, use mvn install dependency:copy-dependencies to copy dependencies of the target jar into PROJ_ROOT/target/dependency

  3. Ready to expose, use jexpose com.example PROJ_ROOT/target/example-x.x-SNAPSHOT.jar PROJ_ROOT/target/dependency

jexpose's People

Contributors

hsiaosiyuan0 avatar zhcsyncer avatar

Watchers

 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.