RXPromise icon indicating copy to clipboard operation
RXPromise copied to clipboard

Build warnings when using the compiled framework

Open Iftahh opened this issue 9 years ago • 3 comments

When I add RXPromise using Carthage to my project, and I have two build warnings.

At my workplace we enable the "Treat Warnings as Errors" flag so the RXPromise module can't be built -

<module-includes>
Umbrella header for module 'RXPromise' does not include header 'RXPromise+RXExtension.h'
Umbrella header for module 'RXPromise' does not include header 'RXSettledResult.h'
TestFile.m
Could not build module 'RXPromise' 

To reproduce simply start a new project, add RXPromise to Cartfile, run "carthage update", add the framework to the project, add #import <RXPromise/RXPromise.h> to one of the source files, enable the warnings-as-errors flag and attempt to compile.

The solution is very simple - at the bottom of RXPromise.h add:

#import "RXPromise+RXExtension.h"
#import "RXSettledResult.h"

I've verified it fixes the issue, but I'm not sure if you left those header files out of the Umbrella header on purpose for some reason

Iftahh avatar Jun 14 '16 07:06 Iftahh

Thanks for reporting this issue. I will take a look into it.

By the way, do you experience a related issue when including it with CocoaPods?

couchdeveloper avatar Jun 14 '16 07:06 couchdeveloper

Checked now - no, when I install using CocoaPods there are no problems.

CocoaPods generates RXPromise-umbrella.h which includes all three header files.

Iftahh avatar Jun 14 '16 08:06 Iftahh

Up until now, RXPromise didn't use a "Master Header". This means, without such a master header you have to explicitly import any of the corresponding header files.

Since this generally isn't a good idea, though - I added now such a master header. Now, you only need to import RXPromise.h - which is now the "Master Header" file. For example:

In your Objective-C sources, add

#import <RXPromise/RXPromise.h>

This header includes all public headers. Then you can use any API, for example:

    [RXPromise all: promises] ...

couchdeveloper avatar Jun 14 '16 13:06 couchdeveloper