This message was deleted.
# community-support
s
This message was deleted.
j
I am not following you, at the end you get a tree of reports which are accumulative merges based on the configuration output • root (root + foo + bar + baz + qux + quz) ◦ foo (foo + bar + baz) ▪︎ bar (bar) ▪︎ baz (baz) ◦ qux (qux + quz) ▪︎ quz (quz) What am I missing?
m
What is
root
up there?
Is it the build
rootProject
or something else?
j
it can be potentially anything, that would be based on how your configuration is used
m
That's the thing, I don't want to manage an extra module + its dependencies. I just want "all the modules in my build"
j
if you want to get all reports in only one module, you can use the root project, or other project too, I will change the root name as it can mislead because it is the typical use case to use the root one, but it is noy mandatory
I think you want a settings plugin which add all projects to one automatically, hiding this to do manually
m
Ah, settings plugin yes maybe!
j
I think this could be a summary
m
Is that better than using
allprojects {}
from the root
build.gradle
?
j
I am not pretty sure, but I think that
allproject
is project isolation safe, the project one isn't. But I wouldn't put my hand on the fire 😛
m
but I think that
allproject
is project isolation safe, the project one isn't.
You mean the settings one?
j
yeah, the settings one is compatible with project isolation, the project one it isn't (at least in the current state)
m
Gotcha 👍 TIL !
j
if you try it and it works, please share feedback here 🙂
👍 1
m
Well, we still haven't enabled CC so trying out project isolation might take a while but will do!
j
hahaha, I feel you!
😄 1
v
This is not my case, I have multiple unrelated modules.
Where is the difference actually? If you just want to get the test results of all modules in the build, just use
dependencies { testReportAggregation(allprojects) }
. Whether you do that in a stand-alone aggregator project or in the root project doesn't matter.
m
I was trying to avoid the
allproject
thing but my this is just over zealous cult to the CC gods from my part 😄
Will try the
dependencies { testReportAggregation(allprojects) }
, thanks!
v
allprojects { ... }
is bad. Using
allprojects
to depend on them for use-cases like this should not disturb CC
thank you 1
til 3
allprojects { ... }
(typically) configures other projects and thus is bad as it couples the projects' configurations.
testReportAggregation(allprojects)
is just a shortcut to
testReportAggregation(project(":a"), project(":b"), <all others too>
, so while the latter is fine the former should too.
m
dependencies { testReportAggregation(allprojects) }
Welp, that didn't go really far 😞
Copy code
Cannot convert the provided notation to an object of type Dependency: [project ':apollo-kotlin', project ':apollo-kotlin:apollo-adapters', project ':apollo-kotlin:apollo-annotations', project ':apollo-kotlin:apollo-api', project ':apollo-kotlin:apollo-api-java', project ':apollo-kotlin:apollo-ast', project ':apollo-kotlin:apollo-cli', project ':apollo-kotlin:apollo-compiler', project ':apollo-kotlin:apollo-compose-paging-support', project ':apollo-kotlin:apollo-compose-support',
The below works. But then we're back to CC-compatiblity issues I guess?
Copy code
subprojects.forEach {
    testReportAggregation(it)
  }
v
Oh, that's unexpected. This works in Groovy DSL but not in Kotlin DSL. I guess this should be reported to get improved eventually.
👀 1
But yeah, your other version should work fine and also not disturb CC
m
Ah, it's fine to iterate the projects as long as I do not configure them?
v
Should be, yes
👍 1
thank you 1
m
(will file the bug about Kotlin DSL)
v
Hm, search for it first. It could be I reported it already some time ago. I faintly remember something.
👍 1
v
Yep, exactly
j
I am subscribed to that and I don’t even remember it, it would be fun to check the list of issues I am subscribed
🙃 1
m
TBH I don't consider this an issue. If Groovy has specific features I don't expect them to work in Kotlin, same as I wouldn't expect to be able to call a Kotlin extension function in Groovy
v
I do consider it an issue. It is not about "you cannot use Groovy magic in Kotlin". It is about the DSL in Groovy is different from the DSL in Kotlin. And Gradle folks had the goal to have the DSLs at least similar in possibilities. This missing feature is definitely a bad thing imho. 🙂
But well, at least one with an easy solution
m
Gradle folks had the goal to have the DSLs at least similar in possibilities.
Fair point. I can see how that's desirable and a noble goal albeit one I have personally given up any hope to see in a realistic time frame. The turing completeness of both languages and the lack of a common formalism to describe a shared DSL make that effort gargantuous IMO.
val foo by getting {}
is my daily reminder I should think in terms of Java APIs, not DSLs
j
Yeah, it looks like a missing API,
Object
magic being checked as
List<Project>>
(or some
List<*>
) on Groovy and not being checked on Kotlin maybe?
m
BTW, I suspect in Groovy something like this doesn't work (haven't checked):
Copy code
dependencies {
  add("testReportAggregation", allprojects) // no dynamic invoke here because .add is a real API
}
v
That's correct, that will not work