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.
 
 
 

39 lines
893 B

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