<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello Swift Package Manager contributors<div class=""><br class=""></div><div class="">We have been working on a <b class="">PackageVersions </b>feature and we would like to hear your feedback and ideas.</div><div class=""><br class=""></div><div class=""><b class="">Idea:</b></div><div class="">We would like to generate Version information about package. The package would be able to import <b class="">PackageVersions </b>module and use that information.</div><div class=""><br class=""></div><div class=""><b class="">Use case:</b></div><div class="">A web server product provides diagnostics when it fails to connect to its port, part of this diagnostics is a dump of the version information for the socket library it uses.<br class=""></div><div class="">Real uses case - <a href="https://github.com/IBM-Swift/Kitura/pull/352/files" class="">https://github.com/IBM-Swift/Kitura/pull/352/files</a></div><div class=""><br class=""></div><div class=""><b class="">Format:</b></div><div class="">- url: a git origin of a package or local path if there is no git (package not published yet),</div><div class="">- package version</div><div class="">- version string representation</div><div class="">- SHA of of a commit made after checked <span style="font-family: Menlo; font-size: 11px;" class="">version</span></div><div class="">- modified, are there any uncommitted changes to the package.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(180, 38, 26);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> url: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">String</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span>"<a href="https://github.com/apple/swift-package-manager.git" class="">https://github.com/apple/swift-package-manager.git</a>"</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> version: (major: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">, minor: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">, patch: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">, prereleaseIdentifiers: [</span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">], buildMetadata: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">?) = (0, 2, 2, [], </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> versionString: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"0.2.2"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> sha: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">? = </span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"</span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">154cf23f74efa6c596bd25f4caa5a3bd20c78c4f"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> modified: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Bool</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">true </span></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div class="">Concerns and questions:</div><div class=""><div class="">- "We think that this should only be generated for the root-package, the rationale here is that we don't want packages writing code like if<b class=""> version.major > 2</b> as this should be a compile time language feature and Swift core are already on board with this idea.”</div></div><div class="">- Should a package have access to own dependencies VersionData information ?</div><div class=""> </div><div class="">You can find more information here.</div><div class=""><a href="https://github.com/apple/swift-package-manager/pull/122" class="">https://github.com/apple/swift-package-manager/pull/122</a></div><div class=""><a href="https://bugs.swift.org/browse/SR-473" class="">https://bugs.swift.org/browse/SR-473</a></div><div class=""><br class=""></div><div class="">Looking forward for your feedback</div><div class="">- Kostiantyn</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div>
</body></html>