version.rs 957 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. pub fn version_string() -> String {
  2. format!("librespot-{}", short_sha())
  3. }
  4. // Generate a timestamp representing now (UTC) in RFC3339 format.
  5. pub fn now() -> &'static str {
  6. env!("VERGEN_BUILD_TIMESTAMP")
  7. }
  8. // Generate a timstamp string representing now (UTC).
  9. pub fn short_now() -> &'static str {
  10. env!("VERGEN_BUILD_DATE")
  11. }
  12. // Generate a SHA string
  13. pub fn sha() -> &'static str {
  14. env!("VERGEN_SHA")
  15. }
  16. // Generate a short SHA string
  17. pub fn short_sha() -> &'static str {
  18. env!("VERGEN_SHA_SHORT")
  19. }
  20. // Generate the commit date string
  21. pub fn commit_date() -> &'static str {
  22. env!("VERGEN_COMMIT_DATE")
  23. }
  24. // Generate the target triple string
  25. pub fn target() -> &'static str {
  26. env!("VERGEN_TARGET_TRIPLE")
  27. }
  28. // Generate a semver string
  29. pub fn semver() -> &'static str {
  30. // env!("VERGEN_SEMVER")
  31. env!("CARGO_PKG_VERSION")
  32. }
  33. // Generate a random build id.
  34. pub fn build_id() -> &'static str {
  35. env!("VERGEN_BUILD_ID")
  36. }