I would like to know if I should store and provide a
--version flag for resulting executable and how to do it.
I have a library that is developed in SPM. It provides executable for our project. This executable has a version of its own and also a version of its dependencies.
Here I should notice that one version of one dependency is very important and could be a part of version of this executable.
I want to add
--version flag for this executable. However, to add this flag, I need to know how to store a version.
I could either store it in a code or in a resource (
VERSION file, for example) or read it from
Package.swift or even read it from its dependencies.
One of its dependencies (import dependency which version I want to see) does contain neither version flag nor version structure in a library. Actually, it is a library.
How could I solve these two problems:
- Figure out which version of import dependency I have.
- Figure out which version of result executable I have.
Share your practices, please.
( Especially you, SwiftSyntax ).