|
1 | | -# flit |
2 | | -Twitch Twirp RPC implementation for Java |
| 1 | +# Flit - Twirp RPC Generator Framework |
| 2 | + |
| 3 | +This project is a generator for the [Twitch TV Twirp](https://github.com/twitchtv/twirp "Twitch TV Twirp") RPC |
| 4 | +framework. |
| 5 | + |
| 6 | +It supports the generation of Java based servers with the following flavours supported: |
| 7 | + |
| 8 | + + [Spring Boot/Spring MVC](https://spring.io/projects/spring-boot "Spring Boot") |
| 9 | + + [Undertow](http://undertow.io/ "Undertow") |
| 10 | + |
| 11 | +## Building & Running |
| 12 | + |
| 13 | +### Requirements |
| 14 | + |
| 15 | +The build has been tested with [Oracle's JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html "JDK Downloads") (version 1.8) |
| 16 | + |
| 17 | +The build uses gradle to generate the artifacts. No installation is required as the project uses the |
| 18 | +[gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html "gradle wrapper") setup. |
| 19 | + |
| 20 | +For testing you will need an installation of the [protocol buffers compiler](https://github.com/google/protobuf/releases "protobuf releases"). |
| 21 | + |
| 22 | +### Modules |
| 23 | + |
| 24 | +The project is split into the following modules: |
| 25 | + |
| 26 | +| Module | Description | |
| 27 | +|:------------------|:------------------------------------------------------| |
| 28 | +| `plugin` | The `protoc` plugin | |
| 29 | +| `runtime:core` | Core functionality required by generated code | |
| 30 | +| `runtime:spring` | Runtime library for Spring MVC/Boot servers | |
| 31 | +| `runtime:undertow`| Runtime library for Undertow servers | |
| 32 | + |
| 33 | + |
| 34 | +### Build |
| 35 | + |
| 36 | +To build the various components, run the following: |
| 37 | + |
| 38 | + git clone git@github.com:devork/flit.git |
| 39 | + cd flit |
| 40 | + ./gradlew clean build pack |
| 41 | + |
| 42 | +### Installation |
| 43 | + |
| 44 | +Currently, the run script only supports *nix but the run script should be fairly easy to migrate to windows. |
| 45 | + |
| 46 | +After building: |
| 47 | + |
| 48 | + cp plugin/build/package/flit-plugin.zip /usr/local/bin |
| 49 | + cd /usr/local/bin |
| 50 | + unzip flit-plugin.zip |
| 51 | + chmod +x protoc-gen-flit |
| 52 | + |
| 53 | +## Running |
| 54 | + |
| 55 | +The plugin is executed as part of a protoc compilation step: |
| 56 | + |
| 57 | + protoc --proto_path=. --java_out=../java --flit_out=target=server,type=undertow:../java ./haberdasher.proto |
| 58 | + |
| 59 | +### Options |
| 60 | + |
| 61 | +The flit plugin accepts the following plugin parameters: |
| 62 | + |
| 63 | +| Name | Required | Type | Description | |
| 64 | +|:--------------|:---------:|:------------------------------|:----------------------------------------------------------| |
| 65 | +| `target` | Y | `enum[server]` | The type of target to generate e.g. server, client etc | |
| 66 | +| `type` | Y | `enum[spring|undertow|boot]` | Type of target to generate | |
0 commit comments