Adam
05/05/2025, 11:35 AMorg.jetbrains.kotlin:kotlin-native-prebuilt
(which is simple - just pick the right OS-Arch variant, download and unpack), and the also the required dependencies (which is more complicated).
Each kotlin-native-prebuilt
archive contains a konan.properties
file, that (among other things), can be processed to produce the URLs of required dependencies per Kotlin Native target, e.g. <https://download.jetbrains.com/kotlin/native/resources/llvm/16.0.0-aarch64-macos/llvm-16.0.0-aarch64-macos-dev-63.tar.gz>
.
The current download dependencies utility (org.jetbrains.kotlin:kotlin-native-utils
) is slow, doesn't cache downloads, and is hard to customise.
Options:
• I see ComponentMetadataRules can add variants, and the variant can have custom files, and the URLs of the files can be explicitly specified. However, a CMR can't read files, so I can't see how to compute the dependencies from konan.properties
.
• Maybe it's possible to compute the necessary files in prior step and add them as arguments to the CMR? But I don't think that would be possible - the phases are out of order.
• I want to avoid Artifact Transforms because they're too sensitive to classpath changes. Re-running when there's any change would be very slow.Vampire
05/05/2025, 11:43 AMkotlin-native-prebuilt
at configuration time, investigate it and then do the according configuration. You probably can use a detached configuration or a dedicated named configuration to download the file with caching at configuration time and then derive the configuration you need from it. But I never tried doing something like that.