Skip to content

Commit 1570699

Browse files
author
Alex Davies-Moore
committed
Update the README.md file and changes to the plugin packaging
1 parent c151fb0 commit 1570699

2 files changed

Lines changed: 84 additions & 4 deletions

File tree

README.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,66 @@
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 |

plugin/build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ group 'com.flit'
1616

1717
sourceCompatibility = 1.8
1818

19-
version = "${project.version}+${project.scm.tstamp}"
19+
if (!(project.hasProperty("release") && project.properties['release'] == "true")) {
20+
project.version += ".snapshot." + project.scm.tstamp
21+
}
2022

2123
shadowJar {
2224
manifest {
@@ -33,7 +35,6 @@ repositories {
3335
dependencies {
3436
compile 'com.google.guava:guava:25.1-jre'
3537
compile 'org.slf4j:slf4j-api:1.7.25'
36-
compile 'org.codehaus.janino:janino:3.0.6'
3738
compile 'ch.qos.logback:logback-classic:1.2.3'
3839
compile 'commons-io:commons-io:2.5'
3940
compile 'com.google.protobuf:protobuf-java:3.5.1'
@@ -47,3 +48,18 @@ dependencies {
4748

4849
shadowJar.dependsOn build
4950

51+
task pack(type: Zip) {
52+
53+
archiveName = "flit-plugin.zip"
54+
destinationDir = file("${buildDir}/package")
55+
56+
from("${buildDir}/libs") {
57+
include "plugin-*-all.jar"
58+
}
59+
60+
from("${projectDir}/src/main/shell") {
61+
include("*")
62+
}
63+
}
64+
65+
pack.dependsOn shadowJar

0 commit comments

Comments
 (0)