Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error.NonExistentClass in Metalava Signature Files #2755

Merged
merged 12 commits into from
Nov 23, 2020

Conversation

tylerbwong
Copy link
Contributor

@tylerbwong tylerbwong commented Nov 16, 2020

This fixes most of the error.NonExistentClass occurrences in each module's Metalava signature descriptors.

A standalone Gradle plugin has been added which built on top of this project's build logic, but adds the proper --classpath flag arguments for Android, Multiplatform, and Java libraries and other configurations.

There are a few notable changes to signature descriptor files since the Gradle plugin uses an embedded Metalava artifact from here:

  • Non-abstract functions seem to be omitted from public sub-class API.
  • There is a bug with @JvmSynthetic targets being omitted from the output. (Found in rx2/rx3 artifacts)
  • More nullability information is included.
  • Empty Kotlin constructors from top-level only files are removed.
  • Lots of annotation information is now included.

build.gradle.kts Outdated Show resolved Hide resolved
@martinbonnin
Copy link
Contributor

Thanks a lot for the contribution, that looks awesome ! I'll look into the details of the plugin source code later this week.

@martinbonnin
Copy link
Contributor

CI is a bit flaky at the moment, I'm not sure why but :apollo-integration:jvmTest sometimes stay stuck for 6h. I just relaunched it

@tylerbwong
Copy link
Contributor Author

There seems to be an issue with the new check compatibility task 😞. It looks like the temporary generated API is incorrect. I'll look into fixing it.

@tylerbwong
Copy link
Contributor Author

Turns out the build was failing because I generated the signature files on a Linux machine and the multiplatform module apollo-normalized-cache-sqlite/api.txt was inconsistent with the macOS image CI was generating. It should be fixed by 88ac699!

@tylerbwong
Copy link
Contributor Author

@martinbonnin Just updated and released 0.1.4 of the Metalava Gradle plugin which makes the changes we discussed today (See tylerbwong/metalava-gradle@5589803). Let me know if there's anything else that needs to be done! 😄

@martinbonnin
Copy link
Contributor

Awesome, looks good to me 👍 . I'll keep this open for the week end if anyone wants to look into it and merge on Monday. Thanks a lot for the contribution !

@martinbonnin martinbonnin merged commit 006372e into apollographql:main Nov 23, 2020
martinbonnin pushed a commit that referenced this pull request Dec 21, 2020
* Fix error.NonExistentClass in Metalava Signature Files

* Exclude internal packages

* Remove SNAPSHOT version

* Fix bad imports

* Revert unnecessary changes

* Fix matchingFallbacks API call

* Bump Version 0.1.1

* Revert AGP and bump Gradle Plugin to 0.1.2

* Revert more unnecessary changes

* Plugin 0.1.3

* Add signature file updates from macOS build

