Hi there, anyone know how I might provide a custom...
# kotlin-native
m
Hi there, anyone know how I might provide a custom cinterop def file when using a cocoapod? For some context, I am wanting to use a framework in a cocoapod which contains C++ and C header files, but am wanting to specify header filters to ignore the C++ headers, otherwise cinterop fails. Downloading the framework and referencing it locally works using the header filter, but curious as to whether I can specify this when using a cocoapod. Thanks, Michael
k
I’m not sure if I understand your request properly, but I think this might work:
Copy code
tasks.named<org.jetbrains.kotlin.gradle.tasks.DefFileTask>("generateDefPod").configure {
    doLast {
        outputFile.writeText("""
            language = Objective-C
            headers = <CustomHeaderFile>
        """)
    }
}
for dependency called
Pod
. Note that you should replace
generateDefPod
with the name of the task according to the pod name you are using
m
This is perfect thank you!