VS2019Target.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using System;
  2. using System.IO;
  3. using System.Text;
  4. using Prebuild.Core.Attributes;
  5. using Prebuild.Core.Interfaces;
  6. using Prebuild.Core.Nodes;
  7. using Prebuild.Core.Utilities;
  8. using System.CodeDom.Compiler;
  9. namespace Prebuild.Core.Targets
  10. {
  11. /// <summary>
  12. ///
  13. /// </summary>
  14. [Target("vs2019")]
  15. public class VS2019Target : VSGenericTarget
  16. {
  17. #region Fields
  18. string solutionVersion = "12.00";
  19. string productVersion = "16.7.3";
  20. string schemaVersion = "2.0";
  21. string versionName = "Visual Studio 19";
  22. string name = "vs2019";
  23. VSVersion version = VSVersion.VS19;
  24. #endregion
  25. #region Properties
  26. /// <summary>
  27. /// Gets or sets the solution version.
  28. /// </summary>
  29. /// <value>The solution version.</value>
  30. public override string SolutionVersion
  31. {
  32. get
  33. {
  34. return solutionVersion;
  35. }
  36. }
  37. /// <summary>
  38. /// Gets or sets the product version.
  39. /// </summary>
  40. /// <value>The product version.</value>
  41. public override string ProductVersion
  42. {
  43. get
  44. {
  45. return productVersion;
  46. }
  47. }
  48. /// <summary>
  49. /// Gets or sets the schema version.
  50. /// </summary>
  51. /// <value>The schema version.</value>
  52. public override string SchemaVersion
  53. {
  54. get
  55. {
  56. return schemaVersion;
  57. }
  58. }
  59. /// <summary>
  60. /// Gets or sets the name of the version.
  61. /// </summary>
  62. /// <value>The name of the version.</value>
  63. public override string VersionName
  64. {
  65. get
  66. {
  67. return versionName;
  68. }
  69. }
  70. /// <summary>
  71. /// Gets or sets the version.
  72. /// </summary>
  73. /// <value>The version.</value>
  74. public override VSVersion Version
  75. {
  76. get
  77. {
  78. return version;
  79. }
  80. }
  81. /// <summary>
  82. /// Gets the name.
  83. /// </summary>
  84. /// <value>The name.</value>
  85. public override string Name
  86. {
  87. get
  88. {
  89. return name;
  90. }
  91. }
  92. protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
  93. {
  94. switch (frameworkVersion)
  95. {
  96. case FrameworkVersion.v4_8:
  97. case FrameworkVersion.v4_7_2:
  98. return "ToolsVersion=\"16.0\"";
  99. case FrameworkVersion.v4_7_1:
  100. case FrameworkVersion.v4_7:
  101. return "ToolsVersion=\"15.0\"";
  102. case FrameworkVersion.v4_6_2:
  103. case FrameworkVersion.v4_6_1:
  104. case FrameworkVersion.v4_6:
  105. return "ToolsVersion=\"14.0\"";
  106. case FrameworkVersion.v4_5_2:
  107. return "ToolsVersion=\"12.0\"";
  108. case FrameworkVersion.v4_5_1:
  109. case FrameworkVersion.v4_5:
  110. case FrameworkVersion.v4_0:
  111. case FrameworkVersion.v3_5:
  112. return "ToolsVersion=\"4.0\"";
  113. case FrameworkVersion.v3_0:
  114. return "ToolsVersion=\"3.0\"";
  115. default:
  116. return "ToolsVersion=\"2.0\"";
  117. }
  118. }
  119. public override string SolutionTag
  120. {
  121. get { return "# Visual Studio 19"; }
  122. }
  123. #endregion
  124. #region Constructors
  125. /// <summary>
  126. /// Initializes a new instance of the <see cref="VS2012Target"/> class.
  127. /// </summary>
  128. public VS2019Target()
  129. : base()
  130. {
  131. }
  132. #endregion
  133. }
  134. }