* Metalava Gradle 0.1.4
martinbonnin added a commit that referenced this pull request Dec 23, 2020
* Adds documentation whem using apollo with the -native-mt branch of co… (#2723)

* Adds documentation whem using apollo with the -native-mt branch of coroutines

* Remove dependency ordering comment

* Fix issue #2734 (#2735)

Co-authored-by: Christophe DONGIEUX <[email protected]>

* [KMP] added a 'timeoutMillis' parameter to ApolloHttpNetworkTransport (#2690)

* added a 'timeoutMillis' parameter to ApolloHttpNetworkTransport

* fix doc

* use setTimeoutInterval()

* fix tests

* use timeoutIntervalForRequest

* fix tests

* Update dependency gatsby-theme-apollo-docs to v4.5.9

* Update dependency gatsby to v2.25.3

* Change from exemple to example (#2740)

* Fix `downloadApolloSchema` regression when there are multiple compilationUnits (#2730)

* add tests

* Make the compilation unit resolution lazy so that --endpoint --schema
always have precedence

* fix tests

* Better handling of string escapes (#2732)

* release 2.4.3

* version is now 2.4.4-SNAPSHOT

* [codegen] Revert default values as Kotlin default parameters and made skipField more robust (#2741)

* adding tests for include directives and default parameters

* make SimpleResponseReader more robust

* revert #2704

* fix tests

* [Codegen] disable parsing of default variables for now (#2743)

* disable parsing of default variables for now

* merge all variable default values tests

* release 2.4.4

* version is now 2.4.5-SNAPSHOT

* [Doc] for Java users, put Groovy first for Gradle configuration (#2749)

* for Java users, put Groovy first for Gradle configuration

* aded a note that redirects to the tutorial endpoint if needed

* Introduce custom error class for better error handling (#2751)

* added a test case for optional enum variables with default values (#2745)

* Update dependency gatsby to v2.26.1 (#2753)

Co-authored-by: Renovate Bot <[email protected]>

* add a few jar attributes (#2736)

This allow in particular to use `getImplementationVersion()`: https://docs.oracle.com/javase/7/docs/api/java/lang/Package.html#getImplementationVersion()

* [Gradle plugin] Add schema upload (#2737)

* add uploadApolloSchema

* add ./gradlew uploadApolloSchema

* upload -> push

* exemple -> example

* use schemaName for actually writing fields (#2746)

* add `./gradlew convertApolloSchema --from schema.json --to schema.sdl` (#2757)

* [Build scripts] be more strict about what we download from jcenter (#2758)

* be more strict about what we download from jcenter

only download org.jetbrains.trove4j:trove4j:20160824

* looks like we don't need jcenter in the main repositories

* Revert "looks like we don't need jcenter in the main repositories"

We need it for apollo-android-support
This reverts commit f3b10f8.

* revert to AGP 3.6.2

* fix java sample

* release 2.4.5

* version is now 2.4.6-SNAPSHOT

* Update dependency gatsby to v2.27.0

* Increase Gradle verbosity during integration test to investigate Github Action hangs (#2764)

* [codegen] Honor packageName for schema types as well (#2759)

* honor package name for schema types as well

* fix typo

* fix tests

* Fix error.NonExistentClass in Metalava Signature Files (#2755)

* Fix error.NonExistentClass in Metalava Signature Files

* Exclude internal packages

* Remove SNAPSHOT version

* Fix bad imports

* Revert unnecessary changes

* Fix matchingFallbacks API call

* Bump Version 0.1.1

* Revert AGP and bump Gradle Plugin to 0.1.2

* Revert more unnecessary changes

* Plugin 0.1.3

* Add signature file updates from macOS build

* Metalava Gradle 0.1.4

* Do not use Java8 Duration (#2767)

* [Gradle Plugin] make convertApolloSchema never up-to-date  (#2761)

* mark the convertApolloSchema task as never up-to-date as it's intented
to be used from the command line

* Annotate parameters as Input

* revert to okhttp 3 to support older versions of Android (#2769)

* adding test coverage (#2770)

* fix NSURLSession configuration (#2777)

* publish sha256 and sha512 signatures (#2772)

there was a bug in bintray/sonatype that made it not work but it looks
like it's working now (see
gradle/gradle#11412 (comment))

* Add interface for classes generated for enum types and fix sealed classes json representation (#2776)

* Make generated classes for enum types implement a common interface

Objects representing enums in sealed classes don't have stable toString() implementation: instead, they'll return the class name along with memory address for that object. This breaks SQLite-based caching for queries that accept enum parameters, as toString() is used to generate the query key, so it would change between app restarts. This commit fixes this behavior by adding an EnumValue interface to types representing enums, and using its `rawValue` property to build proper cache key.

Fixes #2775

* added a test for sealed classes cache keys

Co-authored-by: Martin Bonnin <[email protected]>

* Revert "publish sha256 and sha512 signatures (#2772)" (#2780)

This reverts commit 81d742a.

* release 2.4.6

* version is now 2.4.7-SNAPSHOT

* do not choke on "repeated" directive. (#2785)

We don't do anything with them but them not being in the grammar made
the parser fail for recent schemas

* Update Metalava Gradle Plugin to 0.1.5 (#2774)

* Another attempt at publishing from CI (#2782)

* another attempt at publishing from CI

This time, it will only upload the artifact and the final releasing step
still needs to be done on bintray.com/oss.sontatype.org

Except for the plugin portal which doesn't separate these steps so it is
run last so that it's only released if all uploads went well

* fix name of the snoatype task

* Update 06-add-more-info.mdx (#2797)

Fix wrong class name

* Fix the example arguments for downloadApolloSchema (#2799)

Using the `-P` parameters have been deprecated

* Replace all .toDeferred().await() with .await() in the tutorial (#2800)

toDeferred has been deprecated and should be replaces by just await.

* Update 11-subscriptions.mdx (#2801)

Changes Wikipedia's link from `fr` to `en. (Since this is an English tutorial)

* support null arguments (#2805)

* Fix watcher clone (#2795)

* fix ApolloQueryWatcher.clone() and move test to Kotlin

* added a test case

* add another test case

* remove unused import

* For recent versions of Gradle, use .convention to provide the default (#2803)

This allows to call `customTypeMap.put()`

* Implement support for AWS AppSync in WebSocketSubscriptionTransport (#2809)

* Rename .java to .kt

* Convert WebSocketSubscriptionTransport to Kotlin

* Rename .java to .kt

* Rewrite OperationClientMessage to a sealed class

* Implement support for AWS AppSync in WebSocketSubscriptionTransport

* Rename .java to .kt

* Fix the broken test

* Fix the binary compatibility

* Use Utils.writeToJson

* Use Utils.writeToJson

* Rename .java to .kt

* Convert OperationServerMessage to a sealed class

* Rewrite the writing and reading to use a serializer

* Replace the data classes with regular classes

* Replace delegation with method calls

* Update the deprecation message

* Rename buildAppSyncWebSocketUrl to buildWebSocketUrl

* Rename .java to .kt

* Add tests and documentation

* Adds documentation whem using apollo with the -native-mt branch of co… (#2723)

* Adds documentation whem using apollo with the -native-mt branch of coroutines

* Remove dependency ordering comment

* Fix issue #2734 (#2735)

Co-authored-by: Christophe DONGIEUX <[email protected]>

* [KMP] added a 'timeoutMillis' parameter to ApolloHttpNetworkTransport (#2690)

* added a 'timeoutMillis' parameter to ApolloHttpNetworkTransport

* fix doc

* use setTimeoutInterval()

* fix tests

* use timeoutIntervalForRequest

* fix tests

* Update dependency gatsby-theme-apollo-docs to v4.5.9

* Update dependency gatsby to v2.25.3

* Change from exemple to example (#2740)

* [Doc] for Java users, put Groovy first for Gradle configuration (#2749)

* for Java users, put Groovy first for Gradle configuration

* aded a note that redirects to the tutorial endpoint if needed

* Introduce custom error class for better error handling (#2751)

* Update dependency gatsby to v2.26.1 (#2753)

Co-authored-by: Renovate Bot <[email protected]>

* add a few jar attributes (#2736)

This allow in particular to use `getImplementationVersion()`: https://docs.oracle.com/javase/7/docs/api/java/lang/Package.html#getImplementationVersion()

* [Gradle plugin] Add schema upload (#2737)

* add uploadApolloSchema

* add ./gradlew uploadApolloSchema

* upload -> push

* exemple -> example

* add `./gradlew convertApolloSchema --from schema.json --to schema.sdl` (#2757)

* [Build scripts] be more strict about what we download from jcenter (#2758)

* be more strict about what we download from jcenter

only download org.jetbrains.trove4j:trove4j:20160824

* looks like we don't need jcenter in the main repositories

* Revert "looks like we don't need jcenter in the main repositories"

We need it for apollo-android-support
This reverts commit f3b10f8.

* revert to AGP 3.6.2

* fix java sample

* Update dependency gatsby to v2.27.0

* Fix error.NonExistentClass in Metalava Signature Files (#2755)

* Fix error.NonExistentClass in Metalava Signature Files

* Exclude internal packages

* Remove SNAPSHOT version

* Fix bad imports

* Revert unnecessary changes

* Fix matchingFallbacks API call

* Bump Version 0.1.1

* Revert AGP and bump Gradle Plugin to 0.1.2

* Revert more unnecessary changes

* Plugin 0.1.3

* Add signature file updates from macOS build

* Metalava Gradle 0.1.4

* Do not use Java8 Duration (#2767)

* [Gradle Plugin] make convertApolloSchema never up-to-date  (#2761)

* mark the convertApolloSchema task as never up-to-date as it's intented
to be used from the command line

* Annotate parameters as Input

* revert to okhttp 3 to support older versions of Android (#2769)

* adding test coverage (#2770)

* fix imports

* fix imports

* better formatting

* fix tests

* fix NSURLSession configuration (#2777)

* Add interface for classes generated for enum types and fix sealed classes json representation (#2776)

* Make generated classes for enum types implement a common interface

Objects representing enums in sealed classes don't have stable toString() implementation: instead, they'll return the class name along with memory address for that object. This breaks SQLite-based caching for queries that accept enum parameters, as toString() is used to generate the query key, so it would change between app restarts. This commit fixes this behavior by adding an EnumValue interface to types representing enums, and using its `rawValue` property to build proper cache key.

Fixes #2775

* added a test for sealed classes cache keys

Co-authored-by: Martin Bonnin <[email protected]>

* fix bad merge

* Update Metalava Gradle Plugin to 0.1.5 (#2774)

* Another attempt at publishing from CI (#2782)

* another attempt at publishing from CI

This time, it will only upload the artifact and the final releasing step
still needs to be done on bintray.com/oss.sontatype.org

Except for the plugin portal which doesn't separate these steps so it is
run last so that it's only released if all uploads went well

* fix name of the snoatype task

* Update 06-add-more-info.mdx (#2797)

Fix wrong class name

* Fix the example arguments for downloadApolloSchema (#2799)

Using the `-P` parameters have been deprecated

* Replace all .toDeferred().await() with .await() in the tutorial (#2800)

toDeferred has been deprecated and should be replaces by just await.

* Update 11-subscriptions.mdx (#2801)

Changes Wikipedia's link from `fr` to `en. (Since this is an English tutorial)

* support null arguments (#2805)

* Fix watcher clone (#2795)

* fix ApolloQueryWatcher.clone() and move test to Kotlin

* added a test case

* add another test case

* remove unused import

* Implement support for AWS AppSync in WebSocketSubscriptionTransport (#2809)

* Rename .java to .kt

* Convert WebSocketSubscriptionTransport to Kotlin

* Rename .java to .kt

* Rewrite OperationClientMessage to a sealed class

* Implement support for AWS AppSync in WebSocketSubscriptionTransport

* Rename .java to .kt

* Fix the broken test

* Fix the binary compatibility

* Use Utils.writeToJson

* Use Utils.writeToJson

* Rename .java to .kt

* Convert OperationServerMessage to a sealed class

* Rewrite the writing and reading to use a serializer

* Replace the data classes with regular classes

* Replace delegation with method calls

* Update the deprecation message

* Rename buildAppSyncWebSocketUrl to buildWebSocketUrl

* Rename .java to .kt

* Add tests and documentation

* fix merge

* adapt to dev-3.x

* update metalava signatures

Co-authored-by: Ian Alexander <[email protected]>
Co-authored-by: cdongieux <[email protected]>
Co-authored-by: Christophe DONGIEUX <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Eduardo Rengifo <[email protected]>
Co-authored-by: Said Tahsin Dane <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tyler Wong <[email protected]>
Co-authored-by: Vitaliy Kondratiev <[email protected]>
Co-authored-by: Łukasz Wasylkowski <[email protected]>
Co-authored-by: Theo Ioakeimidis <[email protected]>
Co-authored-by: Nicklas Ansman Giertz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants