Zac Sweers
a5020ddb3c
Support gradle incremental processing in code gen ( #824 )
...
* Support gradle incremental processing in code gen
This adds support for incremental compilation in gradle via incap helper and marking the code gen as `ISOLATING`.
Depends on a newer version of KotlinPoet that has https://github.com/square/kotlinpoet/pull/647
Resolves #589
* Opportunistically update to auto-service 1.0-rc5
Supports incremental compilation and moves annotations to a separate artifact
* 1.2.0 final!
* Mark compiler embeddales as test only
2019-04-17 18:12:11 -07:00
Jake Wharton
bcb6fd4a4d
Don't wrap between throw and exception type
2019-04-10 10:28:30 -04:00
Oliver Bestmann
3994723c3c
Use StringBuilder to deduplicate String constants
2019-04-02 11:49:40 -04:00
Eric Cochran
3e848c0cdd
Use KotlinPoet's MemberName for emptySet import. ( #818 )
...
* Update to KotlinPoet 1.1.0.
* Use KotlinPoet's MemberName for emptySet import.
2019-03-14 02:57:08 -07:00
Zac Sweers
ded3bccc60
Some miscellaneous kotlinpoet updates ( #786 )
...
* KotlinPoet 1.0.1
* Nix asNullableIf in favor of plain copy() function use
* Add a test for packages that look like classes
Resolves #783
2019-01-13 10:18:00 -05:00
Zac Sweers
e6de367369
Remove shading of KotlinPoet
...
Resolves #770
2018-12-11 16:19:29 -08:00
Egor Andreevici
6393692926
KotlinPoet 1.0.0
2018-12-10 19:59:37 -05:00
Jesse Wilson
ca4d8f5e34
Upgrade to KotlinPoet 1.0-RC3
2018-11-28 22:20:07 -05:00
Jesse Wilson
6b6c1af907
[maven-release-plugin] prepare for next development iteration
2018-11-09 10:04:52 +11:00
Jesse Wilson
eb7110bf59
[maven-release-plugin] prepare release moshi-parent-1.8.0
2018-11-09 10:04:36 +11:00
Jesse Wilson
a8102bccd2
Merge pull request #733 from daugeldauge/fix-variance-issues
...
Fix variance issues in kotlin-codegen
2018-11-05 07:22:40 +11:00
Artem Daugel-Dauge
8a22f6b133
Do not check required property for null second time ( #732 )
...
* Do not check required property second time
* Fix codestyle
2018-11-04 09:44:10 -08:00
Artem Daugel-Dauge
0e3a52b729
Use javaObjectType instead of Java primitives while creating parametrized type ( #731 )
...
* Add test for collection of primitives
* Use javaObjectType instead of Java primitives while creating parametrized type
2018-11-04 09:42:51 -08:00
Artem Daugel-Dauge
e0be5f5a54
Fix variance issues
2018-11-04 17:11:22 +03:00
Eric Cochran
0795e9cbd5
Update to KotlinPoet 1.0.0-RC2.
...
Also, use KotlinPoet's escaping for $ characters in formatted strings.
This is partly a revert of 01f600c
(https://github.com/square/moshi/pull/604/ ).
2018-11-02 16:59:27 -07:00
Zac Sweers
a34ca365f0
Allow other processors to process JsonClass
...
Someone at KotlinConf brought this to my attention, as they're trying to generate their own adapter factory but can't since moshi consumes the annotation and doesn't allow others.
2018-10-06 17:05:06 +02:00
Zac Sweers
e0861cca57
Improve enum exception message ( #694 )
...
* Improve enum exception message
It is applicable to enums for proguard reasons, just not with code gen as well
* Update test message
2018-09-28 00:24:58 -04:00
Jesse Wilson
705ddc24e3
Merge pull request #687 from hzsweers/z/removeExtensions
...
Completely remove companion object jsonAdapter extension function gen
2018-09-25 07:08:54 -04:00
Eric Cochran
526717ec36
Remove duplicate kotlin-metadata version declaration.
...
The version is already defined in the root.
2018-09-25 00:17:32 -07:00
Zac Sweers
86c8671d64
Completely remove companion object jsonAdapter extension function gen
...
It's broken currently (see #611 ), and after talking with @swankjesse decided it's best to just nix this API
2018-09-25 00:58:52 -04:00
Jesse Wilson
2cb81857ac
[maven-release-plugin] prepare for next development iteration
2018-09-24 22:55:49 -04:00
Jesse Wilson
9a652f8788
[maven-release-plugin] prepare release moshi-parent-1.7.0
2018-09-24 22:55:35 -04:00
Eric Cochran
242b7b1055
Use the adapter lookup hint API in Kotlin codegen adapters.
2018-09-20 21:00:18 -07:00
Eric Cochran
8e151b1df3
Allow user adapters to convert null to non-null in codegen.
...
Delegate to installed adapters instead of checking for null.
2018-09-11 22:25:42 -07:00
Jesse Wilson
cb86194f8f
Merge pull request #651 from square/jwilson.0909.enclosed_parameterized
...
Call Types.newParameterizedTypeWithOwner when necessary.
2018-09-09 23:16:38 -04:00
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
7382145318
Change DelegateKey to use AnnotationSpec instead of AnnotationMirror
...
AnnotationSpec implements equals() in the way we need, but
AnnotationMirror doesn't. As a consequence this fixes a problem
where we were generating redundant adapters.
Closes: https://github.com/square/moshi/issues/563
2018-09-09 15:27:21 -04: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
Eric Cochran
1b17423343
Make nullable primitives in codegen use boxed type adapters.
2018-08-17 13:41:43 -07:00
Jesse Wilson
9ea1f845a8
Generate Kotlin documentation with Dokka
2018-08-14 20:20:15 -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
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
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
Eric Cochran
4666e06910
Allow private transient Kotlin properties.
2018-06-06 17:12:29 -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
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
31ef245eeb
[maven-release-plugin] prepare for next development iteration
2018-05-14 23:00:15 -04:00
Jesse Wilson
bf4d1f8693
[maven-release-plugin] prepare release moshi-parent-1.6.0
2018-05-14 23:00:02 -04:00
Jesse Wilson
0b26628232
Merge pull request #536 from square/jwilson.0514.cast_shade
...
Shade unreleased KotlinPoet 0.7.0.
2018-05-14 22:52:35 -04:00
Jesse Wilson
b857388796
Shade unreleased KotlinPoet 0.7.0.
...
That way we won't collide with other annotation processors if they have an
incompatible version.
2018-05-14 22:40:29 -04:00
Jesse Wilson
dd3043722e
Generated adapters should use skipName(), not nextName().
2018-05-14 22:39:33 -04:00
Jesse Wilson
9f69029ef0
Move the Kotlin code generator to the kotlin/ module
2018-05-14 16:29:52 -04:00