<div>Cheers,</div><div>Geordie</div><div><br></div><div><br><div class="gmail_quote"><div>Daniel Dunbar <<a href="mailto:daniel_dunbar@apple.com">daniel_dunbar@apple.com</a>> schrieb am Fr. 12. Mai 2017 um 20:33:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">We don't have explicit support for api notes in SwiftPM.</div></blockquote><div><br></div><div>Does that mean there is "unexplicit" support (maybe via swift build command line arguments)?</div><div><br></div><div>I don't mind if I have to make a build script, but it'd be a major code compatibility issue across the supported platforms if apinotes didn't work at all on Linux.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>We discussed it, and it something which probably makes sense, but no one has worked on a design or implementation yet.</div></div><div style="word-wrap:break-word"><div><br></div><div> - Daniel</div></div><div style="word-wrap:break-word"><div><br></div><div><div><blockquote type="cite"><div>On May 12, 2017, at 11:32 AM, Michael Gottesman via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br class="m_8825262421296439786Apple-interchange-newline"><div><div style="word-wrap:break-word">+Ankit<div><br></div><div>Michael</div><div><br><div><blockquote type="cite"><div>On May 12, 2017, at 10:10 AM, Geordie J via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br class="m_8825262421296439786Apple-interchange-newline"><div><div style="word-wrap:break-word"><div>To continue this thread: I managed to annotate a bunch of C APIs with modulename.apinotes. This works with Xcode (to a certain degree - pointers, enums, and especially OpaquePointers are tricky). I’m now trying to build my package with SwiftPM and it doesn’t seem to recognise the apinotes file. </div><div><br></div><div>@Doug Gregor, would you be able to advise as to whether apinotes works with SwiftPM (on Linux) and whether it requires some extra settings that I may be unaware of?</div><div><br></div><div>Thanks and best regards for the weekend,</div><div>Geordie</div><div><br></div><br><div><blockquote type="cite"><div>Am 08.05.2017 um 00:51 schrieb Geordie Jay <<a href="mailto:geojay@gmail.com" target="_blank">geojay@gmail.com</a>>:</div><br class="m_8825262421296439786Apple-interchange-newline"><div>I'm having the same issue. The renames seem to work, as in they disappear from the global scope with a fixit to rename to the new (namespaced) version if I type in the name manually, but they don't appear as static members of the enum type, regardless of how I call them. Would appreciate some help with this too.<br><br>Cheers,<br>Geordie <br><div class="gmail_quote"><div>Rick Mann <<a href="mailto:rmann@latencyzero.com" target="_blank">rmann@latencyzero.com</a>> schrieb am So. 7. Mai 2017 um 23:06:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to use apinotes for this third-party C library (call it "Lib.dylib"). It has an enum lgs_error_t:<br>
<br>
typedef enum {<br>
lgs_error_none = 0,<br>
lgs_error_invalid_handle = -1,<br>
lgs_error_null = -2,<br>
lgs_error_invalid_parameter = -3,<br>
lgs_error_invalid_operation = -4,<br>
lgs_error_queue_full = -5<br>
} lgs_error_t;<br>
<br>
So I wrote apinotes ("Lib.apinotes") that look like this, next to the .dylib, and part of my Xcode iOS app target:<br>
<br>
Enumerators:<br>
# lgs_error_t<br>
<br>
- Name: lgs_error_none<br>
SwiftName: lgs_error_t.none<br>
- Name: lgs_error_invalid_handle<br>
SwiftName: lgs_error_t.invalidHandle<br>
- Name: lgs_error_null<br>
SwiftName: lgs_error_t.nullParameter<br>
- Name: lgs_error_invalid_parameter<br>
SwiftName: lgs_error_t.invalideParameter<br>
- Name: lgs_error_invalid_operation<br>
SwiftName: lgs_error_t.invalidOperation<br>
- Name: lgs_error_queue_full<br>
SwiftName: lgs_error_t.queueFull<br>
<br>
But this line of code fails:<br>
<br>
var err: lgs_error_t = .nullParameter<br>
Type 'lgs_error_t' has no member 'nullParameter'<br>
<br>
Am I missing something else?<br>
<br>
> On May 4, 2017, at 16:55 , Douglas Gregor via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br>
><br>
><br>
>> On May 3, 2017, at 4:10 PM, Geordie J via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br>
>><br>
>> Hi everyone,<br>
>><br>
>> I’m about to start on another big project with Swift on Android and would like to annotate that JNI headers as much as possible before I do: specifically I’d like to make _Nonnull and CF_SWIFT_NAME annotations to the headers found in a user's jni.h.<br>
>><br>
>> The question is: is it possible to annotate headers this without changing the original header files? Specifically I’m looking for an options that allows annotations in a separate file, probably one that is read when loading the package’s module.modulemap.<br>
>><br>
>> I’d like to distribute the annotations in a SwiftPM package that also exposes the original (hopefully annotated) headers. Up until now I’ve been using Swift to override methods in code, but this isn’t as clean or extensible and I fear it may have other (particularly performance) implications.<br>
>><br>
>> I guess the alternative would be to just maintain and distribute a modified version of jni.h with the annotations, but that would be a "last resort” option.<br>
><br>
><br>
> This is the role of API notes, which you can see here:<br>
><br>
> <a href="https://github.com/apple/swift/tree/master/apinotes" rel="noreferrer" target="_blank">https://github.com/apple/swift/tree/master/apinotes</a><br>
><br>
> with some rough documentation-in-source here:<br>
><br>
> <a href="https://github.com/apple/swift-clang/blob/stable/lib/APINotes/APINotesYAMLCompiler.cpp" rel="noreferrer" target="_blank">https://github.com/apple/swift-clang/blob/stable/lib/APINotes/APINotesYAMLCompiler.cpp</a><br>
><br>
> - Doug<br>
><br>
> _______________________________________________<br>
> swift-users mailing list<br>
> <a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br>
<br>
--<br>
Rick Mann<br>
<a href="mailto:rmann@latencyzero.com" target="_blank">rmann@latencyzero.com</a><br>
<br>
<br>
</blockquote></div></div></blockquote></div><br></div>_______________________________________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></div></blockquote></div></div>