5 // Marek Sieradzki (marek.sieradzki@gmail.com)
7 // (C) 2005 Marek Sieradzki
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
35 namespace Microsoft.Build.BuildEngine {
36 public interface IProject {
37 void AddNewImport (string importLocation,
38 string importCondition);
40 BuildItem AddNewItem (string itemName, string itemInclude);
42 BuildItemGroup AddNewItemGroup ();
44 BuildPropertyGroup AddNewPropertyGroup (bool insertAtEndOfProject);
46 bool Build (string[] targetNamesToBuild,
47 IDictionary targetOutputs);
49 bool BuildTarget (string targetName,
50 IDictionary targetOutputs);
52 bool BuildTargetWithFlags (string targetName,
53 IDictionary targetOutputs,
54 BuildSettings buildFlags);
56 string[] GetConditionedPropertyValues (string propertyName);
58 string[] GetDirectlyImportedProjects ();
60 BuildItemGroup GetEvaluatedItemsByName (string itemName);
62 BuildItemGroup GetEvaluatedItemsByNameIgnoringCondition (string itemName);
64 string GetEvaluatedProperty (string propertyName);
66 string[] GetNonImportedItemNames ();
68 string[] GetNonImportedPropertyNames ();
70 string[] GetNonImportedTargetNames ();
72 string[] GetNonImportedUsingTasks ();
74 string GetProjectExtensions (string id);
76 void LoadFromFile (string projectFileName);
78 void LoadFromXml (XmlDocument projectXml);
80 void MarkProjectAsDirty ();
82 void RemoveAllItemGroups ();
84 void RemoveAllItemsGroupsByCondition (string condition);
86 void RemoveAllPropertyGroups ();
88 void RemoveAllPropertyGroupsByCondition (string condition);
90 void RemoveItem (BuildItem itemToRemove);
92 void RemoveItemGroup (BuildItemGroup itemGroupToRemove);
94 void RemoveItemsByName (string itemName);
96 void RemovePropertyGroup (BuildPropertyGroup propertyGroupToRemove);
98 void ResetBuildStatus ();
100 void SaveToFile (string projectFileName);
102 void SaveToFile (string projectFileName,
103 ProjectFileEncoding encoding);
105 void SaveToTextWriter (TextWriter outTextWriter);
107 void SetImportedProperty (string propertyName,
108 string propertyValue,
110 Project importedProject);
112 void SetImportedPropertyAt (string propertyName,
113 string propertyValue,
115 Project importedProject,
116 PropertyPosition position);
118 void SetProjectExtensions (string id, string xmlText);
120 void SetProperty (string propertyName, string propertyValue,
123 void SetPropertyAt (string propertyName, string propertyValue,
125 PropertyPosition postition);
134 ProjectFileEncoding CurrentProjectFileEncoding {
138 string DefaultTargets {
143 BuildItemGroup EvaluatedItems {
147 BuildItemGroup EvaluatedItemsIgnoringCondition {
151 BuildPropertyGroup EvaluatedProperties {
155 string FullFileName {
159 BuildPropertyGroup GlobalProperties {
168 BuildItemGroupCollection ItemGroups {
172 Engine ParentEngine {
176 BuildPropertyGroupCollection PropertyGroups {
180 DateTime TimeOfLastDirty {