Commit Graph

34 Commits

Author SHA1 Message Date
Jesse Wilson
28831b04cf [maven-release-plugin] prepare for next development iteration 2020-08-26 21:38:44 -04:00
Jesse Wilson
cff20193c2 [maven-release-plugin] prepare release moshi-parent-1.10.0 2020-08-26 21:38:36 -04:00
Zac Sweers
a5dbc1d642 Update to Kotlin 1.4.0 (#1191)
* Update to Kotlin 1.4.0

* Remove moshi-kotlin rules in favor of Kotlin's

* Ignore tests for now

* Update to OptIn

* Update test for kotlin 1.4 behavior
2020-08-25 22:51:44 -04:00
Zac Sweers
debb7d3160 Generate proguard rules for code gen on demand (#1067)
* Extract target constructor signature into TargetConstructor.kt

We'll need this to know what the runtime types are for proguard rules

* Add ProguardConfig

* Wire in proguard config

* Write proguard configs out with adapters

* Add full tests

* Now remove the rules!

* Ignore on inline classes for now

* Pass adapter constructor params correctly
2020-01-14 14:59:10 -05:00
Zac Sweers
365e955381 Update to KotlinPoet 1.5.0 (#1062) 2020-01-10 21:05:21 -05:00
Jesse Wilson
b287596c60 [maven-release-plugin] prepare for next development iteration 2019-11-17 09:53:53 -05:00
Jesse Wilson
89a254d644 [maven-release-plugin] prepare release moshi-parent-1.9.2 2019-11-17 09:53:46 -05:00
Jesse Wilson
878e9a86d6 [maven-release-plugin] prepare for next development iteration 2019-10-30 23:26:50 -04:00
Jesse Wilson
0af27a39a6 [maven-release-plugin] prepare release moshi-parent-1.9.1 2019-10-30 23:26:43 -04:00
Jesse Wilson
4637950bab [maven-release-plugin] prepare for next development iteration 2019-10-29 07:57:56 -04:00
Jesse Wilson
0c8005bcee [maven-release-plugin] prepare release moshi-parent-1.9.0 2019-10-29 07:57:49 -04:00
Zac Sweers
01b7ea4ba2 Update to KotlinPoet 1.4.1/Kotlin 1.3.50 (#956)
* KotlinPoet 1.4.1 & Kotlin 1.3.50

KotlinPoet uses 1.3.50, so this just matches that now

* Remove now-unnecessary custom shade

This uses the same common package prefix in kotlinpoet now

* Add backwardReferencingTypeVars() regression test

Coverage for #955
2019-10-26 15:04:51 -04:00
Zac Sweers
902a935f89 Shade kotlinpoet-metadata and kotlinx-metadata (#936)
* Shade kotlinpoet-metadata and kotlinx-metadata

* Relocate KotlinPoet's shaded autocommon dep too
2019-09-25 23:15:06 -04:00
Zac Sweers
54d07b6cbf Migrate to KotlinPoet-metadata (#903)
* Add kotlinpoet version to properties

* Swap in kotlinpoet-metadata for kotlin-metadata in dependencies

* Don't use KotlinMetadataUtils and KotlinAbstractProcessor anymore

* Upcast to TypeElement

* Temporarily add direct kotlinx-metadata dependency

Something is wrong with packaging in my local kotlinpoet, will remove before

* Remove tags API from TargetParameter

No longer needed

* Add PropertySpec directly to TargetProperty, remove holder funs

Simplifies some things!

* Move generated annotation gen into type callback

Removes JsonClassCodegenProcessor completely from codegen API

* Remove unstable autocommon dependency

Won't be using this anymore after this change

* Manually put quotes jsonName in AdapterGenerator

Otherwise we could incur double escaping from kotlinpoet since we directly reuse possible-escaped parsed `@Json` name values

* Opt in to use `@UseExperimental` annotation for preview

* Rework and simplify metadata to just use kotlinpoet-metadata

This is hard to do in broken down 1:1 steps, but the net result is a much smaller implementation footprint, better error messages, and a simpler API interaction with the code gen API. There is some raw parsing of kotlinpoet types required (mostly around annotations), but otherwise it's pretty smooth sailing and a good test of the upcoming kotlinpoet-metadata support

* Declare KotlinPoetMetadataPreview directly

* Try to point to snapshots for CI build

* Update to classinspector API

* Remove TypeResolver API

No longer needed

* Kotlinpoet 1.4.0 final

* Fix missing import from rebase

* Remove old kotlin-metadata version
2019-09-25 22:22:44 -04:00
Zac Sweers
5f98e93698 Switch to kotlin-compile-testing for JsonClassCodegenProcessorTe… (#928)
* Add kotlin-compile-testing dependency

* Add Okio dependency to tests to match kotlin-compile-testing

Without this, Okio.sink() fails to resolve at runtime

* Try converting privateConstructor() to kotlin-compile-testing

* Space

* Update to 1.2.2

* Use new kotlin source file API

* Use temporaryFolder as workingDir

* Extract prepareCompilation helper method

This allows for modifying the compilation with extra bits as needed

* Migrate tests entirely to new API

* Remove incorrect error message

This passed before, but was picked up in https://github.com/square/moshi/pull/903 before and observed to be incorrect.

* Remove custom kotlin compiler implementations

* Add an OK exit code test

This wasn't possible before!

* Remove jitpack dependency now that it's on mavencentral

* Move versions to parent pom

* Fix new test from rebase
2019-09-25 16:41:31 -04:00
Zac Sweers
98092d0727 Update KotlinPoet to 1.3.0 (#915)
* Update to KotlinPoet 1.3.0

* Add hotwords test case

* Use %N for toJson parameter names to ensure escaping
2019-09-12 14:13:23 -04:00
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
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
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
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
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
Jesse Wilson
9ea1f845a8 Generate Kotlin documentation with Dokka 2018-08-14 20:20:15 -04: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
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
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
9f69029ef0 Move the Kotlin code generator to the kotlin/ module 2018-05-14 16:29:52 -04:00