thrifty/thrifty-compiler
Ben Bader fc3d9881d4
Don't enable Dokka or signing unless publishing (#515)
2022-12-12 20:36:28 -07:00
..
src/main/kotlin/com/microsoft/thrifty/compiler Add generated comments to Kotlin files (default true) (#486) 2022-05-23 15:59:11 -06:00
Module.md Add lots more documentation (#222) 2018-08-13 12:55:32 -07:00
README.md Update CLI and documentation for 3.0.0 release (#451) 2021-06-21 08:34:45 -06:00
TestThrift.thrift Implement most of annotation parsing 2015-12-27 14:49:09 -08:00
build.gradle Don't enable Dokka or signing unless publishing (#515) 2022-12-12 20:36:28 -07:00
gradle.properties Fix Maven publication (#364) 2020-06-09 10:46:43 -07:00
testcase.thrift Assign copyright to Microsoft, conform with MS OSS requirements 2016-02-22 17:19:38 -08:00

README.md

thrifty-compiler

A command-line executable that bundles the parser and code-generator together.

Basic usage:

java -jar thrifty-compiler.jar \
        --out=path/to/output \
        --path=thrift/search/path \
        --path=other/search/path \
        a.thrift \
        b.thrift
Option Description
--out=[dir] Required. Specifies where generated Java files go
--path=[dir] Optional. Adds a directory to a search path, used for locating included thrift files.
--lang=[kotlin,java] Optional, defaults to kotlin. Specifies whether to generate Java or Kotlin code.
--name-style=[default,java] Optional. Specifies how Thrift field names should be represented in generated code. default leaves names unchanged, while java converts them to camelCase.
--use-android-annotations Optional, deprecated. Equivalent to --nullability-annotation-type=android-support.
--nullability-annotation-type=[none,android-support,androidx] Optional, defaults to none. Specifies whether or not Android nullability annotations will be added for generated fields (@NonNull and @Nullable) and, if so, which types - those in android.support.annotation or androidx.annotation.
--parcelable Optional. Structs, unions, and exceptions will have implementations of Parcelable generated.
--omit-file-comments Optional. When set, don't add file comments to generated files.
--list-type=[classname] A java.util.List implementation to be used wherever lists are instantiated in generated code.
--set-type=[classname] A java.util.Set implementation to be used wherever sets are instantiated in generated code.
--map-type=[classname] A java.util.Map implementation, as above.
--kt-file-per-type Specifies that one .kt file should be generated per Kotlin type. The default is for all code to be written to a single file.
--service-type=[callback,coroutine] Optional. Defines the style of interface generated for Thrift service clients. The default is callback-based.