In 3.x I had a setup where the schema module had `...
# apollo-kotlin
s
In 3.x I had a setup where the schema module had
packageName.set("octopus")
. Then all sub-modules that also wanted to have their own queries/mutations would also apply the apollo plugin, and also do
packageName.set("octopus")
. I just realized there was nothing being generated by the
generateApolloSources
task. I changed the packageName to something else, and it now did generate the queries properly. So I am realizing, does 4.x not like the package name being the same for conflict reasons? Or is this just not true and I am experiencing something completely different perhaps? I did read this https://www.apollographql.com/docs/kotlin/v4/migration/4.0/#all-schema-types-are-generated-in-the-schema-module but I don't think this is related right? Because when I do change the packageName itself those queries do get properly generated only in that feature module.
1
b
I think this should work!
s
My repro so far was: • Change the packageName from that to something else • Sync project • Run
generateApolloSources
• Notice the in that feature module, in
build/generated/source/apollo...
the files are generated. • Then change the packageName back to the same as the one in the schema module • Sync project • Run
generateApolloSources
• The
build/generated/source/apollo...
dir is just empty. Perhaps I should run generateApolloSources with logs to see if anything stand out?
b
hmm odd indeed. Doesn't hurt to have a look at the logs but not sure you'll see anything, as I would expect it to fail if there's anything wrong
is this on your branch so I can have a look maybe?
s
Hmm yeah it's on latest develop however which is not buildable for you for the same reasons as before. Let me give it a few more runs, then I'll try to see if I can repro it on that branch specifically perhaps. Do you still have a link to your fork or did you delete that?
b
fork is still here
thank you color 1
s
Changing both schema module and feature module to
Copy code
service("octopus") {
    packageName = "octopuss"
instead did work 😕 Changing them both back to just "octopus" the the feature module does not generate anything again 😅 I must be doing something super weird somewhere, this makes no sense 😄
m
Bad build cache entry?
💡 1
What if you run with
--no-build-cache
?
s
I did run
./gradlew generateApolloSources --no-build-cache
once before. But I will do it again maybe I didn't do it in a proper state before.
m
Maybe add
--no-configuration-cache --rerun-tasks
as well “just to be sure”...
s
I just run
./gradlew generateApolloSources --no-build-cache --no-configuration-cache --rerun-tasks
and it worked
I swear me and gradle are about to throw hands anytime today
😂 1
🤣 1
😡 2
m
Yea something fishy there...
s
Just "`./gradlew generateApolloSources --no-build-cache`" did not work for me
m
it could be us not being good “build cache citizens” but we haven’t had too much issues there
I would err on the “configuration cache” side
The implementation of CC is crazy, it’s Java serialization all the way down
🙈 2
s
Thanks for saving my day though, I was already considering what I have to do to rename the package name of all feature modules 😂 New tool unlocked too, slap a
--no-build-cache --no-configuration-cache --rerun-tasks
at all problems 😂 I used to do
--no-build-cache
but TIL it's not always enough 😄
😂 1
b
the new 'invalidate cache and restart'
☝️ 2