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

An Tran

06/28/2022, 2:34 AM
Can anyone help me to cache
./konan
folder as the information from this: https://kotlinlang.org/docs/native-improving-compilation-time.html#general-recommendations. It takes long time for me to build the shared-code, it is about 18 minutes, looks like it creates
./konan
folder everytime
j

Jim

07/06/2022, 5:37 PM
Are you having an issue locally or on like a CI system?
👀 1
a

An Tran

07/13/2022, 9:36 AM
Both of them
j

Jim

07/13/2022, 7:26 PM
I do something like this and it caches the compiler in my CI builder and never re-downloads it:
Copy code
FROM alpine:3.14 as download-compiler

# Make sure this version matches the version below
ARG VERSION=1.7.0

RUN wget <https://download.jetbrains.com/kotlin/native/builds/releases/>"${VERSION}"/linux-x86_64/kotlin-native-prebuilt-linux-x86_64-"${VERSION}".tar.gz -nv \
    && tar -xvf "kotlin-native-prebuilt-linux-x86_64-${VERSION}.tar.gz"

FROM alpine:3.14

# Make sure this version matches the version above
ARG VERSION=1.7.0

COPY --from=download-compiler kotlin-native-prebuilt-linux-x86_64-"${VERSION}" /root/.konan/kotlin-native-prebuilt-linux-x86_64-"${VERSION}"/
Are you using gradle for your mpp build? I'm surprised you're seeing this locally
21 Views