2006-02-26 Marek Sieradzki <marek.sieradzki@gmail.com>
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / IProject.cs
1 //
2 // IProject.cs:
3 //
4 // Author:
5 //   Marek Sieradzki (marek.sieradzki@gmail.com)
6 // 
7 // (C) 2005 Marek Sieradzki
8 //
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:
16 //
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 //
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.
27
28 #if NET_2_0
29
30 using System;
31 using System.Collections;
32 using System.IO;
33 using System.Xml;
34
35 namespace Microsoft.Build.BuildEngine {
36         public interface IProject {
37                 void AddNewImport (string importLocation,
38                                    string importCondition);
39
40                 BuildItem AddNewItem (string itemName, string itemInclude);
41
42                 BuildItemGroup AddNewItemGroup ();
43
44                 BuildPropertyGroup AddNewPropertyGroup (bool insertAtEndOfProject);
45
46                 bool Build (string[] targetNamesToBuild,
47                             IDictionary targetOutputs);
48
49                 bool BuildTarget (string targetName,
50                                   IDictionary targetOutputs);
51
52                 bool BuildTargetWithFlags (string targetName,
53                                            IDictionary targetOutputs,
54                                            BuildSettings buildFlags);
55
56                 string[] GetConditionedPropertyValues (string propertyName);
57
58                 string[] GetDirectlyImportedProjects ();
59
60                 BuildItemGroup GetEvaluatedItemsByName (string itemName);
61
62                 BuildItemGroup GetEvaluatedItemsByNameIgnoringCondition (string itemName);
63
64                 string GetEvaluatedProperty (string propertyName);
65
66                 string[] GetNonImportedItemNames ();
67
68                 string[] GetNonImportedPropertyNames ();
69
70                 string[] GetNonImportedTargetNames ();
71
72                 string[] GetNonImportedUsingTasks ();
73
74                 string GetProjectExtensions (string id);
75
76                 void LoadFromFile (string projectFileName);
77
78                 void LoadFromXml (XmlDocument projectXml);
79
80                 void MarkProjectAsDirty ();
81
82                 void RemoveAllItemGroups ();
83
84                 void RemoveAllItemsGroupsByCondition (string condition);
85
86                 void RemoveAllPropertyGroups ();
87
88                 void RemoveAllPropertyGroupsByCondition (string condition);
89
90                 void RemoveItem (BuildItem itemToRemove);
91
92                 void RemoveItemGroup (BuildItemGroup itemGroupToRemove);
93
94                 void RemoveItemsByName (string itemName);
95
96                 void RemovePropertyGroup (BuildPropertyGroup propertyGroupToRemove);
97
98                 void ResetBuildStatus ();
99
100                 void SaveToFile (string projectFileName);
101
102                 void SaveToFile (string projectFileName,
103                                 ProjectFileEncoding encoding);
104
105                 void SaveToTextWriter (TextWriter outTextWriter);
106
107                 void SetImportedProperty (string propertyName,
108                                           string propertyValue,
109                                           string condition,
110                                           Project importedProject);
111
112                 void SetImportedPropertyAt (string propertyName,
113                                             string propertyValue,
114                                             string condition,
115                                             Project importedProject,
116                                             PropertyPosition position);
117
118                 void SetProjectExtensions (string id, string xmlText);
119
120                 void SetProperty (string propertyName, string propertyValue,
121                                   string condition);
122
123                 void SetPropertyAt (string propertyName, string propertyValue,
124                                     string condition,
125                                     PropertyPosition postition);
126
127                 void Unload ();
128
129                 bool BuildEnabled {
130                         get;
131                         set;
132                 }
133
134                 ProjectFileEncoding CurrentProjectFileEncoding {
135                         get;
136                 }
137
138                 string DefaultTargets {
139                         get;
140                         set;
141                 }
142
143                 BuildItemGroup EvaluatedItems {
144                         get;
145                 }
146
147                 BuildItemGroup EvaluatedItemsIgnoringCondition {
148                         get;
149                 }
150
151                 BuildPropertyGroup EvaluatedProperties {
152                         get;
153                 }
154
155                 string FullFileName {
156                         get;
157                 }
158
159                 BuildPropertyGroup GlobalProperties {
160                         get;
161                         set;
162                 }
163
164                 bool IsDirty {
165                         get;
166                 }
167
168                 BuildItemGroupCollection ItemGroups {
169                         get;
170                 }
171
172                 Engine ParentEngine {
173                         get;
174                 }
175
176                 BuildPropertyGroupCollection PropertyGroups {
177                         get;
178                 }
179
180                 DateTime TimeOfLastDirty {
181                         get;
182                 }
183         }
184 }
185
186 #endif