Commit Graph

550 Commits

Author SHA1 Message Date
Jesse Wilson
306664fb6a Call Types.newParameterizedTypeWithOwner when necessary.
Otherwise we crash with an exception attempting to create an adapter
for an enclosed type that has a type parameter.

I ran into this looking for a test case for issue 615.
https://github.com/square/moshi/issues/615
2018-09-09 17:05:33 -04:00
Jesse Wilson
4f3c418202 Merge pull request #647 from square/jwilson.0909.confirm_one_way_code_gen
Confirm you can use codegen with adapter methods
2018-09-09 14:00:04 -04:00
Jesse Wilson
f5fe86dd78 Confirm you can use codegen with adapter methods
We had a bug report that said using just @ToJson wasn't working.
This test attempts to show it should work just fine.

https://github.com/square/moshi/issues/545
2018-09-09 12:16:18 -04:00
Jesse Wilson
2a593da06c Merge pull request #628 from gabrielittner/master
Embed ProGuard rules in the jar
2018-09-08 14:58:44 -04:00
Gabriel Ittner
24e0777ebd add period to comments 2018-09-07 08:04:56 +02:00
Jesse Wilson
3c470575f4 Merge pull request #640 from square/eric.null-enum
Allow null fallback enum value in EnumJsonAdapter.
2018-09-03 09:47:16 -04:00
Eric Cochran
8a8cde0ce3 Allow null fallback enum value in EnumJsonAdapter. 2018-08-31 00:51:34 -07:00
Gabriel Ittner
597da2d861 keep BuiltInsLoaderImpl for kotlin reflect artifact 2018-08-24 10:47:22 +02:00
Jesse Wilson
f9c53f39f4 Merge pull request #629 from stoyicker/patch-1
Remove unnecessary isAccessible check
2018-08-19 16:21:39 -04:00
Jorge Antonio Díaz-Benito Soriano
56e67088a9 Remove unnecessary isAccessible check
https://github.com/square/moshi/issues/624
2018-08-19 20:46:43 +02:00
Jesse Wilson
354db6b46f Merge pull request #627 from square/eric.2018-08-17.boxed-primitive-adapters
Make nullable primitives in codegen use boxed type adapters.
2018-08-19 07:36:12 -04:00
Jesse Wilson
0c773a38f4 Merge pull request #623 from square/jwilson.0814.dokka
Generate Kotlin documentation with Dokka
2018-08-19 07:30:52 -04:00
Gabriel Ittner
4bbc5b2ff8 Embed ProGuard rules in the jar 2018-08-19 11:14:47 +02:00
Eric Cochran
1b17423343 Make nullable primitives in codegen use boxed type adapters. 2018-08-17 13:41:43 -07:00
Eric Cochran
83f60d6bd7 Fix README link to jar. (#622) 2018-08-14 22:54:30 -04:00
Jesse Wilson
9ea1f845a8 Generate Kotlin documentation with Dokka 2018-08-14 20:20:15 -04:00
Eric Cochran
29bdc0aa45 Add EnumJsonAdapter to adapters module. (#607) 2018-08-07 15:05:56 -07:00
Eric Cochran
137ffc992f Fix incorrect path in enum adapter error message. (#613) 2018-08-06 22:46:41 -07:00
Jesse Wilson
34f8f9472f Merge pull request #612 from square/jwilson.0805.extension_property
Test to confirm that extension properties are not encoded or decoded
2018-08-06 04:36:34 -04:00
Eric Cochran
0f1fa3d385 Add RuntimeJsonAdapterFactory to adapters module. (#606)
* Add RuntimeJsonAdapterFactory to adapters module.

* Make RuntimeJsonAdapterFactory create null-safe adapters.

* Add copyright headers.
2018-08-06 04:35:53 -04:00
Jesse Wilson
9251309c3f Merge pull request #603 from square/eric.patch-1
Simplify Options initializer generation.
2018-08-05 22:36:29 -04:00
Jesse Wilson
01f600cdd3 Merge pull request #604 from square/eric.💲
Fix dollar sign escaping for json key names.
2018-08-05 22:34:21 -04:00
Jesse Wilson
c360a1c840 Test to confirm that extension properties are not encoded or decoded 2018-08-05 22:20:25 -04:00
Jesse Wilson
3aa31d9135 Merge pull request #608 from square/eric.checkstyle
Remove unused import.
2018-08-05 21:26:52 -04:00
Eric Cochran
ee873b64f6 Remove unused import. 2018-07-26 17:28:15 -07:00
Eric Cochran
248be5805b Fix dollar sign escaping for json key names. 2018-07-24 18:03:23 -07:00
Eric Cochran
6bb83abf84 Simplify Options initializer generation. 2018-07-24 17:51:18 -07:00
Zac Sweers
78821bbc80 Update to KotlinPoet 1.0.0-RC1 (#599)
* Update to kotlinpoet 1.0.0-RC1

* Move to WildcardTypeName.STAR

* simpleNames() function -> simpleNames property

* packageName() fun -> packageName property

* simpleName() fun -> simpleName property

* Check if bounds are empty for TypeVariableName. If so, use no-bounds creator

* Use new parameterizedBy/plusParameter API where appropriate
2018-07-17 22:44:20 -04:00
Jesse Wilson
bcd61c9621 Merge pull request #592 from runningcode/no/readme-update
Update readme to add information about depending on stdlib.
2018-07-03 16:57:56 -04:00
Nelson Osacky
2d7d2c116d Update readme to add information about depending on stdlib. 2018-07-03 22:52:49 +02:00
Jesse Wilson
0b0883db68 Merge pull request #584 from square/eric.emptyDocumentHasNextReturnsFalse
Fix hasNext to return false at document end.
2018-06-24 10:34:46 -04:00
Jesse Wilson
de79ed364e Merge pull request #582 from hzsweers/z/fixGeneratedAnnotation
Fix GeneratedAnnotation member definition
2018-06-24 10:03:08 -04:00
Eric Cochran
627e62f507 Fix hasNext to return false at document end. 2018-06-22 15:18:22 -07:00
Zac Sweers
c9aee2e853 Fix GeneratedAnnotation member definition
Before this was just adding both as varargs of "value"
2018-06-15 22:09:13 -07:00
Jesse Wilson
03ada87e90 Merge pull request #576 from square/eric.private-transient
Allow private transient Kotlin properties.
2018-06-07 10:26:44 -04:00
Eric Cochran
4666e06910 Allow private transient Kotlin properties. 2018-06-06 17:12:29 -07:00
Jake Wharton
cd9e600955 Merge pull request #559 from square/eric.word
Remove redundant "to" in doc.
2018-05-23 15:29:30 -04:00
Eric Cochran
df3a6ce2ae Remove redundant "to" in doc. 2018-05-23 12:28:07 -07:00
Zac Sweers
3ecdfb6374 Fix generic typealiases (#551)
* Add generic type alias

* Fix missing resolveAliases check to fix generics

* Reword to useAbbreviatedType
2018-05-17 22:06:43 -04:00
Jesse Wilson
7470536606 Merge pull request #553 from LouisCAD/patch-1
Fix codegen dependency configuration in README
2018-05-17 10:20:55 -04:00
Louis CAD
dd86599d5b Fix codegen dependency configuration
annotationProcessor configuration is for java. Kotlin uses kapt
2018-05-17 16:14:35 +02:00
Zac Sweers
b956b06f6d Fix companion object names not being resolved (#549)
* Fix companion object names not being resolved

This slipped through the cracks before the release

Fixes #546

* Add braces on the else clause for symmetry
2018-05-16 15:44:07 -04:00
Jesse Wilson
d48e3aaa27 Merge pull request #548 from square/jwilson.0516.fix_parent_relative_link
Fix the link to the parent pom.xml in kotlin/reflect
2018-05-16 14:48:47 -04:00
Jesse Wilson
03f17310bc Fix the link to the parent pom.xml in kotlin/reflect 2018-05-16 14:43:38 -04:00
Jesse Wilson
6142a167e9 Merge pull request #543 from square/eric.checkreturn
Add more CheckReturnValues for JsonReader.
2018-05-15 22:03:02 -04:00
Eric Cochran
d31f3c2482 Add more CheckReturnValues for JsonReader.
This encourages skipName over nextName.
2018-05-15 18:37:29 -07:00
Pierre Degand
b5a50d8281 Update Proguard configuration for codegen (#542)
* Update Proguard configuration for codegen

-keepnames will prevent Proguard from renaming the class during obfuscation phase but won't protect the class from code shrinking.
In most cases, the generated are never referenced directly in the code as the adapters are loaded dynamically.
This means that, for Proguard, the class is unused and it will remove the generated adapters during the shrinking phase.

The adapters need to be kept as well as there primary constructor.

* Keep fields of generated JsonAdapter
2018-05-15 21:34:56 -04:00
Jesse Wilson
16938ab83a Merge pull request #541 from LouisCAD/patch-1
Add missing val and fix indentation in README
2018-05-15 06:15:33 -04:00
Jesse Wilson
279b1e00a7 Merge pull request #539 from 3flex/patch-1
README: fix typo
2018-05-15 06:14:42 -04:00
Jesse Wilson
40817a2f2a Merge pull request #538 from hzsweers/patch-2
Fix adapter factory name in proguard mention
2018-05-15 06:13:59 -04:00