https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

hmole

02/21/2019, 7:37 AM
@h0tk3y Hey, do you by any chance know if there is a way to do a
includeBuild
dependency substition on a preset of an mpp project? In a non-mpp android module I have a dependency
mpp-module-android
, and trying to substitute it with
mpp-module
, but it fails with
Unable to find module with Gradle path
h

h0tk3y

02/21/2019, 12:43 PM
@hmole Here's a sample project where a
jvm-app
depends on an
mpp-lib
through an included build:
In the `jvm-app`'s settings script, I used:
Copy code
includeBuild("../mpp-lib") {
    dependencySubstitution {
        substitute(module("com.example.mpp.composite:mpp-lib")).with(project(":"))
    }
}
The dependency is declared as
Copy code
implementation 'com.example.mpp.composite:mpp-lib:1.0'
I believe it should work with Android, too. If it doesn't, please provide more details about your project structure so I could try reproducing it.
h

hmole

02/21/2019, 12:47 PM
Thanks, I will check it some time later
h

h0tk3y

02/21/2019, 4:43 PM
Btw, using the
mpp-lib-jvm
dependency works, too, but requires that you substitute
mpp-lib-jvm
, not just
mpp-lib
.
h

hmole

02/21/2019, 5:59 PM
Looks like it's an IDE's sync problem. Builds fine from console. Thanks for help
h

h0tk3y

02/21/2019, 6:11 PM
Ok, if you can reproduce it, could you please report this to kotl.in/issue or describe it here?
h

hmole

02/22/2019, 9:38 AM
I don't think I could. It's and android app project which `includeBuild`s android multimodle project which `includeBuild`'s android-mpp multimodule project. Not easy to make a minimal reproducer
3 Views