mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce a new flag `-export-as` to specify a name used to identify the target module in swiftinterfaces. This provides an analoguous feature for Swift module as Clang's `export_as` feature. In practice it should be used when a lower level module `MyKitCore` is desired to be shown publicly as a downstream module `MyKit`. This should be used in conjunction with `@_exported import MyKitCore` from `MyKit` that allows clients to refer to all services as being part of `MyKit`, while the new `-export-as MyKit` from `MyKitCore` will ensure that the clients swiftinterfaces also use the `MyKit` name for all services. In the current implementation, the export-as name is used in the module's clients and not in the declarer's swiftinterface (e.g. `MyKitCore`'s swiftinterface still uses the `MyKitCore` module name). This way the module swiftinterface can be verified. In the future, we may want a similar behavior for other modules in between `MyKitCore` and `MyKit` as verifying a swiftinterface referencing `MyKit` without it being imported would fail. rdar://103888618
21 KiB
21 KiB