This message was deleted.
# community-support
s
This message was deleted.
v
I don't know, but it probably would be pointless. A CC entry is tied to the tasks you request to be executed and for that skips all the configuration and directly jumps to the execution of the tasks. But IDE sync is different, it does not execute tasks but just gets information about the project. What will improve and speedup IDE sync afair will be project isolation which will then allow the sync to be done for multiple projects in parallel.
t
IDE does run tasks though, those provide the data for IDE import. Essentially the configuration cache is what IDE needs to import when you think about it.
v
No, the configuration cache contains tasks and their properties, not the information the IDE needs.
And no, the IDE does not necessarily execute any tasks.
In some particular cases as far as I remember it indeed invokes a task, something Kotlin-specific, but for a normal Java project for example there should not be any tasks executed during sync afair.
t
It's true that I'm thinking of the specific way IntelliJ IDEA imports Gradle projects. That works by running tasks that give it the description of the tasks and their properties and how the modules are structured and all, which is all part of configuration.
I haven't used pure Java Gradle project in quite some while, so I'll take your word for it
v
That works by running tasks that give it the description of the tasks and their properties and how the modules are structured and all
No, it does not.
It uses the Tooling API to request information from the build which is given back over the Tooling API. IntelliJ is not executing the
tasks
task and parsing its result.
t
I'm not saying it's executing the
tasks
task, but some Gradle tasks are being run during sync
Just tried an empty Java project and IntelliJ runs
:prepareKotlinBuildScriptModel
task on sync.
v
Yeah, as I said, something Kotlin specific. Use Groovy DSL build scripts and there will be no task.
t
Same thing with Groovy DSL
But as far as I can remember, there was always the "BUILD SUCCESSFUL" message when importing to IntelliJ which I'm interpreting as Gradle being run
But it still stands, with a larger project a lot of the time is spent in "Configuration" phase during sync, a phase that could be skipped with CC
v
Then that obviously changed. It was not the case in the past. But anyway. that task is not outputting anything anyway, it just prepares something, no idea what. But the information IntelliJ needs, it gets through the tooling API.
Obviously it can not be skipped
t
Why not?
v
Otherwise it would be skipped
t
That's not necessarily true
That's why I was asking whether this is a temporary restriction of GCC, or if there was something in the way of it being used for IDE sync
v
Well, it is written as "limitation" and with the words "not yet". But that does not mean it ever will, there were similar "limitations that will be removed in a future version" that never were and finally just the promise removed from the docs. 🤷‍♂️
t
Yeah, and that's why I was trying to understand the reason behind it
a
as I understand it's because there's no API to get the description without configuring the task https://github.com/gradle/gradle/issues/9823
t
But that would be part of the configuration cache, wouldn't it?
a
interesting question, I don't know if the name and description are stored in the configuration cache 🤔. I assumed it would only be task inputs and outputs. In any case, even if they were I don't think there's any reasonable way to read values from the configuration cache.
t
The cache should contain everything that's done during configuration so that it can restore it later
v
I don't think it is about inputs and outputs, but about the whole state of the task class
Which is not the information the IDE needs for the most part
t
I'd expect it's not just the tasks, but the whole configuration (configurations, sourcesets etc.) and that's the information IDE is using
a
by IDE you mean IntelliJ right? :) I don't know if other IDEs support Gradle quite as deeply
👍 1
v
Why should it be more than tasks? At execution time tasks are executed, to tasks is what is saved and restored.
If you think about tasks that access configurations or source sets at execution time, this only works if they are stored in a comaptible way in the task state. Tasks must not access the project at execution time.
a
I know that IntelliJ dynamically builds and injects an init.gradle script in order to modify the build config, and fetch Gradle data. And because it's created dynamically and stored in a temporary file that often means Gradle needs to reconfigure.
a
There's no fundamental reason why configuration caching (CC) can't be applied to sync. However, the coarse-grained caching that CC currently uses makes it kind of pointless, as generally developers run a sync when one of the inputs into the IDE model has changed and so the cache entry will not be usable.
However, one of the main goals of the Isolated Projects work is to bring this caching to sync, by making the caching finer-grained (per project), so that much more of the cached state can be reused even if some inputs have changed. The incremental caching will also be applied to task graph execution.
t
Great to hear! As for the coarse-grainess, we often have just one of a 100 modules configuration changed so CC would still be valid for the other 99 during sync. Or would it all get invalidated anyway?
a
Currently, CC is coarse-grained, so if 1 module changes and 99 stay the same, then everything is invalidated. Obviously, this isn't a great situation, but it was only intended to be a temporary one. Isolated projects (IP) basically takes CC and makes it fine-grained. So, when IP is enabled, then if 1 module changed and 99 stay the same, then only that changed module will be invalidated. For the other modules, the result would be reused from cache.
t
Oh! Now I understand, thanks for that context
Can't wait for this as it'll make larger Kotlin Multiplatform projects (and larger Android projects) way more usable!
👍 1
a
Oh yeah, absolutely.