js-graphql-intellij-plugin icon indicating copy to clipboard operation
js-graphql-intellij-plugin copied to clipboard

Android Studios Build Variants Support

Open justincamp404 opened this issue 5 years ago • 2 comments

Greetings and thanks for the excellent plugin.

I see that there's support for multiple projects. Is there any support for android studios "build variants" in the same project?

For example, I have an app with "production" and "staging" variants which point to different servers. I download the schema DSLs for both of these and put them in separate directories. Is there a way to

  • Point the JSGQL Plugin to the correct schema file based on the current build variant
  • Have the plugin update itself when it notices that the build variant (or the config) changed?

justincamp404 avatar Feb 13 '20 01:02 justincamp404

Hi Justin.

Thanks for using the plugin.

Based on my current knowledge, Android Studio is its own distribution based on top of the shared IntelliJ platform. This likely means that this plugin can't reference the build variants code.

I think an additional plugin would be needed, one that's built specifically against Android Studio. The GraphQL plugin would then have to be extended with a new extension point that the new Android Studio plugin could utilize based on something like a build variant listener.

Given other projects and priorities I don't think I'll find time to work on this, but I would happily take a PR which adds the necessary extension points that would make it possible.

If you're up for giving it a shot, the starting point is https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html

Best regards, Jim.

jimkyndemeyer avatar Feb 13 '20 05:02 jimkyndemeyer

Hi Jim, I kind of figured it would be something like that. Thanks for the info!

I might take a stab at it at some point in the relatively near future, but right now I'm swamped @ work.

Cheers! Justin

justincamp404 avatar Feb 13 '20 17:02 justincamp404