Граф коммитов

102 Коммитов

Автор SHA1 Сообщение Дата
Ben Bader ced90d5b02
Move more build logic to real plugins (#516) 2022-12-13 10:27:10 -07:00
Ben Bader fc3d9881d4
Don't enable Dokka or signing unless publishing (#515) 2022-12-12 20:36:28 -07:00
Ben Bader d7d09987f0
Remove deprecated JvmDefault annotations (#481) 2022-04-14 19:01:14 -06:00
Ben Bader 86e89af427
Move version catalog into TOML file, put plugins there (#472) 2022-04-11 23:29:58 -06:00
Ben Bader 4c569057e6
Fix simple Kotlin deprecations in thrifty-runtime (#471) 2022-04-11 21:08:59 -06:00
Ben Bader e38faa544d
Fix various Gradle deprecations around version catalogs (#470) 2022-04-11 17:11:18 -06:00
Ben Bader d940d78efb
Upgrade to kotlin 1.6.10 (#463) 2022-01-20 16:52:41 -07:00
Ben Bader 84e37870cb
Bump to Kotlin 1.5.32 (#462) 2022-01-18 12:00:33 -07:00
Lucas Romero b28da74d6b
Add Server support (#447)
* Expose synthetic structs for method args and result

* Make ThriftException a Struct

and make kind required (there is an "unknown" type anyways)

* Move type holders to class level in order to allow for methods to write to them

* Add runtime classes for server support

* Add server support

* Update README

* Clear type outputs at the beginning of generate()

in case the generator gets re-used

* clean up imports

* remove @JvmOverloads

* import all the things

* Remove wildcard import

* Use hand-built ClassNames instead of direct type references

in order to try to be as compatible with Kotlin Multiplatform as
possible.

* Generate server-specific interface

in a server-specific namespace instead of reusing the client interface.
This is necessary because we always want to generate a coroutine based interface for the server and never a callback based one.

* Support compilation of multiple FileSpecs as a unit

because now we generate a separate FileSpec for the server that also need the types from the "normal" FileSpec.

* Move server integration test to "normal" task

as it no longer requires the coroutine client flag to be set.

* Add license headers

* Add license to thrift test code

* Fix README
2021-09-21 09:11:09 -06:00
Ben Bader 7bdb221058
Replace subprojects/allprojects with buildSrc and version catalogs (#456) 2021-08-01 21:22:45 -06:00
Ben Bader 2487676ad2
Convert thrifty-gradle-plugin to Java, use Worker API (#455) 2021-07-10 20:53:14 -06:00
Ben Bader 1afd1bcf92
Add missing license headers and a script to check that new files have them (#450)
Add missing license headers and a script to check that new files have them
2021-06-20 22:04:47 -06:00
Ben Bader a2287c4b69
Okio 2.8.0 -> 2.10.0 (#430) 2021-02-10 23:16:59 -07:00
Ben Bader f2f598befe
Make AsyncClientBase into an 'expect' class (#410) 2020-12-17 16:09:16 -07:00
Ben Bader cefa407e74
Add Okio-based convenience APIs to thrifty-runtime (#408) 2020-12-15 12:05:17 -07:00
Ben Bader 7cd69f007c
Initial port to kotlin multiplatform (#399)
* Initial port to kotlin multiplatform

* Fix ObfuscationUtil casing
2020-09-11 22:13:56 -07:00
Ben Bader 80946e248b
Remove the now-redundant thrifty-runtime-ktx (#397)
* Remove the now-redundant thrifty-runtime-ktx

* Add kotlinx-coroutines-core to thrifty-runtime
2020-08-24 16:04:29 -07:00
Ben Bader c9be396db8
JUnit 4 -> 5 (#396) 2020-08-24 09:16:49 -07:00
Ben Bader 25696242cc
Add an API dependency on kotlin-stdlib (#393) 2020-08-23 18:50:00 -07:00
Ben Bader 5a7f320171
Convert thrifty-runtime to kotlin, require Java 8 (#391)
* Convert thrifty-runtime to kotlin, require Java 8

* Remove erroneous nits in KotlinCodeGenerator

* New kt files should end with a newline

* Fix artifacts from Java->Kotlin conversion, use better idioms
2020-08-23 18:43:51 -07:00
Ben Bader ae31baf36d
Remove most usage of com.google.truth (#382)
* Remove most usage of com.google.truth

* Remove truth entirely
2020-08-22 00:27:59 -07:00
Ben Bader d794fae3ad
Remove all Kotlin uses of mocks in unit tests (#378) 2020-08-21 22:20:59 -07:00
Mikhail.S.Denisov dd87b46e72
Fixed infinity loop in FramedTransport.read in case of EOF. (#368)
Co-authored-by: Mihail S. Denisov <mdenisov@ac-sw.com>
2020-06-28 15:14:02 -07:00
Alexey Morozov c46aeac08f
Explicitly call fail() on a failed request when an exception occurs (#362)
If an exception occurs when performing a client request (i.e. an
IOException or a RuntimeException) then the request never completes,
even with a fail.

This happens because these types of exceptions are handled differently
in `AsyncClientBase.invokeRequest()` than other types, and the
exception is re-thrown without `fail`-ing the request leaving
client code hung.

This patch fixes the problem #358.

Signed-off-by: Alexey Morozov <morozov@gmail.com>
2020-06-05 01:14:37 -07:00
Ben Bader 4f5df92911
Apply checkstyle only to thrifty-runtime (#353)
This is our last important Java module.  There's no point to applying checkstyle to any other module in our project - it only burns CPU and causes problems.
2020-05-16 22:24:45 -07:00
Ben Bader 672a6b6710
Bump truth to 1.0.1, compile-testing to 0.18 (#347)
* Bump truth to 1.0.1, compile-testing to 0.18

* Remove spurious compile-testing dependency from thrifty-kotlin-codegen
2020-05-15 12:20:09 -07:00
Ben Bader e1a390e2bf
Move to gradle-maven-publish-plugin (#343) 2020-05-15 00:41:11 -07:00
Ben Bader 14607e5dd5
Use openjdk instead of oracle jdk (#321)
* Use openjdk instead of oracle jdk

* Don't force Java 8 compatibility in the compiler

* Remove generated annotations from apache thrift classes

* Remove ErrorProne
2019-11-07 15:39:19 -08:00
Ben Bader 32012249b6
Use UTF-8 when writing strings in SimpleJsonProtocol (#317) 2019-06-13 09:46:57 -07:00
Ben Bader 78f0a79430
Bump errorprone, only use it on Java modules (#255) 2018-10-30 11:04:21 -07:00
Ben Bader d510978323
Add missing license headers (#229) 2018-08-15 17:02:37 -07:00
Ben Bader d964d9f7f1
Make ThriftException extend RuntimeException, not Exception (#227) 2018-08-15 16:16:10 -07:00
Ben Bader a8cd8f826f
Add missing call to protocol.readMessageEnd() (#224)
We've missed this since the beginning because BinaryProtocol and CompactProtocol both send and receive nothing for message end.  JsonProtocol, however, is sensitive to this.  Adding calls to `readMessageEnd()` for both normal and exceptional results fixes things.
2018-08-14 14:28:24 -07:00
Ben Bader 86a39a534f
Fix FramedTransport reads spanning >1 frame (#223)
I can't believe that this has been utterly broken since 2015.  I guess no Thrifty users use non-blocking transports?
2018-08-13 17:32:05 -07:00
Ben Bader 103614bd7e
Remove TType.ENUM from thrifty-runtime (#176) 2018-06-10 16:26:17 -07:00
Dino Kovač 4c5e96b38d Json Protocol support (#156)
Add Json Protocol support
2017-11-18 09:45:12 -08:00
Dino Kovač 39b99da82a Fix reading bool value using compact protocol (#153)
We came across an issue in deserializing a bool value using compact protocol - the value always comes out false.

This PR modifies the test so that it catches this bug and fixes it.
2017-08-09 15:11:41 -07:00
Gabriel Ittner 85ff3c7642 Fix server error handling (#150)
* fix server error handling

* make ThriftException checked

* add ThriftException to Adapter.read methods
2017-07-24 12:51:07 -07:00
Gabriel Ittner dac643223c Split ClientBase to enabled synchronous calls (#147) 2017-06-24 12:43:38 -07:00
Ben Bader 9da1602315 Fix remaining warnings reported by ErrorProne (#125) 2017-03-06 10:39:12 -08:00
Ben Bader b8ee4bc477 Adopt more-idiomatic Java 8 (#123)
- Remove now-redundant type arguments
- Use new Map APIs like computeIfAbsent
- Use lambdas instead of anonymous Runnables
2017-03-04 23:05:53 -08:00
Ben Bader 13c0b8eed8 Use 'java-library' plugin instead of 'java' (#121)
This paves the way for Java 9 compatibility, and removes some
implementation details from consumers' compile-time classpaths.  This
may break said consumers.
2017-03-02 16:43:43 -08:00
Ben Bader 028f85f0d5 Target Java 8 for compiler, keep 7 for runtime (#110)
* Target Java 8 for compiler, keep 7 for runtime

* Use Oracle JDK 8 for Travis builds

* Ensure JDK 8 is up-to-date in Travis builds
2017-02-20 18:20:22 -08:00
Gabriel Ittner 87246e58d1 Add DecoratingProtocol (#65)
add DecoratingProtocol
2016-10-14 14:17:21 -07:00
Ben Bader 8a1835e8a6 Print "null" for missing obfuscated fields (#58)
This is a behavior change; previously, a constant hex value would be
printed.  It's not much different from before, privacy-wise, in that
missing values are still indicated; it will, however, be much easier to
debug thrifts visually.

Fixes #57.
2016-08-28 16:17:49 -07:00
Sean Abraham 1ba3e91737 Add the Struct Interface and make generated Thrift structs implement it (#40)
* Add Struct to thrifty runtime and generated structs

* Clean up Struct interface

* Fix imports for checkstyle failure

* Add Struct javadoc

* Checkstyle fix
2016-07-18 16:17:39 -07:00
Ben Bader 8ed651455b Use Thrift type names when obfuscating collections
Java names are nice, but when aggregating data from other platforms it
makes more sense to have a platform-neutral data definition... which
Thrift already provides!
2016-07-08 13:32:09 -07:00
Ben Bader 16477e10da Add ommitted license header to ObfuscationUtilTest 2016-07-08 13:08:16 -07:00
Ben Bader 11c4a4f4e9 Apply obfuscation to annotated fields in toString() 2016-07-06 12:00:40 -07:00
Ben Bader c6cd1f174f Add Obfuscated annotation, emit it and Redacted on generated fields 2016-07-06 11:26:11 -07:00