VS2012Target.cs 2.8 KB

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