Oops, slight correction. I finally found I wasn't including the 
module.modulemap correctly. It belongs in Modules/module.modulemap.

With that, Xcode sees the lgscolibri module. However enum renaming (the problem 
I was trying to solve initially) is still oddly broken. This pair of 
compilation errors illustrates the problem:

BLK360API.swift:664:9: Type 'lgs_status_t' has no member 'aborted'
BLK360Request.swift:657:9: 'lgs_status_aborted' has been renamed to 
'lgs_status_t.aborted'

> On Nov 29, 2017, at 16:05 , Rick Mann via swift-users <swift-users@swift.org> 
> wrote:
> 
> FWIW, I submitted an Xcode feature request via Radar:
> 
>       https://bugreport.apple.com/web/?problemID=35757360
> 
> I also have this Framework:
> 
> $ ls -Rl lgscolibri.framework 
> total 18128
> drwxr-xr-x  3 rmann  staff    96B Nov 21 16:41 Headers/
> -rwxr-xr-x  1 rmann  staff   888B Nov 21 16:41 Info.plist*
> -rwxr-xr-x  1 rmann  staff   8.9M Nov 21 16:41 lgscolibri*
> -rw-r--r--@ 1 rmann  staff   1.7K Nov 29 14:07 lgscolibri.apinotes
> -rw-r--r--@ 1 rmann  staff    69B Nov 29 15:21 module.modulemap
> 
> With the attached .apinotes and module map, and it doesn't seem to be picked 
> up by Xcode:
> 
>       BLK360API.swift:10:8: error: no such module 'lgscolibri'
>       import lgscolibri
>              ^
> 
> 
> <lgscolibri.apinotes><module.modulemap>
> 
> Note that this is Swift 3.2; does that matter? Is 4.0 better?
> 
> 
>> On Nov 2, 2017, at 13:22 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> 
>>> On Nov 1, 2017, at 14:27 , Jordan Rose <jordan_r...@apple.com> wrote:
>>> 
>>> Yep, you can! In fact, you don't even need to compile it. You can just put 
>>> the apinotes file itself into the Headers/ directory and it will work, as 
>>> long as
>>> 
>>> - the file has the same name as the framework, i.e. "MyKit.apinotes"
>>> - the framework has a proper module map
>>> 
>>> (I have a task on me to write up documentation on this but haven't gotten 
>>> around to it. It's not something most people need to do, but adapting an 
>>> existing library is one of the more likely cases.)
>> 
>> I'd sure appreciate this. We get this binary iOS Framework from a vendor and 
>> need to integrate it. They know nothing of Swift, and their header is 
>> cross-platform, so they don't have any of the proper naming conventions or 
>> macros included. I don't really know how to write a robust and complete 
>> module map or apinotes file.
>> 
>> I'd love to be able to include both of those *outside* of the framework, so 
>> that I don't have to modify their provided items in any way. But for now, I 
>> can drop both files into the Framework they provide.
>> 
>> Thanks!
>> 
>>> 
>>> Jordan
>>> 
>>> 
>>>> On Oct 30, 2017, at 18:31, Rick Mann via swift-users 
>>>> <swift-users@swift.org> wrote:
>>>> 
>>>> I'm using a third-party C library shoehorned into a Framework. It does not 
>>>> have proper ENUM macros nor an apinotes file. I'd like to add one. I'm 
>>>> using Xcode 9. 
>>>> 
>>>> • Can I put the .apinotesc file in the Framework somewhere?
>>>> • Can I make Xcode automatically compile it?
>>>> 
>>>> Thanks.
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>>> 
>>>> 
>>>> _______________________________________________
>>>> swift-users mailing list
>>>> swift-users@swift.org
>>>> https://lists.swift.org/mailman/listinfo/swift-users
>>> 
>> 
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
>> 
>> 
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> 
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users


-- 
Rick Mann
rm...@latencyzero.com


_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to