PageRenderTime 56ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/Microsoft.Build/Microsoft.Build/Microsoft/Build/Execution/BuildRequestData.cs

#
C# | 182 lines | 166 code | 16 blank | 0 comment | 6 complexity | 15d42e3e523f15c0623f6afc6b230351 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-3.0
  1. namespace Microsoft.Build.Execution
  2. {
  3. using Microsoft.Build.Collections;
  4. using Microsoft.Build.Shared;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime;
  8. using System.Runtime.CompilerServices;
  9. public class BuildRequestData
  10. {
  11. [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  12. public BuildRequestData(Microsoft.Build.Execution.ProjectInstance projectInstance, string[] targetsToBuild) : this(projectInstance, targetsToBuild, null, BuildRequestDataFlags.None)
  13. {
  14. }
  15. [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  16. public BuildRequestData(Microsoft.Build.Execution.ProjectInstance projectInstance, string[] targetsToBuild, Microsoft.Build.Execution.HostServices hostServices) : this(projectInstance, targetsToBuild, hostServices, BuildRequestDataFlags.None)
  17. {
  18. }
  19. private BuildRequestData(string[] targetsToBuild, Microsoft.Build.Execution.HostServices hostServices, BuildRequestDataFlags flags)
  20. {
  21. ErrorUtilities.VerifyThrowArgumentNull(targetsToBuild, "targetsToBuild");
  22. this.HostServices = hostServices;
  23. this.TargetNames = new List<string>(targetsToBuild);
  24. this.Flags = flags;
  25. }
  26. public BuildRequestData(Microsoft.Build.Execution.ProjectInstance projectInstance, string[] targetsToBuild, Microsoft.Build.Execution.HostServices hostServices, BuildRequestDataFlags flags) : this(targetsToBuild, hostServices, flags)
  27. {
  28. ErrorUtilities.VerifyThrowArgumentNull(projectInstance, "projectInstance");
  29. ErrorUtilities.VerifyThrowArgument((hostServices == null) || (hostServices.GetNodeAffinity(projectInstance.FullPath) != NodeAffinity.OutOfProc), "ProjectInstanceConflictsWithAffinity");
  30. foreach (string str in targetsToBuild)
  31. {
  32. ErrorUtilities.VerifyThrowArgumentNull(str, "target");
  33. }
  34. this.ProjectInstance = projectInstance;
  35. this.ProjectFullPath = projectInstance.FullPath;
  36. this.GlobalPropertiesDictionary = projectInstance.GlobalPropertiesDictionary;
  37. this.ExplicitlySpecifiedToolsVersion = null;
  38. }
  39. [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  40. public BuildRequestData(string projectFullPath, IDictionary<string, string> globalProperties, string toolsVersion, string[] targetsToBuild, Microsoft.Build.Execution.HostServices hostServices) : this(projectFullPath, globalProperties, toolsVersion, targetsToBuild, hostServices, BuildRequestDataFlags.None)
  41. {
  42. }
  43. public BuildRequestData(string projectFullPath, IDictionary<string, string> globalProperties, string toolsVersion, string[] targetsToBuild, Microsoft.Build.Execution.HostServices hostServices, BuildRequestDataFlags flags) : this(targetsToBuild, hostServices, flags)
  44. {
  45. ErrorUtilities.VerifyThrowArgumentLength(projectFullPath, "projectFullPath");
  46. ErrorUtilities.VerifyThrowArgumentNull(globalProperties, "globalProperties");
  47. this.ProjectFullPath = FileUtilities.NormalizePath(projectFullPath);
  48. this.TargetNames = (ICollection<string>) targetsToBuild.Clone();
  49. this.GlobalPropertiesDictionary = new PropertyDictionary<ProjectPropertyInstance>(globalProperties.Count);
  50. foreach (KeyValuePair<string, string> pair in globalProperties)
  51. {
  52. this.GlobalPropertiesDictionary.Set(new ProjectPropertyInstance(pair.Key, pair.Value));
  53. }
  54. this.ExplicitlySpecifiedToolsVersion = toolsVersion;
  55. }
  56. public string ExplicitlySpecifiedToolsVersion
  57. {
  58. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  59. get
  60. {
  61. return this.<ExplicitlySpecifiedToolsVersion>k__BackingField;
  62. }
  63. [CompilerGenerated]
  64. private set
  65. {
  66. this.<ExplicitlySpecifiedToolsVersion>k__BackingField = value;
  67. }
  68. }
  69. internal bool ExplicitToolsVersionSpecified
  70. {
  71. get
  72. {
  73. return (this.ExplicitlySpecifiedToolsVersion != null);
  74. }
  75. }
  76. public BuildRequestDataFlags Flags
  77. {
  78. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  79. get
  80. {
  81. return this.<Flags>k__BackingField;
  82. }
  83. [CompilerGenerated]
  84. private set
  85. {
  86. this.<Flags>k__BackingField = value;
  87. }
  88. }
  89. public ICollection<ProjectPropertyInstance> GlobalProperties
  90. {
  91. get
  92. {
  93. if (this.GlobalPropertiesDictionary != null)
  94. {
  95. return new ReadOnlyCollection<ProjectPropertyInstance>(this.GlobalPropertiesDictionary);
  96. }
  97. return ReadOnlyEmptyCollection<ProjectPropertyInstance>.Instance;
  98. }
  99. }
  100. internal PropertyDictionary<ProjectPropertyInstance> GlobalPropertiesDictionary
  101. {
  102. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  103. get
  104. {
  105. return this.<GlobalPropertiesDictionary>k__BackingField;
  106. }
  107. [CompilerGenerated]
  108. private set
  109. {
  110. this.<GlobalPropertiesDictionary>k__BackingField = value;
  111. }
  112. }
  113. public Microsoft.Build.Execution.HostServices HostServices
  114. {
  115. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  116. get
  117. {
  118. return this.<HostServices>k__BackingField;
  119. }
  120. [CompilerGenerated]
  121. private set
  122. {
  123. this.<HostServices>k__BackingField = value;
  124. }
  125. }
  126. public string ProjectFullPath
  127. {
  128. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  129. get
  130. {
  131. return this.<ProjectFullPath>k__BackingField;
  132. }
  133. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  134. internal set
  135. {
  136. this.<ProjectFullPath>k__BackingField = value;
  137. }
  138. }
  139. public Microsoft.Build.Execution.ProjectInstance ProjectInstance
  140. {
  141. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  142. get
  143. {
  144. return this.<ProjectInstance>k__BackingField;
  145. }
  146. [CompilerGenerated]
  147. private set
  148. {
  149. this.<ProjectInstance>k__BackingField = value;
  150. }
  151. }
  152. public ICollection<string> TargetNames
  153. {
  154. [CompilerGenerated, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
  155. get
  156. {
  157. return this.<TargetNames>k__BackingField;
  158. }
  159. [CompilerGenerated]
  160. private set
  161. {
  162. this.<TargetNames>k__BackingField = value;
  163. }
  164. }
  165. }
  166. }