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

Improve relocation in gradle plugin #4528

Merged
merged 4 commits into from
Nov 24, 2022
Merged

Improve relocation in gradle plugin #4528

merged 4 commits into from
Nov 24, 2022

Conversation

BoD
Copy link
Contributor

@BoD BoD commented Nov 23, 2022

@netlify
Copy link

netlify bot commented Nov 23, 2022

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 40b5d08
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/637f540688be4d0009e681f8

@BoD BoD changed the title Use kotlinx.serializer instead of Moshi to parse introspection schema Improve relocation in gradle plugin Nov 23, 2022
}

public final class com/apollographql/apollo3/ast/introspection/IntrospectionSchema$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an option to hide this from the public API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked a question here

@@ -4,7 +4,7 @@ plugins {
antlr
id("org.jetbrains.kotlin.jvm")
id("apollo.library")
id("com.google.devtools.ksp")
kotlin("plugin.serialization")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. We're using the id("") notation everywhere else

Suggested change
kotlin("plugin.serialization")
id("org.jetbrains.kotlin.plugin.serialization")

}
}

@OptIn(ExperimentalSerializationApi::class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's ok to use this. If a future version changes the signatures, they will break at runtime.

Copy link
Contributor Author

@BoD BoD Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we bundle and relocate the code, so we should be immune to changes? (OTOH I'm ok with avoiding using this)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We relocate in apollo-gradle-plugin but some users might use apollo-ast outside the Gradle context so I'd feel safer avoid this for the time being.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense 👍

@BoD BoD merged commit 17a2d33 into main Nov 24, 2022
@BoD BoD deleted the improve-relocation branch November 24, 2022 13:57
@@ -14,6 +14,7 @@ pluginManagement {
includeModule("me.champeau.gradle", "japicmp-gradle-plugin")
includeModule("com.gradle.publish", "plugin-publish-plugin")
includeModule("com.github.ben-manes", "gradle-versions-plugin")
includeModule("org.jetbrains.kotlin.plugin.serialization", "org.jetbrains.kotlin.plugin.serialization.gradle.plugin")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed that one. Do we need this? The serialization plugin should be on maven central these days: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/plugin/serialization/org.jetbrains.kotlin.plugin.serialization.gradle.plugin/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it again in https://github.com/apollographql/apollo-kotlin/pull/4531/files, see what breaks 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 1.6.10 (which we use during idea sync) is not on Maven central, but now I'm no longer sure this is needed because I removed it on my machine and it still works 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you have configuration cache enabled 😅 . Ok I'll add it again in #4531 with a comment to remove it at some point

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