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

Add plugin configuration option to allow generating test client files into testFixtures sources root #1935

Open
jonnymags opened this issue Mar 5, 2024 · 0 comments
Labels
type: enhancement New feature or request

Comments

@jonnymags
Copy link

Is your feature request related to a problem? Please describe.
I have test code in a Gradle project that I need shared across submodules, so it lives in a TestFixtures source directory. I'd like my code that's generated by the GraphQLGenerateTestClientTask to also exist in a TestFixtures sources directory so that I can share it across modules. Currently, there is no option to specify that a directory is a TestFixtures sources directory in the plugin, since it automatically marks the output directory as a Test sources root.

Describe the solution you'd like
A plugin configuration option that allows me to specify whether I want to generate the resulting code into a test sources root or a testFixtures sources root.

Describe alternatives you've considered
I've been able to get around this by overwriting the test sources root and adding the output directory to the testFixtures source set, like so:

sourceSets.testFixtures.get().java.srcDir(graphqlGenerateTestClient.get().outputDirectory)
sourceSets.test.get().java.setSrcDirs(listOf("src/test/java"))

Additional context
Add any other context or screenshots about the feature request here.

@jonnymags jonnymags added the type: enhancement New feature or request label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Development

No branches or pull requests

1 participant