There is any way to use modules as dependencies in...
# kotlin-native
d
There is any way to use modules as dependencies in 'konan' gradle plugin?
o
Could you please clarify, what modules you're talking about?
d
I want to move some code into separate gradle modules and define they as dependencies in application module.
Copy code
apply plugin: 'konan'

konan.targets = ['macbook']

konanArtifacts {
    program('Window')
}

dependencies {
    compile project(':domain')
}
But I found that konan plugih has no any configuraton that can be usen for dependencies.
i
Yes, the konan plugin doesn't create any configurations but you can use the
libraries
block instead. Just declare a klib in the module you want to use as dependency and add this klib in you application:
Copy code
// project :domain
konanArtifacts {
    library('domain') { ... }
}

// project :application
konanArtifacts {
    program('Window') {
        libraries {
            allLibrariesFrom project(':domain')
        }
    }
}
Such approach was used in Kotlin Spinner demo so you can use it as an example: https://github.com/JetBrains/kotlinconf-spinner
👍 1