Skip to content

Releases: laconicman/swift-pjsip-gen

Release list

0.2.0

Choose a tag to compare

@laconicman laconicman released this 16 Oct 14:58
36b4a69

The first release that works with a current swift-pjsip, and the first whose output reflects the binary it is generated for.

Fixed

  • Guarded members are resolved, not dropped (#1). C macro guards around enum cases and struct fields used to become Swift #ifs, which are always false for a C macro, so every guarded member vanished silently, among them pj_math_stat.fmean_, the mean of every jitter and RTT statistic. Guards are now evaluated against the config_site.h shipped with the headers; a guard that cannot be evaluated fails the run.
  • Headers are found for swift-pjsip 0.2.1 and later (#2, #7). Since 0.2.1 the xcframework is a release asset, so the plugin's paths inside the checkout found nothing. SwiftPM builds now ask for the PJSIP binary target's artifact; Xcode project targets also look under SourcePackages/artifacts/. 0.1.x still works.
  • A run that finds nothing fails (#3, #8). A searchRoots entry that does not exist, a rootTypes entry no header declares, or an empty rootTypes is now an error naming the entries, in the CLI and in the plugin, instead of an empty run that exits 0.
  • Generated struct descriptions compile on their own (#4, #10). The fixed-array helper ships in each generated file that needs it, under a name that cannot collide with a consumer's own tupleToArray.

Changed

  • The package no longer depends on swift-pjsip (#5, #9). The consumer's own swift-pjsip decides the headers.
  • discoverTypes(config:pjprojectRoot:) now throws (DiscoveryError). Source-breaking for direct users of PJSIPSwiftGenCore.
  • Configs that matched nothing used to "succeed"; they now fail. Point searchRoots at [""] for the xcframework's flat Headers/.
  • A tupleToArray(_:count:as:) you wrote for the generated code is no longer needed; it does not collide with the shipped helper, so removing it is optional.
  • The plugin's fingerprint changes with the version, so Xcode asks to trust it again.

Known issues

  • The generated description of pj_ssl_sock_cb does not compile: its multi-line function-pointer members are mis-parsed. pjsua_acc_config reaches it, so add "pj_ssl_sock_cb" to skipTypes (as the README example already does for pjsip_hdr, which has a similar problem).

Use

.package(url: "https://github.com/laconicman/swift-pjsip-gen", from: "0.2.0"),

Under xcodebuild, pass -skipPackagePluginValidation.