You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
961 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace BuildScript
  5. {
  6. public class BuildVersion
  7. {
  8. public BuildVersion(int major, int minor, int patch, string quality)
  9. {
  10. Major = major;
  11. Minor = minor;
  12. Patch = patch;
  13. Quality = quality;
  14. }
  15. public int Major { get; set; }
  16. public int Minor { get; set; }
  17. public int Patch { get; set; }
  18. public string Quality { get; set; }
  19. public string Suffix { get; set; }
  20. public string VersionWithoutQuality()
  21. {
  22. return $"{Major}.{Minor}.{Patch}";
  23. }
  24. public string Version()
  25. {
  26. return VersionWithoutQuality() + (Quality == null ? string.Empty : $"-{Quality}");
  27. }
  28. public string VersionWithSuffix()
  29. {
  30. return Version() + (Suffix == null ? string.Empty : $"-{Suffix}");
  31. }
  32. }
  33. }