https://kotlinlang.org logo
m

max.denissov

06/07/2019, 7:33 AM
Hello! I am trying add web client in my kotlin multiplatform project (Android/iOS work fine), but I am in a deep trouble with a module dependencies in a JS code.
d

Dico

06/07/2019, 11:03 AM
Please, please remove the code and put it in a reply to your thread using a code block, enclosed by 3 back ticks (`).
I think you're using an old version of the multiplatform plugin / kotlin
m

max.denissov

06/07/2019, 1:37 PM
Copy code
module: common_domain
has class : User

module: common_client
has dependency: common_domain
has class : UserInfoPresenter

app: web
has dependency: common_client

I can not use the UserInfoPresenter, all classes are available from common_domain but not from common_client.




/** Web App **/

dependencies {
   implementation project(':common_client')

}

/** Common client **/

targets {
    fromPreset(presets.js, 'js')
}

/** Common domain **/

targets {
    js() {
       configure([compilations.main, compilations.test]) {
           tasks.getByName(compileKotlinTaskName).kotlinOptions {
               sourceMap = true
               moduleKind = "commonjs"
               metaInfo = true
           }
       }

       configure(compilations.main) {
           tasks.getByName(compileKotlinTaskName).kotlinOptions {
               main = "call"
           }
       }
   }
}
I found that problem only with Intellij Idea import highlight. The Idea doesn’t recognize imports but the gradle task build a code.
d

Dico

06/07/2019, 2:12 PM
Are you using
implementation
to declare dependencies?
m

max.denissov

06/10/2019, 4:15 AM
Copy code
/** Web App **/

dependencies {
   implementation project(':common_client')

}
d

Dico

06/10/2019, 10:42 AM
Try using
api