John Whited
09/05/2023, 7:41 PMval graphqlModule = subprojects.find {
it.path.endsWith(":graphql")
}?.let {
it.afterEvaluate {
apolloModules.forEach { apolloModule ->
it.extensions.configure<com.android.build.gradle.BaseExtension> {
dependencies.apply {
this.add("apolloUsedCoordinates", (project(apolloModule.path)))
}
}
}
}
}
Is anyone else seeing longish startup times (5ish mins to detect up-to-date?). We are seeing a lot of time spent examining kotlin types since the above creates a dependency star that keeps growing (it wasn’t long ago we were around ~2 minutes). Is there a better strategy we should follow for configuring fragments? The schema file isn’t changing here but the same amount of time is being taken up. Any help would be greatly appreciated!mbonnin
09/05/2023, 7:55 PMalwaysGenerateTypesMatching.set(listOf(".*"))
) and skip "apolloUsedCoordinates"
altogethermbonnin
09/05/2023, 7:56 PMJohn Whited
09/05/2023, 9:00 PMmbonnin
09/05/2023, 10:05 PMmbonnin
09/05/2023, 10:07 PMmbonnin
09/05/2023, 10:08 PMJohn Whited
09/13/2023, 6:34 PMJohn Whited
09/13/2023, 6:36 PMJohn Whited
09/13/2023, 7:18 PMmbonnin
09/13/2023, 9:20 PMmbonnin
09/13/2023, 9:27 PM__Schema.all
issue, do you mind ellaborating a bit more? Is the issue that it contains too many or too little types?John Whited
09/13/2023, 10:32 PMJohn Whited
09/13/2023, 10:33 PM__Schema.all
, I’m looking in the generated types in the build folder. It’s still seems to be generating all the types and then the lint process is just insanely expensive when that’s enabled in your project.John Whited
09/13/2023, 10:35 PMisADependencyOf
when dependent projects are using dependsOn
? Shouldn’t there be enough graph information?John Whited
09/13/2023, 10:37 PMmbonnin
09/14/2023, 9:39 AMAlso, I was wondering if you really need to do theThe problem is Gradle project isolation. Projects can't change each other so the link has to be done both ways.when dependent projects are usingisADependencyOf
? Shouldn’t there be enough graph information?dependsOn
mbonnin
09/14/2023, 9:51 AMIt’s still seems to be generating all the types and then the lint process is just insanely expensive when that’s enabled in your project.It's hard to tell what's causing those types to be generated without more information. The used typed can be from a wide variety of reasons (dataBuilders, input types, etc....). I'm curious why this makes lints so slow though. Most of the used types are very simple classes, shouldn't be too hard to parse...
John Whited
09/14/2023, 4:03 PMJohn Whited
09/14/2023, 4:04 PMmbonnin
09/14/2023, 4:05 PMIn the case of non-isolated projects, does it have the full graph?Can you ellaborate? What should have the full graph?
mbonnin
09/14/2023, 4:05 PM10k typesSounds doable if every type is a class with a few lines (which it should be). But maybe there's more to it
John Whited
09/14/2023, 4:07 PMisADependencyOf
in the top level schema project or dynamically scan for something to help the root schema project understand those inclusionsJohn Whited
09/14/2023, 4:07 PMJohn Whited
09/14/2023, 4:10 PMval apolloModules = rootProject.subprojects.filter {
try {
val projectGradleFile = File(it.buildFile.absolutePath)
val fileText = projectGradleFile.readText(Charsets.UTF_8)
!it.path.endsWith(":graphql") &&
(
fileText.contains(""<junk identifying our apollo gql is being used>"") ||
fileText.contains("<more junk identifying our apollo gql is being used>")
)
} catch (e: Exception) {
false
}
}
apolloModules.forEach {
it?.let {
isADependencyOf(it)
}
}
mbonnin
09/14/2023, 4:11 PMJohn Whited
09/14/2023, 4:12 PMmbonnin
09/14/2023, 4:13 PM// feature/build.gradle.kts
schemaProject.dependencies.add("apolloSomething", project)
mbonnin
09/14/2023, 4:14 PMJohn Whited
09/14/2023, 4:15 PMmbonnin
09/14/2023, 4:15 PMmbonnin
09/14/2023, 4:16 PMI was just thinking maybe the answer is you have to common path write your dependencies out from each project and collect them in a later taskGut feeling there is that ultimately, you'll want a project to read that file and have that trigger a task in a different project and you're back to configuring explicit dependencies
mbonnin
09/14/2023, 4:17 PMJohn Whited
09/14/2023, 4:17 PMmbonnin
09/14/2023, 4:18 PM:schema:lintDebugAndroid
or something like so? In the schema module containing the 10k types?John Whited
09/14/2023, 4:18 PMmbonnin
09/14/2023, 4:19 PMJohn Whited
09/14/2023, 4:19 PMmbonnin
09/14/2023, 4:19 PMmbonnin
09/14/2023, 4:19 PM