Thrifty Retrofit converter

Retrofit converter for Thrifty implementation of Apache Thrift

License

License

Categories

Categories

Retrofit Net HTTP Clients
GroupId

GroupId

com.infinum
ArtifactId

ArtifactId

retrofit-converter-thrifty
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Thrifty Retrofit converter
Retrofit converter for Thrifty implementation of Apache Thrift
Project URL

Project URL

https://github.com/infinum/thrifty-retrofit-converter
Source Code Management

Source Code Management

https://github.com/infinum/thrifty-retrofit-converter

Download retrofit-converter-thrifty

Dependencies

compile (4)

Group / Artifact Type Version
com.microsoft.thrifty : thrifty-runtime jar 2.1.2
com.microsoft.thrifty : thrifty-runtime-ktx jar 2.1.2
com.squareup.retrofit2 : retrofit jar 2.9.0
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.30

runtime (2)

Group / Artifact Type Version
com.squareup.okio : okio jar 2.10.0
javax.annotation : javax.annotation-api jar 1.3.2

Project Modules

There are no modules declared in this project.

Thrifty Retrofit converter

License

A Retrofit converter implementation using Thrifty for (de)serialization of Apache Thrift requests and responses.

It supports Binary, Compact and Json Thrift protocols. It supports Thrifty models generated in both Java and Kotlin.

Usage

Add the library as a dependency to your build.gradle to automatically download it from Maven Central.

implementation "com.infinum:retrofit-converter-thrifty:3.0.0"

... and add the converter factory when you create the Retrofit object.

Retrofit retrofit = new Retrofit.Builder()
    .baseUrl("https://example.com/api/")
    .addConverterFactory(ThriftyConverterFactory.create(ProtocolType.COMPACT))
    .build();

We also maintain a changelog.

Contributing

Feedback and code contributions are very much welcome. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same license.

Generating new files with the thrifty compiler

In case source files need to be generated from .thrift files using a different version of the thrifty compiler, use these commands:

wget https://repo1.maven.org/maven2/com/microsoft/thrifty/thrifty-compiler/2.1.2/thrifty-compiler-2.1.2-all.jar
java -jar thrifty-compiler-2.1.2-all.jar --out=retrofit-converter-thrifty/src/test/java/ --lang=java retrofit-converter-thrifty/src/test/resources/phone.thrift
java -jar thrifty-compiler-2.1.2-all.jar --out=retrofit-converter-thrifty/src/test/kotlin/ --lang=kotlin --kt-file-per-type retrofit-converter-thrifty/src/test/resources/phone.thrift

Deploying a new version

To publish to Maven Central you first need to set the following Gradle properties:

signing.keyId=<GPG_KEY_ID>
signing.password=<GPG_KEY_PASSWORD>
signing.secretKeyRingFile=<GPG_SECRING_LOCATION>

sonatypeUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
sonatypeUsername=<SONATYPE_USERNAME>
sonatypePassword=<SONATYPE_PASSWORD>

To deploy a new version to Maven Central, use deploy.sh:

./publish.sh <artifact version> [optional tag message]

The publish.sh script will automatically push a tag with the version name and change the version in the README.

All you need to do after the script runs is to press release in Sonatype OSS.

com.infinum

Infinum

We're an independent design & development agency of 230 people, creating beautiful software for 14 years.

Versions

Version
3.0.0