<div>Cheers,</div><div>Geordie</div><div><br></div><div><br><div class="gmail_quote"><div>Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com">daniel_dunbar@apple.com</a>&gt; 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&#39;t have explicit support for api notes in SwiftPM.</div></blockquote><div><br></div><div>Does that mean there is &quot;unexplicit&quot; support (maybe via swift build command line arguments)?</div><div><br></div><div>I don&#39;t mind if I have to make a build script, but it&#39;d be a major code compatibility issue across the supported platforms if apinotes didn&#39;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 &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; 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 &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; 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 &lt;<a href="mailto:geojay@gmail.com" target="_blank">geojay@gmail.com</a>&gt;:</div><br class="m_8825262421296439786Apple-interchange-newline"><div>I&#39;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&#39;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 &lt;<a href="mailto:rmann@latencyzero.com" target="_blank">rmann@latencyzero.com</a>&gt; 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&#39;m trying to use apinotes for this third-party C library (call it &quot;Lib.dylib&quot;). 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 (&quot;Lib.apinotes&quot;) 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 &#39;lgs_error_t&#39; has no member &#39;nullParameter&#39;<br>
<br>
Am I missing something else?<br>
<br>
&gt; On May 4, 2017, at 16:55 , Douglas Gregor via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On May 3, 2017, at 4:10 PM, Geordie J via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi everyone,<br>
&gt;&gt;<br>
&gt;&gt; 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&#39;s jni.h.<br>
&gt;&gt;<br>
&gt;&gt; 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>
&gt;&gt;<br>
&gt;&gt; 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>
&gt;&gt;<br>
&gt;&gt; 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 &quot;last resort” option.<br>
&gt;<br>
&gt;<br>
&gt; This is the role of API notes, which you can see here:<br>
&gt;<br>
&gt;       <a href="https://github.com/apple/swift/tree/master/apinotes" rel="noreferrer" target="_blank">https://github.com/apple/swift/tree/master/apinotes</a><br>
&gt;<br>
&gt; with some rough documentation-in-source here:<br>
&gt;<br>
&gt;       <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>
&gt;<br>
&gt;       - Doug<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-users mailing list<br>
&gt; <a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
&gt; <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>