Commit Graph

1080 Commits

Author SHA1 Message Date
Zac Sweers
862ff7ddcd Update to JDK 17 (#1394)
Everything still targets JDK 8 (non-records) or JDK 16 (records only)
2021-10-16 02:18:51 -04:00
Zac Sweers
2db351f8ed Upstream KSP implementation (#1393) 2021-10-16 01:52:04 -04:00
Zac Sweers
de8bbf12f5 Update KotlinPoet to 1.10.0 (#1396) 2021-09-20 16:13:56 -04:00
Chitranshi Srivastava
628a193d69 fix: corrected a grammatical error. (#1298) 2021-09-12 20:55:53 -04:00
iury souza
29d2f0f0ed Update README to include enum section in ProGuard/R8 rules (#1354) 2021-09-12 20:54:44 -04:00
Zac Sweers
5756136a72 Move apt-specific classes to apt package (#1392) 2021-09-09 22:14:29 -04:00
Zac Sweers
213fb33012 Fix snapshots (#1385) 2021-08-27 13:28:20 -04:00
Zac Sweers
6947ab00d0 Modernize build a bit (#1383) 2021-08-23 17:09:59 -04:00
Zac Sweers
95250b0359 Implement reflective support for Java Records (#1381)
* Standardize around JDK 8

* Update GJF to support newer JDKs

* Fix misc java 8 issues in tests

* Prepare java 16/records checking at runtime

* Implement real RecordJsonAdapter

* Spotless

* Prepare build for JDK 16+

* Fix property name for kapt

* Small cleanup

* Make FallbackEnum java-8 happy

* Remove animalsniffer

* Fix format

* Add opens for ExtendsPlatformClassWithProtectedFields

* Return null every time in shim for main tests

* Use JDK 16 + release 8 to replace animalsniffer

* Simplify accessor accessible handling

* Remove manifest attrs

* Fix typo

* Fix KCT tests + upgrade it

* Cover another

* Try explicit kotlin daemon args for java 17?

* Disable 17-ea for now until kotlin 1.5.30

* Add JsonQualifier and Json(name) tests + fix qualifiers

* Ensure constructor is accessible

* GJF it properly

* GJF 1.11

* Unwrap InvocationTargetException

* Use MethodHandle for constructor

* Use MethodHandle for accessor too

* Revert "Remove manifest attrs"

This reverts commit 3eb768fd6904bb5c979aa01c3c182e0fb9329d62.

* Proper MR jar

* *actually* fix GJF, which wasn't getting applied before

We can just enable this everywhere now since we require JDK 16 anyway

* Make IDE happy about modules access

* Fixup records tests to play nice with modules

Gotta be public

* Add complex smoke test

* Remove comment

Not a regression test in this case
2021-08-23 12:00:06 -04:00
Goooler
2572c29e42 Code cleanups 2021-08-18 14:51:52 -04:00
Jake Wharton
ce78d34c14 Merge pull request #1379 from Goooler/gradle
Update gradle 7.2
2021-08-17 08:32:24 -04:00
Goooler
c1f5ce2b1b Update gradle 7.2 2021-08-17 19:52:43 +08:00
Jake Wharton
e41b79170e Merge pull request #1377 from Goooler/action
Disable publish action in forked repository
2021-08-16 10:55:33 -04:00
Jake Wharton
201a1d8a4b Merge pull request #1376 from Goooler/bump
Bump gradle to 7.1.1
2021-08-16 10:55:15 -04:00
Goooler
2eb40a0cff Disable publish action in forked repository 2021-08-16 22:29:22 +08:00
Goooler
6c2c578637 Bump gradle to 7.1.1 2021-08-16 22:19:00 +08:00
Jake Wharton
5379ac8539 Merge pull request #1374 from Goooler/attr
Add .gitattributes
2021-08-16 10:05:59 -04:00
Jake Wharton
620e340181 Merge pull request #1373 from Goooler/config
Add .editorconfig
2021-08-16 10:05:39 -04:00
Goooler
06cce171c6 Bump setup-java action to v2 2021-08-16 10:05:05 -04:00
Goooler
4bca55b113 Add .gitattributes 2021-08-16 17:04:42 +08:00
Goooler
6d48f16d1f Add .editorconfig 2021-08-16 17:03:24 +08:00
Zac Sweers
ce45a68cc3 Small grammar and naming followups for proguard gen (#1365) 2021-07-16 03:06:43 -04:00
Steve SeongUg Jung
72f464bbdc Add an argument to be disable proguard code generating (#1353)
Co-authored-by: SeongUg Jung <seongug.jung@hanwha.com>
Co-authored-by: Zac Sweers <pandanomic@gmail.com>
2021-07-15 21:24:31 -04:00
Dkhusainov
3c108919ee JsonReader.nextSource javadoc (#1350)
Co-authored-by: Dinar <d.khusainov@infotech.team>
2021-05-31 16:35:32 -04:00
Zac Sweers
e343751593 Update to Kotlin 1.5 (and associated deps) (#1339) 2021-05-07 12:51:33 -04:00
Zac Sweers
45c8595bfa Update to Gradle 7 + Kotlin 1.4.32 + AutoService 1.0 (#1334) 2021-04-10 13:03:34 -04:00
wrongwrong
9c17bb823f fix version on readme (#1333) 2021-04-07 10:34:17 -04:00
Yuichiro Kawano
1654313fee update version on README (#1332) 2021-04-05 19:44:39 -04:00
Jesse Wilson
aea17e09bc Prepare next development version. 2021-04-01 16:31:07 -04:00
Jesse Wilson
cdf9546df5 Prepare for release 1.12.0. 2021-04-01 16:30:45 -04:00
Zac Sweers
7372baaaa0 Invoke constructor directly if all params with default are set (#1326)
Resolves #1302
2021-03-29 21:47:22 -04:00
Zac Sweers
b33a94dfc1 Update more dependencies (#1319) 2021-03-29 21:37:54 -04:00
wrongwrong
37f34e16f0 Improve KotlinJsonAdapter performance by invoke KFunction by "call". (#1286) 2021-03-29 20:46:42 -04:00
Zac Sweers
bcfce60577 Warn on missing TypeElement rather than error (#1323)
One example I found for this is when a property is annotated with android's `@SuppressLint`, which is only available from the android jar and not visible during apt. This should just be a warning (if even?) and not a hard error.
2021-03-29 20:44:55 -04:00
Ralf Wondratschek
7ef4a32d52 Bump the Kotlin JVM metadata library to the latest release. This will avoid problems with Kotlin 1.5.0-M2. (#1325) 2021-03-29 11:00:03 -04:00
Zac Sweers
797140c5cf Add some short basic docs to JsonAdapter methods (#1313) 2021-03-13 20:52:40 -05:00
Zac Sweers
103b60328c Improve readability of constructor invocation params (#1312) 2021-03-13 20:52:25 -05:00
Zac Sweers
3bc47519ab Fix reading property function types (#1311) 2021-03-13 20:47:52 -05:00
Zac Sweers
935f8b872a Support generic arrays with defaults in code gen (#1310) 2021-03-13 20:47:27 -05:00
Márton Braun
6df66b81dc Fix typo in PolymorphicJsonAdapterFactory.java (#1314) 2021-03-08 13:54:19 -05:00
Zac Sweers
9ac54dd33f Update dependencies (#1307)
* Gradle 6.8.2

* Truth 1.1.2

* Kotlin 1.4.30

* ASM 9.1

* Lower versions

These require java 8, which we don't actually formally support

* Gradle 6.8.3
2021-02-23 02:51:12 -05:00
Masatoshi Kubode
156b1f0365 Fix a crash when processing a parameter annotated with an annotation that placed in annotation package (#1287)
* Update KotlinPoet to 1.7.2

* Fix a Java NPE crash when processing a parameter annotated with an annotation that placed in annotation package

This problem happens with KotlinPoet 1.7.x.
From KotlinPoet 1.7.x, `TypeName.toString()` is escaped with backquotes if the package name contains keywords.
So NPE will be thrown if an annotation is placed in `annotation` package because `elements.getTypeElement(it.typeName.toString())` returns `null`.

* Reformat imports

* Use rawType().canonicalName instead of toString()

* Fix test case

* Require getTypeElement

* Exclude com.google.guava from shadowJar

* Move a test case of processing a qualifier placed in `annotation` package

* Use checkNull instead
2021-02-22 02:43:04 -05:00
Zac Sweers
7f1e7e229e Suppress some poet deprecations (#1306) 2021-02-20 23:27:56 -05:00
Zac Sweers
99ebab66c0 Reserve simple type names referenced by properties to avoid collisions (#1305) 2021-02-15 13:02:28 -05:00
Zac Sweers
6b09dc443d Suppress RedundantVisibilityModifier in generated adapters (#1303) 2021-02-15 12:58:14 -05:00
Zac Sweers
6e5bb3a29b Prepare project for Kotlin migration (#1257) 2021-02-02 13:11:38 -05:00
Zac Sweers
8518f47f52 Update dependencies (#1258) 2021-02-02 13:11:20 -05:00
Zac Sweers
23d056c054 Add issue templates (#1254) 2021-02-01 18:00:03 -05:00
Alex Vanyo
f0202d5d29 Revert pull-request-target to pull-request (#1295) 2021-02-01 17:58:29 -05:00
Zac Sweers
9c2cd7a37b Use pull_request_target (#1255)
https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#pull_request_target
2020-10-10 07:52:57 -04:00