Norbi
09/11/2023, 8:01 AMroot
|- shared
|- project1
|- project2
and
// in root's settings.gradle.kts
includeBuild("shared")
includeBuild("project1")
includeBuild("project2")
// in project1's settings.gradle.kts
includeBuild("../shared")
// in project2's settings.gradle.kts
includeBuild("../shared")
Thanks.CLOVIS
09/11/2023, 8:07 AMβ’ Multiple composite builds may conflict when run in parallel, if more than one includes the same build. Gradle does not share the project lock of a shared composite build to between Gradle invocation to prevent concurrent execution.https://docs.gradle.org/current/userguide/composite_builds.html#current_limitations_and_future_work
Vampire
09/11/2023, 9:22 AMVampire
09/11/2023, 9:22 AMVampire
09/11/2023, 9:23 AMproject1
in one console and proejct2
in another console at the same timeVampire
09/11/2023, 9:23 AMNorbi
09/11/2023, 10:00 AMnot buildHm, I'm curious whether Idea takes it into account when building the root project...in one console andproject1
in another console at the same timeproejct2
Vampire
09/11/2023, 10:35 AMVampire
09/11/2023, 10:36 AMNorbi
09/11/2023, 10:41 AMPlease look at the channel topic to find that your question is off-topic πI was specifically interested in multi-module Kotlin Multiplatform project behaviour. Mainly because there were lots of issues with KMP and included builds in the past years. I didn't know at the start of the discussion that this is a core Gradle limitation... π
Vampire
09/11/2023, 10:45 AMCLOVIS
09/11/2023, 12:21 PMHm, I'm curious whether Idea takes it into account when building the root project...It does not.
Vampire
09/11/2023, 12:21 PMCLOVIS
09/11/2023, 12:22 PMjust make sure to not run those projects in parallelit will also happen when you execute any command that requires to compile both projects with
--parallel
enabled (which is the default nowadays), for example ./gradlew check
CLOVIS
09/11/2023, 12:22 PMIt does not what?If you start multiple run configurations, IDEA will start multiple Gradle daemons to satisfy them, in parallel.
Vampire
09/11/2023, 12:35 PMroot
build I'd expect it to work properly.Vampire
09/11/2023, 12:35 PM--parallel
is not the defaultVampire
09/11/2023, 12:35 PMVampire
09/11/2023, 12:36 PM--parallel
CLOVIS
09/11/2023, 12:37 PM--parallel
.Vampire
09/11/2023, 12:38 PMVampire
09/11/2023, 12:38 PMCLOVIS
09/11/2023, 12:39 PMVampire
09/11/2023, 12:39 PM--parallel
just enables running tasks of different projects if they are decoupled and is completely independentVampire
09/11/2023, 12:40 PMVampire
09/11/2023, 12:40 PM[...]
However, you should see build performance improvement immediately because tasks will run in parallel.
[...]
β’ All tasks run in parallel by default, subject to dependency constraints.
Vampire
09/11/2023, 12:41 PMCLOVIS
09/11/2023, 12:41 PM