moshi/kotlin/codegen/pom.xml

206 lines
6.4 KiB
XML
Raw Permalink Normal View History

Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi-parent</artifactId>
<version>1.9.0-SNAPSHOT</version>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>moshi-kotlin-codegen</artifactId>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<dependencies>
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>kotlinpoet</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>net.ltgt.gradle.incap</groupId>
<artifactId>incap</artifactId>
<version>${incap.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<dependency>
<groupId>com.google.auto</groupId>
<artifactId>auto-common</artifactId>
<version>0.10</version>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<version>${autoservice.version}</version>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<scope>provided</scope>
<optional>true</optional>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<!--
The Kotlin compiler must be near the end of the list because its .jar file includes an
obsolete version of Guava!
-->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-compiler-embeddable</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-annotation-processing-embeddable</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>me.eugeniomarletti.kotlin.metadata</groupId>
<artifactId>kotlin-metadata</artifactId>
</dependency>
<!--
Though we don't use compile-testing, including it is a convenient way to get tools.jar on the
classpath. This dependency is required by kapt3.
-->
<dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
<scope>test</scope>
</dependency>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
</dependencies>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip><!-- We use Dokka instead. -->
</properties>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${autoservice.version}</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>net.ltgt.gradle.incap</groupId>
<artifactId>incap-processor</artifactId>
<version>${incap.version}</version>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<!--
Suppress the surefire classloader which prevents introspecting the classpath.
http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html
-->
<useManifestOnlyJar>false</useManifestOnlyJar>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/assembly/dokka.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>${dokka.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>dokka</goal>
</goals>
</execution>
</executions>
</plugin>
Kotlin Code Gen module (#435) * Add kotlin code gen modules * Update kotlin to 1.2 * Add a serializable dummy class * Try using kapt configuration from kotlin-examples repo Still no luck! * Use proper allocated name for assignment too * Use selectName() API * Clean up constructor parameter annotations & plumbing for qualifiers * Updates poms and kotlin code gen processor to support tests. * Ignore kotlin code gen tests for now None of these are data classes tests right now, which is the only thing this supports right now * Replace $ with _ in class names for consistency * Shortcut Array types to arrayOf * Add DataClassTest * Try generated option first, fall back to maven after * More idiomatic handling * Only use nonnullable types for adapter properties * Code dump of kotshi tests * Comment out specifics to get compiling * Generics support! * Fix double primitive default * Pick up temporary snapshot for Any fix * Invariance should just be null * Better handling of nullably-bound variance * Just assume the first jvm constructor for now as jvmMethodSig is flaky * Specify types param if needed * Don't do lazy delegation * Clean up nullable typevariablename boundaries * Add type variables to extension function on companion object * Use properties instead of allocated names for more robustness Since we're already on a snapshot * If there are no type variables, make it null for simpler handling * Fix generics and Type[] handling * Fix unnecessary as casts on primitive defaults * Reference spec directly for possible bangs * Use nullSafe() adapters for anything nullable or with default values * Use object type in makeType() Types.java cares * Make TestPrimitiveDefaultValues work * Re-enable TestClassWithJavaKeyword * Ignore remaining tests that are pending decisions or JsonQualifier support * Remove customnames test as we're just going to stick with simple @Json * Add toString() implementations * Reenable default values testing, adapt to kotlin lang support * Remove primitive adapters bits since we're not using it * Clean up a bunch of leftover comments * Switch to only nullable handling, report missing properties This makes all nullable handling for local properties the same, and removes defaults for primitives in the process. It simplifies the handling a lot, and leans on kotlin language features to take care of null handling (null checking and then throwing the lazily evaluated list of missing properties). One minor change from what kotshi does - this reports the serialized name in the missing properties, not the property name. We could look at supporting this though if we want. * Implement JsonQualifier support * Use Kapt for AutoService/processor declaration * Checkstyle * Remove unused primite type checks * Add test verifying mutable and immutable collections work * Fix test name * Standardize isRequired checks * Add more nullability and mutability tests * Kotlinpoet 0.7.0 final * Switch to new vararg overload for annotation class adapter() * Make suffix just JsonAdapter without underscore * Switch to just a regular constructor for MoshiSerializableFactory * Remove constructor caching * Remove unnecessary framework class checks * Nix unnecessary superclass lookups, inline constructor lookup * Nix null token check in reads * Nix null check in writes, do !! on first value use * Nix null checks in favor of serializeNulls * Inline null checks and fail eagerly * Fix double _Adapter * First pass at simplifying adapter names * Inline names to options property, life into class and rm companion * Differentiate between absent and null, use nullSafe() as needed * Group together compile and test dependencies * Remove incorrect comment * Revert formatting * Set, not mutable set * Collapse else-if nesting to one when * Cleaner formatting test code * Collapse more to locals * Collapse more * Return a nonnullable type in fromJson * Remove redundant out variance * Use KClass where appropriate * End comment in period * Remove redundant comment * Throw on unrecognized type in simplified name * Use illegalargumentexception instead * Emit a nullcheck at the beginning of toJson instead * Remove extra newline * Simplify processing to be less abusive * Skip using asClassName() when possible * Use addComment() * Switch to declared constructors Technically more correct since we're defining these * Unmodifiable set * return adapter(type, annotationTypes[0]) * Slight optimization - check if the type is parameterized first If the type is a parameterized type, then we know they'll have the two-arg constructor. This way we don't always try and fail the single arg constructor on parameterized types * Add test for type aliases, optimize to reuse adapters if possible This is a tiny optimization to make type aliases (which did already work) reuse adapter properties if they already exist for the backing type. What this means is that if you have: typealias Foo = String and properties foo: Foo bar: String you'll only get one adapter property field for String, and both will use it * Use string templating where possible * Remove all the kotshi tests
2018-03-12 01:17:55 +00:00
</plugins>
</build>
</project>