Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is export * in module.modulemap file inside each framework?

I have created one framework named Communication, inside framework container there is one module.modulemap file.

module.modulemap

framework module Communication {
  umbrella header "Communication.h"

  export *
  module * { export * }
}

I can understand that module required umbrella header to expose it to containing application/target.

But what is meaning of other two lines of code.

  export *
  module * { export * }

If any have idea what this lines exporting ?

like image 329
technerd Avatar asked Oct 31 '17 12:10

technerd


People also ask

What is a Modulemap file?

Modulemap exposes C header files for external binaries. It is a bridge between module and headers. Modulemap helps to convert #include, #import -> @import because it has a mapping between module name and headers inside. Also modulemap helps to create standalone additional modules and submodules.

What is module in Xcode?

Module: A set of parts that can be assembled into a structure. To Xcode, that means you can have a group of lines of code that you can (re)use in different places without having to write that code again.

What is umbrella header IOS?

The umbrella header is the 'master' header file for a framework. Its use is that you can write #import <UIKit/UIKit.h>


1 Answers

Objective-C Module Map(.modulemap) for Objective-C and Swift

Objective-C language exposes API thought .modulemap for Objective-C and Swift languages

[ObjC Module]

[Custom .modulemap]

It is about LLVM Modules and Module Map Language. Modulemap exposes C header files for external binaries. It is a bridge between module and headers. Modulemap helps to convert #include, #import -> @import because it has a mapping between module name and headers inside. Also modulemap helps to create standalone additional modules and submodules. Modulemap can contains a lot of modules(only one has to have the same name as product name) and a lot of submodules

//Objective-C exposes API thought .modulemap for Objective-C and Swift

.h.m uses .h.m = Objective-C consumer, Objective-C producer = .modulemap
.swift uses .h.m = Swift consumer, Objective-C producer = .modulemap

Framework which includes .modulemap is called Modular Framework. Path:

module_name.framework/Modules/module_name.modulemap

Setup

  • When you create a library[Example] you should create and setup it manually
  • When you create a framework[Example] it is setup automatically

Even if you create Swift framework Xcode automatically creates modulemap

[Mixing Objective-C and Swift in the same Application]

like image 68
yoAlex5 Avatar answered Sep 23 '22 05:09

yoAlex5