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

felislynx

04/07/2021, 6:58 AM
Hi, i want to add new module to project which will be multiplatform shared module. Inside it i want to add dependency on another project. In groovy format it was like:
Copy code
include ':OtherProject'
project(':OtherProject').projectDir = new File('../other_project/module')
How to achieve that in KTS format?
c

CLOVIS

04/07/2021, 7:19 AM
You can just write
implementation(project(":projectNameHere"))
Here's an example: the project
compose/common
depends on
client
. (Both are Multiplattorm) https://gitlab.com/braindot/clovis/-/blob/master/compose/common/build.gradle.kts#L21
f

felislynx

04/07/2021, 7:24 AM
@CLOVIS it is not exactly ma case. Project that i want to include
is in other dir
--Workspaces | -- Project A | --- app | --- multiplatformModule | -- Project B | --- moduleX
so multiplatform module need to add moduleX as dependency
app is using old groovy scripts and sees moduleX, multiplatform module uses kts and doesn't see moduleX as dependency
In your example moduleX would be inside Project A not Project B
k

kqr

04/07/2021, 8:30 AM
Copy code
include(":asasd")
project(":adasd").projectDir = File("abc")
?
f

felislynx

04/07/2021, 8:50 AM
Heh @kqr worked after invalidate caches and restart -_-
🧙‍♂️ 1