Hello everyone. I have `build-logic-a` and `build-...
# gradle
a
Hello everyone. I have
build-logic-a
and
build-logic-b
and all in the same project
settings.gradle.kts
Copy code
pluginManagement {
    includeBuild("./build-logic-a")
    includeBuild("./build-logic-b")
}
I need to use
build-logic-a
as dependency to
build-logic-b
build-logic-a/build.gradle.kts
Copy code
plugins {
    `kotlin-dsl`
}

repositories {
    gradlePluginPortal()
    mavenCentral()
}

group = "com.example"
version = "0.0.0"
and
build-logic-b/build.gradle.kts
looks like this
Copy code
plugins {
    `kotlin-dsl`
}

repositories {
    gradlePluginPortal()
    mavenCentral()
}

dependencies {
  api("com.example:build-logic-a:*")
}
The problem is that,
build-logic-b
is trying to fetch
com.example:build-logic-b
from the defined repositories instead of resolving from their current folders. How do I solve this?
m
I would try to do include builds of included builds
settings.gradle.kts
Copy code
pluginManagement {
    includeBuild("./build-logic-b")
}
build-logic-b/settings.gradle.kts
Copy code
includeBuild("../build-logic-a")
☝️ 1
all the way down
v
Actually, you might need both includes of a
In b for compiling, in root for using
m
I think I’ve seen it working without but I would definitely not put my hand on it 😅
a
Thanks @mbonnin I had to include a in both
👍 1
v
If you seen it working Martin, maybe it was only included in B, but was compatible with the A that was published and then the published A was used in root. 🤷‍♂️ It should usually be the same as with repositories that do not propagate. If A uses repo "foo" for a dependency, then B also has to declare "foo" manually as dependency repo and the root build as plugin repo.
👍🏾 1
👍 1
m
Yep, that was probably it! It was a long time ago 😄! In all cases, thanks for the follow up @andylamax!
a
Thanks for the explanation @Vampire
👌 1