-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support generating external adapters (#146)
* Update dependencies * Gradle 6 * Add option to generate externally * Update README * Style * Add generic test * Fix key * Share lookup of jsonclass * Use all names * Add nested types and properly match all names * Style * Style * Style
- Loading branch information
Showing
9 changed files
with
219 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...shi-tests/src/main/java/com/ryanharter/auto/value/moshi/test/GenericNativeMoshiClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.ryanharter.auto.value.moshi.test; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.squareup.moshi.JsonClass; | ||
|
||
@JsonClass(generateAdapter = true, generator = "avm") | ||
@AutoValue | ||
public abstract class GenericNativeMoshiClass<T> { | ||
public abstract T property(); | ||
|
||
@AutoValue.Builder | ||
public interface Builder<T> { | ||
Builder<T> property(T prop); | ||
GenericNativeMoshiClass<T> build(); | ||
} | ||
|
||
@JsonClass(generateAdapter = true, generator = "avm") | ||
@AutoValue | ||
public abstract static class Nested<T> { | ||
public abstract T property(); | ||
|
||
@AutoValue.Builder | ||
public interface Builder<T> { | ||
Builder<T> property(T prop); | ||
Nested<T> build(); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...alue-moshi-tests/src/main/java/com/ryanharter/auto/value/moshi/test/NativeMoshiClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.ryanharter.auto.value.moshi.test; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.squareup.moshi.JsonClass; | ||
|
||
@JsonClass(generateAdapter = true, generator = "avm") | ||
@AutoValue | ||
public abstract class NativeMoshiClass { | ||
public abstract String property(); | ||
|
||
@AutoValue.Builder | ||
public interface Builder { | ||
Builder property(String prop); | ||
NativeMoshiClass build(); | ||
} | ||
|
||
@JsonClass(generateAdapter = true, generator = "avm") | ||
@AutoValue | ||
public abstract static class Nested { | ||
public abstract String property(); | ||
|
||
@AutoValue.Builder | ||
public interface Builder { | ||
Builder property(String prop); | ||
Nested build(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Sun Nov 03 21:45:52 IST 2019 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.