Support 'exportForwardDeclarations' internal .def file option
This commit is contained in:
committed by
SvyatoslavScherbina
parent
5c931033da
commit
2758aad1e9
+2
-1
@@ -27,5 +27,6 @@ class InteropConfiguration(
|
||||
val excludedFunctions: Set<String>,
|
||||
val strictEnums: Set<String>,
|
||||
val nonStrictEnums: Set<String>,
|
||||
val noStringConversion: Set<String>
|
||||
val noStringConversion: Set<String>,
|
||||
val exportForwardDeclarations: List<String>
|
||||
)
|
||||
+6
-2
@@ -995,12 +995,16 @@ class StubGenerator(
|
||||
}
|
||||
|
||||
fun addManifestProperties(properties: Properties) {
|
||||
properties["exportForwardDeclarations"] = nativeIndex.structs
|
||||
val exportForwardDeclarations = configuration.exportForwardDeclarations.toMutableList()
|
||||
|
||||
nativeIndex.structs
|
||||
.filter { it.def == null }
|
||||
.joinToString(" ") {
|
||||
.mapTo(exportForwardDeclarations) {
|
||||
"$cnamesStructsPackageName.${it.kotlinName}"
|
||||
}
|
||||
|
||||
properties["exportForwardDeclarations"] = exportForwardDeclarations.joinToString(" ")
|
||||
|
||||
// TODO: consider exporting Objective-C class and protocol forward refs.
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -275,7 +275,8 @@ private fun processCLib(args: Array<String>): Array<String>? {
|
||||
excludedFunctions = excludedFunctions,
|
||||
strictEnums = def.config.strictEnums.toSet(),
|
||||
nonStrictEnums = def.config.nonStrictEnums.toSet(),
|
||||
noStringConversion = def.config.noStringConversion.toSet()
|
||||
noStringConversion = def.config.noStringConversion.toSet(),
|
||||
exportForwardDeclarations = def.config.exportForwardDeclarations
|
||||
)
|
||||
|
||||
val nativeIndex = buildNativeIndex(library)
|
||||
|
||||
@@ -95,6 +95,10 @@ class DefFile(val file:File?, val config:DefFileConfig, val manifestAddendProper
|
||||
val depends by lazy {
|
||||
properties.getSpaceSeparated("depends")
|
||||
}
|
||||
|
||||
val exportForwardDeclarations by lazy {
|
||||
properties.getSpaceSeparated("exportForwardDeclarations")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user