I have some questions about the gradle plugins. No...
# kotlin-native
k
I have some questions about the gradle plugins. Not sure of best place to ask, so I'll post here. The K/N gradle plugin, 'konan' has a lot of control and options, and you can publish libraries to maven, but as far as I can tell, there's no way to specify those published libraries as dependencies. There's also 'kotlin-platform-native' which can also publish libraries to maven, and can ingest dependencies from maven, but only if they were published by 'kotlin-platform-native'. The 'konan' published dependencies aren't compatible with 'kotlin-platform-native' out of the box.
If you used 'kotlin-platform-native' for everything, I think you could make things work, but in my case, I need some settings that don't seem available. In the library case, I need to specify 'nativeLibraries' to include code built from C++. Downstream, I want to create an Xcode Framework, but 'kotlin-platform-native' seems only able to build a library or executable.
Are there plans to sort of merge these, or can they be used together and I'm simply not understanding how they interact?
r
I haven’t played with kotlin-platform-native much, but you can consume dependencies with konan. The syntax is a little weird. Put a
dependencies
block inside one of the configurations inside
konanArtifacts
, then add a line
artifactConfigurationName com.example:dependency:1.0
, replacing
ConfigurationName
with the name of your configuration. Most of this stuff isn’t documented yet that I’ve found so there may be better ways, but that’s what I’ve gotten working so far. See eg https://github.com/russhwolf/multiplatform-settings/blob/master/sample/shared/ios/build.gradle
k
Awesome! I suspect this stuff isn't super final, hence the no docs, but this is exactly what I'm looking for.
r
Neat. Seems like I’m probably doing more work than I need to when I’ve been configuring stuff. I had trouble making a single framework for both x64 and arm64 but it’s been at least a month or so since I really dug into that.
k
First round was pretty verbose, but I just kept poking at it. The plugin can be rough in spots, but it's well built and thought out. In the sqldelight project, I'm using this style of dependencies now, including a project dependency, and it seems to map everything OK. Now to tie things down and try to release an actual version, then to build and app (Droidcon app, actually)