-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-12926] provide a way to get the SHA of the current package in code #4538
Comments
@swift-ci create |
Just a thought, if we end up wanting to have a built-in rather than implement the same as a plugin that's fine as well: If we had "extensible build tools" this could rather be solved as a plugin (again, if we had those), and this way it becomes "gather some resources and put them somewhere task". I've built such thing many years ago for the java ecosystem for including git information https://github.com/git-commit-id/git-commit-id-maven-plugin what we found is that people may want to include various things, like marking things as "dev" if on some specific branch or for specific customer/build etc... It might be nice to think about this as "how do we enable building this" rather than a built-in in SPM that would be less flexible. Such plugin would want to write a resource, and then the resource would use all the normal ways to get accessed (so https://github.com/apple/swift-evolution/blob/master/proposals/0271-package-manager-resources.md ) |
Additional Detail from JIRA
md5: c119e8705c814a44ed478dbb1dec3864
relates to:
CURRENT_PROJECT_VERSION
should be defined ongenerated-xcodeproj
Issue Description:
This needs design of course but in certain cases it's really helpful if the binary contains the version (ie. the current SHA (+ a "dirty" marker if modified)) of its package in the binary. Even better if accessible in code.
Potentially we could even embed something like
Package.resolved
into the binary too so that every module could get the information for all packages.See also:
embed NIO version in binaries apple/swift-nio#684
embedded http client user-agent string should include library version swift-server/swift-aws-lambda-runtime#108
Add a User-Agent when using the Lambda Runtime API swift-server/swift-aws-lambda-runtime#98 (comment)
The text was updated successfully, but these errors were encountered: