Hi there, in Android studio I have project structu...
# community-support
s
Hi there, in Android studio I have project structure like this StudioProjects/ ├── kmm-pw-pitara/ │ ├── settings.gradle[.kts] │ └── build.gradle[.kts] └── penpencil/ ├── settings.gradle[.kts] └── ai/ └── ai-mentor-kmp/ └── build.gradle.kts How can I access ai/ai-mentor-kmp inside kmp-pw-pitara/build.gradle.kts ?
I have added kmm-pw-pitara at root project settings.gradle
Copy code
includeBuild('../kmm-pw-pitara')
and in kmm-pw-pitara project's
settings.gradle
I have added like this
Copy code
includeBuild("../penpencil") {
    dependencySubstitution {
        substitute(module("ai:ai-mentor-kmp"))
            .using(project(":ai-mentor-kmp"))
    }
}
still no luck when I try inside kmm-pw-pitara
Copy code
implementation(project(":ai:ai-mentor-kmp"))
n
you should not declare dependencies on the project, instead you should depend on the binaries produced by the included build. Gradle will handle the substitution for you. https://docs.gradle.org/current/userguide/composite_builds.html
s
binaries produced
you mean local/central maven binaries??
can hardcoded project dependencies possible @Niels Doucet?
n
just reference the maven coordinates produced by the module you're trying to depend on. Gradle will translate that to project coordinates when it's in a composite build.
b
You need to set the group on ai-mentor, e.g.:
group = penpencil
and then in the consumer build:
implementation("penpencil:ai-mentor-kmp")
s
@Benedikt Ritter you mean should I publish to maven with the
group = penpencil
name??
b
No, I'm just saying you need to configure a group in order to use the
group:artifact
notation.
s
I see let me do this and check...