Rainer Schlonvoigt
01/07/2022, 2:24 PMSet<SomeInterface>
translates badly into Swift. While i understand why the language allows for it, i would like to forbid it for our own projects. Does anybody have an idea how to best achieve this?Rainer Schlonvoigt
01/07/2022, 2:51 PMdef iosFrameworkName = kotlin.cocoapods.frameworkName
['DEBUG', 'RELEASE'].forEach { config ->
def frameworkArm64 = kotlin.targets.iosArm64.binaries.getFramework("${config}")
def frameworkX64 = kotlin.targets.iosX64.binaries.getFramework("${config}")
[frameworkArm64, frameworkX64].forEach { framework ->
framework.linkTask.doLast {
new File(framework.outputFile, "Headers/${iosFrameworkName}.h").eachLine {line ->
if (line.contains('NSSet<id<')) {
throw new Exception("Stop using Set<SomeInterface> on public API! violater: $line")
}
}
}
}
}
Rainer Schlonvoigt
01/07/2022, 2:52 PM