diff options
104 files changed, 10586 insertions, 15258 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index 53ed115..0f3f48e 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Linq; | 31 | using System.Linq; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | ||
33 | using log4net; | 34 | using log4net; |
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
@@ -60,7 +61,6 @@ namespace OpenSim.Capabilities.Handlers | |||
60 | m_Scene = s; | 61 | m_Scene = s; |
61 | } | 62 | } |
62 | 63 | ||
63 | |||
64 | public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 64 | public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
65 | { | 65 | { |
66 | //m_log.DebugFormat("[XXX]: FetchInventoryDescendentsRequest in {0}, {1}", (m_Scene == null) ? "none" : m_Scene.Name, request); | 66 | //m_log.DebugFormat("[XXX]: FetchInventoryDescendentsRequest in {0}, {1}", (m_Scene == null) ? "none" : m_Scene.Name, request); |
@@ -93,8 +93,8 @@ namespace OpenSim.Capabilities.Handlers | |||
93 | 93 | ||
94 | ArrayList foldersrequested = (ArrayList)hash["folders"]; | 94 | ArrayList foldersrequested = (ArrayList)hash["folders"]; |
95 | 95 | ||
96 | string response = ""; | 96 | StringBuilder tmpresponse = new StringBuilder(1024); |
97 | string bad_folders_response = ""; | 97 | StringBuilder tmpbadfolders = new StringBuilder(1024); |
98 | 98 | ||
99 | List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>(); | 99 | List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>(); |
100 | for (int i = 0; i < foldersrequested.Count; i++) | 100 | for (int i = 0; i < foldersrequested.Count; i++) |
@@ -113,10 +113,7 @@ namespace OpenSim.Capabilities.Handlers | |||
113 | continue; | 113 | continue; |
114 | } | 114 | } |
115 | 115 | ||
116 | // Filter duplicate folder ids that bad viewers may send | 116 | folders.Add(llsdRequest); |
117 | if (folders.Find(f => f.folder_id == llsdRequest.folder_id) == null) | ||
118 | folders.Add(llsdRequest); | ||
119 | |||
120 | } | 117 | } |
121 | 118 | ||
122 | if (folders.Count > 0) | 119 | if (folders.Count > 0) |
@@ -136,49 +133,44 @@ namespace OpenSim.Capabilities.Handlers | |||
136 | string inventoryitemstr = string.Empty; | 133 | string inventoryitemstr = string.Empty; |
137 | foreach (InventoryCollectionWithDescendents icoll in invcollSet) | 134 | foreach (InventoryCollectionWithDescendents icoll in invcollSet) |
138 | { | 135 | { |
139 | LLSDInventoryDescendents reply = ToLLSD(icoll.Collection, icoll.Descendents); | 136 | LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents); |
140 | 137 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(thiscontents); | |
141 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); | 138 | // inventoryitemstr = inventoryitemstr.Replace("<llsd>", ""); |
142 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); | 139 | // inventoryitemstr = inventoryitemstr.Replace("</llsd>", ""); |
143 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); | 140 | // inventoryitemstr = inventoryitemstr.Substring(6,inventoryitemstr.Length - 13); |
144 | 141 | // tmpresponse.Append(inventoryitemstr); | |
145 | response += inventoryitemstr; | 142 | tmpresponse.Append(inventoryitemstr.Substring(6,inventoryitemstr.Length - 13)); |
146 | } | 143 | } |
147 | 144 | ||
148 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders)); | 145 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders)); |
149 | foreach (UUID bad in bad_folders) | 146 | foreach (UUID bad in bad_folders) |
150 | bad_folders_response += "<uuid>" + bad + "</uuid>"; | 147 | { |
148 | tmpbadfolders.Append("<map><key>folder_id</key><uuid>"); | ||
149 | tmpbadfolders.Append(bad.ToString()); | ||
150 | tmpbadfolders.Append("</uuid><key>error</key><string>Unknown</string></map>"); | ||
151 | } | ||
151 | } | 152 | } |
152 | 153 | ||
153 | if (response.Length == 0) | 154 | StringBuilder lastresponse = new StringBuilder(1024); |
155 | lastresponse.Append("<llsd>"); | ||
156 | if(tmpresponse.Length > 0) | ||
154 | { | 157 | { |
155 | /* Viewers expect a bad_folders array when not available */ | 158 | lastresponse.Append("<map><key>folders</key><array>"); |
156 | if (bad_folders_response.Length != 0) | 159 | lastresponse.Append(tmpresponse.ToString()); |
157 | { | 160 | lastresponse.Append("</array></map>"); |
158 | response = "<llsd><map><key>bad_folders</key><array>" + bad_folders_response + "</array></map></llsd>"; | ||
159 | } | ||
160 | else | ||
161 | { | ||
162 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; | ||
163 | } | ||
164 | } | 161 | } |
165 | else | 162 | else |
163 | lastresponse.Append("<map><key>folders</key><array /></map>"); | ||
164 | |||
165 | if(tmpbadfolders.Length > 0) | ||
166 | { | 166 | { |
167 | if (bad_folders_response.Length != 0) | 167 | lastresponse.Append("<map><key>bad_folders</key><array>"); |
168 | { | 168 | lastresponse.Append(tmpbadfolders.ToString()); |
169 | response = "<llsd><map><key>folders</key><array>" + response + "</array><key>bad_folders</key><array>" + bad_folders_response + "</array></map></llsd>"; | 169 | lastresponse.Append("</array></map>"); |
170 | } | ||
171 | else | ||
172 | { | ||
173 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; | ||
174 | } | ||
175 | } | 170 | } |
171 | lastresponse.Append("</llsd>"); | ||
176 | 172 | ||
177 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request for {0} folders. Item count {1}", folders.Count, item_count); | 173 | return lastresponse.ToString(); |
178 | //m_log.Debug("[WEB FETCH INV DESC HANDLER] " + response); | ||
179 | |||
180 | return response; | ||
181 | |||
182 | } | 174 | } |
183 | 175 | ||
184 | /// <summary> | 176 | /// <summary> |
@@ -240,24 +232,19 @@ namespace OpenSim.Capabilities.Handlers | |||
240 | return reply; | 232 | return reply; |
241 | } | 233 | } |
242 | 234 | ||
243 | private LLSDInventoryDescendents ToLLSD(InventoryCollection inv, int descendents) | 235 | private LLSDInventoryFolderContents contentsToLLSD(InventoryCollection inv, int descendents) |
244 | { | 236 | { |
245 | LLSDInventoryDescendents reply = new LLSDInventoryDescendents(); | ||
246 | LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents(); | 237 | LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents(); |
247 | contents.agent_id = inv.OwnerID; | 238 | contents.agent_id = inv.OwnerID; |
248 | contents.owner_id = inv.OwnerID; | 239 | contents.owner_id = inv.OwnerID; |
249 | contents.folder_id = inv.FolderID; | 240 | contents.folder_id = inv.FolderID; |
250 | 241 | ||
251 | reply.folders.Array.Add(contents); | ||
252 | |||
253 | if (inv.Folders != null) | 242 | if (inv.Folders != null) |
254 | { | 243 | { |
255 | foreach (InventoryFolderBase invFolder in inv.Folders) | 244 | foreach (InventoryFolderBase invFolder in inv.Folders) |
256 | { | 245 | { |
257 | contents.categories.Array.Add(ConvertInventoryFolder(invFolder)); | 246 | contents.categories.Array.Add(ConvertInventoryFolder(invFolder)); |
258 | } | 247 | } |
259 | |||
260 | descendents += inv.Folders.Count; | ||
261 | } | 248 | } |
262 | 249 | ||
263 | if (inv.Items != null) | 250 | if (inv.Items != null) |
@@ -271,7 +258,7 @@ namespace OpenSim.Capabilities.Handlers | |||
271 | contents.descendents = descendents; | 258 | contents.descendents = descendents; |
272 | contents.version = inv.Version; | 259 | contents.version = inv.Version; |
273 | 260 | ||
274 | return reply; | 261 | return contents; |
275 | } | 262 | } |
276 | /// <summary> | 263 | /// <summary> |
277 | /// Old style. Soon to be deprecated. | 264 | /// Old style. Soon to be deprecated. |
@@ -285,8 +272,8 @@ namespace OpenSim.Capabilities.Handlers | |||
285 | { | 272 | { |
286 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request for {0} folders", foldersrequested.Count); | 273 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request for {0} folders", foldersrequested.Count); |
287 | 274 | ||
288 | string response = ""; | 275 | StringBuilder tmpresponse = new StringBuilder(1024); |
289 | string bad_folders_response = ""; | 276 | StringBuilder tmpbadfolders = new StringBuilder(1024); |
290 | 277 | ||
291 | for (int i = 0; i < foldersrequested.Count; i++) | 278 | for (int i = 0; i < foldersrequested.Count; i++) |
292 | { | 279 | { |
@@ -308,7 +295,9 @@ namespace OpenSim.Capabilities.Handlers | |||
308 | 295 | ||
309 | if (null == reply) | 296 | if (null == reply) |
310 | { | 297 | { |
311 | bad_folders_response += "<uuid>" + llsdRequest.folder_id.ToString() + "</uuid>"; | 298 | tmpbadfolders.Append("<map><key>folder_id</key><uuid>"); |
299 | tmpbadfolders.Append(llsdRequest.folder_id.ToString()); | ||
300 | tmpbadfolders.Append("</uuid><key>error</key><string>Unknown</string></map>"); | ||
312 | } | 301 | } |
313 | else | 302 | else |
314 | { | 303 | { |
@@ -317,39 +306,29 @@ namespace OpenSim.Capabilities.Handlers | |||
317 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); | 306 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); |
318 | } | 307 | } |
319 | 308 | ||
320 | response += inventoryitemstr; | 309 | tmpresponse.Append(inventoryitemstr); |
321 | } | 310 | } |
322 | 311 | ||
323 | if (response.Length == 0) | 312 | StringBuilder lastresponse = new StringBuilder(1024); |
313 | lastresponse.Append("<llsd>"); | ||
314 | if(tmpresponse.Length > 0) | ||
324 | { | 315 | { |
325 | /* Viewers expect a bad_folders array when not available */ | 316 | lastresponse.Append("<map><key>folders</key><array>"); |
326 | if (bad_folders_response.Length != 0) | 317 | lastresponse.Append(tmpresponse.ToString()); |
327 | { | 318 | lastresponse.Append("</array></map>"); |
328 | response = "<llsd><map><key>bad_folders</key><array>" + bad_folders_response + "</array></map></llsd>"; | ||
329 | } | ||
330 | else | ||
331 | { | ||
332 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; | ||
333 | } | ||
334 | } | 319 | } |
335 | else | 320 | else |
321 | lastresponse.Append("<map><key>folders</key><array /></map>"); | ||
322 | |||
323 | if(tmpbadfolders.Length > 0) | ||
336 | { | 324 | { |
337 | if (bad_folders_response.Length != 0) | 325 | lastresponse.Append("<map><key>bad_folders</key><array>"); |
338 | { | 326 | lastresponse.Append(tmpbadfolders.ToString()); |
339 | response = "<llsd><map><key>folders</key><array>" + response + "</array><key>bad_folders</key><array>" + bad_folders_response + "</array></map></llsd>"; | 327 | lastresponse.Append("</array></map>"); |
340 | } | ||
341 | else | ||
342 | { | ||
343 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; | ||
344 | } | ||
345 | } | 328 | } |
329 | lastresponse.Append("</llsd>"); | ||
346 | 330 | ||
347 | // m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request"); | 331 | return lastresponse.ToString(); |
348 | //m_log.Debug("[WEB FETCH INV DESC HANDLER] "+response); | ||
349 | |||
350 | return response; | ||
351 | |||
352 | // } | ||
353 | } | 332 | } |
354 | 333 | ||
355 | /// <summary> | 334 | /// <summary> |
@@ -436,108 +415,7 @@ namespace OpenSim.Capabilities.Handlers | |||
436 | itemsToReturn.Insert(0, linkedItem); | 415 | itemsToReturn.Insert(0, linkedItem); |
437 | } | 416 | } |
438 | } | 417 | } |
439 | |||
440 | // Now scan for folder links and insert the items they target and those links at the head of the return data | ||
441 | |||
442 | /* dont send contents of LinkFolders. | ||
443 | from docs seems this was never a spec | ||
444 | |||
445 | foreach (InventoryItemBase item in originalItems) | ||
446 | { | ||
447 | if (item.AssetType == (int)AssetType.LinkFolder) | ||
448 | { | ||
449 | InventoryCollection linkedFolderContents = m_InventoryService.GetFolderContent(ownerID, item.AssetID); | ||
450 | List<InventoryItemBase> links = linkedFolderContents.Items; | ||
451 | |||
452 | itemsToReturn.InsertRange(0, links); | ||
453 | |||
454 | foreach (InventoryItemBase link in linkedFolderContents.Items) | ||
455 | { | ||
456 | // Take care of genuinely broken links where the target doesn't exist | ||
457 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | ||
458 | // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles | ||
459 | // rather than having to keep track of every folder requested in the recursion. | ||
460 | if (link != null) | ||
461 | { | ||
462 | // m_log.DebugFormat( | ||
463 | // "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3}", | ||
464 | // link.Name, (AssetType)link.AssetType, item.AssetID, containingFolder.Name); | ||
465 | |||
466 | InventoryItemBase linkedItem | ||
467 | = m_InventoryService.GetItem(new InventoryItemBase(link.AssetID)); | ||
468 | |||
469 | if (linkedItem != null) | ||
470 | itemsToReturn.Insert(0, linkedItem); | ||
471 | } | ||
472 | } | ||
473 | } | ||
474 | } | ||
475 | */ | ||
476 | } | 418 | } |
477 | |||
478 | // foreach (InventoryItemBase item in contents.Items) | ||
479 | // { | ||
480 | // m_log.DebugFormat( | ||
481 | // "[WEB FETCH INV DESC HANDLER]: Returning item {0}, type {1}, parent {2} in {3} {4}", | ||
482 | // item.Name, (AssetType)item.AssetType, item.Folder, containingFolder.Name, containingFolder.ID); | ||
483 | // } | ||
484 | |||
485 | // ===== | ||
486 | |||
487 | // | ||
488 | // foreach (InventoryItemBase linkedItem in linkedItemsToAdd) | ||
489 | // { | ||
490 | // m_log.DebugFormat( | ||
491 | // "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}", | ||
492 | // linkedItem.Name, folderID, agentID); | ||
493 | // | ||
494 | // contents.Items.Add(linkedItem); | ||
495 | // } | ||
496 | // | ||
497 | // // If the folder requested contains links, then we need to send those folders first, otherwise the links | ||
498 | // // will be broken in the viewer. | ||
499 | // HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>(); | ||
500 | // foreach (InventoryItemBase item in contents.Items) | ||
501 | // { | ||
502 | // if (item.AssetType == (int)AssetType.Link) | ||
503 | // { | ||
504 | // InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | ||
505 | // | ||
506 | // // Take care of genuinely broken links where the target doesn't exist | ||
507 | // // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | ||
508 | // // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles | ||
509 | // // rather than having to keep track of every folder requested in the recursion. | ||
510 | // if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) | ||
511 | // { | ||
512 | // // We don't need to send the folder if source and destination of the link are in the same | ||
513 | // // folder. | ||
514 | // if (linkedItem.Folder != containingFolder.ID) | ||
515 | // linkedItemFolderIdsToSend.Add(linkedItem.Folder); | ||
516 | // } | ||
517 | // } | ||
518 | // } | ||
519 | // | ||
520 | // foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) | ||
521 | // { | ||
522 | // m_log.DebugFormat( | ||
523 | // "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}", | ||
524 | // linkedItemFolderId, folderID, agentID); | ||
525 | // | ||
526 | // int dummyVersion; | ||
527 | // InventoryCollection linkedCollection | ||
528 | // = Fetch( | ||
529 | // agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion); | ||
530 | // | ||
531 | // InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId); | ||
532 | // linkedFolder.Owner = agentID; | ||
533 | // linkedFolder = m_InventoryService.GetFolder(linkedFolder); | ||
534 | // | ||
535 | //// contents.Folders.AddRange(linkedCollection.Folders); | ||
536 | // | ||
537 | // contents.Folders.Add(linkedFolder); | ||
538 | // contents.Items.AddRange(linkedCollection.Items); | ||
539 | // } | ||
540 | // } | ||
541 | } | 419 | } |
542 | } | 420 | } |
543 | else | 421 | else |
@@ -550,33 +428,26 @@ from docs seems this was never a spec | |||
550 | 428 | ||
551 | } | 429 | } |
552 | 430 | ||
553 | private void AddLibraryFolders(List<LLSDFetchInventoryDescendents> fetchFolders, List<InventoryCollectionWithDescendents> result) | 431 | private void AddLibraryFolders(List<LLSDFetchInventoryDescendents> libFolders, List<InventoryCollectionWithDescendents> result) |
554 | { | 432 | { |
555 | InventoryFolderImpl fold; | 433 | InventoryFolderImpl fold; |
556 | if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null) | 434 | foreach (LLSDFetchInventoryDescendents f in libFolders) |
557 | { | 435 | { |
558 | List<LLSDFetchInventoryDescendents> libfolders = fetchFolders.FindAll(f => f.owner_id == m_LibraryService.LibraryRootFolder.Owner); | 436 | if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null) |
559 | fetchFolders.RemoveAll(f => libfolders.Contains(f)); | ||
560 | |||
561 | //m_log.DebugFormat("[XXX]: Found {0} library folders in request", libfolders.Count); | ||
562 | |||
563 | foreach (LLSDFetchInventoryDescendents f in libfolders) | ||
564 | { | 437 | { |
565 | if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null) | 438 | InventoryCollectionWithDescendents ret = new InventoryCollectionWithDescendents(); |
566 | { | 439 | ret.Collection = new InventoryCollection(); |
567 | InventoryCollectionWithDescendents ret = new InventoryCollectionWithDescendents(); | 440 | // ret.Collection.Folders = new List<InventoryFolderBase>(); |
568 | ret.Collection = new InventoryCollection(); | 441 | ret.Collection.Folders = fold.RequestListOfFolders(); |
569 | ret.Collection.Folders = new List<InventoryFolderBase>(); | 442 | ret.Collection.Items = fold.RequestListOfItems(); |
570 | ret.Collection.Items = fold.RequestListOfItems(); | 443 | ret.Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner; |
571 | ret.Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner; | 444 | ret.Collection.FolderID = f.folder_id; |
572 | ret.Collection.FolderID = f.folder_id; | 445 | ret.Collection.Version = fold.Version; |
573 | ret.Collection.Version = fold.Version; | 446 | |
574 | 447 | ret.Descendents = ret.Collection.Items.Count + ret.Collection.Folders.Count; | |
575 | ret.Descendents = ret.Collection.Items.Count; | 448 | result.Add(ret); |
576 | result.Add(ret); | 449 | |
577 | 450 | //m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID); | |
578 | //m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID); | ||
579 | } | ||
580 | } | 451 | } |
581 | } | 452 | } |
582 | } | 453 | } |
@@ -589,57 +460,97 @@ from docs seems this was never a spec | |||
589 | // FIXME MAYBE: We're not handling sortOrder! | 460 | // FIXME MAYBE: We're not handling sortOrder! |
590 | 461 | ||
591 | List<InventoryCollectionWithDescendents> result = new List<InventoryCollectionWithDescendents>(); | 462 | List<InventoryCollectionWithDescendents> result = new List<InventoryCollectionWithDescendents>(); |
463 | if(fetchFolders.Count <= 0) | ||
464 | return result; | ||
465 | |||
466 | List<LLSDFetchInventoryDescendents> libFolders = new List<LLSDFetchInventoryDescendents>(); | ||
467 | List<LLSDFetchInventoryDescendents> otherFolders = new List<LLSDFetchInventoryDescendents>(); | ||
468 | HashSet<UUID> libIDs = new HashSet<UUID>(); | ||
469 | HashSet<UUID> otherIDs = new HashSet<UUID>(); | ||
592 | 470 | ||
593 | AddLibraryFolders(fetchFolders, result); | 471 | bool dolib = (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null); |
472 | UUID libOwner = UUID.Zero; | ||
473 | if(dolib) | ||
474 | libOwner = m_LibraryService.LibraryRootFolder.Owner; | ||
594 | 475 | ||
595 | // Filter folder Zero right here. Some viewers (Firestorm) send request for folder Zero, which doesn't make sense | 476 | // Filter folder Zero right here. Some viewers (Firestorm) send request for folder Zero, which doesn't make sense |
596 | // and can kill the sim (all root folders have parent_id Zero) | 477 | // and can kill the sim (all root folders have parent_id Zero) |
597 | LLSDFetchInventoryDescendents zero = fetchFolders.Find(f => f.folder_id == UUID.Zero); | 478 | // send something. |
598 | if (zero != null) | 479 | foreach(LLSDFetchInventoryDescendents f in fetchFolders) |
599 | { | 480 | { |
600 | fetchFolders.Remove(zero); | 481 | if (f.folder_id == UUID.Zero) |
601 | BadFolder(zero, null, bad_folders); | 482 | { |
483 | InventoryCollectionWithDescendents zeroColl = new InventoryCollectionWithDescendents(); | ||
484 | zeroColl.Collection = new InventoryCollection(); | ||
485 | zeroColl.Collection.OwnerID = f.owner_id; | ||
486 | zeroColl.Collection.Version = 0; | ||
487 | zeroColl.Collection.FolderID = f.folder_id; | ||
488 | zeroColl.Descendents = 0; | ||
489 | result.Add(zeroColl); | ||
490 | continue; | ||
491 | } | ||
492 | if(dolib && f.owner_id == libOwner) | ||
493 | { | ||
494 | if(libIDs.Contains(f.folder_id)) | ||
495 | continue; | ||
496 | libIDs.Add(f.folder_id); | ||
497 | libFolders.Add(f); | ||
498 | continue; | ||
499 | } | ||
500 | if(otherIDs.Contains(f.folder_id)) | ||
501 | continue; | ||
502 | otherIDs.Add(f.folder_id); | ||
503 | otherFolders.Add(f); | ||
602 | } | 504 | } |
603 | 505 | ||
604 | if (fetchFolders.Count > 0) | 506 | |
605 | { | 507 | if(otherFolders.Count > 0) |
606 | UUID[] fids = new UUID[fetchFolders.Count]; | 508 | { |
509 | UUID[] fids = new UUID[otherFolders.Count]; | ||
607 | int i = 0; | 510 | int i = 0; |
608 | foreach (LLSDFetchInventoryDescendents f in fetchFolders) | 511 | foreach (LLSDFetchInventoryDescendents f in otherFolders) |
609 | fids[i++] = f.folder_id; | 512 | fids[i++] = f.folder_id; |
610 | 513 | ||
611 | //m_log.DebugFormat("[XXX]: {0}", string.Join(",", fids)); | 514 | //m_log.DebugFormat("[XXX]: {0}", string.Join(",", fids)); |
612 | 515 | ||
613 | InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(fetchFolders[0].owner_id, fids); | 516 | InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(otherFolders[0].owner_id, fids); |
614 | 517 | ||
615 | if (fetchedContents == null || (fetchedContents != null && fetchedContents.Length == 0)) | 518 | if (fetchedContents == null) |
519 | return null; | ||
520 | |||
521 | if (fetchedContents.Length == 0) | ||
616 | { | 522 | { |
617 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Could not get contents of multiple folders for user {0}", fetchFolders[0].owner_id); | 523 | foreach (LLSDFetchInventoryDescendents freq in otherFolders) |
618 | foreach (LLSDFetchInventoryDescendents freq in fetchFolders) | ||
619 | BadFolder(freq, null, bad_folders); | 524 | BadFolder(freq, null, bad_folders); |
620 | return null; | ||
621 | } | 525 | } |
622 | 526 | else | |
623 | i = 0; | ||
624 | // Do some post-processing. May need to fetch more from inv server for links | ||
625 | foreach (InventoryCollection contents in fetchedContents) | ||
626 | { | 527 | { |
627 | // Find the original request | 528 | i = 0; |
628 | LLSDFetchInventoryDescendents freq = fetchFolders[i++]; | 529 | // Do some post-processing. May need to fetch more from inv server for links |
530 | foreach (InventoryCollection contents in fetchedContents) | ||
531 | { | ||
532 | // Find the original request | ||
533 | LLSDFetchInventoryDescendents freq = otherFolders[i++]; | ||
629 | 534 | ||
630 | InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents(); | 535 | InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents(); |
631 | coll.Collection = contents; | 536 | coll.Collection = contents; |
632 | 537 | ||
633 | if (BadFolder(freq, contents, bad_folders)) | 538 | if (BadFolder(freq, contents, bad_folders)) |
634 | continue; | 539 | continue; |
635 | 540 | ||
636 | // Next: link management | 541 | // Next: link management |
637 | ProcessLinks(freq, coll); | 542 | ProcessLinks(freq, coll); |
638 | 543 | ||
639 | result.Add(coll); | 544 | result.Add(coll); |
545 | } | ||
640 | } | 546 | } |
641 | } | 547 | } |
642 | 548 | ||
549 | if(dolib && libFolders.Count > 0) | ||
550 | { | ||
551 | AddLibraryFolders(libFolders, result); | ||
552 | } | ||
553 | |||
643 | return result; | 554 | return result; |
644 | } | 555 | } |
645 | 556 | ||
@@ -666,35 +577,8 @@ from docs seems this was never a spec | |||
666 | } | 577 | } |
667 | else | 578 | else |
668 | { | 579 | { |
669 | // Was it really a request for folder Zero? | 580 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id); |
670 | // This is an overkill, but Firestorm really asks for folder Zero. | 581 | bad_folders.Add(freq.folder_id); |
671 | // I'm leaving the code here for the time being, but commented. | ||
672 | if (freq.folder_id == UUID.Zero) | ||
673 | { | ||
674 | //coll.Collection.OwnerID = freq.owner_id; | ||
675 | //coll.Collection.FolderID = contents.FolderID; | ||
676 | //containingFolder = m_InventoryService.GetRootFolder(freq.owner_id); | ||
677 | //if (containingFolder != null) | ||
678 | //{ | ||
679 | // m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Request for parent of folder {0}", containingFolder.ID); | ||
680 | // coll.Collection.Folders.Clear(); | ||
681 | // coll.Collection.Folders.Add(containingFolder); | ||
682 | // if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null) | ||
683 | // { | ||
684 | // InventoryFolderBase lib = new InventoryFolderBase(m_LibraryService.LibraryRootFolder.ID, m_LibraryService.LibraryRootFolder.Owner); | ||
685 | // lib.Name = m_LibraryService.LibraryRootFolder.Name; | ||
686 | // lib.Type = m_LibraryService.LibraryRootFolder.Type; | ||
687 | // lib.Version = m_LibraryService.LibraryRootFolder.Version; | ||
688 | // coll.Collection.Folders.Add(lib); | ||
689 | // } | ||
690 | // coll.Collection.Items.Clear(); | ||
691 | //} | ||
692 | } | ||
693 | else | ||
694 | { | ||
695 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id); | ||
696 | bad_folders.Add(freq.folder_id); | ||
697 | } | ||
698 | bad = true; | 582 | bad = true; |
699 | } | 583 | } |
700 | } | 584 | } |
@@ -708,42 +592,21 @@ from docs seems this was never a spec | |||
708 | 592 | ||
709 | if (freq.fetch_items && contents.Items != null) | 593 | if (freq.fetch_items && contents.Items != null) |
710 | { | 594 | { |
711 | List<InventoryItemBase> itemsToReturn = contents.Items; | 595 | // viewers are lasy and want a copy of the linked item sent before the link to it |
712 | 596 | ||
713 | // descendents must only include the links, not the linked items we add | 597 | // descendents must only include the links, not the linked items we add |
714 | coll.Descendents = itemsToReturn.Count; | 598 | coll.Descendents = contents.Items.Count + contents.Folders.Count; |
715 | 599 | ||
716 | // Add target items for links in this folder before the links themselves. | 600 | // look for item links |
717 | List<UUID> itemIDs = new List<UUID>(); | 601 | List<UUID> itemIDs = new List<UUID>(); |
718 | List<UUID> folderIDs = new List<UUID>(); | 602 | foreach (InventoryItemBase item in contents.Items) |
719 | foreach (InventoryItemBase item in itemsToReturn) | ||
720 | { | 603 | { |
721 | //m_log.DebugFormat("[XXX]: {0} {1}", item.Name, item.AssetType); | 604 | //m_log.DebugFormat("[XXX]: {0} {1}", item.Name, item.AssetType); |
722 | if (item.AssetType == (int)AssetType.Link) | 605 | if (item.AssetType == (int)AssetType.Link) |
723 | itemIDs.Add(item.AssetID); | 606 | itemIDs.Add(item.AssetID); |
724 | |||
725 | // else if (item.AssetType == (int)AssetType.LinkFolder) | ||
726 | // folderIDs.Add(item.AssetID); | ||
727 | } | ||
728 | |||
729 | //m_log.DebugFormat("[XXX]: folder {0} has {1} links and {2} linkfolders", contents.FolderID, itemIDs.Count, folderIDs.Count); | ||
730 | |||
731 | // Scan for folder links and insert the items they target and those links at the head of the return data | ||
732 | if (folderIDs.Count > 0) | ||
733 | { | ||
734 | InventoryCollection[] linkedFolders = m_InventoryService.GetMultipleFoldersContent(coll.Collection.OwnerID, folderIDs.ToArray()); | ||
735 | foreach (InventoryCollection linkedFolderContents in linkedFolders) | ||
736 | { | ||
737 | if (linkedFolderContents == null) | ||
738 | continue; | ||
739 | |||
740 | List<InventoryItemBase> links = linkedFolderContents.Items; | ||
741 | |||
742 | itemsToReturn.InsertRange(0, links); | ||
743 | |||
744 | } | ||
745 | } | 607 | } |
746 | 608 | ||
609 | // get the linked if any | ||
747 | if (itemIDs.Count > 0) | 610 | if (itemIDs.Count > 0) |
748 | { | 611 | { |
749 | InventoryItemBase[] linked = m_InventoryService.GetMultipleItems(freq.owner_id, itemIDs.ToArray()); | 612 | InventoryItemBase[] linked = m_InventoryService.GetMultipleItems(freq.owner_id, itemIDs.ToArray()); |
@@ -758,13 +621,11 @@ from docs seems this was never a spec | |||
758 | linked[i++] = m_InventoryService.GetItem(freq.owner_id, id); | 621 | linked[i++] = m_InventoryService.GetItem(freq.owner_id, id); |
759 | } | 622 | } |
760 | } | 623 | } |
761 | 624 | ||
762 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Processing folder {0}. Existing items:", freq.folder_id); | ||
763 | //foreach (InventoryItemBase item in itemsToReturn) | ||
764 | // m_log.DebugFormat("[XXX]: {0} {1} {2}", item.Name, item.AssetType, item.Folder); | ||
765 | |||
766 | if (linked != null) | 625 | if (linked != null) |
767 | { | 626 | { |
627 | List<InventoryItemBase> linkedItems = new List<InventoryItemBase>(); | ||
628 | // check for broken | ||
768 | foreach (InventoryItemBase linkedItem in linked) | 629 | foreach (InventoryItemBase linkedItem in linked) |
769 | { | 630 | { |
770 | // Take care of genuinely broken links where the target doesn't exist | 631 | // Take care of genuinely broken links where the target doesn't exist |
@@ -773,14 +634,16 @@ from docs seems this was never a spec | |||
773 | // rather than having to keep track of every folder requested in the recursion. | 634 | // rather than having to keep track of every folder requested in the recursion. |
774 | if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) | 635 | if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) |
775 | { | 636 | { |
776 | itemsToReturn.Insert(0, linkedItem); | 637 | linkedItems.Add(linkedItem); |
777 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Added {0} {1} {2}", linkedItem.Name, linkedItem.AssetType, linkedItem.Folder); | 638 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Added {0} {1} {2}", linkedItem.Name, linkedItem.AssetType, linkedItem.Folder); |
778 | } | 639 | } |
779 | } | 640 | } |
641 | // insert them | ||
642 | if(linkedItems.Count > 0) | ||
643 | contents.Items.InsertRange(0,linkedItems); | ||
780 | } | 644 | } |
781 | } | 645 | } |
782 | } | 646 | } |
783 | |||
784 | } | 647 | } |
785 | 648 | ||
786 | /// <summary> | 649 | /// <summary> |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 4143aa3..1e9a993 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs | |||
@@ -267,6 +267,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
267 | [Test] | 267 | [Test] |
268 | public void Test_005_FolderZero() | 268 | public void Test_005_FolderZero() |
269 | { | 269 | { |
270 | |||
270 | TestHelpers.InMethod(); | 271 | TestHelpers.InMethod(); |
271 | 272 | ||
272 | Init(); | 273 | Init(); |
@@ -283,11 +284,11 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
283 | 284 | ||
284 | Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); | 285 | Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); |
285 | Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); | 286 | Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); |
286 | Assert.That(llsdresponse.Contains("bad_folders</key><array><uuid>00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder"); | 287 | // we do return a answer now |
288 | //Assert.That(llsdresponse.Contains("bad_folders</key><array><uuid>00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder"); | ||
287 | 289 | ||
288 | Console.WriteLine(llsdresponse); | 290 | Console.WriteLine(llsdresponse); |
289 | } | 291 | } |
290 | |||
291 | } | 292 | } |
292 | 293 | ||
293 | } \ No newline at end of file | 294 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs index a9b81f3..a0471bb 100644 --- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs | |||
@@ -64,10 +64,7 @@ namespace OpenSim.Capabilities.Handlers | |||
64 | Hashtable ret = new Hashtable(); | 64 | Hashtable ret = new Hashtable(); |
65 | ret["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; | 65 | ret["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; |
66 | ret["content_type"] = "text/plain"; | 66 | ret["content_type"] = "text/plain"; |
67 | ret["keepalive"] = false; | ||
68 | ret["reusecontext"] = false; | ||
69 | ret["int_bytes"] = 0; | 67 | ret["int_bytes"] = 0; |
70 | ret["int_lod"] = 0; | ||
71 | string MeshStr = (string)request["mesh_id"]; | 68 | string MeshStr = (string)request["mesh_id"]; |
72 | 69 | ||
73 | 70 | ||
@@ -76,6 +73,8 @@ namespace OpenSim.Capabilities.Handlers | |||
76 | if (m_assetService == null) | 73 | if (m_assetService == null) |
77 | { | 74 | { |
78 | m_log.Error("[GETMESH]: Cannot fetch mesh " + MeshStr + " without an asset service"); | 75 | m_log.Error("[GETMESH]: Cannot fetch mesh " + MeshStr + " without an asset service"); |
76 | ret["keepalive"] = false; | ||
77 | return ret; | ||
79 | } | 78 | } |
80 | 79 | ||
81 | UUID meshID; | 80 | UUID meshID; |
@@ -101,10 +100,7 @@ namespace OpenSim.Capabilities.Handlers | |||
101 | Hashtable responsedata = new Hashtable(); | 100 | Hashtable responsedata = new Hashtable(); |
102 | responsedata["int_response_code"] = 400; //501; //410; //404; | 101 | responsedata["int_response_code"] = 400; //501; //410; //404; |
103 | responsedata["content_type"] = "text/plain"; | 102 | responsedata["content_type"] = "text/plain"; |
104 | responsedata["keepalive"] = false; | ||
105 | responsedata["str_response_string"] = "Request wasn't what was expected"; | 103 | responsedata["str_response_string"] = "Request wasn't what was expected"; |
106 | responsedata["reusecontext"] = false; | ||
107 | responsedata["int_lod"] = 0; | ||
108 | responsedata["int_bytes"] = 0; | 104 | responsedata["int_bytes"] = 0; |
109 | 105 | ||
110 | string meshStr = string.Empty; | 106 | string meshStr = string.Empty; |
@@ -118,10 +114,8 @@ namespace OpenSim.Capabilities.Handlers | |||
118 | if (m_assetService == null) | 114 | if (m_assetService == null) |
119 | { | 115 | { |
120 | responsedata["int_response_code"] = 404; //501; //410; //404; | 116 | responsedata["int_response_code"] = 404; //501; //410; //404; |
121 | responsedata["content_type"] = "text/plain"; | ||
122 | responsedata["keepalive"] = false; | 117 | responsedata["keepalive"] = false; |
123 | responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh."; | 118 | responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh."; |
124 | responsedata["reusecontext"] = false; | ||
125 | return responsedata; | 119 | return responsedata; |
126 | } | 120 | } |
127 | 121 | ||
@@ -155,10 +149,7 @@ namespace OpenSim.Capabilities.Handlers | |||
155 | { | 149 | { |
156 | responsedata["int_response_code"] = 404; //501; //410; //404; | 150 | responsedata["int_response_code"] = 404; //501; //410; //404; |
157 | responsedata["content_type"] = "text/plain"; | 151 | responsedata["content_type"] = "text/plain"; |
158 | responsedata["keepalive"] = false; | ||
159 | responsedata["str_response_string"] = "This range doesnt exist."; | 152 | responsedata["str_response_string"] = "This range doesnt exist."; |
160 | responsedata["reusecontext"] = false; | ||
161 | responsedata["int_lod"] = 3; | ||
162 | return responsedata; | 153 | return responsedata; |
163 | } | 154 | } |
164 | else | 155 | else |
@@ -169,28 +160,11 @@ namespace OpenSim.Capabilities.Handlers | |||
169 | 160 | ||
170 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 161 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
171 | 162 | ||
172 | if (start > 20000) | ||
173 | { | ||
174 | responsedata["int_lod"] = 3; | ||
175 | } | ||
176 | else if (start < 4097) | ||
177 | { | ||
178 | responsedata["int_lod"] = 1; | ||
179 | } | ||
180 | else | ||
181 | { | ||
182 | responsedata["int_lod"] = 2; | ||
183 | } | ||
184 | |||
185 | |||
186 | if (start == 0 && len == mesh.Data.Length) // well redudante maybe | 163 | if (start == 0 && len == mesh.Data.Length) // well redudante maybe |
187 | { | 164 | { |
188 | responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; | 165 | responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; |
189 | responsedata["bin_response_data"] = mesh.Data; | 166 | responsedata["bin_response_data"] = mesh.Data; |
190 | responsedata["int_bytes"] = mesh.Data.Length; | 167 | responsedata["int_bytes"] = mesh.Data.Length; |
191 | responsedata["reusecontext"] = false; | ||
192 | responsedata["int_lod"] = 3; | ||
193 | |||
194 | } | 168 | } |
195 | else | 169 | else |
196 | { | 170 | { |
@@ -203,7 +177,6 @@ namespace OpenSim.Capabilities.Handlers | |||
203 | Array.Copy(mesh.Data, start, d, 0, len); | 177 | Array.Copy(mesh.Data, start, d, 0, len); |
204 | responsedata["bin_response_data"] = d; | 178 | responsedata["bin_response_data"] = d; |
205 | responsedata["int_bytes"] = len; | 179 | responsedata["int_bytes"] = len; |
206 | responsedata["reusecontext"] = false; | ||
207 | } | 180 | } |
208 | } | 181 | } |
209 | } | 182 | } |
@@ -213,8 +186,6 @@ namespace OpenSim.Capabilities.Handlers | |||
213 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); | 186 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); |
214 | responsedata["content_type"] = "application/vnd.ll.mesh"; | 187 | responsedata["content_type"] = "application/vnd.ll.mesh"; |
215 | responsedata["int_response_code"] = 200; | 188 | responsedata["int_response_code"] = 200; |
216 | responsedata["reusecontext"] = false; | ||
217 | responsedata["int_lod"] = 3; | ||
218 | } | 189 | } |
219 | } | 190 | } |
220 | else | 191 | else |
@@ -222,8 +193,6 @@ namespace OpenSim.Capabilities.Handlers | |||
222 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); | 193 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); |
223 | responsedata["content_type"] = "application/vnd.ll.mesh"; | 194 | responsedata["content_type"] = "application/vnd.ll.mesh"; |
224 | responsedata["int_response_code"] = 200; | 195 | responsedata["int_response_code"] = 200; |
225 | responsedata["reusecontext"] = false; | ||
226 | responsedata["int_lod"] = 3; | ||
227 | } | 196 | } |
228 | } | 197 | } |
229 | // Optionally add additional mesh types here | 198 | // Optionally add additional mesh types here |
@@ -231,10 +200,7 @@ namespace OpenSim.Capabilities.Handlers | |||
231 | { | 200 | { |
232 | responsedata["int_response_code"] = 404; //501; //410; //404; | 201 | responsedata["int_response_code"] = 404; //501; //410; //404; |
233 | responsedata["content_type"] = "text/plain"; | 202 | responsedata["content_type"] = "text/plain"; |
234 | responsedata["keepalive"] = false; | ||
235 | responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; | 203 | responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; |
236 | responsedata["reusecontext"] = false; | ||
237 | responsedata["int_lod"] = 1; | ||
238 | return responsedata; | 204 | return responsedata; |
239 | } | 205 | } |
240 | } | 206 | } |
@@ -242,10 +208,7 @@ namespace OpenSim.Capabilities.Handlers | |||
242 | { | 208 | { |
243 | responsedata["int_response_code"] = 404; //501; //410; //404; | 209 | responsedata["int_response_code"] = 404; //501; //410; //404; |
244 | responsedata["content_type"] = "text/plain"; | 210 | responsedata["content_type"] = "text/plain"; |
245 | responsedata["keepalive"] = false; | ||
246 | responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!"; | 211 | responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!"; |
247 | responsedata["reusecontext"] = false; | ||
248 | responsedata["int_lod"] = 0; | ||
249 | return responsedata; | 212 | return responsedata; |
250 | } | 213 | } |
251 | } | 214 | } |
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index f59c902..ddd9578 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs | |||
@@ -403,7 +403,7 @@ namespace OpenSim.Framework.Console | |||
403 | string uri = "/ReadResponses/" + sessionID.ToString() + "/"; | 403 | string uri = "/ReadResponses/" + sessionID.ToString() + "/"; |
404 | 404 | ||
405 | m_Server.AddPollServiceHTTPHandler( | 405 | m_Server.AddPollServiceHTTPHandler( |
406 | uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, sessionID,25000)); // 25 secs timeout | 406 | uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, null, sessionID,25000)); // 25 secs timeout |
407 | 407 | ||
408 | // Our reply is an XML document. | 408 | // Our reply is an XML document. |
409 | // TODO: Change this to Linq.Xml | 409 | // TODO: Change this to Linq.Xml |
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index dfe9695..d79eb0d 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs | |||
@@ -37,6 +37,8 @@ namespace OpenSim.Framework | |||
37 | public bool isSandbox; | 37 | public bool isSandbox; |
38 | public bool HttpUsesSSL = false; | 38 | public bool HttpUsesSSL = false; |
39 | public string HttpSSLCN = ""; | 39 | public string HttpSSLCN = ""; |
40 | public string HttpSSLCertPath = ""; | ||
41 | public string HttpSSLCNCertPass = ""; | ||
40 | public uint httpSSLPort = 9001; | 42 | public uint httpSSLPort = 9001; |
41 | 43 | ||
42 | // "Out of band" managemnt https | 44 | // "Out of band" managemnt https |
@@ -62,6 +64,8 @@ namespace OpenSim.Framework | |||
62 | (uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)ConfigSettings.DefaultRegionHttpPort+1)); | 64 | (uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)ConfigSettings.DefaultRegionHttpPort+1)); |
63 | HttpUsesSSL = config.Configs["Network"].GetBoolean("http_listener_ssl", false); | 65 | HttpUsesSSL = config.Configs["Network"].GetBoolean("http_listener_ssl", false); |
64 | HttpSSLCN = config.Configs["Network"].GetString("http_listener_cn", "localhost"); | 66 | HttpSSLCN = config.Configs["Network"].GetString("http_listener_cn", "localhost"); |
67 | HttpSSLCertPath = config.Configs["Network"].GetString("http_listener_cert_path", HttpSSLCertPath); | ||
68 | HttpSSLCNCertPass = config.Configs["Network"].GetString("http_listener_cert_pass", HttpSSLCNCertPass); | ||
65 | 69 | ||
66 | // "Out of band management https" | 70 | // "Out of band management https" |
67 | ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false); | 71 | ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false); |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 81dd357..f832f81 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -33,6 +33,9 @@ using System.Text; | |||
33 | using System.Text.RegularExpressions; | 33 | using System.Text.RegularExpressions; |
34 | using System.Threading; | 34 | using System.Threading; |
35 | using System.Timers; | 35 | using System.Timers; |
36 | using System.Net; | ||
37 | using System.Net.Security; | ||
38 | using System.Security.Cryptography.X509Certificates; | ||
36 | using log4net; | 39 | using log4net; |
37 | using log4net.Appender; | 40 | using log4net.Appender; |
38 | using log4net.Core; | 41 | using log4net.Core; |
@@ -86,6 +89,26 @@ namespace OpenSim.Framework.Servers | |||
86 | m_osSecret = UUID.Random().ToString(); | 89 | m_osSecret = UUID.Random().ToString(); |
87 | } | 90 | } |
88 | 91 | ||
92 | private static bool m_NoVerifyCertChain = false; | ||
93 | private static bool m_NoVerifyCertHostname = false; | ||
94 | |||
95 | public static bool ValidateServerCertificate( | ||
96 | object sender, | ||
97 | X509Certificate certificate, | ||
98 | X509Chain chain, | ||
99 | SslPolicyErrors sslPolicyErrors) | ||
100 | { | ||
101 | if (m_NoVerifyCertChain) | ||
102 | sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors; | ||
103 | |||
104 | if (m_NoVerifyCertHostname) | ||
105 | sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch; | ||
106 | |||
107 | if (sslPolicyErrors == SslPolicyErrors.None) | ||
108 | return true; | ||
109 | |||
110 | return false; | ||
111 | } | ||
89 | /// <summary> | 112 | /// <summary> |
90 | /// Must be overriden by child classes for their own server specific startup behaviour. | 113 | /// Must be overriden by child classes for their own server specific startup behaviour. |
91 | /// </summary> | 114 | /// </summary> |
@@ -96,6 +119,11 @@ namespace OpenSim.Framework.Servers | |||
96 | RegisterCommonComponents(Config); | 119 | RegisterCommonComponents(Config); |
97 | 120 | ||
98 | IConfig startupConfig = Config.Configs["Startup"]; | 121 | IConfig startupConfig = Config.Configs["Startup"]; |
122 | |||
123 | m_NoVerifyCertChain = startupConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain); | ||
124 | m_NoVerifyCertHostname = startupConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname); | ||
125 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; | ||
126 | |||
99 | int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000); | 127 | int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000); |
100 | m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000; | 128 | m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000; |
101 | m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); | 129 | m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index f4ba02f..ca67d84 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -32,6 +32,7 @@ using System.Collections.Specialized; | |||
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Net; | 33 | using System.Net; |
34 | using System.Net.Sockets; | 34 | using System.Net.Sockets; |
35 | using System.Net.Security; | ||
35 | using System.Security.Cryptography.X509Certificates; | 36 | using System.Security.Cryptography.X509Certificates; |
36 | using System.Reflection; | 37 | using System.Reflection; |
37 | using System.Globalization; | 38 | using System.Globalization; |
@@ -43,10 +44,11 @@ using log4net; | |||
43 | using Nwc.XmlRpc; | 44 | using Nwc.XmlRpc; |
44 | using OpenMetaverse.StructuredData; | 45 | using OpenMetaverse.StructuredData; |
45 | using CoolHTTPListener = HttpServer.HttpListener; | 46 | using CoolHTTPListener = HttpServer.HttpListener; |
46 | using HttpListener=System.Net.HttpListener; | 47 | using HttpListener = System.Net.HttpListener; |
47 | using LogPrio=HttpServer.LogPrio; | 48 | using LogPrio = HttpServer.LogPrio; |
48 | using OpenSim.Framework.Monitoring; | 49 | using OpenSim.Framework.Monitoring; |
49 | using System.IO.Compression; | 50 | using System.IO.Compression; |
51 | using System.Security.Cryptography; | ||
50 | 52 | ||
51 | namespace OpenSim.Framework.Servers.HttpServer | 53 | namespace OpenSim.Framework.Servers.HttpServer |
52 | { | 54 | { |
@@ -107,19 +109,26 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
107 | new Dictionary<string, WebSocketRequestDelegate>(); | 109 | new Dictionary<string, WebSocketRequestDelegate>(); |
108 | 110 | ||
109 | protected uint m_port; | 111 | protected uint m_port; |
110 | protected uint m_sslport; | ||
111 | protected bool m_ssl; | 112 | protected bool m_ssl; |
112 | private X509Certificate2 m_cert; | 113 | private X509Certificate2 m_cert; |
113 | protected bool m_firstcaps = true; | ||
114 | protected string m_SSLCommonName = ""; | 114 | protected string m_SSLCommonName = ""; |
115 | protected List<string> m_certNames = new List<string>(); | ||
116 | protected List<string> m_certIPs = new List<string>(); | ||
117 | protected string m_certCN= ""; | ||
118 | protected RemoteCertificateValidationCallback m_certificateValidationCallback = null; | ||
115 | 119 | ||
116 | protected IPAddress m_listenIPAddress = IPAddress.Any; | 120 | protected IPAddress m_listenIPAddress = IPAddress.Any; |
117 | 121 | ||
118 | public PollServiceRequestManager PollServiceRequestManager { get; private set; } | 122 | public PollServiceRequestManager PollServiceRequestManager { get; private set; } |
119 | 123 | ||
124 | public string Protocol | ||
125 | { | ||
126 | get { return m_ssl ? "https://" : "http://"; } | ||
127 | } | ||
128 | |||
120 | public uint SSLPort | 129 | public uint SSLPort |
121 | { | 130 | { |
122 | get { return m_sslport; } | 131 | get { return m_port; } |
123 | } | 132 | } |
124 | 133 | ||
125 | public string SSLCommonName | 134 | public string SSLCommonName |
@@ -148,27 +157,166 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
148 | m_port = port; | 157 | m_port = port; |
149 | } | 158 | } |
150 | 159 | ||
151 | public BaseHttpServer(uint port, bool ssl) : this (port) | 160 | private void load_cert(string CPath, string CPass) |
152 | { | 161 | { |
153 | m_ssl = ssl; | 162 | try |
163 | { | ||
164 | m_cert = new X509Certificate2(CPath, CPass); | ||
165 | X509Extension ext = m_cert.Extensions["2.5.29.17"]; | ||
166 | if(ext != null) | ||
167 | { | ||
168 | AsnEncodedData asndata = new AsnEncodedData(ext.Oid, ext.RawData); | ||
169 | string datastr = asndata.Format(true); | ||
170 | string[] lines = datastr.Split(new char[] {'\n','\r'}); | ||
171 | foreach(string s in lines) | ||
172 | { | ||
173 | if(String.IsNullOrEmpty(s)) | ||
174 | continue; | ||
175 | string[] parts = s.Split(new char[] {'='}); | ||
176 | if(String.IsNullOrEmpty(parts[0])) | ||
177 | continue; | ||
178 | string entryName = parts[0].Replace(" ",""); | ||
179 | if(entryName == "DNSName") | ||
180 | m_certNames.Add(parts[1]); | ||
181 | else if(entryName == "IPAddress") | ||
182 | m_certIPs.Add(parts[1]); | ||
183 | else if(entryName == "Unknown(135)") // stupid mono | ||
184 | { | ||
185 | try | ||
186 | { | ||
187 | if(parts[1].Length == 8) | ||
188 | { | ||
189 | long tmp = long.Parse(parts[1], NumberStyles.AllowHexSpecifier); | ||
190 | tmp = IPAddress.HostToNetworkOrder(tmp); | ||
191 | tmp = (long)((ulong) tmp >> 32); | ||
192 | IPAddress ia = new IPAddress(tmp); | ||
193 | m_certIPs.Add(ia.ToString()); | ||
194 | } | ||
195 | } | ||
196 | catch {} | ||
197 | } | ||
198 | } | ||
199 | } | ||
200 | m_certCN = m_cert.GetNameInfo(X509NameType.SimpleName, false); | ||
201 | } | ||
202 | catch | ||
203 | { | ||
204 | throw new Exception("SSL cert load error"); | ||
205 | } | ||
154 | } | 206 | } |
155 | 207 | ||
156 | public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl) | 208 | public BaseHttpServer(uint port, bool ssl, string CN, string CPath, string CPass) |
157 | { | 209 | { |
158 | if (m_ssl) | 210 | m_port = port; |
211 | if (ssl) | ||
159 | { | 212 | { |
160 | m_sslport = sslport; | 213 | if(string.IsNullOrEmpty(CPath)) |
214 | throw new Exception("invalid main http server cert path"); | ||
215 | |||
216 | if(Uri.CheckHostName(CN) == UriHostNameType.Unknown) | ||
217 | throw new Exception("invalid main http server CN (ExternalHostName)"); | ||
218 | |||
219 | m_certNames.Clear(); | ||
220 | m_certIPs.Clear(); | ||
221 | m_certCN= ""; | ||
222 | |||
223 | m_ssl = true; | ||
224 | load_cert(CPath, CPass); | ||
225 | |||
226 | if(!CheckSSLCertHost(CN)) | ||
227 | throw new Exception("invalid main http server CN (ExternalHostName)"); | ||
228 | |||
229 | m_SSLCommonName = CN; | ||
230 | |||
231 | if(m_cert.Issuer == m_cert.Subject ) | ||
232 | m_log.Warn("Self signed certificate. Clients need to allow this (some viewers debug option NoVerifySSLcert must be set to true"); | ||
161 | } | 233 | } |
234 | else | ||
235 | m_ssl = false; | ||
162 | } | 236 | } |
163 | 237 | ||
164 | public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl) | 238 | public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) |
165 | { | 239 | { |
166 | if (m_ssl) | 240 | m_port = port; |
241 | if (ssl) | ||
167 | { | 242 | { |
168 | m_cert = new X509Certificate2(CPath, CPass); | 243 | load_cert(CPath, CPass); |
244 | if(m_cert.Issuer == m_cert.Subject ) | ||
245 | m_log.Warn("Self signed certificate. Http clients need to allow this"); | ||
246 | m_ssl = true; | ||
247 | } | ||
248 | else | ||
249 | m_ssl = false; | ||
250 | } | ||
251 | |||
252 | static bool MatchDNS (string hostname, string dns) | ||
253 | { | ||
254 | int indx = dns.IndexOf ('*'); | ||
255 | if (indx == -1) | ||
256 | return (String.Compare(hostname, dns, true, CultureInfo.InvariantCulture) == 0); | ||
257 | |||
258 | int dnslen = dns.Length; | ||
259 | dnslen--; | ||
260 | if(indx == dnslen) | ||
261 | return true; // just * ? | ||
262 | |||
263 | if(indx > dnslen - 2) | ||
264 | return false; // 2 short ? | ||
265 | |||
266 | if (dns[indx + 1] != '.') | ||
267 | return false; | ||
268 | |||
269 | int indx2 = dns.IndexOf ('*', indx + 1); | ||
270 | if (indx2 != -1) | ||
271 | return false; // there can only be one; | ||
272 | |||
273 | string end = dns.Substring(indx + 1); | ||
274 | int hostlen = hostname.Length; | ||
275 | int endlen = end.Length; | ||
276 | int length = hostlen - endlen; | ||
277 | if (length <= 0) | ||
278 | return false; | ||
279 | |||
280 | if (String.Compare(hostname, length, end, 0, endlen, true, CultureInfo.InvariantCulture) != 0) | ||
281 | return false; | ||
282 | |||
283 | if (indx == 0) | ||
284 | { | ||
285 | indx2 = hostname.IndexOf ('.'); | ||
286 | return ((indx2 == -1) || (indx2 >= length)); | ||
287 | } | ||
288 | |||
289 | string start = dns.Substring (0, indx); | ||
290 | return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0); | ||
291 | } | ||
292 | |||
293 | public bool CheckSSLCertHost(string hostname) | ||
294 | { | ||
295 | UriHostNameType htype = Uri.CheckHostName(hostname); | ||
296 | |||
297 | if(htype == UriHostNameType.Unknown || htype == UriHostNameType.Basic) | ||
298 | return false; | ||
299 | if(htype == UriHostNameType.Dns) | ||
300 | { | ||
301 | foreach(string name in m_certNames) | ||
302 | { | ||
303 | if(MatchDNS(hostname, name)) | ||
304 | return true; | ||
305 | } | ||
306 | if(MatchDNS(hostname, m_certCN)) | ||
307 | return true; | ||
308 | } | ||
309 | else | ||
310 | { | ||
311 | foreach(string ip in m_certIPs) | ||
312 | { | ||
313 | if (String.Compare(hostname, ip, true, CultureInfo.InvariantCulture) == 0) | ||
314 | return true; | ||
315 | } | ||
169 | } | 316 | } |
170 | } | ||
171 | 317 | ||
318 | return false; | ||
319 | } | ||
172 | /// <summary> | 320 | /// <summary> |
173 | /// Add a stream handler to the http server. If the handler already exists, then nothing happens. | 321 | /// Add a stream handler to the http server. If the handler already exists, then nothing happens. |
174 | /// </summary> | 322 | /// </summary> |
@@ -396,12 +544,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
396 | if (psEvArgs.Request != null) | 544 | if (psEvArgs.Request != null) |
397 | { | 545 | { |
398 | OSHttpRequest req = new OSHttpRequest(context, request); | 546 | OSHttpRequest req = new OSHttpRequest(context, request); |
399 | |||
400 | Stream requestStream = req.InputStream; | ||
401 | |||
402 | string requestBody; | 547 | string requestBody; |
403 | Encoding encoding = Encoding.UTF8; | 548 | Encoding encoding = Encoding.UTF8; |
404 | using(StreamReader reader = new StreamReader(requestStream, encoding)) | 549 | using(StreamReader reader = new StreamReader(req.InputStream, encoding)) |
405 | requestBody = reader.ReadToEnd(); | 550 | requestBody = reader.ReadToEnd(); |
406 | 551 | ||
407 | Hashtable keysvals = new Hashtable(); | 552 | Hashtable keysvals = new Hashtable(); |
@@ -460,7 +605,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
460 | } | 605 | } |
461 | 606 | ||
462 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); | 607 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); |
463 | resp.ReuseContext = true; | 608 | // resp.ReuseContext = true; |
464 | // resp.ReuseContext = false; | 609 | // resp.ReuseContext = false; |
465 | HandleRequest(req, resp); | 610 | HandleRequest(req, resp); |
466 | 611 | ||
@@ -496,6 +641,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
496 | byte[] buffer500 = SendHTML500(response); | 641 | byte[] buffer500 = SendHTML500(response); |
497 | response.OutputStream.Write(buffer500, 0, buffer500.Length); | 642 | response.OutputStream.Write(buffer500, 0, buffer500.Length); |
498 | response.Send(); | 643 | response.Send(); |
644 | if(request.InputStream.CanRead) | ||
645 | request.InputStream.Close(); | ||
499 | } | 646 | } |
500 | catch | 647 | catch |
501 | { | 648 | { |
@@ -540,7 +687,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
540 | // } | 687 | // } |
541 | // } | 688 | // } |
542 | 689 | ||
543 | //response.KeepAlive = true; | ||
544 | response.SendChunked = false; | 690 | response.SendChunked = false; |
545 | 691 | ||
546 | string path = request.RawUrl; | 692 | string path = request.RawUrl; |
@@ -564,11 +710,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
564 | { | 710 | { |
565 | //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); | 711 | //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); |
566 | IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; | 712 | IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; |
567 | Stream requestStream = request.InputStream; | ||
568 | 713 | ||
569 | string requestBody; | 714 | string requestBody; |
570 | Encoding encoding = Encoding.UTF8; | 715 | Encoding encoding = Encoding.UTF8; |
571 | using(StreamReader reader = new StreamReader(requestStream, encoding)) | 716 | using(StreamReader reader = new StreamReader(request.InputStream, encoding)) |
572 | requestBody = reader.ReadToEnd(); | 717 | requestBody = reader.ReadToEnd(); |
573 | 718 | ||
574 | Hashtable keysvals = new Hashtable(); | 719 | Hashtable keysvals = new Hashtable(); |
@@ -609,7 +754,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
609 | else | 754 | else |
610 | { | 755 | { |
611 | IStreamHandler streamHandler = (IStreamHandler)requestHandler; | 756 | IStreamHandler streamHandler = (IStreamHandler)requestHandler; |
612 | |||
613 | using (MemoryStream memoryStream = new MemoryStream()) | 757 | using (MemoryStream memoryStream = new MemoryStream()) |
614 | { | 758 | { |
615 | streamHandler.Handle(path, request.InputStream, memoryStream, request, response); | 759 | streamHandler.Handle(path, request.InputStream, memoryStream, request, response); |
@@ -720,10 +864,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
720 | requestEndTick = Environment.TickCount; | 864 | requestEndTick = Environment.TickCount; |
721 | 865 | ||
722 | response.Send(); | 866 | response.Send(); |
723 | |||
724 | //response.OutputStream.Close(); | ||
725 | |||
726 | //response.FreeContext(); | ||
727 | } | 867 | } |
728 | catch (SocketException e) | 868 | catch (SocketException e) |
729 | { | 869 | { |
@@ -755,6 +895,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
755 | } | 895 | } |
756 | finally | 896 | finally |
757 | { | 897 | { |
898 | if(request.InputStream.CanRead) | ||
899 | request.InputStream.Close(); | ||
900 | |||
758 | // Every month or so this will wrap and give bad numbers, not really a problem | 901 | // Every month or so this will wrap and give bad numbers, not really a problem |
759 | // since its just for reporting | 902 | // since its just for reporting |
760 | int tickdiff = requestEndTick - requestStartTick; | 903 | int tickdiff = requestEndTick - requestStartTick; |
@@ -1008,12 +1151,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1008 | using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) | 1151 | using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) |
1009 | requestBody = reader.ReadToEnd(); | 1152 | requestBody = reader.ReadToEnd(); |
1010 | 1153 | ||
1011 | } | 1154 | } |
1012 | finally | 1155 | finally |
1013 | { | 1156 | { |
1014 | if (innerStream != null) | 1157 | if (innerStream != null && innerStream.CanRead) |
1015 | innerStream.Dispose(); | 1158 | innerStream.Dispose(); |
1016 | requestStream.Dispose(); | 1159 | if (requestStream.CanRead) |
1160 | requestStream.Dispose(); | ||
1017 | } | 1161 | } |
1018 | 1162 | ||
1019 | //m_log.Debug(requestBody); | 1163 | //m_log.Debug(requestBody); |
@@ -1094,6 +1238,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1094 | 1238 | ||
1095 | if (gridproxy) | 1239 | if (gridproxy) |
1096 | xmlRprcRequest.Params.Add("gridproxy"); // Param[4] | 1240 | xmlRprcRequest.Params.Add("gridproxy"); // Param[4] |
1241 | |||
1242 | // reserve this for | ||
1243 | // ... by Fumi.Iseki for DTLNSLMoneyServer | ||
1244 | // BUT make its presence possible to detect/parse | ||
1245 | string rcn = request.IHttpClientContext.SSLCommonName; | ||
1246 | if(!string.IsNullOrWhiteSpace(rcn)) | ||
1247 | { | ||
1248 | rcn = "SSLCN:" + rcn; | ||
1249 | xmlRprcRequest.Params.Add(rcn); // Param[4] or Param[5] | ||
1250 | } | ||
1251 | |||
1097 | try | 1252 | try |
1098 | { | 1253 | { |
1099 | xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); | 1254 | xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); |
@@ -1265,7 +1420,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1265 | requestBody= reader.ReadToEnd(); | 1420 | requestBody= reader.ReadToEnd(); |
1266 | 1421 | ||
1267 | //m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody); | 1422 | //m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody); |
1268 | response.KeepAlive = true; | ||
1269 | 1423 | ||
1270 | OSD llsdRequest = null; | 1424 | OSD llsdRequest = null; |
1271 | OSD llsdResponse = null; | 1425 | OSD llsdResponse = null; |
@@ -1781,20 +1935,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1781 | { | 1935 | { |
1782 | response.ProtocolVersion = (string)responsedata["http_protocol_version"]; | 1936 | response.ProtocolVersion = (string)responsedata["http_protocol_version"]; |
1783 | } | 1937 | } |
1784 | /* | 1938 | |
1785 | if (responsedata.ContainsKey("keepalive")) | 1939 | if (responsedata.ContainsKey("keepalive")) |
1786 | { | 1940 | { |
1787 | bool keepalive = (bool)responsedata["keepalive"]; | 1941 | bool keepalive = (bool)responsedata["keepalive"]; |
1788 | response.KeepAlive = keepalive; | 1942 | response.KeepAlive = keepalive; |
1789 | } | 1943 | } |
1790 | 1944 | ||
1791 | if (responsedata.ContainsKey("reusecontext")) | ||
1792 | response.ReuseContext = (bool) responsedata["reusecontext"]; | ||
1793 | */ | ||
1794 | // disable this things | ||
1795 | response.KeepAlive = false; | ||
1796 | response.ReuseContext = false; | ||
1797 | |||
1798 | // Cross-Origin Resource Sharing with simple requests | 1945 | // Cross-Origin Resource Sharing with simple requests |
1799 | if (responsedata.ContainsKey("access_control_allow_origin")) | 1946 | if (responsedata.ContainsKey("access_control_allow_origin")) |
1800 | response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); | 1947 | response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); |
@@ -1807,11 +1954,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1807 | contentType = "text/html"; | 1954 | contentType = "text/html"; |
1808 | } | 1955 | } |
1809 | 1956 | ||
1810 | |||
1811 | |||
1812 | // The client ignores anything but 200 here for web login, so ensure that this is 200 for that | 1957 | // The client ignores anything but 200 here for web login, so ensure that this is 200 for that |
1813 | 1958 | ||
1814 | |||
1815 | response.StatusCode = responsecode; | 1959 | response.StatusCode = responsecode; |
1816 | 1960 | ||
1817 | if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently) | 1961 | if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently) |
@@ -1821,7 +1965,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1821 | } | 1965 | } |
1822 | 1966 | ||
1823 | response.AddHeader("Content-Type", contentType); | 1967 | response.AddHeader("Content-Type", contentType); |
1824 | |||
1825 | if (responsedata.ContainsKey("headers")) | 1968 | if (responsedata.ContainsKey("headers")) |
1826 | { | 1969 | { |
1827 | Hashtable headerdata = (Hashtable)responsedata["headers"]; | 1970 | Hashtable headerdata = (Hashtable)responsedata["headers"]; |
@@ -1895,7 +2038,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1895 | 2038 | ||
1896 | public void Start() | 2039 | public void Start() |
1897 | { | 2040 | { |
1898 | Start(true); | 2041 | Start(true,true); |
1899 | } | 2042 | } |
1900 | 2043 | ||
1901 | /// <summary> | 2044 | /// <summary> |
@@ -1905,7 +2048,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1905 | /// If true then poll responses are performed asynchronsly. | 2048 | /// If true then poll responses are performed asynchronsly. |
1906 | /// Option exists to allow regression tests to perform processing synchronously. | 2049 | /// Option exists to allow regression tests to perform processing synchronously. |
1907 | /// </param> | 2050 | /// </param> |
1908 | public void Start(bool performPollResponsesAsync) | 2051 | public void Start(bool performPollResponsesAsync, bool runPool) |
1909 | { | 2052 | { |
1910 | m_log.InfoFormat( | 2053 | m_log.InfoFormat( |
1911 | "[BASE HTTP SERVER]: Starting {0} server on port {1}", UseSSL ? "HTTPS" : "HTTP", Port); | 2054 | "[BASE HTTP SERVER]: Starting {0} server on port {1}", UseSSL ? "HTTPS" : "HTTP", Port); |
@@ -1934,6 +2077,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1934 | //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); | 2077 | //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); |
1935 | //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 2078 | //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); |
1936 | m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert); | 2079 | m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert); |
2080 | if(m_certificateValidationCallback != null) | ||
2081 | m_httpListener2.CertificateValidationCallback = m_certificateValidationCallback; | ||
1937 | m_httpListener2.ExceptionThrown += httpServerException; | 2082 | m_httpListener2.ExceptionThrown += httpServerException; |
1938 | m_httpListener2.LogWriter = httpserverlog; | 2083 | m_httpListener2.LogWriter = httpserverlog; |
1939 | } | 2084 | } |
@@ -1943,9 +2088,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1943 | m_httpListener2.Start(64); | 2088 | m_httpListener2.Start(64); |
1944 | 2089 | ||
1945 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events | 2090 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events |
1946 | 2091 | if(runPool) | |
1947 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 2, 25000); | 2092 | { |
1948 | PollServiceRequestManager.Start(); | 2093 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 2, 25000); |
2094 | PollServiceRequestManager.Start(); | ||
2095 | } | ||
1949 | 2096 | ||
1950 | HTTPDRunning = true; | 2097 | HTTPDRunning = true; |
1951 | 2098 | ||
@@ -1959,7 +2106,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1959 | catch (Exception e) | 2106 | catch (Exception e) |
1960 | { | 2107 | { |
1961 | m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message); | 2108 | m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message); |
1962 | m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?"); | 2109 | m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + "?"); |
1963 | 2110 | ||
1964 | // We want this exception to halt the entire server since in current configurations we aren't too | 2111 | // We want this exception to halt the entire server since in current configurations we aren't too |
1965 | // useful without inbound HTTP. | 2112 | // useful without inbound HTTP. |
@@ -2125,10 +2272,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
2125 | string file = Path.Combine(".", "http_500.html"); | 2272 | string file = Path.Combine(".", "http_500.html"); |
2126 | if (!File.Exists(file)) | 2273 | if (!File.Exists(file)) |
2127 | return getDefaultHTTP500(); | 2274 | return getDefaultHTTP500(); |
2128 | 2275 | string result; | |
2129 | StreamReader sr = File.OpenText(file); | 2276 | using(StreamReader sr = File.OpenText(file)) |
2130 | string result = sr.ReadToEnd(); | 2277 | result = sr.ReadToEnd(); |
2131 | sr.Close(); | ||
2132 | return result; | 2278 | return result; |
2133 | } | 2279 | } |
2134 | 2280 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs index f61b090..d26b68a 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
118 | /// </summary> | 118 | /// </summary> |
119 | string StatusDescription { get; set; } | 119 | string StatusDescription { get; set; } |
120 | 120 | ||
121 | bool ReuseContext { get; set; } | 121 | // bool ReuseContext { get; set; } |
122 | 122 | ||
123 | /// <summary> | 123 | /// <summary> |
124 | /// Add a header field and content to the response. | 124 | /// Add a header field and content to the response. |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs index d7744fc..8e1b545 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs | |||
@@ -256,7 +256,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
256 | _httpResponse.Reason = value; | 256 | _httpResponse.Reason = value; |
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | /* | |
260 | public bool ReuseContext | 260 | public bool ReuseContext |
261 | { | 261 | { |
262 | get | 262 | get |
@@ -275,7 +275,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
275 | } | 275 | } |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | */ | |
279 | protected IHttpResponse _httpResponse; | 279 | protected IHttpResponse _httpResponse; |
280 | private IHttpClientContext _httpClientContext; | 280 | private IHttpClientContext _httpClientContext; |
281 | 281 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 7150aad..7c7d08d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | |||
@@ -37,6 +37,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
37 | public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId); | 37 | public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId); |
38 | 38 | ||
39 | public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId); | 39 | public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId); |
40 | public delegate void DropMethod(UUID requestID, UUID pId); | ||
40 | 41 | ||
41 | public class PollServiceEventArgs : EventArgs | 42 | public class PollServiceEventArgs : EventArgs |
42 | { | 43 | { |
@@ -44,6 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
44 | public GetEventsMethod GetEvents; | 45 | public GetEventsMethod GetEvents; |
45 | public NoEventsMethod NoEvents; | 46 | public NoEventsMethod NoEvents; |
46 | public RequestMethod Request; | 47 | public RequestMethod Request; |
48 | public DropMethod Drop; | ||
47 | public UUID Id; | 49 | public UUID Id; |
48 | public int TimeOutms; | 50 | public int TimeOutms; |
49 | public EventType Type; | 51 | public EventType Type; |
@@ -73,13 +75,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
73 | RequestMethod pRequest, | 75 | RequestMethod pRequest, |
74 | string pUrl, | 76 | string pUrl, |
75 | HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents, | 77 | HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents, |
76 | UUID pId, int pTimeOutms) | 78 | DropMethod pDrop, UUID pId, int pTimeOutms) |
77 | { | 79 | { |
78 | Request = pRequest; | 80 | Request = pRequest; |
79 | Url = pUrl; | 81 | Url = pUrl; |
80 | HasEvents = pHasEvents; | 82 | HasEvents = pHasEvents; |
81 | GetEvents = pGetEvents; | 83 | GetEvents = pGetEvents; |
82 | NoEvents = pNoEvents; | 84 | NoEvents = pNoEvents; |
85 | Drop = pDrop; | ||
83 | Id = pId; | 86 | Id = pId; |
84 | TimeOutms = pTimeOutms; | 87 | TimeOutms = pTimeOutms; |
85 | Type = EventType.Poll; | 88 | Type = EventType.Poll; |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index fefcb20..eb8ca0d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | |||
@@ -47,8 +47,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
47 | public readonly UUID RequestID; | 47 | public readonly UUID RequestID; |
48 | public int contextHash; | 48 | public int contextHash; |
49 | 49 | ||
50 | /* | ||
50 | private void GenContextHash() | 51 | private void GenContextHash() |
51 | { | 52 | { |
53 | |||
52 | Random rnd = new Random(); | 54 | Random rnd = new Random(); |
53 | contextHash = 0; | 55 | contextHash = 0; |
54 | if (Request.Headers["remote_addr"] != null) | 56 | if (Request.Headers["remote_addr"] != null) |
@@ -62,8 +64,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
62 | } | 64 | } |
63 | else | 65 | else |
64 | contextHash += rnd.Next() & 0xffff; | 66 | contextHash += rnd.Next() & 0xffff; |
65 | } | ||
66 | 67 | ||
68 | } | ||
69 | */ | ||
67 | public PollServiceHttpRequest( | 70 | public PollServiceHttpRequest( |
68 | PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) | 71 | PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) |
69 | { | 72 | { |
@@ -72,7 +75,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
72 | Request = pRequest; | 75 | Request = pRequest; |
73 | RequestTime = System.Environment.TickCount; | 76 | RequestTime = System.Environment.TickCount; |
74 | RequestID = UUID.Random(); | 77 | RequestID = UUID.Random(); |
75 | GenContextHash(); | 78 | // GenContextHash(); |
79 | contextHash = HttpContext.contextID; | ||
76 | } | 80 | } |
77 | 81 | ||
78 | internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata) | 82 | internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata) |
@@ -88,7 +92,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
88 | response.SendChunked = false; | 92 | response.SendChunked = false; |
89 | response.ContentLength64 = buffer.Length; | 93 | response.ContentLength64 = buffer.Length; |
90 | response.ContentEncoding = Encoding.UTF8; | 94 | response.ContentEncoding = Encoding.UTF8; |
91 | response.ReuseContext = false; | 95 | // response.ReuseContext = false; |
92 | 96 | ||
93 | try | 97 | try |
94 | { | 98 | { |
@@ -116,7 +120,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
116 | response.SendChunked = false; | 120 | response.SendChunked = false; |
117 | response.ContentLength64 = 0; | 121 | response.ContentLength64 = 0; |
118 | response.ContentEncoding = Encoding.UTF8; | 122 | response.ContentEncoding = Encoding.UTF8; |
119 | response.ReuseContext = false; | 123 | // response.ReuseContext = false; |
120 | response.KeepAlive = false; | 124 | response.KeepAlive = false; |
121 | response.SendChunked = false; | 125 | response.SendChunked = false; |
122 | response.StatusCode = 503; | 126 | response.StatusCode = 503; |
@@ -138,8 +142,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
138 | { | 142 | { |
139 | if (b1.contextHash != b2.contextHash) | 143 | if (b1.contextHash != b2.contextHash) |
140 | return false; | 144 | return false; |
141 | bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext); | 145 | // bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext); |
142 | return b; | 146 | // return b; |
147 | return true; | ||
143 | } | 148 | } |
144 | 149 | ||
145 | public int GetHashCode(PollServiceHttpRequest b2) | 150 | public int GetHashCode(PollServiceHttpRequest b2) |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index c6a3e65..cbdd781 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -156,6 +156,19 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | public void DropByContext(PollServiceHttpRequest req) | ||
160 | { | ||
161 | Queue<PollServiceHttpRequest> ctxQeueue; | ||
162 | lock (m_bycontext) | ||
163 | { | ||
164 | if (m_bycontext.TryGetValue(req, out ctxQeueue)) | ||
165 | { | ||
166 | ctxQeueue.Clear(); | ||
167 | m_bycontext.Remove(req); | ||
168 | } | ||
169 | } | ||
170 | } | ||
171 | |||
159 | public void EnqueueInt(PollServiceHttpRequest req) | 172 | public void EnqueueInt(PollServiceHttpRequest req) |
160 | { | 173 | { |
161 | if (m_running) | 174 | if (m_running) |
@@ -232,23 +245,59 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
232 | { | 245 | { |
233 | PollServiceHttpRequest req = m_requests.Dequeue(4500); | 246 | PollServiceHttpRequest req = m_requests.Dequeue(4500); |
234 | Watchdog.UpdateThread(); | 247 | Watchdog.UpdateThread(); |
235 | if (req != null) | 248 | if(req == null) |
249 | continue; | ||
250 | |||
251 | try | ||
236 | { | 252 | { |
237 | try | 253 | if(!req.HttpContext.CanSend()) |
238 | { | 254 | { |
239 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | 255 | req.PollServiceArgs.Drop(req.RequestID, req.PollServiceArgs.Id); |
256 | byContextDequeue(req); | ||
257 | continue; | ||
258 | } | ||
259 | |||
260 | if(req.HttpContext.IsSending()) | ||
261 | { | ||
262 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | ||
240 | { | 263 | { |
241 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); | 264 | req.PollServiceArgs.Drop(req.RequestID, req.PollServiceArgs.Id); |
265 | byContextDequeue(req); | ||
266 | } | ||
267 | else | ||
268 | ReQueueEvent(req); | ||
269 | continue; | ||
270 | } | ||
242 | 271 | ||
272 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | ||
273 | { | ||
274 | m_threadPool.QueueWorkItem(x => | ||
275 | { | ||
276 | try | ||
277 | { | ||
278 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); | ||
279 | req.DoHTTPGruntWork(m_server, responsedata); | ||
280 | } | ||
281 | catch (ObjectDisposedException) { } | ||
282 | finally | ||
283 | { | ||
284 | byContextDequeue(req); | ||
285 | } | ||
286 | return null; | ||
287 | }, null); | ||
288 | } | ||
289 | else | ||
290 | { | ||
291 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | ||
292 | { | ||
243 | m_threadPool.QueueWorkItem(x => | 293 | m_threadPool.QueueWorkItem(x => |
244 | { | 294 | { |
245 | try | 295 | try |
246 | { | 296 | { |
247 | req.DoHTTPGruntWork(m_server, responsedata); | 297 | req.DoHTTPGruntWork(m_server, |
248 | } | 298 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
249 | catch (ObjectDisposedException) | ||
250 | { | ||
251 | } | 299 | } |
300 | catch (ObjectDisposedException) {} | ||
252 | finally | 301 | finally |
253 | { | 302 | { |
254 | byContextDequeue(req); | 303 | byContextDequeue(req); |
@@ -258,39 +307,15 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
258 | } | 307 | } |
259 | else | 308 | else |
260 | { | 309 | { |
261 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 310 | ReQueueEvent(req); |
262 | { | ||
263 | m_threadPool.QueueWorkItem(x => | ||
264 | { | ||
265 | try | ||
266 | { | ||
267 | req.DoHTTPGruntWork(m_server, | ||
268 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | ||
269 | } | ||
270 | catch (ObjectDisposedException) | ||
271 | { | ||
272 | // Ignore it, no need to reply | ||
273 | } | ||
274 | finally | ||
275 | { | ||
276 | byContextDequeue(req); | ||
277 | } | ||
278 | return null; | ||
279 | }, null); | ||
280 | } | ||
281 | else | ||
282 | { | ||
283 | ReQueueEvent(req); | ||
284 | } | ||
285 | } | 311 | } |
286 | } | 312 | } |
287 | catch (Exception e) | 313 | } |
288 | { | 314 | catch (Exception e) |
289 | m_log.ErrorFormat("Exception in poll service thread: " + e.ToString()); | 315 | { |
290 | } | 316 | m_log.ErrorFormat("Exception in poll service thread: " + e.ToString()); |
291 | } | 317 | } |
292 | } | 318 | } |
293 | } | 319 | } |
294 | |||
295 | } | 320 | } |
296 | } | 321 | } |
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 9b1d906..523ccba 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs | |||
@@ -42,6 +42,7 @@ namespace OpenSim.Framework.Servers | |||
42 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
44 | private static BaseHttpServer instance = null; | 44 | private static BaseHttpServer instance = null; |
45 | private static BaseHttpServer unsecureinstance = null; | ||
45 | private static Dictionary<uint, BaseHttpServer> m_Servers = new Dictionary<uint, BaseHttpServer>(); | 46 | private static Dictionary<uint, BaseHttpServer> m_Servers = new Dictionary<uint, BaseHttpServer>(); |
46 | 47 | ||
47 | /// <summary> | 48 | /// <summary> |
@@ -93,6 +94,21 @@ namespace OpenSim.Framework.Servers | |||
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
97 | |||
98 | public static BaseHttpServer UnSecureInstance | ||
99 | { | ||
100 | get { return unsecureinstance; } | ||
101 | |||
102 | set | ||
103 | { | ||
104 | lock (m_Servers) | ||
105 | if (!m_Servers.ContainsValue(value)) | ||
106 | throw new Exception("HTTP server must already have been registered to be set as the main instance"); | ||
107 | |||
108 | unsecureinstance = value; | ||
109 | } | ||
110 | } | ||
111 | |||
96 | /// <summary> | 112 | /// <summary> |
97 | /// Get all the registered servers. | 113 | /// Get all the registered servers. |
98 | /// </summary> | 114 | /// </summary> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0862fcf..757e255 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -353,7 +353,18 @@ namespace OpenSim | |||
353 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) | 353 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) |
354 | WorkManager.JobEngine.Start(); | 354 | WorkManager.JobEngine.Start(); |
355 | 355 | ||
356 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | 356 | |
357 | if(m_networkServersInfo.HttpUsesSSL) | ||
358 | { | ||
359 | m_httpServerSSL = true; | ||
360 | m_httpServerPort = m_networkServersInfo.httpSSLPort; | ||
361 | } | ||
362 | else | ||
363 | { | ||
364 | m_httpServerSSL = false; | ||
365 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | ||
366 | } | ||
367 | |||
357 | SceneManager.OnRestartSim += HandleRestartRegion; | 368 | SceneManager.OnRestartSim += HandleRestartRegion; |
358 | 369 | ||
359 | // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is | 370 | // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is |
@@ -406,7 +417,18 @@ namespace OpenSim | |||
406 | 417 | ||
407 | // set initial ServerURI | 418 | // set initial ServerURI |
408 | regionInfo.HttpPort = m_httpServerPort; | 419 | regionInfo.HttpPort = m_httpServerPort; |
409 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/"; | 420 | if(m_httpServerSSL) |
421 | { | ||
422 | if(!m_httpServer.CheckSSLCertHost(regionInfo.ExternalHostName)) | ||
423 | throw new Exception("main http cert CN doesn't match region External IP"); | ||
424 | |||
425 | regionInfo.ServerURI = "https://" + regionInfo.ExternalHostName + | ||
426 | ":" + regionInfo.HttpPort.ToString() + "/"; | ||
427 | } | ||
428 | else | ||
429 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + | ||
430 | ":" + regionInfo.HttpPort.ToString() + "/"; | ||
431 | |||
410 | 432 | ||
411 | regionInfo.osSecret = m_osSecret; | 433 | regionInfo.osSecret = m_osSecret; |
412 | 434 | ||
@@ -1104,10 +1126,10 @@ namespace OpenSim | |||
1104 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | 1126 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); |
1105 | } | 1127 | } |
1106 | } | 1128 | } |
1107 | } | 1129 | } |
1108 | 1130 | ||
1109 | return true; // need to update the database | 1131 | return true; // need to update the database |
1110 | } | 1132 | } |
1111 | } | 1133 | } |
1112 | 1134 | ||
1113 | public class OpenSimConfigSource | 1135 | public class OpenSimConfigSource |
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs index 83a9fff..0112c1e 100644 --- a/OpenSim/Region/Application/RegionApplicationBase.cs +++ b/OpenSim/Region/Application/RegionApplicationBase.cs | |||
@@ -50,6 +50,7 @@ namespace OpenSim | |||
50 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); | 50 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); |
51 | protected NetworkServersInfo m_networkServersInfo; | 51 | protected NetworkServersInfo m_networkServersInfo; |
52 | protected uint m_httpServerPort; | 52 | protected uint m_httpServerPort; |
53 | protected bool m_httpServerSSL; | ||
53 | protected ISimulationDataService m_simulationDataService; | 54 | protected ISimulationDataService m_simulationDataService; |
54 | protected IEstateDataService m_estateDataService; | 55 | protected IEstateDataService m_estateDataService; |
55 | 56 | ||
@@ -68,20 +69,37 @@ namespace OpenSim | |||
68 | 69 | ||
69 | Initialize(); | 70 | Initialize(); |
70 | 71 | ||
71 | m_httpServer | 72 | uint mainport = m_networkServersInfo.HttpListenerPort; |
72 | = new BaseHttpServer( | 73 | uint mainSSLport = m_networkServersInfo.httpSSLPort; |
73 | m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, | ||
74 | m_networkServersInfo.HttpSSLCN); | ||
75 | 74 | ||
76 | if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) | 75 | if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport)) |
77 | { | 76 | { |
78 | m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); | 77 | m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); |
79 | } | 78 | } |
80 | 79 | ||
81 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); | 80 | if(m_networkServersInfo.HttpUsesSSL) |
82 | m_httpServer.Start(); | 81 | { |
82 | m_httpServer = new BaseHttpServer( | ||
83 | mainSSLport, m_networkServersInfo.HttpUsesSSL, | ||
84 | m_networkServersInfo.HttpSSLCN, | ||
85 | m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass); | ||
86 | m_httpServer.Start(true,true); | ||
87 | MainServer.AddHttpServer(m_httpServer); | ||
88 | } | ||
89 | |||
90 | // unsecure main server | ||
91 | BaseHttpServer server = new BaseHttpServer(mainport); | ||
92 | if(!m_networkServersInfo.HttpUsesSSL) | ||
93 | { | ||
94 | m_httpServer = server; | ||
95 | server.Start(true, true); | ||
96 | } | ||
97 | else | ||
98 | server.Start(false, false); | ||
99 | |||
100 | MainServer.AddHttpServer(server); | ||
101 | MainServer.UnSecureInstance = server; | ||
83 | 102 | ||
84 | MainServer.AddHttpServer(m_httpServer); | ||
85 | MainServer.Instance = m_httpServer; | 103 | MainServer.Instance = m_httpServer; |
86 | 104 | ||
87 | // "OOB" Server | 105 | // "OOB" Server |
@@ -89,22 +107,22 @@ namespace OpenSim | |||
89 | { | 107 | { |
90 | if (!m_networkServersInfo.ssl_external) | 108 | if (!m_networkServersInfo.ssl_external) |
91 | { | 109 | { |
92 | BaseHttpServer server = new BaseHttpServer( | 110 | server = new BaseHttpServer( |
93 | m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, | 111 | m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, |
112 | m_networkServersInfo.cert_path, | ||
94 | m_networkServersInfo.cert_pass); | 113 | m_networkServersInfo.cert_pass); |
95 | 114 | ||
96 | m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); | 115 | m_log.InfoFormat("[REGION SERVER]: Starting OOB HTTPS server on port {0}", server.SSLPort); |
116 | server.Start(false, false); | ||
97 | MainServer.AddHttpServer(server); | 117 | MainServer.AddHttpServer(server); |
98 | server.Start(); | ||
99 | } | 118 | } |
100 | else | 119 | else |
101 | { | 120 | { |
102 | BaseHttpServer server = new BaseHttpServer( | 121 | server = new BaseHttpServer(m_networkServersInfo.https_port); |
103 | m_networkServersInfo.https_port); | ||
104 | 122 | ||
105 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); | 123 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); |
124 | server.Start(false, false); | ||
106 | MainServer.AddHttpServer(server); | 125 | MainServer.AddHttpServer(server); |
107 | server.Start(); | ||
108 | } | 126 | } |
109 | } | 127 | } |
110 | 128 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 7c9a1c4..9ccfd5d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -30,7 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Text; |
34 | using log4net; | 34 | using log4net; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using Mono.Addins; | 36 | using Mono.Addins; |
@@ -292,8 +292,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
292 | Queue<OSD> queue; | 292 | Queue<OSD> queue; |
293 | Random rnd = new Random(Environment.TickCount); | 293 | Random rnd = new Random(Environment.TickCount); |
294 | int nrnd = rnd.Next(30000000); | 294 | int nrnd = rnd.Next(30000000); |
295 | if (nrnd < 0) | ||
296 | nrnd = -nrnd; | ||
297 | 295 | ||
298 | lock (queues) | 296 | lock (queues) |
299 | { | 297 | { |
@@ -307,21 +305,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | queue = new Queue<OSD>(); | 305 | queue = new Queue<OSD>(); |
308 | queues[agentID] = queue; | 306 | queues[agentID] = queue; |
309 | 307 | ||
310 | // push markers to handle old responses still waiting | ||
311 | // this will cost at most viewer getting two forced noevents | ||
312 | // even being a new queue better be safe | ||
313 | queue.Enqueue(null); | ||
314 | queue.Enqueue(null); // one should be enough | ||
315 | |||
316 | lock (m_AvatarQueueUUIDMapping) | 308 | lock (m_AvatarQueueUUIDMapping) |
317 | { | 309 | { |
318 | eventQueueGetUUID = UUID.Random(); | 310 | eventQueueGetUUID = UUID.Random(); |
319 | if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) | 311 | while(m_AvatarQueueUUIDMapping.ContainsKey(agentID)) |
320 | { | 312 | eventQueueGetUUID = UUID.Random(); |
321 | // oops this should not happen ? | ||
322 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID without a queue"); | ||
323 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; | ||
324 | } | ||
325 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); | 313 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); |
326 | } | 314 | } |
327 | lock (m_ids) | 315 | lock (m_ids) |
@@ -329,18 +317,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
329 | if (!m_ids.ContainsKey(agentID)) | 317 | if (!m_ids.ContainsKey(agentID)) |
330 | m_ids.Add(agentID, nrnd); | 318 | m_ids.Add(agentID, nrnd); |
331 | else | 319 | else |
332 | m_ids[agentID] = nrnd; | 320 | m_ids[agentID]++; |
333 | } | 321 | } |
334 | } | 322 | } |
335 | else | 323 | else |
336 | { | 324 | { |
337 | // push markers to handle old responses still waiting | ||
338 | // this will cost at most viewer getting two forced noevents | ||
339 | // even being a new queue better be safe | ||
340 | queue.Enqueue(null); | 325 | queue.Enqueue(null); |
341 | queue.Enqueue(null); // one should be enough | 326 | queue.Enqueue(null); // one should be enough |
342 | 327 | // reuse or not to reuse | |
343 | // reuse or not to reuse TODO FIX | ||
344 | lock (m_AvatarQueueUUIDMapping) | 328 | lock (m_AvatarQueueUUIDMapping) |
345 | { | 329 | { |
346 | // Reuse open queues. The client does! | 330 | // Reuse open queues. The client does! |
@@ -349,30 +333,39 @@ namespace OpenSim.Region.ClientStack.Linden | |||
349 | { | 333 | { |
350 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); | 334 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); |
351 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; | 335 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; |
336 | lock (m_ids) | ||
337 | { | ||
338 | // change to negative numbers so they are changed at end of sending first marker | ||
339 | // old data on a queue may be sent on a response for a new caps | ||
340 | // but at least will be sent with coerent IDs | ||
341 | if (!m_ids.ContainsKey(agentID)) | ||
342 | m_ids.Add(agentID, -nrnd); // should not happen | ||
343 | else | ||
344 | m_ids[agentID] = -m_ids[agentID]; | ||
345 | } | ||
352 | } | 346 | } |
353 | else | 347 | else |
354 | { | 348 | { |
355 | eventQueueGetUUID = UUID.Random(); | 349 | eventQueueGetUUID = UUID.Random(); |
350 | while(m_AvatarQueueUUIDMapping.ContainsKey(agentID)) | ||
351 | eventQueueGetUUID = UUID.Random(); | ||
356 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); | 352 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); |
357 | m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!"); | 353 | m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!"); |
354 | lock (m_ids) | ||
355 | { | ||
356 | if (!m_ids.ContainsKey(agentID)) | ||
357 | m_ids.Add(agentID, nrnd); | ||
358 | else | ||
359 | m_ids[agentID]++; | ||
360 | } | ||
358 | } | 361 | } |
359 | } | 362 | } |
360 | lock (m_ids) | ||
361 | { | ||
362 | // change to negative numbers so they are changed at end of sending first marker | ||
363 | // old data on a queue may be sent on a response for a new caps | ||
364 | // but at least will be sent with coerent IDs | ||
365 | if (!m_ids.ContainsKey(agentID)) | ||
366 | m_ids.Add(agentID, -nrnd); // should not happen | ||
367 | else | ||
368 | m_ids[agentID] = -m_ids[agentID]; | ||
369 | } | ||
370 | } | 363 | } |
371 | } | 364 | } |
372 | 365 | ||
373 | caps.RegisterPollHandler( | 366 | caps.RegisterPollHandler( |
374 | "EventQueueGet", | 367 | "EventQueueGet", |
375 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS)); | 368 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS)); |
376 | } | 369 | } |
377 | 370 | ||
378 | public bool HasEvents(UUID requestID, UUID agentID) | 371 | public bool HasEvents(UUID requestID, UUID agentID) |
@@ -448,7 +441,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
448 | if (DebugLevel > 0) | 441 | if (DebugLevel > 0) |
449 | LogOutboundDebugMessage(element, pAgentId); | 442 | LogOutboundDebugMessage(element, pAgentId); |
450 | array.Add(element); | 443 | array.Add(element); |
451 | thisID++; | ||
452 | } | 444 | } |
453 | } | 445 | } |
454 | 446 | ||
@@ -465,8 +457,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
465 | { | 457 | { |
466 | Random rnd = new Random(Environment.TickCount); | 458 | Random rnd = new Random(Environment.TickCount); |
467 | thisID = rnd.Next(30000000); | 459 | thisID = rnd.Next(30000000); |
468 | if (thisID < 0) | ||
469 | thisID = -thisID; | ||
470 | } | 460 | } |
471 | 461 | ||
472 | lock (m_ids) | 462 | lock (m_ids) |
@@ -474,16 +464,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
474 | m_ids[pAgentId] = thisID + 1; | 464 | m_ids[pAgentId] = thisID + 1; |
475 | } | 465 | } |
476 | 466 | ||
467 | Hashtable responsedata; | ||
477 | // if there where no elements before a marker send a NoEvents | 468 | // if there where no elements before a marker send a NoEvents |
478 | if (array.Count == 0) | 469 | if (events == null) |
479 | return NoEvents(requestID, pAgentId); | 470 | { |
480 | 471 | return NoEvents(requestID, pAgentId); | |
481 | Hashtable responsedata = new Hashtable(); | 472 | } |
482 | responsedata["int_response_code"] = 200; | 473 | else |
483 | responsedata["content_type"] = "application/xml"; | 474 | { |
484 | responsedata["keepalive"] = false; | 475 | responsedata = new Hashtable(); |
485 | responsedata["reusecontext"] = false; | 476 | responsedata["int_response_code"] = 200; |
486 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); | 477 | responsedata["content_type"] = "application/xml"; |
478 | responsedata["bin_response_data"] = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(events)); | ||
479 | } | ||
487 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); | 480 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); |
488 | return responsedata; | 481 | return responsedata; |
489 | } | 482 | } |
@@ -493,13 +486,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
493 | Hashtable responsedata = new Hashtable(); | 486 | Hashtable responsedata = new Hashtable(); |
494 | responsedata["int_response_code"] = 502; | 487 | responsedata["int_response_code"] = 502; |
495 | responsedata["content_type"] = "text/plain"; | 488 | responsedata["content_type"] = "text/plain"; |
496 | responsedata["keepalive"] = false; | ||
497 | responsedata["reusecontext"] = false; | ||
498 | responsedata["str_response_string"] = "<llsd></llsd>"; | 489 | responsedata["str_response_string"] = "<llsd></llsd>"; |
499 | responsedata["error_status_text"] = "<llsd></llsd>"; | 490 | responsedata["error_status_text"] = "<llsd></llsd>"; |
500 | responsedata["http_protocol_version"] = "HTTP/1.0"; | 491 | responsedata["http_protocol_version"] = "HTTP/1.0"; |
492 | responsedata["keepalive"] = false; | ||
501 | return responsedata; | 493 | return responsedata; |
502 | } | 494 | } |
495 | |||
503 | /* this is not a event message | 496 | /* this is not a event message |
504 | public void DisableSimulator(ulong handle, UUID avatarID) | 497 | public void DisableSimulator(ulong handle, UUID avatarID) |
505 | { | 498 | { |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index ee3f4f1..080cef9 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Text; | ||
32 | using log4net.Config; | 33 | using log4net.Config; |
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using NUnit.Framework; | 35 | using NUnit.Framework; |
@@ -59,13 +60,12 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
59 | base.SetUp(); | 60 | base.SetUp(); |
60 | 61 | ||
61 | uint port = 9999; | 62 | uint port = 9999; |
62 | uint sslPort = 9998; | ||
63 | 63 | ||
64 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static | 64 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static |
65 | // variables and the VM is not restarted between tests. | 65 | // variables and the VM is not restarted between tests. |
66 | MainServer.RemoveHttpServer(port); | 66 | MainServer.RemoveHttpServer(port); |
67 | 67 | ||
68 | BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); | 68 | BaseHttpServer server = new BaseHttpServer(port, false, "","",""); |
69 | MainServer.AddHttpServer(server); | 69 | MainServer.AddHttpServer(server); |
70 | MainServer.Instance = server; | 70 | MainServer.Instance = server; |
71 | 71 | ||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
126 | Hashtable eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); | 126 | Hashtable eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); |
127 | 127 | ||
128 | // initial queue as null events | 128 | // initial queue as null events |
129 | eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); | 129 | // eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); |
130 | if((int)eventsResponse["int_response_code"] != (int)HttpStatusCode.OK) | 130 | if((int)eventsResponse["int_response_code"] != (int)HttpStatusCode.OK) |
131 | { | 131 | { |
132 | eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); | 132 | eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); |
@@ -137,8 +137,11 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
137 | Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK)); | 137 | Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK)); |
138 | 138 | ||
139 | // Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]); | 139 | // Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]); |
140 | string data = String.Empty; | ||
141 | if(eventsResponse["bin_response_data"] != null) | ||
142 | data = Encoding.UTF8.GetString((byte[])eventsResponse["bin_response_data"]); | ||
140 | 143 | ||
141 | OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml((string)eventsResponse["str_response_string"]); | 144 | OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml(data); |
142 | OSDArray eventsOsd = (OSDArray)rawOsd["events"]; | 145 | OSDArray eventsOsd = (OSDArray)rawOsd["events"]; |
143 | 146 | ||
144 | bool foundUpdate = false; | 147 | bool foundUpdate = false; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index ba917e39..87ded7b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
76 | { | 76 | { |
77 | public Hashtable response; | 77 | public Hashtable response; |
78 | public int bytes; | 78 | public int bytes; |
79 | public int lod; | ||
80 | } | 79 | } |
81 | 80 | ||
82 | 81 | ||
@@ -231,11 +230,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
231 | new List<Hashtable>(); | 230 | new List<Hashtable>(); |
232 | private Dictionary<UUID, aPollResponse> responses = | 231 | private Dictionary<UUID, aPollResponse> responses = |
233 | new Dictionary<UUID, aPollResponse>(); | 232 | new Dictionary<UUID, aPollResponse>(); |
233 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
234 | 234 | ||
235 | private Scene m_scene; | 235 | private Scene m_scene; |
236 | private MeshCapsDataThrottler m_throttler; | 236 | private MeshCapsDataThrottler m_throttler; |
237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : | 237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : |
238 | base(null, uri, null, null, null, pId, int.MaxValue) | 238 | base(null, uri, null, null, null, null, pId, int.MaxValue) |
239 | { | 239 | { |
240 | m_scene = scene; | 240 | m_scene = scene; |
241 | m_throttler = new MeshCapsDataThrottler(100000); | 241 | m_throttler = new MeshCapsDataThrottler(100000); |
@@ -249,6 +249,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
249 | 249 | ||
250 | } | 250 | } |
251 | }; | 251 | }; |
252 | |||
253 | Drop = (x, y) => | ||
254 | { | ||
255 | lock (responses) | ||
256 | { | ||
257 | responses.Remove(x); | ||
258 | lock(dropedResponses) | ||
259 | dropedResponses.Add(x); | ||
260 | } | ||
261 | }; | ||
262 | |||
252 | GetEvents = (x, y) => | 263 | GetEvents = (x, y) => |
253 | { | 264 | { |
254 | lock (responses) | 265 | lock (responses) |
@@ -307,30 +318,48 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | if(m_scene.ShuttingDown) | 318 | if(m_scene.ShuttingDown) |
308 | return; | 319 | return; |
309 | 320 | ||
310 | // If the avatar is gone, don't bother to get the texture | 321 | lock(responses) |
311 | if (m_scene.GetScenePresence(Id) == null) | ||
312 | { | 322 | { |
313 | response = new Hashtable(); | 323 | lock(dropedResponses) |
314 | 324 | { | |
315 | response["int_response_code"] = 500; | 325 | if(dropedResponses.Contains(requestID)) |
316 | response["str_response_string"] = "Script timeout"; | 326 | { |
317 | response["content_type"] = "text/plain"; | 327 | dropedResponses.Remove(requestID); |
318 | response["keepalive"] = false; | 328 | return; |
319 | response["reusecontext"] = false; | 329 | } |
330 | } | ||
331 | |||
332 | // If the avatar is gone, don't bother to get the texture | ||
333 | if (m_scene.GetScenePresence(Id) == null) | ||
334 | { | ||
335 | response = new Hashtable(); | ||
320 | 336 | ||
321 | lock (responses) | 337 | response["int_response_code"] = 500; |
322 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 338 | response["str_response_string"] = "Script timeout"; |
339 | response["content_type"] = "text/plain"; | ||
340 | response["keepalive"] = false; | ||
341 | responses[requestID] = new aPollResponse() { bytes = 0, response = response}; | ||
323 | 342 | ||
324 | return; | 343 | return; |
344 | } | ||
325 | } | 345 | } |
326 | 346 | ||
327 | response = m_getMeshHandler.Handle(requestinfo.request); | 347 | response = m_getMeshHandler.Handle(requestinfo.request); |
348 | |||
328 | lock (responses) | 349 | lock (responses) |
329 | { | 350 | { |
351 | lock(dropedResponses) | ||
352 | { | ||
353 | if(dropedResponses.Contains(requestID)) | ||
354 | { | ||
355 | dropedResponses.Remove(requestID); | ||
356 | return; | ||
357 | } | ||
358 | } | ||
359 | |||
330 | responses[requestID] = new aPollResponse() | 360 | responses[requestID] = new aPollResponse() |
331 | { | 361 | { |
332 | bytes = (int)response["int_bytes"], | 362 | bytes = (int)response["int_bytes"], |
333 | lod = (int)response["int_lod"], | ||
334 | response = response | 363 | response = response |
335 | }; | 364 | }; |
336 | 365 | ||
@@ -443,7 +472,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
443 | return; | 472 | return; |
444 | int add = (int)(ThrottleBytes * timeElapsed * 0.001); | 473 | int add = (int)(ThrottleBytes * timeElapsed * 0.001); |
445 | if (add >= 1000) | 474 | if (add >= 1000) |
446 | { | 475 | { |
447 | lastTimeElapsed = currenttime; | 476 | lastTimeElapsed = currenttime; |
448 | BytesSent -= add; | 477 | BytesSent -= add; |
449 | if (BytesSent < 0) BytesSent = 0; | 478 | if (BytesSent < 0) BytesSent = 0; |
@@ -451,6 +480,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
451 | } | 480 | } |
452 | 481 | ||
453 | public int ThrottleBytes; | 482 | public int ThrottleBytes; |
454 | } | 483 | } |
455 | } | 484 | } |
456 | } | 485 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index b01c7dc..9a561ea 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -146,39 +146,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
146 | } | 146 | } |
147 | } | 147 | } |
148 | } | 148 | } |
149 | private int ExtractImageThrottle(byte[] pthrottles) | 149 | |
150 | { | ||
151 | |||
152 | byte[] adjData; | ||
153 | int pos = 0; | ||
154 | |||
155 | if (!BitConverter.IsLittleEndian) | ||
156 | { | ||
157 | byte[] newData = new byte[7 * 4]; | ||
158 | Buffer.BlockCopy(pthrottles, 0, newData, 0, 7 * 4); | ||
159 | |||
160 | for (int i = 0; i < 7; i++) | ||
161 | Array.Reverse(newData, i * 4, 4); | ||
162 | |||
163 | adjData = newData; | ||
164 | } | ||
165 | else | ||
166 | { | ||
167 | adjData = pthrottles; | ||
168 | } | ||
169 | |||
170 | pos = pos + 20; | ||
171 | int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); //pos += 4; | ||
172 | //int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
173 | return texture; | ||
174 | } | ||
175 | |||
176 | // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent. | 150 | // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent. |
177 | public void ThrottleUpdate(ScenePresence p) | 151 | public void ThrottleUpdate(ScenePresence p) |
178 | { | 152 | { |
179 | byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); | 153 | byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); |
180 | UUID user = p.UUID; | 154 | UUID user = p.UUID; |
181 | int imagethrottle = ExtractImageThrottle(throttles); | 155 | int imagethrottle = p.ControllingClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Texture); |
182 | PollServiceTextureEventArgs args; | 156 | PollServiceTextureEventArgs args; |
183 | if (m_pollservices.TryGetValue(user,out args)) | 157 | if (m_pollservices.TryGetValue(user,out args)) |
184 | { | 158 | { |
@@ -218,13 +192,15 @@ namespace OpenSim.Region.ClientStack.Linden | |||
218 | new List<Hashtable>(); | 192 | new List<Hashtable>(); |
219 | private Dictionary<UUID, aPollResponse> responses = | 193 | private Dictionary<UUID, aPollResponse> responses = |
220 | new Dictionary<UUID, aPollResponse>(); | 194 | new Dictionary<UUID, aPollResponse>(); |
195 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
221 | 196 | ||
222 | private Scene m_scene; | 197 | private Scene m_scene; |
223 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000); | 198 | private CapsDataThrottler m_throttler; |
224 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : | 199 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : |
225 | base(null, "", null, null, null, pId, int.MaxValue) | 200 | base(null, "", null, null, null, null, pId, int.MaxValue) |
226 | { | 201 | { |
227 | m_scene = scene; | 202 | m_scene = scene; |
203 | m_throttler = new CapsDataThrottler(100000); | ||
228 | // x is request id, y is userid | 204 | // x is request id, y is userid |
229 | HasEvents = (x, y) => | 205 | HasEvents = (x, y) => |
230 | { | 206 | { |
@@ -235,6 +211,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
235 | 211 | ||
236 | } | 212 | } |
237 | }; | 213 | }; |
214 | |||
215 | Drop = (x, y) => | ||
216 | { | ||
217 | lock (responses) | ||
218 | { | ||
219 | responses.Remove(x); | ||
220 | dropedResponses.Add(x); | ||
221 | } | ||
222 | }; | ||
223 | |||
238 | GetEvents = (x, y) => | 224 | GetEvents = (x, y) => |
239 | { | 225 | { |
240 | lock (responses) | 226 | lock (responses) |
@@ -305,53 +291,72 @@ namespace OpenSim.Region.ClientStack.Linden | |||
305 | if(m_scene.ShuttingDown) | 291 | if(m_scene.ShuttingDown) |
306 | return; | 292 | return; |
307 | 293 | ||
308 | if (requestinfo.send503) | 294 | lock (responses) |
309 | { | 295 | { |
310 | response = new Hashtable(); | 296 | lock(dropedResponses) |
297 | { | ||
298 | if(dropedResponses.Contains(requestID)) | ||
299 | { | ||
300 | dropedResponses.Remove(requestID); | ||
301 | return; | ||
302 | } | ||
303 | } | ||
311 | 304 | ||
312 | response["int_response_code"] = 503; | 305 | if (requestinfo.send503) |
313 | response["str_response_string"] = "Throttled"; | 306 | { |
314 | response["content_type"] = "text/plain"; | 307 | response = new Hashtable(); |
315 | response["keepalive"] = false; | ||
316 | response["reusecontext"] = false; | ||
317 | 308 | ||
318 | Hashtable headers = new Hashtable(); | 309 | response["int_response_code"] = 503; |
319 | headers["Retry-After"] = 30; | 310 | response["str_response_string"] = "Throttled"; |
320 | response["headers"] = headers; | 311 | response["content_type"] = "text/plain"; |
312 | response["keepalive"] = false; | ||
313 | response["reusecontext"] = false; | ||
314 | |||
315 | Hashtable headers = new Hashtable(); | ||
316 | headers["Retry-After"] = 30; | ||
317 | response["headers"] = headers; | ||
321 | 318 | ||
322 | lock (responses) | ||
323 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 319 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
324 | 320 | ||
325 | return; | 321 | return; |
326 | } | 322 | } |
327 | 323 | ||
328 | // If the avatar is gone, don't bother to get the texture | 324 | // If the avatar is gone, don't bother to get the texture |
329 | if (m_scene.GetScenePresence(Id) == null) | 325 | if (m_scene.GetScenePresence(Id) == null) |
330 | { | 326 | { |
331 | response = new Hashtable(); | 327 | response = new Hashtable(); |
332 | 328 | ||
333 | response["int_response_code"] = 500; | 329 | response["int_response_code"] = 500; |
334 | response["str_response_string"] = "Script timeout"; | 330 | response["str_response_string"] = "Script timeout"; |
335 | response["content_type"] = "text/plain"; | 331 | response["content_type"] = "text/plain"; |
336 | response["keepalive"] = false; | 332 | response["keepalive"] = false; |
337 | response["reusecontext"] = false; | 333 | response["reusecontext"] = false; |
338 | 334 | ||
339 | lock (responses) | ||
340 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 335 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
341 | 336 | ||
342 | return; | 337 | return; |
338 | } | ||
343 | } | 339 | } |
344 | 340 | ||
345 | response = m_getTextureHandler.Handle(requestinfo.request); | 341 | response = m_getTextureHandler.Handle(requestinfo.request); |
342 | |||
346 | lock (responses) | 343 | lock (responses) |
347 | { | 344 | { |
345 | lock(dropedResponses) | ||
346 | { | ||
347 | if(dropedResponses.Contains(requestID)) | ||
348 | { | ||
349 | dropedResponses.Remove(requestID); | ||
350 | m_throttler.PassTime(); | ||
351 | return; | ||
352 | } | ||
353 | } | ||
348 | responses[requestID] = new aPollResponse() | 354 | responses[requestID] = new aPollResponse() |
349 | { | 355 | { |
350 | bytes = (int) response["int_bytes"], | 356 | bytes = (int) response["int_bytes"], |
351 | response = response | 357 | response = response |
352 | }; | 358 | }; |
353 | 359 | } | |
354 | } | ||
355 | m_throttler.PassTime(); | 360 | m_throttler.PassTime(); |
356 | } | 361 | } |
357 | 362 | ||
@@ -476,7 +481,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
476 | return; | 481 | return; |
477 | int add = (int)(ThrottleBytes * timeElapsed * 0.001); | 482 | int add = (int)(ThrottleBytes * timeElapsed * 0.001); |
478 | if (add >= 1000) | 483 | if (add >= 1000) |
479 | { | 484 | { |
480 | lastTimeElapsed = currenttime; | 485 | lastTimeElapsed = currenttime; |
481 | BytesSent -= add; | 486 | BytesSent -= add; |
482 | if (BytesSent < 0) BytesSent = 0; | 487 | if (BytesSent < 0) BytesSent = 0; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 8d4e561..9cfa488 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -61,7 +61,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
61 | public UUID reqID; | 61 | public UUID reqID; |
62 | public Hashtable request; | 62 | public Hashtable request; |
63 | public ScenePresence presence; | 63 | public ScenePresence presence; |
64 | public List<UUID> folders; | ||
65 | } | 64 | } |
66 | 65 | ||
67 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 66 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -250,17 +249,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | { | 249 | { |
251 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 250 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
252 | 251 | ||
253 | private Dictionary<UUID, Hashtable> responses = | 252 | private Dictionary<UUID, Hashtable> responses = new Dictionary<UUID, Hashtable>(); |
254 | new Dictionary<UUID, Hashtable>(); | 253 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); |
255 | 254 | ||
256 | private WebFetchInvDescModule m_module; | 255 | private WebFetchInvDescModule m_module; |
257 | 256 | ||
258 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : | 257 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : |
259 | base(null, url, null, null, null, pId, int.MaxValue) | 258 | base(null, url, null, null, null, null, pId, int.MaxValue) |
260 | { | 259 | { |
261 | m_module = module; | 260 | m_module = module; |
262 | 261 | ||
263 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; | 262 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; |
263 | |||
264 | Drop = (x, y) => | ||
265 | { | ||
266 | lock (responses) | ||
267 | { | ||
268 | responses.Remove(x); | ||
269 | lock(dropedResponses) | ||
270 | dropedResponses.Add(x); | ||
271 | } | ||
272 | }; | ||
273 | |||
264 | GetEvents = (x, y) => | 274 | GetEvents = (x, y) => |
265 | { | 275 | { |
266 | lock (responses) | 276 | lock (responses) |
@@ -285,8 +295,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
285 | reqinfo.reqID = x; | 295 | reqinfo.reqID = x; |
286 | reqinfo.request = y; | 296 | reqinfo.request = y; |
287 | reqinfo.presence = sp; | 297 | reqinfo.presence = sp; |
288 | reqinfo.folders = new List<UUID>(); | ||
289 | 298 | ||
299 | /* why where we doing this? just to get cof ? | ||
300 | List<UUID> folders = new List<UUID>(); | ||
301 | |||
290 | // Decode the request here | 302 | // Decode the request here |
291 | string request = y["body"].ToString(); | 303 | string request = y["body"].ToString(); |
292 | 304 | ||
@@ -322,11 +334,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
322 | UUID folderID; | 334 | UUID folderID; |
323 | if (UUID.TryParse(folder, out folderID)) | 335 | if (UUID.TryParse(folder, out folderID)) |
324 | { | 336 | { |
325 | if (!reqinfo.folders.Contains(folderID)) | 337 | if (!folders.Contains(folderID)) |
326 | { | 338 | { |
327 | if (sp.COF != UUID.Zero && sp.COF == folderID) | 339 | if (sp.COF != UUID.Zero && sp.COF == folderID) |
328 | highPriority = true; | 340 | highPriority = true; |
329 | reqinfo.folders.Add(folderID); | 341 | folders.Add(folderID); |
330 | } | 342 | } |
331 | } | 343 | } |
332 | } | 344 | } |
@@ -334,6 +346,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
334 | if (highPriority) | 346 | if (highPriority) |
335 | m_queue.PriorityEnqueue(reqinfo); | 347 | m_queue.PriorityEnqueue(reqinfo); |
336 | else | 348 | else |
349 | */ | ||
337 | m_queue.Enqueue(reqinfo); | 350 | m_queue.Enqueue(reqinfo); |
338 | }; | 351 | }; |
339 | 352 | ||
@@ -365,6 +378,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
365 | 378 | ||
366 | UUID requestID = requestinfo.reqID; | 379 | UUID requestID = requestinfo.reqID; |
367 | 380 | ||
381 | |||
382 | lock(responses) | ||
383 | { | ||
384 | lock(dropedResponses) | ||
385 | { | ||
386 | if(dropedResponses.Contains(requestID)) | ||
387 | { | ||
388 | dropedResponses.Remove(requestID); | ||
389 | return; | ||
390 | } | ||
391 | } | ||
392 | } | ||
393 | |||
368 | Hashtable response = new Hashtable(); | 394 | Hashtable response = new Hashtable(); |
369 | 395 | ||
370 | response["int_response_code"] = 200; | 396 | response["int_response_code"] = 200; |
@@ -377,11 +403,21 @@ namespace OpenSim.Region.ClientStack.Linden | |||
377 | 403 | ||
378 | lock (responses) | 404 | lock (responses) |
379 | { | 405 | { |
406 | lock(dropedResponses) | ||
407 | { | ||
408 | if(dropedResponses.Contains(requestID)) | ||
409 | { | ||
410 | dropedResponses.Remove(requestID); | ||
411 | requestinfo.request.Clear(); | ||
412 | WebFetchInvDescModule.ProcessedRequestsCount++; | ||
413 | return; | ||
414 | } | ||
415 | } | ||
416 | |||
380 | if (responses.ContainsKey(requestID)) | 417 | if (responses.ContainsKey(requestID)) |
381 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); | 418 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); |
382 | responses[requestID] = response; | 419 | responses[requestID] = response; |
383 | } | 420 | } |
384 | requestinfo.folders.Clear(); | ||
385 | requestinfo.request.Clear(); | 421 | requestinfo.request.Clear(); |
386 | WebFetchInvDescModule.ProcessedRequestsCount++; | 422 | WebFetchInvDescModule.ProcessedRequestsCount++; |
387 | } | 423 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index f5b575b..d342163 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
110 | 110 | ||
111 | public HttpRequestModule() | 111 | public HttpRequestModule() |
112 | { | 112 | { |
113 | ServicePointManager.ServerCertificateValidationCallback +=ValidateServerCertificate; | 113 | // ServicePointManager.ServerCertificateValidationCallback +=ValidateServerCertificate; |
114 | } | 114 | } |
115 | 115 | ||
116 | public static bool ValidateServerCertificate( | 116 | public static bool ValidateServerCertificate( |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 11fc513..5f72733 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
258 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; | 258 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; |
259 | 259 | ||
260 | PollServiceEventArgs args | 260 | PollServiceEventArgs args |
261 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 261 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
262 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 262 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
263 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 263 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
264 | 264 | ||
@@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
316 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | 316 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; |
317 | 317 | ||
318 | PollServiceEventArgs args | 318 | PollServiceEventArgs args |
319 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 319 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
320 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 320 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
321 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 321 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
322 | 322 | ||
@@ -570,6 +570,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
570 | } | 570 | } |
571 | } | 571 | } |
572 | } | 572 | } |
573 | |||
574 | protected void Drop(UUID requestID, UUID sessionID) | ||
575 | { | ||
576 | UrlData url = null; | ||
577 | lock (m_RequestMap) | ||
578 | { | ||
579 | if (m_RequestMap.ContainsKey(requestID)) | ||
580 | { | ||
581 | url = m_RequestMap[requestID]; | ||
582 | m_RequestMap.Remove(requestID); | ||
583 | if(url != null) | ||
584 | { | ||
585 | lock (url.requests) | ||
586 | { | ||
587 | if(url.requests.ContainsKey(requestID)) | ||
588 | url.requests.Remove(requestID); | ||
589 | } | ||
590 | } | ||
591 | } | ||
592 | } | ||
593 | } | ||
594 | |||
573 | protected Hashtable GetEvents(UUID requestID, UUID sessionID) | 595 | protected Hashtable GetEvents(UUID requestID, UUID sessionID) |
574 | { | 596 | { |
575 | UrlData url = null; | 597 | UrlData url = null; |
@@ -729,9 +751,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
729 | else | 751 | else |
730 | { | 752 | { |
731 | queryString = queryString + val + "&"; | 753 | queryString = queryString + val + "&"; |
732 | } | ||
733 | } | 754 | } |
734 | } | 755 | } |
756 | } | ||
735 | if (queryString.Length > 1) | 757 | if (queryString.Length > 1) |
736 | queryString = queryString.Substring(0, queryString.Length - 1); | 758 | queryString = queryString.Substring(0, queryString.Length - 1); |
737 | 759 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 95b1af9..c32de62 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1833,26 +1833,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1833 | 1833 | ||
1834 | private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) | 1834 | private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) |
1835 | { | 1835 | { |
1836 | //string capsBase = "/CAPS/" + UUID.Random(); | 1836 | string cap = "/CAPS/" + UUID.Random(); |
1837 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | ||
1838 | caps.RegisterHandler( | 1837 | caps.RegisterHandler( |
1839 | "RemoteParcelRequest", | 1838 | "RemoteParcelRequest", |
1840 | new RestStreamHandler( | 1839 | new RestStreamHandler( |
1841 | "POST", | 1840 | "POST", cap, |
1842 | capsBase, | ||
1843 | (request, path, param, httpRequest, httpResponse) | 1841 | (request, path, param, httpRequest, httpResponse) |
1844 | => RemoteParcelRequest(request, path, param, agentID, caps), | 1842 | => RemoteParcelRequest(request, path, param, agentID, caps), |
1845 | "RemoteParcelRequest", | 1843 | "RemoteParcelRequest", |
1846 | agentID.ToString())); | 1844 | agentID.ToString())); |
1847 | 1845 | ||
1848 | UUID parcelCapID = UUID.Random(); | 1846 | cap = "/CAPS/" + UUID.Random(); |
1849 | caps.RegisterHandler( | 1847 | caps.RegisterHandler( |
1850 | "ParcelPropertiesUpdate", | 1848 | "ParcelPropertiesUpdate", |
1851 | new RestStreamHandler( | 1849 | new RestStreamHandler( |
1852 | "POST", | 1850 | "POST", cap, |
1853 | "/CAPS/" + parcelCapID, | 1851 | (request, path, param, httpRequest, httpResponse) |
1854 | (request, path, param, httpRequest, httpResponse) | 1852 | => ProcessPropertiesUpdate(request, path, param, agentID, caps), |
1855 | => ProcessPropertiesUpdate(request, path, param, agentID, caps), | ||
1856 | "ParcelPropertiesUpdate", | 1853 | "ParcelPropertiesUpdate", |
1857 | agentID.ToString())); | 1854 | agentID.ToString())); |
1858 | } | 1855 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 3fd6e13..d8f2b80 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -250,7 +250,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
250 | } | 250 | } |
251 | 251 | ||
252 | foreach (TaskInventoryItem item in m_items.Values) | 252 | foreach (TaskInventoryItem item in m_items.Values) |
253 | item.GroupID = groupID; | 253 | item.GroupID = groupID; |
254 | 254 | ||
255 | m_items.LockItemsForWrite(false); | 255 | m_items.LockItemsForWrite(false); |
256 | } | 256 | } |
@@ -1454,7 +1454,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1454 | { | 1454 | { |
1455 | if (item.InvType == (int)InventoryType.LSL) | 1455 | if (item.InvType == (int)InventoryType.LSL) |
1456 | count++; | 1456 | count++; |
1457 | } | 1457 | } |
1458 | m_items.LockItemsForRead(false); | 1458 | m_items.LockItemsForRead(false); |
1459 | return count; | 1459 | return count; |
1460 | } | 1460 | } |
@@ -1479,9 +1479,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1479 | { | 1479 | { |
1480 | if (engine.GetScriptState(item.ItemID)) | 1480 | if (engine.GetScriptState(item.ItemID)) |
1481 | count++; | 1481 | count++; |
1482 | } | ||
1482 | } | 1483 | } |
1483 | } | 1484 | } |
1484 | } | ||
1485 | return count; | 1485 | return count; |
1486 | } | 1486 | } |
1487 | 1487 | ||
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs index 50276ae..5a01fa9 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs | |||
@@ -52,12 +52,12 @@ namespace OpenSim.Region.DataSnapshot | |||
52 | m_externalData = externalData; | 52 | m_externalData = externalData; |
53 | 53 | ||
54 | //Register HTTP handler | 54 | //Register HTTP handler |
55 | if (MainServer.Instance.AddHTTPHandler("collector", OnGetSnapshot)) | 55 | if (MainServer.UnSecureInstance.AddHTTPHandler("collector", OnGetSnapshot)) |
56 | { | 56 | { |
57 | m_log.Info("[DATASNAPSHOT]: Set up snapshot service"); | 57 | m_log.Info("[DATASNAPSHOT]: Set up snapshot service"); |
58 | } | 58 | } |
59 | // Register validation callback handler | 59 | // Register validation callback handler |
60 | MainServer.Instance.AddHTTPHandler("validate", OnValidate); | 60 | MainServer.UnSecureInstance.AddHTTPHandler("validate", OnValidate); |
61 | 61 | ||
62 | } | 62 | } |
63 | 63 | ||
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index 0e46471..f111e87 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -751,8 +751,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
751 | 751 | ||
752 | m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace); | 752 | m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace); |
753 | 753 | ||
754 | collider = d.HashSpaceCreate(m_parent_scene.CharsSpace); | 754 | collider = d.SimpleSpaceCreate(m_parent_scene.CharsSpace); |
755 | d.HashSpaceSetLevels(collider, -4, 3); | ||
756 | d.SpaceSetSublevel(collider, 3); | 755 | d.SpaceSetSublevel(collider, 3); |
757 | d.SpaceSetCleanup(collider, false); | 756 | d.SpaceSetCleanup(collider, false); |
758 | d.GeomSetCategoryBits(collider, (uint)m_collisionCategories); | 757 | d.GeomSetCategoryBits(collider, (uint)m_collisionCategories); |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index aa208e2..e080b18 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |||
@@ -196,8 +196,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
196 | 196 | ||
197 | private int m_eventsubscription; | 197 | private int m_eventsubscription; |
198 | private int m_cureventsubscription; | 198 | private int m_cureventsubscription; |
199 | private CollisionEventUpdate CollisionEventsThisFrame = null; | 199 | private CollisionEventUpdate CollisionEvents = null; |
200 | private CollisionEventUpdate CollisionVDTCEventsThisFrame = null; | 200 | private CollisionEventUpdate CollisionVDTCEvents = null; |
201 | private bool SentEmptyCollisionsEvent; | 201 | private bool SentEmptyCollisionsEvent; |
202 | 202 | ||
203 | public volatile bool childPrim; | 203 | public volatile bool childPrim; |
@@ -1138,24 +1138,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1138 | { | 1138 | { |
1139 | m_eventsubscription = ms; | 1139 | m_eventsubscription = ms; |
1140 | m_cureventsubscription = 0; | 1140 | m_cureventsubscription = 0; |
1141 | if (CollisionEventsThisFrame == null) | 1141 | if (CollisionEvents == null) |
1142 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1142 | CollisionEvents = new CollisionEventUpdate(); |
1143 | if (CollisionVDTCEventsThisFrame == null) | 1143 | if (CollisionVDTCEvents == null) |
1144 | CollisionVDTCEventsThisFrame = new CollisionEventUpdate(); | 1144 | CollisionVDTCEvents = new CollisionEventUpdate(); |
1145 | SentEmptyCollisionsEvent = false; | 1145 | SentEmptyCollisionsEvent = false; |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | public override void UnSubscribeEvents() | 1148 | public override void UnSubscribeEvents() |
1149 | { | 1149 | { |
1150 | if (CollisionVDTCEventsThisFrame != null) | 1150 | if (CollisionVDTCEvents != null) |
1151 | { | 1151 | { |
1152 | CollisionVDTCEventsThisFrame.Clear(); | 1152 | CollisionVDTCEvents.Clear(); |
1153 | CollisionVDTCEventsThisFrame = null; | 1153 | CollisionVDTCEvents = null; |
1154 | } | 1154 | } |
1155 | if (CollisionEventsThisFrame != null) | 1155 | if (CollisionEvents != null) |
1156 | { | 1156 | { |
1157 | CollisionEventsThisFrame.Clear(); | 1157 | CollisionEvents.Clear(); |
1158 | CollisionEventsThisFrame = null; | 1158 | CollisionEvents = null; |
1159 | } | 1159 | } |
1160 | m_eventsubscription = 0; | 1160 | m_eventsubscription = 0; |
1161 | _parent_scene.RemoveCollisionEventReporting(this); | 1161 | _parent_scene.RemoveCollisionEventReporting(this); |
@@ -1163,27 +1163,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1163 | 1163 | ||
1164 | public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) | 1164 | public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) |
1165 | { | 1165 | { |
1166 | if (CollisionEventsThisFrame == null) | 1166 | if (CollisionEvents == null) |
1167 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1167 | CollisionEvents = new CollisionEventUpdate(); |
1168 | 1168 | ||
1169 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); | 1169 | CollisionEvents.AddCollider(CollidedWith, contact); |
1170 | _parent_scene.AddCollisionEventReporting(this); | 1170 | _parent_scene.AddCollisionEventReporting(this); |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | public override void AddVDTCCollisionEvent(uint CollidedWith, ContactPoint contact) | 1173 | public override void AddVDTCCollisionEvent(uint CollidedWith, ContactPoint contact) |
1174 | { | 1174 | { |
1175 | if (CollisionVDTCEventsThisFrame == null) | 1175 | if (CollisionVDTCEvents == null) |
1176 | CollisionVDTCEventsThisFrame = new CollisionEventUpdate(); | 1176 | CollisionVDTCEvents = new CollisionEventUpdate(); |
1177 | 1177 | ||
1178 | CollisionVDTCEventsThisFrame.AddCollider(CollidedWith, contact); | 1178 | CollisionVDTCEvents.AddCollider(CollidedWith, contact); |
1179 | _parent_scene.AddCollisionEventReporting(this); | 1179 | _parent_scene.AddCollisionEventReporting(this); |
1180 | } | 1180 | } |
1181 | 1181 | ||
1182 | internal void SleeperAddCollisionEvents() | 1182 | internal void SleeperAddCollisionEvents() |
1183 | { | 1183 | { |
1184 | if(CollisionEventsThisFrame != null && CollisionEventsThisFrame.m_objCollisionList.Count != 0) | 1184 | if(CollisionEvents != null && CollisionEvents.m_objCollisionList.Count != 0) |
1185 | { | 1185 | { |
1186 | foreach(KeyValuePair<uint,ContactPoint> kvp in CollisionEventsThisFrame.m_objCollisionList) | 1186 | foreach(KeyValuePair<uint,ContactPoint> kvp in CollisionEvents.m_objCollisionList) |
1187 | { | 1187 | { |
1188 | if(kvp.Key == 0) | 1188 | if(kvp.Key == 0) |
1189 | continue; | 1189 | continue; |
@@ -1196,9 +1196,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1196 | other.AddCollisionEvent(ParentActor.LocalID,cp); | 1196 | other.AddCollisionEvent(ParentActor.LocalID,cp); |
1197 | } | 1197 | } |
1198 | } | 1198 | } |
1199 | if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.m_objCollisionList.Count != 0) | 1199 | if(CollisionVDTCEvents != null && CollisionVDTCEvents.m_objCollisionList.Count != 0) |
1200 | { | 1200 | { |
1201 | foreach(KeyValuePair<uint,ContactPoint> kvp in CollisionVDTCEventsThisFrame.m_objCollisionList) | 1201 | foreach(KeyValuePair<uint,ContactPoint> kvp in CollisionVDTCEvents.m_objCollisionList) |
1202 | { | 1202 | { |
1203 | OdePrim other = _parent_scene.getPrim(kvp.Key); | 1203 | OdePrim other = _parent_scene.getPrim(kvp.Key); |
1204 | if(other == null) | 1204 | if(other == null) |
@@ -1213,8 +1213,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1213 | 1213 | ||
1214 | internal void clearSleeperCollisions() | 1214 | internal void clearSleeperCollisions() |
1215 | { | 1215 | { |
1216 | if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.Count >0 ) | 1216 | if(CollisionVDTCEvents != null && CollisionVDTCEvents.Count >0 ) |
1217 | CollisionVDTCEventsThisFrame.Clear(); | 1217 | CollisionVDTCEvents.Clear(); |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | public void SendCollisions(int timestep) | 1220 | public void SendCollisions(int timestep) |
@@ -1226,14 +1226,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1226 | if (m_cureventsubscription < m_eventsubscription) | 1226 | if (m_cureventsubscription < m_eventsubscription) |
1227 | return; | 1227 | return; |
1228 | 1228 | ||
1229 | if (CollisionEventsThisFrame == null) | 1229 | if (CollisionEvents == null) |
1230 | return; | 1230 | return; |
1231 | 1231 | ||
1232 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; | 1232 | int ncolisions = CollisionEvents.m_objCollisionList.Count; |
1233 | 1233 | ||
1234 | if (!SentEmptyCollisionsEvent || ncolisions > 0) | 1234 | if (!SentEmptyCollisionsEvent || ncolisions > 0) |
1235 | { | 1235 | { |
1236 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 1236 | base.SendCollisionUpdate(CollisionEvents); |
1237 | m_cureventsubscription = 0; | 1237 | m_cureventsubscription = 0; |
1238 | 1238 | ||
1239 | if (ncolisions == 0) | 1239 | if (ncolisions == 0) |
@@ -1244,7 +1244,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1244 | else if(Body == IntPtr.Zero || (d.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) | 1244 | else if(Body == IntPtr.Zero || (d.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) |
1245 | { | 1245 | { |
1246 | SentEmptyCollisionsEvent = false; | 1246 | SentEmptyCollisionsEvent = false; |
1247 | CollisionEventsThisFrame.Clear(); | 1247 | CollisionEvents.Clear(); |
1248 | } | 1248 | } |
1249 | } | 1249 | } |
1250 | } | 1250 | } |
@@ -1832,7 +1832,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1832 | // should only be called for non physical prims unless they are becoming non physical | 1832 | // should only be called for non physical prims unless they are becoming non physical |
1833 | private void SetInStaticSpace(OdePrim prim) | 1833 | private void SetInStaticSpace(OdePrim prim) |
1834 | { | 1834 | { |
1835 | IntPtr targetSpace = _parent_scene.MoveGeomToStaticSpace(prim.prim_geom, prim._position, prim.m_targetSpace); | 1835 | IntPtr targetSpace = _parent_scene.MoveGeomToStaticSpace(prim.prim_geom, prim.m_targetSpace); |
1836 | prim.m_targetSpace = targetSpace; | 1836 | prim.m_targetSpace = targetSpace; |
1837 | collide_geom = IntPtr.Zero; | 1837 | collide_geom = IntPtr.Zero; |
1838 | } | 1838 | } |
@@ -2069,8 +2069,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2069 | } | 2069 | } |
2070 | else | 2070 | else |
2071 | { | 2071 | { |
2072 | m_targetSpace = d.HashSpaceCreate(_parent_scene.ActiveSpace); | 2072 | m_targetSpace = d.SimpleSpaceCreate(_parent_scene.ActiveSpace); |
2073 | d.HashSpaceSetLevels(m_targetSpace, -2, 8); | ||
2074 | d.SpaceSetSublevel(m_targetSpace, 3); | 2073 | d.SpaceSetSublevel(m_targetSpace, 3); |
2075 | d.SpaceSetCleanup(m_targetSpace, false); | 2074 | d.SpaceSetCleanup(m_targetSpace, false); |
2076 | 2075 | ||
@@ -2964,7 +2963,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2964 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 2963 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
2965 | _position = newPos; | 2964 | _position = newPos; |
2966 | 2965 | ||
2967 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, _position, m_targetSpace); | 2966 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); |
2968 | } | 2967 | } |
2969 | } | 2968 | } |
2970 | } | 2969 | } |
@@ -3103,7 +3102,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3103 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 3102 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
3104 | _position = newPos; | 3103 | _position = newPos; |
3105 | 3104 | ||
3106 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, _position, m_targetSpace); | 3105 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); |
3107 | } | 3106 | } |
3108 | } | 3107 | } |
3109 | } | 3108 | } |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 004ee7f..5f63a7b 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |||
@@ -179,12 +179,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
179 | 179 | ||
180 | // const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce; | 180 | // const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce; |
181 | 181 | ||
182 | const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1 | d.ContactFlags.Slip1 | d.ContactFlags.Slip2; | 182 | // const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1 | d.ContactFlags.Slip1 | d.ContactFlags.Slip2; |
183 | const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1; | ||
183 | const float comumContactERP = 0.75f; | 184 | const float comumContactERP = 0.75f; |
184 | const float comumContactCFM = 0.0001f; | 185 | const float comumContactCFM = 0.0001f; |
185 | const float comumContactSLIP = 0f; | 186 | const float comumContactSLIP = 0f; |
186 | 187 | ||
187 | float frictionMovementMult = 0.8f; | 188 | // float frictionMovementMult = 0.2f; |
188 | 189 | ||
189 | float TerrainBounce = 0.001f; | 190 | float TerrainBounce = 0.001f; |
190 | float TerrainFriction = 0.3f; | 191 | float TerrainFriction = 0.3f; |
@@ -200,7 +201,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
200 | public float ODE_STEPSIZE = 0.020f; | 201 | public float ODE_STEPSIZE = 0.020f; |
201 | public float HalfOdeStep = 0.01f; | 202 | public float HalfOdeStep = 0.01f; |
202 | public int odetimestepMS = 20; // rounded | 203 | public int odetimestepMS = 20; // rounded |
203 | private float metersInSpace = 25.6f; | ||
204 | private float m_timeDilation = 1.0f; | 204 | private float m_timeDilation = 1.0f; |
205 | 205 | ||
206 | private double m_lastframe; | 206 | private double m_lastframe; |
@@ -283,16 +283,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
283 | public IntPtr StaticSpace; // space for the static things around | 283 | public IntPtr StaticSpace; // space for the static things around |
284 | public IntPtr GroundSpace; // space for ground | 284 | public IntPtr GroundSpace; // space for ground |
285 | 285 | ||
286 | // some speedup variables | ||
287 | private int spaceGridMaxX; | ||
288 | private int spaceGridMaxY; | ||
289 | private float spacesPerMeterX; | ||
290 | private float spacesPerMeterY; | ||
291 | |||
292 | // split static geometry collision into a grid as before | ||
293 | private IntPtr[,] staticPrimspace; | ||
294 | private IntPtr[] staticPrimspaceOffRegion; | ||
295 | |||
296 | public Object OdeLock; | 286 | public Object OdeLock; |
297 | public static Object SimulationLock; | 287 | public static Object SimulationLock; |
298 | 288 | ||
@@ -385,13 +375,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
385 | try | 375 | try |
386 | { | 376 | { |
387 | world = d.WorldCreate(); | 377 | world = d.WorldCreate(); |
388 | TopSpace = d.HashSpaceCreate(IntPtr.Zero); | 378 | TopSpace = d.SimpleSpaceCreate(IntPtr.Zero); |
389 | 379 | ActiveSpace = d.SimpleSpaceCreate(TopSpace); | |
390 | // now the major subspaces | 380 | CharsSpace = d.SimpleSpaceCreate(TopSpace); |
391 | ActiveSpace = d.HashSpaceCreate(TopSpace); | 381 | GroundSpace = d.SimpleSpaceCreate(TopSpace); |
392 | CharsSpace = d.HashSpaceCreate(TopSpace); | 382 | float sx = WorldExtents.X + 16; |
393 | StaticSpace = d.HashSpaceCreate(TopSpace); | 383 | float sy = WorldExtents.Y + 16; |
394 | GroundSpace = d.HashSpaceCreate(TopSpace); | 384 | d.Vector3 ex =new d.Vector3(sx, sy, 0); |
385 | d.Vector3 px =new d.Vector3(sx * 0.5f, sx * 0.5f, 0); | ||
386 | if(sx < sy) | ||
387 | sx = sy; | ||
388 | sx = (float)Math.Log(sx) * 1.442695f + 0.5f; | ||
389 | int dp = (int)sx - 2; | ||
390 | if(dp > 8) | ||
391 | dp = 8; | ||
392 | else if(dp < 4) | ||
393 | dp = 4; | ||
394 | StaticSpace = d.QuadTreeSpaceCreate(TopSpace, ref px, ref ex, dp); | ||
395 | } | 395 | } |
396 | catch | 396 | catch |
397 | { | 397 | { |
@@ -399,12 +399,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
399 | // i did! | 399 | // i did! |
400 | } | 400 | } |
401 | 401 | ||
402 | d.HashSpaceSetLevels(TopSpace, -5, 12); | ||
403 | d.HashSpaceSetLevels(ActiveSpace, -5, 10); | ||
404 | d.HashSpaceSetLevels(CharsSpace, -4, 3); | ||
405 | d.HashSpaceSetLevels(StaticSpace, -5, 12); | ||
406 | d.HashSpaceSetLevels(GroundSpace, 0, 8); | ||
407 | |||
408 | // demote to second level | 402 | // demote to second level |
409 | d.SpaceSetSublevel(ActiveSpace, 1); | 403 | d.SpaceSetSublevel(ActiveSpace, 1); |
410 | d.SpaceSetSublevel(CharsSpace, 1); | 404 | d.SpaceSetSublevel(CharsSpace, 1); |
@@ -468,8 +462,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
468 | gravityy = physicsconfig.GetFloat("world_gravityy", gravityy); | 462 | gravityy = physicsconfig.GetFloat("world_gravityy", gravityy); |
469 | gravityz = physicsconfig.GetFloat("world_gravityz", gravityz); | 463 | gravityz = physicsconfig.GetFloat("world_gravityz", gravityz); |
470 | 464 | ||
471 | metersInSpace = physicsconfig.GetFloat("meters_in_small_space", metersInSpace); | ||
472 | |||
473 | // contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer); | 465 | // contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer); |
474 | 466 | ||
475 | ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE); | 467 | ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE); |
@@ -559,76 +551,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
559 | m_materialContactsData[(int)Material.light].mu = 0.0f; | 551 | m_materialContactsData[(int)Material.light].mu = 0.0f; |
560 | m_materialContactsData[(int)Material.light].bounce = 0.0f; | 552 | m_materialContactsData[(int)Material.light].bounce = 0.0f; |
561 | 553 | ||
562 | |||
563 | spacesPerMeterX = 1.0f / metersInSpace; | ||
564 | spacesPerMeterY = spacesPerMeterX; | ||
565 | spaceGridMaxX = (int)(WorldExtents.X * spacesPerMeterX); | ||
566 | spaceGridMaxY = (int)(WorldExtents.Y * spacesPerMeterY); | ||
567 | |||
568 | if (spaceGridMaxX > 24) | ||
569 | { | ||
570 | spaceGridMaxX = 24; | ||
571 | spacesPerMeterX = spaceGridMaxX / WorldExtents.X; | ||
572 | } | ||
573 | |||
574 | if (spaceGridMaxY > 24) | ||
575 | { | ||
576 | spaceGridMaxY = 24; | ||
577 | spacesPerMeterY = spaceGridMaxY / WorldExtents.Y; | ||
578 | } | ||
579 | |||
580 | staticPrimspace = new IntPtr[spaceGridMaxX, spaceGridMaxY]; | ||
581 | |||
582 | // create all spaces now | ||
583 | int i, j; | ||
584 | IntPtr newspace; | ||
585 | |||
586 | for (i = 0; i < spaceGridMaxX; i++) | ||
587 | for (j = 0; j < spaceGridMaxY; j++) | ||
588 | { | ||
589 | newspace = d.HashSpaceCreate(StaticSpace); | ||
590 | d.GeomSetCategoryBits(newspace, (int)CollisionCategories.Space); | ||
591 | waitForSpaceUnlock(newspace); | ||
592 | d.SpaceSetSublevel(newspace, 2); | ||
593 | d.HashSpaceSetLevels(newspace, -2, 8); | ||
594 | d.GeomSetCategoryBits(newspace, (uint)(CollisionCategories.Space | | ||
595 | CollisionCategories.Geom | | ||
596 | CollisionCategories.Land | | ||
597 | CollisionCategories.Water | | ||
598 | CollisionCategories.Phantom | | ||
599 | CollisionCategories.VolumeDtc | ||
600 | )); | ||
601 | d.GeomSetCollideBits(newspace, 0); | ||
602 | |||
603 | staticPrimspace[i, j] = newspace; | ||
604 | } | ||
605 | |||
606 | // let this now be index limit | ||
607 | spaceGridMaxX--; | ||
608 | spaceGridMaxY--; | ||
609 | |||
610 | // create 4 off world spaces (x<0,x>max,y<0,y>max) | ||
611 | staticPrimspaceOffRegion = new IntPtr[4]; | ||
612 | |||
613 | for (i = 0; i < 4; i++) | ||
614 | { | ||
615 | newspace = d.HashSpaceCreate(StaticSpace); | ||
616 | d.GeomSetCategoryBits(newspace, (int)CollisionCategories.Space); | ||
617 | waitForSpaceUnlock(newspace); | ||
618 | d.SpaceSetSublevel(newspace, 2); | ||
619 | d.HashSpaceSetLevels(newspace, -2, 8); | ||
620 | d.GeomSetCategoryBits(newspace, (uint)(CollisionCategories.Space | | ||
621 | CollisionCategories.Geom | | ||
622 | CollisionCategories.Land | | ||
623 | CollisionCategories.Water | | ||
624 | CollisionCategories.Phantom | | ||
625 | CollisionCategories.VolumeDtc | ||
626 | )); | ||
627 | d.GeomSetCollideBits(newspace, 0); | ||
628 | |||
629 | staticPrimspaceOffRegion[i] = newspace; | ||
630 | } | ||
631 | |||
632 | m_lastframe = Util.GetTimeStamp(); | 554 | m_lastframe = Util.GetTimeStamp(); |
633 | m_lastMeshExpire = m_lastframe; | 555 | m_lastMeshExpire = m_lastframe; |
634 | step_time = -1; | 556 | step_time = -1; |
@@ -757,7 +679,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
757 | // | 679 | // |
758 | */ | 680 | */ |
759 | 681 | ||
760 | |||
761 | if (d.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || | 682 | if (d.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || |
762 | d.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) | 683 | d.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) |
763 | { | 684 | { |
@@ -866,9 +787,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
866 | break; | 787 | break; |
867 | 788 | ||
868 | case (int)ActorTypes.Prim: | 789 | case (int)ActorTypes.Prim: |
869 | Vector3 relV = p1.rootVelocity - p2.rootVelocity; | 790 | // Vector3 relV = p1.rootVelocity - p2.rootVelocity; |
870 | float relVlenSQ = relV.LengthSquared(); | 791 | // float relVlenSQ = relV.LengthSquared(); |
871 | if (relVlenSQ > 0.0001f) | 792 | // if (relVlenSQ > 0.0001f) |
872 | { | 793 | { |
873 | p1.CollidingObj = true; | 794 | p1.CollidingObj = true; |
874 | p2.CollidingObj = true; | 795 | p2.CollidingObj = true; |
@@ -878,8 +799,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
878 | bounce = contactdata1.bounce * contactdata2.bounce; | 799 | bounce = contactdata1.bounce * contactdata2.bounce; |
879 | mu = (float)Math.Sqrt(contactdata1.mu * contactdata2.mu); | 800 | mu = (float)Math.Sqrt(contactdata1.mu * contactdata2.mu); |
880 | 801 | ||
881 | if (relVlenSQ > 0.01f) | 802 | // if (relVlenSQ > 0.01f) |
882 | mu *= frictionMovementMult; | 803 | // mu *= frictionMovementMult; |
883 | 804 | ||
884 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass && | 805 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass && |
885 | d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) | 806 | d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) |
@@ -891,9 +812,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
891 | bounce = contactdata1.bounce * TerrainBounce; | 812 | bounce = contactdata1.bounce * TerrainBounce; |
892 | mu = (float)Math.Sqrt(contactdata1.mu * TerrainFriction); | 813 | mu = (float)Math.Sqrt(contactdata1.mu * TerrainFriction); |
893 | 814 | ||
894 | Vector3 v1 = p1.rootVelocity; | 815 | // Vector3 v1 = p1.rootVelocity; |
895 | if (Math.Abs(v1.X) > 0.1f || Math.Abs(v1.Y) > 0.1f) | 816 | // if (Math.Abs(v1.X) > 0.1f || Math.Abs(v1.Y) > 0.1f) |
896 | mu *= frictionMovementMult; | 817 | // mu *= frictionMovementMult; |
897 | p1.CollidingGround = true; | 818 | p1.CollidingGround = true; |
898 | 819 | ||
899 | if(d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) | 820 | if(d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) |
@@ -918,9 +839,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
918 | 839 | ||
919 | // if (curContact.side1 > 0) // should be 2 ? | 840 | // if (curContact.side1 > 0) // should be 2 ? |
920 | // IgnoreNegSides = true; | 841 | // IgnoreNegSides = true; |
921 | Vector3 v2 = p2.rootVelocity; | 842 | // Vector3 v2 = p2.rootVelocity; |
922 | if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) | 843 | // if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) |
923 | mu *= frictionMovementMult; | 844 | // mu *= frictionMovementMult; |
924 | 845 | ||
925 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass) | 846 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass) |
926 | smoothMesh = true; | 847 | smoothMesh = true; |
@@ -1306,6 +1227,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1306 | public override void RemoveAvatar(PhysicsActor actor) | 1227 | public override void RemoveAvatar(PhysicsActor actor) |
1307 | { | 1228 | { |
1308 | //m_log.Debug("[PHYSICS]:ODELOCK"); | 1229 | //m_log.Debug("[PHYSICS]:ODELOCK"); |
1230 | if (world == IntPtr.Zero) | ||
1231 | return; | ||
1232 | |||
1309 | lock (OdeLock) | 1233 | lock (OdeLock) |
1310 | { | 1234 | { |
1311 | d.AllocateODEDataForThread(0); | 1235 | d.AllocateODEDataForThread(0); |
@@ -1460,27 +1384,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1460 | 1384 | ||
1461 | /// <summary> | 1385 | /// <summary> |
1462 | /// Called when a static prim moves or becomes static | 1386 | /// Called when a static prim moves or becomes static |
1463 | /// Places the prim in a space one the static sub-spaces grid | 1387 | /// Places the prim in a space one the static space |
1464 | /// </summary> | 1388 | /// </summary> |
1465 | /// <param name="geom">the pointer to the geom that moved</param> | 1389 | /// <param name="geom">the pointer to the geom that moved</param> |
1466 | /// <param name="pos">the position that the geom moved to</param> | ||
1467 | /// <param name="currentspace">a pointer to the space it was in before it was moved.</param> | 1390 | /// <param name="currentspace">a pointer to the space it was in before it was moved.</param> |
1468 | /// <returns>a pointer to the new space it's in</returns> | 1391 | /// <returns>a pointer to the new space it's in</returns> |
1469 | public IntPtr MoveGeomToStaticSpace(IntPtr geom, Vector3 pos, IntPtr currentspace) | 1392 | public IntPtr MoveGeomToStaticSpace(IntPtr geom, IntPtr currentspace) |
1470 | { | 1393 | { |
1471 | // moves a prim into another static sub-space or from another space into a static sub-space | 1394 | // moves a prim into static sub-space |
1472 | 1395 | ||
1473 | // Called ODEPrim so | 1396 | // Called ODEPrim so |
1474 | // it's already in locked space. | 1397 | // it's already in locked space. |
1475 | 1398 | ||
1476 | if (geom == IntPtr.Zero) // shouldn't happen | 1399 | if (geom == IntPtr.Zero) // shouldn't happen |
1477 | return IntPtr.Zero; | 1400 | return IntPtr.Zero; |
1478 | 1401 | ||
1479 | // get the static sub-space for current position | 1402 | if (StaticSpace == currentspace) // if we are there all done |
1480 | IntPtr newspace = calculateSpaceForGeom(pos); | 1403 | return StaticSpace; |
1481 | |||
1482 | if (newspace == currentspace) // if we are there all done | ||
1483 | return newspace; | ||
1484 | 1404 | ||
1485 | // else remove it from its current space | 1405 | // else remove it from its current space |
1486 | if (currentspace != IntPtr.Zero && d.SpaceQuery(currentspace, geom)) | 1406 | if (currentspace != IntPtr.Zero && d.SpaceQuery(currentspace, geom)) |
@@ -1515,44 +1435,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1515 | { | 1435 | { |
1516 | d.SpaceDestroy(currentspace); | 1436 | d.SpaceDestroy(currentspace); |
1517 | } | 1437 | } |
1518 | |||
1519 | } | 1438 | } |
1520 | } | 1439 | } |
1521 | } | 1440 | } |
1522 | 1441 | ||
1523 | // put the geom in the newspace | 1442 | // put the geom in the newspace |
1524 | waitForSpaceUnlock(newspace); | 1443 | waitForSpaceUnlock(StaticSpace); |
1525 | d.SpaceAdd(newspace, geom); | 1444 | d.SpaceAdd(StaticSpace, geom); |
1526 | 1445 | ||
1527 | // let caller know this newspace | 1446 | return StaticSpace; |
1528 | return newspace; | ||
1529 | } | 1447 | } |
1530 | 1448 | ||
1531 | /// <summary> | ||
1532 | /// Calculates the space the prim should be in by its position | ||
1533 | /// </summary> | ||
1534 | /// <param name="pos"></param> | ||
1535 | /// <returns>a pointer to the space. This could be a new space or reused space.</returns> | ||
1536 | public IntPtr calculateSpaceForGeom(Vector3 pos) | ||
1537 | { | ||
1538 | int x, y; | ||
1539 | |||
1540 | if (pos.X < 0) | ||
1541 | return staticPrimspaceOffRegion[0]; | ||
1542 | |||
1543 | if (pos.Y < 0) | ||
1544 | return staticPrimspaceOffRegion[2]; | ||
1545 | |||
1546 | x = (int)(pos.X * spacesPerMeterX); | ||
1547 | if (x > spaceGridMaxX) | ||
1548 | return staticPrimspaceOffRegion[1]; | ||
1549 | |||
1550 | y = (int)(pos.Y * spacesPerMeterY); | ||
1551 | if (y > spaceGridMaxY) | ||
1552 | return staticPrimspaceOffRegion[3]; | ||
1553 | |||
1554 | return staticPrimspace[x, y]; | ||
1555 | } | ||
1556 | 1449 | ||
1557 | #endregion | 1450 | #endregion |
1558 | 1451 | ||
@@ -1641,6 +1534,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1641 | /// <returns></returns> | 1534 | /// <returns></returns> |
1642 | public override float Simulate(float reqTimeStep) | 1535 | public override float Simulate(float reqTimeStep) |
1643 | { | 1536 | { |
1537 | if (world == IntPtr.Zero) | ||
1538 | return 0; | ||
1539 | |||
1644 | double now = Util.GetTimeStamp(); | 1540 | double now = Util.GetTimeStamp(); |
1645 | double timeStep = now - m_lastframe; | 1541 | double timeStep = now - m_lastframe; |
1646 | m_lastframe = now; | 1542 | m_lastframe = now; |
@@ -1679,10 +1575,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1679 | double maxChangestime = (int)(reqTimeStep * 500f); // half the time | 1575 | double maxChangestime = (int)(reqTimeStep * 500f); // half the time |
1680 | double maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time | 1576 | double maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time |
1681 | 1577 | ||
1682 | // double collisionTime = 0; | 1578 | /* |
1683 | // double qstepTIme = 0; | 1579 | double collisionTime = 0; |
1684 | // double tmpTime = 0; | 1580 | double qstepTIme = 0; |
1685 | 1581 | double tmpTime = 0; | |
1582 | double changestot = 0; | ||
1583 | double collisonRepo = 0; | ||
1584 | double updatesTime = 0; | ||
1585 | double moveTime = 0; | ||
1586 | double rayTime = 0; | ||
1587 | */ | ||
1686 | d.AllocateODEDataForThread(~0U); | 1588 | d.AllocateODEDataForThread(~0U); |
1687 | 1589 | ||
1688 | if (ChangesQueue.Count > 0) | 1590 | if (ChangesQueue.Count > 0) |
@@ -1719,6 +1621,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1719 | m_global_contactcount = 0; | 1621 | m_global_contactcount = 0; |
1720 | 1622 | ||
1721 | 1623 | ||
1624 | // tmpTime = Util.GetTimeStampMS(); | ||
1625 | |||
1722 | // Move characters | 1626 | // Move characters |
1723 | lock (_characters) | 1627 | lock (_characters) |
1724 | { | 1628 | { |
@@ -1746,13 +1650,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1746 | aprim.Move(); | 1650 | aprim.Move(); |
1747 | } | 1651 | } |
1748 | } | 1652 | } |
1653 | // moveTime += Util.GetTimeStampMS() - tmpTime; | ||
1749 | 1654 | ||
1655 | // tmpTime = Util.GetTimeStampMS(); | ||
1750 | m_rayCastManager.ProcessQueuedRequests(); | 1656 | m_rayCastManager.ProcessQueuedRequests(); |
1657 | // rayTime += Util.GetTimeStampMS() - tmpTime; | ||
1751 | 1658 | ||
1752 | // tmpTime = Util.GetTimeStampMS(); | 1659 | // tmpTime = Util.GetTimeStampMS(); |
1753 | collision_optimized(); | 1660 | collision_optimized(); |
1754 | // collisionTime += Util.GetTimeStampMS() - tmpTime; | 1661 | // collisionTime += Util.GetTimeStampMS() - tmpTime; |
1755 | 1662 | ||
1663 | // tmpTime = Util.GetTimeStampMS(); | ||
1756 | lock(_collisionEventPrimRemove) | 1664 | lock(_collisionEventPrimRemove) |
1757 | { | 1665 | { |
1758 | foreach (PhysicsActor obj in _collisionEventPrimRemove) | 1666 | foreach (PhysicsActor obj in _collisionEventPrimRemove) |
@@ -1791,6 +1699,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1791 | foreach(OdePrim prm in sleepers) | 1699 | foreach(OdePrim prm in sleepers) |
1792 | prm.SleeperAddCollisionEvents(); | 1700 | prm.SleeperAddCollisionEvents(); |
1793 | sleepers.Clear(); | 1701 | sleepers.Clear(); |
1702 | // collisonRepo += Util.GetTimeStampMS() - tmpTime; | ||
1703 | |||
1794 | 1704 | ||
1795 | // do a ode simulation step | 1705 | // do a ode simulation step |
1796 | // tmpTime = Util.GetTimeStampMS(); | 1706 | // tmpTime = Util.GetTimeStampMS(); |
@@ -1814,7 +1724,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1814 | } | 1724 | } |
1815 | } | 1725 | } |
1816 | */ | 1726 | */ |
1817 | 1727 | // tmpTime = Util.GetTimeStampMS(); | |
1818 | lock (_activegroups) | 1728 | lock (_activegroups) |
1819 | { | 1729 | { |
1820 | { | 1730 | { |
@@ -1827,6 +1737,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1827 | } | 1737 | } |
1828 | } | 1738 | } |
1829 | } | 1739 | } |
1740 | // updatesTime += Util.GetTimeStampMS() - tmpTime; | ||
1830 | } | 1741 | } |
1831 | catch (Exception e) | 1742 | catch (Exception e) |
1832 | { | 1743 | { |
@@ -1834,10 +1745,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1834 | // ode.dunlock(world); | 1745 | // ode.dunlock(world); |
1835 | } | 1746 | } |
1836 | 1747 | ||
1748 | |||
1837 | step_time -= ODE_STEPSIZE; | 1749 | step_time -= ODE_STEPSIZE; |
1838 | nodeframes++; | 1750 | nodeframes++; |
1839 | 1751 | ||
1840 | looptimeMS = Util.GetTimeStampMS() - loopstartMS; | 1752 | looptimeMS = Util.GetTimeStampMS() - loopstartMS; |
1753 | |||
1841 | if (looptimeMS > maxLoopTime) | 1754 | if (looptimeMS > maxLoopTime) |
1842 | break; | 1755 | break; |
1843 | } | 1756 | } |
@@ -1854,9 +1767,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1854 | _badCharacter.Clear(); | 1767 | _badCharacter.Clear(); |
1855 | } | 1768 | } |
1856 | } | 1769 | } |
1857 | |||
1858 | // information block for in debug breakpoint only | ||
1859 | /* | 1770 | /* |
1771 | // information block for in debug breakpoint only | ||
1772 | |||
1860 | int ntopactivegeoms = d.SpaceGetNumGeoms(ActiveSpace); | 1773 | int ntopactivegeoms = d.SpaceGetNumGeoms(ActiveSpace); |
1861 | int ntopstaticgeoms = d.SpaceGetNumGeoms(StaticSpace); | 1774 | int ntopstaticgeoms = d.SpaceGetNumGeoms(StaticSpace); |
1862 | int ngroundgeoms = d.SpaceGetNumGeoms(GroundSpace); | 1775 | int ngroundgeoms = d.SpaceGetNumGeoms(GroundSpace); |
@@ -1898,14 +1811,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1898 | int nbodies = d.NTotalBodies; | 1811 | int nbodies = d.NTotalBodies; |
1899 | int ngeoms = d.NTotalGeoms; | 1812 | int ngeoms = d.NTotalGeoms; |
1900 | */ | 1813 | */ |
1814 | |||
1901 | /* | 1815 | /* |
1902 | looptimeMS /= nodeframes; | 1816 | looptimeMS /= nodeframes; |
1903 | if(looptimeMS > 0.080) | 1817 | collisionTime /= nodeframes; |
1818 | qstepTIme /= nodeframes; | ||
1819 | changestot /= nodeframes; | ||
1820 | collisonRepo /= nodeframes; | ||
1821 | updatesTime /= nodeframes; | ||
1822 | moveTime /= nodeframes; | ||
1823 | rayTime /= nodeframes; | ||
1824 | |||
1825 | if(looptimeMS > .05) | ||
1904 | { | 1826 | { |
1905 | collisionTime /= nodeframes; | 1827 | |
1906 | qstepTIme /= nodeframes; | 1828 | |
1907 | } | 1829 | } |
1908 | */ | 1830 | */ |
1831 | /* | ||
1909 | // Finished with all sim stepping. If requested, dump world state to file for debugging. | 1832 | // Finished with all sim stepping. If requested, dump world state to file for debugging. |
1910 | // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed? | 1833 | // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed? |
1911 | // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots? | 1834 | // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots? |
@@ -1924,7 +1847,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1924 | 1847 | ||
1925 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); | 1848 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); |
1926 | } | 1849 | } |
1927 | 1850 | */ | |
1928 | fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep; | 1851 | fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep; |
1929 | 1852 | ||
1930 | if(step_time < HalfOdeStep) | 1853 | if(step_time < HalfOdeStep) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs index 241a24d..bafc0b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
95 | config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1"); | 95 | config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1"); |
96 | m_scene = new SceneHelpers().SetupScene(); | 96 | m_scene = new SceneHelpers().SetupScene(); |
97 | 97 | ||
98 | BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); | 98 | BaseHttpServer server = new BaseHttpServer(port); |
99 | MainServer.AddHttpServer(server); | 99 | MainServer.AddHttpServer(server); |
100 | MainServer.Instance = server; | 100 | MainServer.Instance = server; |
101 | 101 | ||
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 69d0b74..4b7fd8a 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs | |||
@@ -30,6 +30,8 @@ using log4net; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System; | 31 | using System; |
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Net.Security; | ||
34 | using System.Security.Cryptography.X509Certificates; | ||
33 | using System.Collections.Generic; | 35 | using System.Collections.Generic; |
34 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
@@ -52,12 +54,33 @@ namespace OpenSim.Server | |||
52 | new List<IServiceConnector>(); | 54 | new List<IServiceConnector>(); |
53 | 55 | ||
54 | protected static PluginLoader loader; | 56 | protected static PluginLoader loader; |
57 | private static bool m_NoVerifyCertChain = false; | ||
58 | private static bool m_NoVerifyCertHostname = false; | ||
59 | |||
60 | public static bool ValidateServerCertificate( | ||
61 | object sender, | ||
62 | X509Certificate certificate, | ||
63 | X509Chain chain, | ||
64 | SslPolicyErrors sslPolicyErrors) | ||
65 | { | ||
66 | if (m_NoVerifyCertChain) | ||
67 | sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors; | ||
68 | |||
69 | if (m_NoVerifyCertHostname) | ||
70 | sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch; | ||
71 | |||
72 | if (sslPolicyErrors == SslPolicyErrors.None) | ||
73 | return true; | ||
74 | |||
75 | return false; | ||
76 | } | ||
55 | 77 | ||
56 | public static int Main(string[] args) | 78 | public static int Main(string[] args) |
57 | { | 79 | { |
58 | ServicePointManager.DefaultConnectionLimit = 64; | 80 | ServicePointManager.DefaultConnectionLimit = 64; |
59 | ServicePointManager.Expect100Continue = false; | 81 | ServicePointManager.Expect100Continue = false; |
60 | ServicePointManager.UseNagleAlgorithm = false; | 82 | ServicePointManager.UseNagleAlgorithm = false; |
83 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; | ||
61 | 84 | ||
62 | try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } | 85 | try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } |
63 | 86 | ||
@@ -72,6 +95,10 @@ namespace OpenSim.Server | |||
72 | throw new Exception("Configuration error"); | 95 | throw new Exception("Configuration error"); |
73 | } | 96 | } |
74 | 97 | ||
98 | m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain); | ||
99 | m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname); | ||
100 | |||
101 | |||
75 | string connList = serverConfig.GetString("ServiceConnectors", String.Empty); | 102 | string connList = serverConfig.GetString("ServiceConnectors", String.Empty); |
76 | 103 | ||
77 | registryLocation = serverConfig.GetString("RegistryLocation","."); | 104 | registryLocation = serverConfig.GetString("RegistryLocation","."); |
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 37dc0d9..60e6ce3 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -302,7 +302,7 @@ namespace pCampBot | |||
302 | { | 302 | { |
303 | lock (m_bots) | 303 | lock (m_bots) |
304 | { | 304 | { |
305 | string lastName = string.Format("{0}_{1}", m_lastNameStem, i + m_fromBotNumber); | 305 | string lastName = string.Format("{0}{1}", m_lastNameStem, i + m_fromBotNumber); |
306 | 306 | ||
307 | CreateBot( | 307 | CreateBot( |
308 | this, | 308 | this, |
@@ -958,7 +958,7 @@ namespace pCampBot | |||
958 | 958 | ||
959 | private string GenerateBotNameFromNumber(int botNumber) | 959 | private string GenerateBotNameFromNumber(int botNumber) |
960 | { | 960 | { |
961 | return string.Format("{0} {1}_{2}", m_firstName, m_lastNameStem, botNumber); | 961 | return string.Format("{0} {1}{2}", m_firstName, m_lastNameStem, botNumber); |
962 | } | 962 | } |
963 | 963 | ||
964 | internal void Grid_GridRegion(object o, GridRegionEventArgs args) | 964 | internal void Grid_GridRegion(object o, GridRegionEventArgs args) |
diff --git a/Prebuild/ChangeLog b/Prebuild/ChangeLog index bb8e7b0..a7d0612 100644 --- a/Prebuild/ChangeLog +++ b/Prebuild/ChangeLog | |||
@@ -1,3 +1,22 @@ | |||
1 | 2017, August Unit Umarov | ||
2 | * add Freak Tech patch for prefer32bit default to false | ||
3 | * fix comand line target override | ||
4 | * fix CSharp target assembly name | ||
5 | |||
6 | 2015, June Fly-Man- <fly.man.opensim@gmail.com> | ||
7 | * V2.0.7 (WhiteCore Build) | ||
8 | * Added the VS2012/VS2013 targets so .Net 4.5 can be used for WhiteCore | ||
9 | * Cleaned up the SharpDevelop2 code part | ||
10 | |||
11 | 2015, April rowan Deppeler <greythane@gmail.com> | ||
12 | * V2.0.6w (WhiteCore build | ||
13 | * No changes to the code as it appears development has now stalled at 1.10 | ||
14 | - Incorporated (Rev's, I think) patches from Aurora to provide for passing the framework | ||
15 | and additional conditionals in the Prebuild.xml spec | ||
16 | - Re-built using Net 4.0 framework to provide for use on unmodified Windows 8 systems (No Net 3.5) | ||
17 | - Included Solution and project files to assist building if required | ||
18 | |||
19 | |||
1 | 2008-12-09T02:15 D. Moonfire <d.moonfire@mfgames.com> | 20 | 2008-12-09T02:15 D. Moonfire <d.moonfire@mfgames.com> |
2 | * src/Core/Kernel.cs | 21 | * src/Core/Kernel.cs |
3 | - Added a /ppi target to get the results of processing but before | 22 | - Added a /ppi target to get the results of processing but before |
diff --git a/Prebuild/prebuild.xml b/Prebuild/prebuild.xml index f39175b..f0003df 100644 --- a/Prebuild/prebuild.xml +++ b/Prebuild/prebuild.xml | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | <Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd" version="1.10"> | 2 | <Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd" version="1.10"> |
3 | <Solution name="Prebuild" version="2.0.6"> | 3 | <Solution name="Prebuild" version="2.0.7"> |
4 | <Configuration name="Debug"> | 4 | <Configuration name="Debug"> |
5 | <Options> | 5 | <Options> |
6 | <CompilerDefines>DEBUG;TRACE</CompilerDefines> | 6 | <CompilerDefines>DEBUG;TRACE</CompilerDefines> |
@@ -21,7 +21,6 @@ | |||
21 | </Configuration> | 21 | </Configuration> |
22 | <Files> | 22 | <Files> |
23 | <File>prebuild.xml</File> | 23 | <File>prebuild.xml</File> |
24 | <File>prebuild</File> | ||
25 | </Files> | 24 | </Files> |
26 | <Project name="Prebuild" | 25 | <Project name="Prebuild" |
27 | path="src" | 26 | path="src" |
@@ -31,8 +30,8 @@ | |||
31 | type="Exe" | 30 | type="Exe" |
32 | rootNamespace="Prebuild" | 31 | rootNamespace="Prebuild" |
33 | startupObject="Prebuild.Prebuild" | 32 | startupObject="Prebuild.Prebuild" |
34 | version="2.0.6" | 33 | version="2.0.7" |
35 | frameworkVersion="v3_5" | 34 | frameworkVersion="v4_0" |
36 | > | 35 | > |
37 | <Author>Matthew Holmes (matthew@wildfiregames.com)</Author> | 36 | <Author>Matthew Holmes (matthew@wildfiregames.com)</Author> |
38 | <Author>Dan Moorehead (dan05a@gmail.com)</Author> | 37 | <Author>Dan Moorehead (dan05a@gmail.com)</Author> |
@@ -40,6 +39,8 @@ | |||
40 | <Author>Rob Loach (http://robloach.net)</Author> | 39 | <Author>Rob Loach (http://robloach.net)</Author> |
41 | <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author> | 40 | <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author> |
42 | <Author>John Hurliman (john.hurliman@intel.com)</Author> | 41 | <Author>John Hurliman (john.hurliman@intel.com)</Author> |
42 | <Author>WhiteCore build (2015) Rowan Deppeler (greythan@gmail.com)</Author> | ||
43 | <Author>OpenSimulator build (2017) AJLDuarte</Author> | ||
43 | <Description>The Prebuild project generator</Description> | 44 | <Description>The Prebuild project generator</Description> |
44 | <Configuration name="Debug"> | 45 | <Configuration name="Debug"> |
45 | <Options> | 46 | <Options> |
@@ -68,7 +69,9 @@ | |||
68 | <Match pattern="App.ico" buildAction="EmbeddedResource"/> | 69 | <Match pattern="App.ico" buildAction="EmbeddedResource"/> |
69 | <Match path="data" pattern="prebuild-1.10.xsd" buildAction="EmbeddedResource"/> | 70 | <Match path="data" pattern="prebuild-1.10.xsd" buildAction="EmbeddedResource"/> |
70 | <Match path="data" pattern="autotools.xml" buildAction="EmbeddedResource"/> | 71 | <Match path="data" pattern="autotools.xml" buildAction="EmbeddedResource"/> |
71 | <Match pattern="*.cs" recurse="true"/> | 72 | <Match pattern="*.cs" recurse="true"> |
73 | <Exclude name="obj" pattern="obj"/> | ||
74 | </Match> | ||
72 | </Files> | 75 | </Files> |
73 | </Project> | 76 | </Project> |
74 | </Solution> | 77 | </Solution> |
diff --git a/Prebuild/runprebuild.bat b/Prebuild/runprebuild.bat new file mode 100644 index 0000000..5cdef31 --- /dev/null +++ b/Prebuild/runprebuild.bat | |||
@@ -0,0 +1,127 @@ | |||
1 | |||
2 | |||
3 | rem Prebuild.exe /target VS2010 | ||
4 | |||
5 | @ECHO OFF | ||
6 | |||
7 | echo ========================================== | ||
8 | echo ==== WhiteCore Prebuild Configuration ==== | ||
9 | echo ========================================== | ||
10 | echo. | ||
11 | echo If you wish to customize the configuration, re-run with the switch '-p' | ||
12 | echo e.g. runprebuild -p | ||
13 | echo. | ||
14 | |||
15 | rem ## Default "configuration" choice ((r)elease, (d)ebug) | ||
16 | set configuration=d | ||
17 | |||
18 | rem ## Default Visual Studio edition | ||
19 | set vstudio=2010 | ||
20 | |||
21 | rem ## Default Framework | ||
22 | set framework=4_0 | ||
23 | |||
24 | rem ## Default architecture (86 (for 32bit), 64) | ||
25 | :CheckArch | ||
26 | set bits=AnyCPU | ||
27 | rem if exist "%PROGRAMFILES(X86)%" (set bits=x64) | ||
28 | rem if %bits% == x64 ( | ||
29 | rem echo Found 64bit architecture | ||
30 | rem ) | ||
31 | rem if %bits% == x86 ( | ||
32 | rem echo Found 32 bit architecture | ||
33 | rem ) | ||
34 | |||
35 | rem ## Determine native framework | ||
36 | :CheckOS | ||
37 | set framework=4_5 | ||
38 | for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j | ||
39 | if %version% == 10.0 ( | ||
40 | set framework=4_5 | ||
41 | echo Windows 10 | ||
42 | ) | ||
43 | if %version% == 6.3 ( | ||
44 | set framework=4_5 | ||
45 | echo Windows 8.1 or Server 2012 R2 | ||
46 | ) | ||
47 | if %version% == 6.2 ( | ||
48 | set framework=4_5 | ||
49 | echo Windows 8 or Server 2012 | ||
50 | ) | ||
51 | if %version% == 6.1 ( | ||
52 | set framework=4_0 | ||
53 | echo Windows 7 or Server 2008 R2 | ||
54 | ) | ||
55 | if %version% == 6.0 ( | ||
56 | set framework=3_5 | ||
57 | echo hmmm... Windows Vista or Server 2008 | ||
58 | ) | ||
59 | if %version% == 5.2 ( | ||
60 | set framework=3_5 | ||
61 | echo hmmm... Windows XP x64 or Server 2003 | ||
62 | ) | ||
63 | if %version% == 5.1 ( | ||
64 | set framework=3_5 | ||
65 | echo hmmm... Windows XP | ||
66 | ) | ||
67 | |||
68 | |||
69 | rem ## If not requested, skip the prompting | ||
70 | if "%1" =="" goto final | ||
71 | if %1 == -p goto prompt | ||
72 | if %1 == --prompt goto prompt | ||
73 | goto final | ||
74 | |||
75 | :prompt | ||
76 | echo I will now ask you four questions regarding your build. | ||
77 | echo However, if you wish to build for: | ||
78 | echo %bits% Architecture | ||
79 | echo .NET %framework% | ||
80 | echo Visual Studio %vstudio% | ||
81 | |||
82 | echo. | ||
83 | echo Simply tap [ENTER] three times. | ||
84 | echo. | ||
85 | echo Note that you can change these defaults by opening this | ||
86 | echo batch file in a text editor. | ||
87 | echo. | ||
88 | |||
89 | :bits | ||
90 | set /p bits="Choose your architecture (x86, x64, AnyCPU) [%bits%]: " | ||
91 | if %bits%==86 goto configuration | ||
92 | if %bits%==x86 goto configuration | ||
93 | if %bits%==64 goto configuration | ||
94 | if %bits%==x64 goto configuration | ||
95 | if %bits%==AnyCPU goto configuration | ||
96 | if %bits%==anycpu goto configuration | ||
97 | echo "%bits%" isn't a valid choice! | ||
98 | goto bits | ||
99 | |||
100 | :configuration | ||
101 | set /p configuration="Choose your configuration ((r)elease or (d)ebug)? [%configuration%]: " | ||
102 | if %configuration%==r goto framework | ||
103 | if %configuration%==d goto framework | ||
104 | if %configuration%==release goto framework | ||
105 | if %configuration%==debug goto framework | ||
106 | echo "%configuration%" isn't a valid choice! | ||
107 | goto configuration | ||
108 | |||
109 | :framework | ||
110 | set /p framework="Choose your .NET framework (4_0 or 4_5)? [%framework%]: " | ||
111 | if %framework%==4_0 goto final | ||
112 | if %framework%==4_5 goto final | ||
113 | echo "%framework%" isn't a valid choice! | ||
114 | goto framework | ||
115 | |||
116 | :final | ||
117 | echo. | ||
118 | echo Configuring for %bits% architecture using %framework% .NET framework | ||
119 | echo. | ||
120 | echo. | ||
121 | |||
122 | |||
123 | if %framework%==4_5 set %vstudio%=2012 | ||
124 | |||
125 | echo Calling Prebuild for target %vstudio% with framework %framework%... | ||
126 | Prebuild.exe /target vs%vstudio% /targetframework v%framework% /conditionals ISWIN;NET_%framework% | ||
127 | |||
diff --git a/Prebuild/runprebuild.sh b/Prebuild/runprebuild.sh new file mode 100644 index 0000000..4e701b7 --- /dev/null +++ b/Prebuild/runprebuild.sh | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | #exec mono [PREFIX]/prebuild.exe "$@" | ||
3 | exec mono Prebuild.exe /target VS2010 | ||
diff --git a/Prebuild/src/Core/Attributes/DataNodeAttribute.cs b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs index cd3cea4..f1938a2 100644 --- a/Prebuild/src/Core/Attributes/DataNodeAttribute.cs +++ b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -28,45 +28,45 @@ using System.Collections.Specialized; | |||
28 | 28 | ||
29 | namespace Prebuild.Core.Attributes | 29 | namespace Prebuild.Core.Attributes |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple=true)] | 34 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple=true)] |
35 | public sealed class DataNodeAttribute : Attribute | 35 | public sealed class DataNodeAttribute : Attribute |
36 | { | 36 | { |
37 | #region Fields | 37 | #region Fields |
38 | 38 | ||
39 | private string m_Name = "unknown"; | 39 | private string m_Name = "unknown"; |
40 | 40 | ||
41 | #endregion | 41 | #endregion |
42 | 42 | ||
43 | #region Constructors | 43 | #region Constructors |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Initializes a new instance of the <see cref="DataNodeAttribute"/> class. | 46 | /// Initializes a new instance of the <see cref="DataNodeAttribute"/> class. |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <param name="name">The name.</param> | 48 | /// <param name="name">The name.</param> |
49 | public DataNodeAttribute(string name) | 49 | public DataNodeAttribute(string name) |
50 | { | 50 | { |
51 | m_Name = name; | 51 | m_Name = name; |
52 | } | 52 | } |
53 | 53 | ||
54 | #endregion | 54 | #endregion |
55 | 55 | ||
56 | #region Properties | 56 | #region Properties |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Gets the name. | 59 | /// Gets the name. |
60 | /// </summary> | 60 | /// </summary> |
61 | /// <value>The name.</value> | 61 | /// <value>The name.</value> |
62 | public string Name | 62 | public string Name |
63 | { | 63 | { |
64 | get | 64 | get |
65 | { | 65 | { |
66 | return m_Name; | 66 | return m_Name; |
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | #endregion | 70 | #endregion |
71 | } | 71 | } |
72 | } | 72 | } |
diff --git a/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs index 8ef97a1..2d6a6a7 100644 --- a/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs +++ b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -27,45 +27,45 @@ using System; | |||
27 | 27 | ||
28 | namespace Prebuild.Core.Attributes | 28 | namespace Prebuild.Core.Attributes |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// | 31 | /// |
32 | /// </summary> | 32 | /// </summary> |
33 | [AttributeUsage(AttributeTargets.Field)] | 33 | [AttributeUsage(AttributeTargets.Field)] |
34 | public sealed class OptionNodeAttribute : Attribute | 34 | public sealed class OptionNodeAttribute : Attribute |
35 | { | 35 | { |
36 | #region Fields | 36 | #region Fields |
37 | 37 | ||
38 | private string m_NodeName; | 38 | private string m_NodeName; |
39 | 39 | ||
40 | #endregion | 40 | #endregion |
41 | 41 | ||
42 | #region Constructors | 42 | #region Constructors |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Initializes a new instance of the <see cref="OptionNodeAttribute"/> class. | 45 | /// Initializes a new instance of the <see cref="OptionNodeAttribute"/> class. |
46 | /// </summary> | 46 | /// </summary> |
47 | /// <param name="nodeName">Name of the node.</param> | 47 | /// <param name="nodeName">Name of the node.</param> |
48 | public OptionNodeAttribute(string nodeName) | 48 | public OptionNodeAttribute(string nodeName) |
49 | { | 49 | { |
50 | m_NodeName = nodeName; | 50 | m_NodeName = nodeName; |
51 | } | 51 | } |
52 | 52 | ||
53 | #endregion | 53 | #endregion |
54 | 54 | ||
55 | #region Properties | 55 | #region Properties |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Gets the name of the node. | 58 | /// Gets the name of the node. |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <value>The name of the node.</value> | 60 | /// <value>The name of the node.</value> |
61 | public string NodeName | 61 | public string NodeName |
62 | { | 62 | { |
63 | get | 63 | get |
64 | { | 64 | { |
65 | return m_NodeName; | 65 | return m_NodeName; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/Prebuild/src/Core/Attributes/TargetAttribute.cs b/Prebuild/src/Core/Attributes/TargetAttribute.cs index fb30914..5ad62ee 100644 --- a/Prebuild/src/Core/Attributes/TargetAttribute.cs +++ b/Prebuild/src/Core/Attributes/TargetAttribute.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -27,45 +27,45 @@ using System; | |||
27 | 27 | ||
28 | namespace Prebuild.Core.Attributes | 28 | namespace Prebuild.Core.Attributes |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// | 31 | /// |
32 | /// </summary> | 32 | /// </summary> |
33 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] | 33 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] |
34 | public sealed class TargetAttribute : Attribute | 34 | public sealed class TargetAttribute : Attribute |
35 | { | 35 | { |
36 | #region Fields | 36 | #region Fields |
37 | 37 | ||
38 | private string m_Name; | 38 | private string m_Name; |
39 | 39 | ||
40 | #endregion | 40 | #endregion |
41 | 41 | ||
42 | #region Constructors | 42 | #region Constructors |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Initializes a new instance of the <see cref="TargetAttribute"/> class. | 45 | /// Initializes a new instance of the <see cref="TargetAttribute"/> class. |
46 | /// </summary> | 46 | /// </summary> |
47 | /// <param name="name">The name.</param> | 47 | /// <param name="name">The name.</param> |
48 | public TargetAttribute(string name) | 48 | public TargetAttribute(string name) |
49 | { | 49 | { |
50 | m_Name = name; | 50 | m_Name = name; |
51 | } | 51 | } |
52 | 52 | ||
53 | #endregion | 53 | #endregion |
54 | 54 | ||
55 | #region Properties | 55 | #region Properties |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Gets the name. | 58 | /// Gets the name. |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <value>The name.</value> | 60 | /// <value>The name.</value> |
61 | public string Name | 61 | public string Name |
62 | { | 62 | { |
63 | get | 63 | get |
64 | { | 64 | { |
65 | return m_Name; | 65 | return m_Name; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/Prebuild/src/Core/FatalException.cs b/Prebuild/src/Core/FatalException.cs index 751297a..3487905 100644 --- a/Prebuild/src/Core/FatalException.cs +++ b/Prebuild/src/Core/FatalException.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -28,58 +28,58 @@ using System.Runtime.Serialization; | |||
28 | 28 | ||
29 | namespace Prebuild.Core | 29 | namespace Prebuild.Core |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | [Serializable()] | 34 | [Serializable()] |
35 | public class FatalException : Exception | 35 | public class FatalException : Exception |
36 | { | 36 | { |
37 | #region Constructors | 37 | #region Constructors |
38 | 38 | ||
39 | |||
40 | /// <summary> | ||
41 | /// Initializes a new instance of the <see cref="FatalException"/> class. | ||
42 | /// </summary> | ||
43 | public FatalException() | ||
44 | { | ||
45 | } | ||
39 | 46 | ||
40 | /// <summary> | 47 | /// <summary> |
41 | /// Initializes a new instance of the <see cref="FatalException"/> class. | 48 | /// Initializes a new instance of the <see cref="FatalException"/> class. |
42 | /// </summary> | 49 | /// </summary> |
43 | public FatalException() | 50 | /// <param name="format">The format.</param> |
44 | { | 51 | /// <param name="args">The args.</param> |
45 | } | 52 | public FatalException(string format, params object[] args) |
53 | : base(String.Format(format, args)) | ||
54 | { | ||
55 | } | ||
46 | 56 | ||
47 | /// <summary> | 57 | /// <summary> |
48 | /// Initializes a new instance of the <see cref="FatalException"/> class. | 58 | /// Exception with specified string |
49 | /// </summary> | 59 | /// </summary> |
50 | /// <param name="format">The format.</param> | 60 | /// <param name="message">Exception message</param> |
51 | /// <param name="args">The args.</param> | 61 | public FatalException(string message): base(message) |
52 | public FatalException(string format, params object[] args) | 62 | { |
53 | : base(String.Format(format, args)) | 63 | } |
54 | { | ||
55 | } | ||
56 | 64 | ||
57 | /// <summary> | 65 | /// <summary> |
58 | /// Exception with specified string | 66 | /// |
59 | /// </summary> | 67 | /// </summary> |
60 | /// <param name="message">Exception message</param> | 68 | /// <param name="message"></param> |
61 | public FatalException(string message): base(message) | 69 | /// <param name="exception"></param> |
62 | { | 70 | public FatalException(string message, Exception exception) : base(message, exception) |
63 | } | 71 | { |
72 | } | ||
64 | 73 | ||
65 | /// <summary> | 74 | /// <summary> |
66 | /// | 75 | /// |
67 | /// </summary> | 76 | /// </summary> |
68 | /// <param name="message"></param> | 77 | /// <param name="info"></param> |
69 | /// <param name="exception"></param> | 78 | /// <param name="context"></param> |
70 | public FatalException(string message, Exception exception) : base(message, exception) | 79 | protected FatalException(SerializationInfo info, StreamingContext context) : base( info, context ) |
71 | { | 80 | { |
72 | } | 81 | } |
73 | 82 | ||
74 | /// <summary> | 83 | #endregion |
75 | /// | 84 | } |
76 | /// </summary> | ||
77 | /// <param name="info"></param> | ||
78 | /// <param name="context"></param> | ||
79 | protected FatalException(SerializationInfo info, StreamingContext context) : base( info, context ) | ||
80 | { | ||
81 | } | ||
82 | |||
83 | #endregion | ||
84 | } | ||
85 | } | 85 | } |
diff --git a/Prebuild/src/Core/Interfaces/IDataNode.cs b/Prebuild/src/Core/Interfaces/IDataNode.cs index 4917b18..986dd2d 100644 --- a/Prebuild/src/Core/Interfaces/IDataNode.cs +++ b/Prebuild/src/Core/Interfaces/IDataNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -26,22 +26,22 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
26 | using System; | 26 | using System; |
27 | using System.Xml; | 27 | using System.Xml; |
28 | 28 | ||
29 | namespace Prebuild.Core.Interfaces | 29 | namespace Prebuild.Core.Interfaces |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | public interface IDataNode | 34 | public interface IDataNode |
35 | { | 35 | { |
36 | /// <summary> | 36 | /// <summary> |
37 | /// Gets or sets the parent. | 37 | /// Gets or sets the parent. |
38 | /// </summary> | 38 | /// </summary> |
39 | /// <value>The parent.</value> | 39 | /// <value>The parent.</value> |
40 | IDataNode Parent { get; set; } | 40 | IDataNode Parent { get; set; } |
41 | /// <summary> | 41 | /// <summary> |
42 | /// Parses the specified node. | 42 | /// Parses the specified node. |
43 | /// </summary> | 43 | /// </summary> |
44 | /// <param name="node">The node.</param> | 44 | /// <param name="node">The node.</param> |
45 | void Parse(XmlNode node); | 45 | void Parse(XmlNode node); |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/Prebuild/src/Core/Interfaces/ITarget.cs b/Prebuild/src/Core/Interfaces/ITarget.cs index e4c3ea4..47115c6 100644 --- a/Prebuild/src/Core/Interfaces/ITarget.cs +++ b/Prebuild/src/Core/Interfaces/ITarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -25,27 +25,27 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
25 | 25 | ||
26 | using System; | 26 | using System; |
27 | 27 | ||
28 | namespace Prebuild.Core.Interfaces | 28 | namespace Prebuild.Core.Interfaces |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// | 31 | /// |
32 | /// </summary> | 32 | /// </summary> |
33 | public interface ITarget | 33 | public interface ITarget |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// Writes the specified kern. | 36 | /// Writes the specified kern. |
37 | /// </summary> | 37 | /// </summary> |
38 | /// <param name="kern">The kern.</param> | 38 | /// <param name="kern">The kern.</param> |
39 | void Write(Kernel kern); | 39 | void Write(Kernel kern); |
40 | /// <summary> | 40 | /// <summary> |
41 | /// Cleans the specified kern. | 41 | /// Cleans the specified kern. |
42 | /// </summary> | 42 | /// </summary> |
43 | /// <param name="kern">The kern.</param> | 43 | /// <param name="kern">The kern.</param> |
44 | void Clean(Kernel kern); | 44 | void Clean(Kernel kern); |
45 | /// <summary> | 45 | /// <summary> |
46 | /// Gets the name. | 46 | /// Gets the name. |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <value>The name.</value> | 48 | /// <value>The name.</value> |
49 | string Name { get; } | 49 | string Name { get; } |
50 | } | 50 | } |
51 | } \ No newline at end of file | 51 | } \ No newline at end of file |
diff --git a/Prebuild/src/Core/Kernel.cs b/Prebuild/src/Core/Kernel.cs index 454ff8b..3db92ef 100644 --- a/Prebuild/src/Core/Kernel.cs +++ b/Prebuild/src/Core/Kernel.cs | |||
@@ -49,202 +49,206 @@ using Prebuild.Core.Interfaces; | |||
49 | using Prebuild.Core.Nodes; | 49 | using Prebuild.Core.Nodes; |
50 | using Prebuild.Core.Utilities; | 50 | using Prebuild.Core.Utilities; |
51 | 51 | ||
52 | namespace Prebuild.Core | 52 | namespace Prebuild.Core |
53 | { | 53 | { |
54 | /// <summary> | 54 | /// <summary> |
55 | /// | 55 | /// |
56 | /// </summary> | 56 | /// </summary> |
57 | public class Kernel : IDisposable | 57 | public class Kernel : IDisposable |
58 | { | 58 | { |
59 | #region Inner Classes | 59 | #region Inner Classes |
60 | 60 | ||
61 | private struct NodeEntry | 61 | private struct NodeEntry |
62 | { | 62 | { |
63 | public Type Type; | 63 | public Type Type; |
64 | public DataNodeAttribute Attribute; | 64 | public DataNodeAttribute Attribute; |
65 | } | 65 | } |
66 | 66 | ||
67 | #endregion | 67 | #endregion |
68 | 68 | ||
69 | #region Fields | 69 | #region Fields |
70 | 70 | ||
71 | private static readonly Kernel m_Instance = new Kernel(); | 71 | private static readonly Kernel m_Instance = new Kernel(); |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// This must match the version of the schema that is embeeded | 74 | /// This must match the version of the schema that is embeeded |
75 | /// </summary> | 75 | /// </summary> |
76 | private const string m_SchemaVersion = "1.10"; | 76 | private const string m_SchemaVersion = "1.10"; |
77 | private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd"; | 77 | private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd"; |
78 | private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema; | 78 | private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema; |
79 | bool disposed; | 79 | bool disposed; |
80 | private Version m_Version; | 80 | private Version m_Version; |
81 | private const string m_Revision = ""; | 81 | private const string m_Revision = "w"; |
82 | private CommandLineCollection m_CommandLine; | 82 | private CommandLineCollection m_CommandLine; |
83 | private Log m_Log; | 83 | private Log m_Log; |
84 | private CurrentDirectory m_CurrentWorkingDirectory; | 84 | private CurrentDirectory m_CurrentWorkingDirectory; |
85 | private XmlSchemaCollection m_Schemas; | 85 | private XmlSchemaCollection m_Schemas; |
86 | 86 | ||
87 | private readonly Dictionary<string, ITarget> m_Targets = new Dictionary<string, ITarget>(); | 87 | private readonly Dictionary<string, ITarget> m_Targets = new Dictionary<string, ITarget>(); |
88 | private readonly Dictionary<string, NodeEntry> m_Nodes = new Dictionary<string, NodeEntry>(); | 88 | private readonly Dictionary<string, NodeEntry> m_Nodes = new Dictionary<string, NodeEntry>(); |
89 | 89 | ||
90 | readonly List<SolutionNode> m_Solutions = new List<SolutionNode>(); | 90 | readonly List<SolutionNode> m_Solutions = new List<SolutionNode>(); |
91 | string m_Target; | 91 | string m_Target; |
92 | string m_Clean; | 92 | bool cmdlineTargetFramework; |
93 | string[] m_RemoveDirectories; | 93 | FrameworkVersion m_TargetFramework; //Overrides all project settings |
94 | XmlDocument m_CurrentDoc; | 94 | string m_Conditionals; //Adds to all project settings |
95 | bool m_PauseAfterFinish; | 95 | public string ForcedConditionals { get { return m_Conditionals; } } |
96 | string[] m_ProjectGroups; | 96 | string m_Clean; |
97 | 97 | string[] m_RemoveDirectories; | |
98 | #endregion | 98 | XmlDocument m_CurrentDoc; |
99 | 99 | bool m_PauseAfterFinish; | |
100 | #region Constructors | 100 | string[] m_ProjectGroups; |
101 | 101 | ||
102 | private Kernel() | 102 | #endregion |
103 | { | 103 | |
104 | } | 104 | #region Constructors |
105 | 105 | ||
106 | #endregion | 106 | private Kernel() |
107 | 107 | { | |
108 | #region Properties | 108 | } |
109 | 109 | ||
110 | /// <summary> | 110 | #endregion |
111 | /// Gets a value indicating whether [pause after finish]. | 111 | |
112 | /// </summary> | 112 | #region Properties |
113 | /// <value><c>true</c> if [pause after finish]; otherwise, <c>false</c>.</value> | 113 | |
114 | public bool PauseAfterFinish | 114 | /// <summary> |
115 | { | 115 | /// Gets a value indicating whether [pause after finish]. |
116 | get | 116 | /// </summary> |
117 | { | 117 | /// <value><c>true</c> if [pause after finish]; otherwise, <c>false</c>.</value> |
118 | return m_PauseAfterFinish; | 118 | public bool PauseAfterFinish |
119 | } | 119 | { |
120 | } | 120 | get |
121 | 121 | { | |
122 | /// <summary> | 122 | return m_PauseAfterFinish; |
123 | /// Gets the instance. | 123 | } |
124 | /// </summary> | 124 | } |
125 | /// <value>The instance.</value> | 125 | |
126 | public static Kernel Instance | 126 | /// <summary> |
127 | { | 127 | /// Gets the instance. |
128 | get | 128 | /// </summary> |
129 | { | 129 | /// <value>The instance.</value> |
130 | return m_Instance; | 130 | public static Kernel Instance |
131 | } | 131 | { |
132 | } | 132 | get |
133 | 133 | { | |
134 | /// <summary> | 134 | return m_Instance; |
135 | /// Gets the version. | 135 | } |
136 | /// </summary> | 136 | } |
137 | /// <value>The version.</value> | 137 | |
138 | public string Version | 138 | /// <summary> |
139 | { | 139 | /// Gets the version. |
140 | get | 140 | /// </summary> |
141 | { | 141 | /// <value>The version.</value> |
142 | return String.Format("{0}.{1}.{2}{3}", m_Version.Major, m_Version.Minor, m_Version.Build, m_Revision); | 142 | public string Version |
143 | } | 143 | { |
144 | } | 144 | get |
145 | 145 | { | |
146 | /// <summary> | 146 | return String.Format("{0}.{1}.{2}{3}", m_Version.Major, m_Version.Minor, m_Version.Build, m_Revision); |
147 | /// Gets the command line. | 147 | } |
148 | /// </summary> | 148 | } |
149 | /// <value>The command line.</value> | 149 | |
150 | public CommandLineCollection CommandLine | 150 | /// <summary> |
151 | { | 151 | /// Gets the command line. |
152 | get | 152 | /// </summary> |
153 | { | 153 | /// <value>The command line.</value> |
154 | return m_CommandLine; | 154 | public CommandLineCollection CommandLine |
155 | } | 155 | { |
156 | } | 156 | get |
157 | 157 | { | |
158 | /// <summary> | 158 | return m_CommandLine; |
159 | /// Gets the targets. | 159 | } |
160 | /// </summary> | 160 | } |
161 | /// <value>The targets.</value> | 161 | |
162 | public Dictionary<string, ITarget> Targets | 162 | /// <summary> |
163 | { | 163 | /// Gets the targets. |
164 | get | 164 | /// </summary> |
165 | { | 165 | /// <value>The targets.</value> |
166 | return m_Targets; | 166 | public Dictionary<string, ITarget> Targets |
167 | } | 167 | { |
168 | } | 168 | get |
169 | 169 | { | |
170 | /// <summary> | 170 | return m_Targets; |
171 | /// Gets the log. | 171 | } |
172 | /// </summary> | 172 | } |
173 | /// <value>The log.</value> | 173 | |
174 | public Log Log | 174 | /// <summary> |
175 | { | 175 | /// Gets the log. |
176 | get | 176 | /// </summary> |
177 | { | 177 | /// <value>The log.</value> |
178 | return m_Log; | 178 | public Log Log |
179 | } | 179 | { |
180 | } | 180 | get |
181 | 181 | { | |
182 | /// <summary> | 182 | return m_Log; |
183 | /// Gets the current working directory. | 183 | } |
184 | /// </summary> | 184 | } |
185 | /// <value>The current working directory.</value> | 185 | |
186 | public CurrentDirectory CurrentWorkingDirectory | 186 | /// <summary> |
187 | { | 187 | /// Gets the current working directory. |
188 | get | 188 | /// </summary> |
189 | { | 189 | /// <value>The current working directory.</value> |
190 | return m_CurrentWorkingDirectory; | 190 | public CurrentDirectory CurrentWorkingDirectory |
191 | } | 191 | { |
192 | } | 192 | get |
193 | 193 | { | |
194 | /// <summary> | 194 | return m_CurrentWorkingDirectory; |
195 | /// Gets the solutions. | 195 | } |
196 | /// </summary> | 196 | } |
197 | /// <value>The solutions.</value> | 197 | |
198 | public List<SolutionNode> Solutions | 198 | /// <summary> |
199 | { | 199 | /// Gets the solutions. |
200 | get | 200 | /// </summary> |
201 | { | 201 | /// <value>The solutions.</value> |
202 | return m_Solutions; | 202 | public List<SolutionNode> Solutions |
203 | } | 203 | { |
204 | } | 204 | get |
205 | 205 | { | |
206 | /// <summary> | 206 | return m_Solutions; |
207 | /// Gets the XmlDocument object representing the prebuild.xml | 207 | } |
208 | /// being processed | 208 | } |
209 | /// </summary> | 209 | |
210 | /// <value>The XmlDocument object</value> | 210 | /// <summary> |
211 | public XmlDocument CurrentDoc | 211 | /// Gets the XmlDocument object representing the prebuild.xml |
212 | { | 212 | /// being processed |
213 | get | 213 | /// </summary> |
214 | { | 214 | /// <value>The XmlDocument object</value> |
215 | return m_CurrentDoc; | 215 | public XmlDocument CurrentDoc |
216 | } | 216 | { |
217 | } | 217 | get |
218 | 218 | { | |
219 | #endregion | 219 | return m_CurrentDoc; |
220 | 220 | } | |
221 | #region Private Methods | 221 | } |
222 | 222 | ||
223 | private static void RemoveDirectories(string rootDir, string[] dirNames) | 223 | #endregion |
224 | { | 224 | |
225 | foreach(string dir in Directory.GetDirectories(rootDir)) | 225 | #region Private Methods |
226 | { | 226 | |
227 | string simpleName = Path.GetFileName(dir); | 227 | private static void RemoveDirectories(string rootDir, string[] dirNames) |
228 | 228 | { | |
229 | if(Array.IndexOf(dirNames, simpleName) != -1) | 229 | foreach(string dir in Directory.GetDirectories(rootDir)) |
230 | { | 230 | { |
231 | //delete if the name matches one of the directory names to delete | 231 | string simpleName = Path.GetFileName(dir); |
232 | string fullDirPath = Path.GetFullPath(dir); | 232 | |
233 | Directory.Delete(fullDirPath,true); | 233 | if(Array.IndexOf(dirNames, simpleName) != -1) |
234 | } | 234 | { |
235 | else//not a match, so check children | 235 | //delete if the name matches one of the directory names to delete |
236 | { | 236 | string fullDirPath = Path.GetFullPath(dir); |
237 | RemoveDirectories(dir,dirNames); | 237 | Directory.Delete(fullDirPath,true); |
238 | //recurse, checking children for them | 238 | } |
239 | } | 239 | else//not a match, so check children |
240 | } | 240 | { |
241 | } | 241 | RemoveDirectories(dir,dirNames); |
242 | 242 | //recurse, checking children for them | |
243 | // private void RemoveDirectoryMatches(string rootDir, string dirPattern) | 243 | } |
244 | } | ||
245 | } | ||
246 | |||
247 | // private void RemoveDirectoryMatches(string rootDir, string dirPattern) | ||
244 | // { | 248 | // { |
245 | // foreach(string dir in Directory.GetDirectories(rootDir)) | 249 | // foreach(string dir in Directory.GetDirectories(rootDir)) |
246 | // { | 250 | // { |
247 | // foreach(string match in Directory.GetDirectories(dir)) | 251 | // foreach(string match in Directory.GetDirectories(dir)) |
248 | // {//delete all child directories that match | 252 | // {//delete all child directories that match |
249 | // Directory.Delete(Path.GetFullPath(match),true); | 253 | // Directory.Delete(Path.GetFullPath(match),true); |
250 | // } | 254 | // } |
@@ -253,56 +257,56 @@ namespace Prebuild.Core | |||
253 | // } | 257 | // } |
254 | // } | 258 | // } |
255 | 259 | ||
256 | private void LoadSchema() | 260 | private void LoadSchema() |
257 | { | 261 | { |
258 | Assembly assembly = GetType().Assembly; | 262 | Assembly assembly = GetType().Assembly; |
259 | Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema); | 263 | Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema); |
260 | if(stream == null) | 264 | if(stream == null) |
261 | { | 265 | { |
262 | //try without the default namespace prepending to it in case was compiled with SharpDevelop or MonoDevelop instead of Visual Studio .NET | 266 | //try without the default namespace prepending to it in case was compiled with SharpDevelop or MonoDevelop instead of Visual Studio .NET |
263 | stream = assembly.GetManifestResourceStream(m_Schema); | 267 | stream = assembly.GetManifestResourceStream(m_Schema); |
264 | if(stream == null) | 268 | if(stream == null) |
265 | { | 269 | { |
266 | throw new System.Reflection.TargetException(string.Format("Could not find the scheme embedded resource file '{0}'.", m_Schema)); | 270 | throw new System.Reflection.TargetException(string.Format("Could not find the scheme embedded resource file '{0}'.", m_Schema)); |
267 | } | 271 | } |
268 | } | 272 | } |
269 | XmlReader schema = new XmlTextReader(stream); | 273 | XmlReader schema = new XmlTextReader(stream); |
270 | 274 | ||
271 | m_Schemas = new XmlSchemaCollection(); | 275 | m_Schemas = new XmlSchemaCollection(); |
272 | m_Schemas.Add(m_SchemaURI, schema); | 276 | m_Schemas.Add(m_SchemaURI, schema); |
273 | } | 277 | } |
274 | 278 | ||
275 | private void CacheVersion() | 279 | private void CacheVersion() |
276 | { | 280 | { |
277 | m_Version = Assembly.GetEntryAssembly().GetName().Version; | 281 | m_Version = Assembly.GetEntryAssembly().GetName().Version; |
278 | } | 282 | } |
279 | 283 | ||
280 | private void CacheTargets(Assembly assm) | 284 | private void CacheTargets(Assembly assm) |
281 | { | 285 | { |
282 | foreach(Type t in assm.GetTypes()) | 286 | foreach(Type t in assm.GetTypes()) |
283 | { | 287 | { |
284 | TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget)); | 288 | TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget)); |
285 | 289 | ||
286 | if(ta == null) | 290 | if(ta == null) |
287 | continue; | 291 | continue; |
288 | 292 | ||
289 | if (t.IsAbstract) | 293 | if (t.IsAbstract) |
290 | continue; | 294 | continue; |
291 | 295 | ||
292 | ITarget target = (ITarget)assm.CreateInstance(t.FullName); | 296 | ITarget target = (ITarget)assm.CreateInstance(t.FullName); |
293 | if (target == null) | 297 | if (target == null) |
294 | { | 298 | { |
295 | throw new MissingMethodException("Could not create ITarget instance"); | 299 | throw new MissingMethodException("Could not create ITarget instance"); |
296 | } | 300 | } |
297 | 301 | ||
298 | m_Targets[ta.Name] = target; | 302 | m_Targets[ta.Name] = target; |
299 | } | 303 | } |
300 | } | 304 | } |
301 | 305 | ||
302 | private void CacheNodeTypes(Assembly assm) | 306 | private void CacheNodeTypes(Assembly assm) |
303 | { | 307 | { |
304 | foreach(Type t in assm.GetTypes()) | 308 | foreach(Type t in assm.GetTypes()) |
305 | { | 309 | { |
306 | foreach (DataNodeAttribute dna in t.GetCustomAttributes(typeof(DataNodeAttribute), true)) | 310 | foreach (DataNodeAttribute dna in t.GetCustomAttributes(typeof(DataNodeAttribute), true)) |
307 | { | 311 | { |
308 | NodeEntry ne = new NodeEntry(); | 312 | NodeEntry ne = new NodeEntry(); |
@@ -310,11 +314,11 @@ namespace Prebuild.Core | |||
310 | ne.Attribute = dna; | 314 | ne.Attribute = dna; |
311 | m_Nodes[dna.Name] = ne; | 315 | m_Nodes[dna.Name] = ne; |
312 | } | 316 | } |
313 | } | 317 | } |
314 | } | 318 | } |
315 | 319 | ||
316 | private void LogBanner() | 320 | private void LogBanner() |
317 | { | 321 | { |
318 | m_Log.Write("Prebuild v" + Version); | 322 | m_Log.Write("Prebuild v" + Version); |
319 | m_Log.Write("Copyright (c) 2004-2010"); | 323 | m_Log.Write("Copyright (c) 2004-2010"); |
320 | m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),"); | 324 | m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),"); |
@@ -323,10 +327,12 @@ namespace Prebuild.Core | |||
323 | m_Log.Write("Rob Loach (http://www.robloach.net),"); | 327 | m_Log.Write("Rob Loach (http://www.robloach.net),"); |
324 | m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),"); | 328 | m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),"); |
325 | m_Log.Write("John Hurliman (john.hurliman@intel.com),"); | 329 | m_Log.Write("John Hurliman (john.hurliman@intel.com),"); |
326 | 330 | m_Log.Write("WhiteCore build 2015 (greythane@gmail.com),"); | |
331 | m_Log.Write("OpenSimulator build 2017 Ubit Umarov,"); | ||
332 | m_Log.Write (""); | ||
327 | m_Log.Write("See 'prebuild /usage' for help"); | 333 | m_Log.Write("See 'prebuild /usage' for help"); |
328 | m_Log.Write(); | 334 | m_Log.Write(); |
329 | } | 335 | } |
330 | 336 | ||
331 | 337 | ||
332 | 338 | ||
@@ -348,37 +354,37 @@ namespace Prebuild.Core | |||
348 | } | 354 | } |
349 | 355 | ||
350 | /// <summary> | 356 | /// <summary> |
351 | /// | 357 | /// |
352 | /// </summary> | 358 | /// </summary> |
353 | /// <param name="file"></param> | 359 | /// <param name="file"></param> |
354 | /// <param name="solutions"></param> | 360 | /// <param name="solutions"></param> |
355 | /// <returns></returns> | 361 | /// <returns></returns> |
356 | public void ProcessFile(string file, IList<SolutionNode> solutions) | 362 | public void ProcessFile(string file, IList<SolutionNode> solutions) |
357 | { | 363 | { |
358 | m_CurrentWorkingDirectory.Push(); | 364 | m_CurrentWorkingDirectory.Push(); |
359 | 365 | ||
360 | string path = file; | 366 | string path = file; |
361 | try | 367 | try |
362 | { | 368 | { |
363 | try | 369 | try |
364 | { | 370 | { |
365 | path = Helper.ResolvePath(path); | 371 | path = Helper.ResolvePath(path); |
366 | } | 372 | } |
367 | catch(ArgumentException) | 373 | catch(ArgumentException) |
368 | { | 374 | { |
369 | m_Log.Write("Could not open Prebuild file: " + path); | 375 | m_Log.Write("Could not open Prebuild file: " + path); |
370 | m_CurrentWorkingDirectory.Pop(); | 376 | m_CurrentWorkingDirectory.Pop(); |
371 | return; | 377 | return; |
372 | } | 378 | } |
373 | 379 | ||
374 | Helper.SetCurrentDir(Path.GetDirectoryName(path)); | 380 | Helper.SetCurrentDir(Path.GetDirectoryName(path)); |
375 | 381 | ||
376 | XmlTextReader reader = new XmlTextReader(path); | 382 | XmlTextReader reader = new XmlTextReader(path); |
377 | 383 | ||
378 | Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor(); | 384 | Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor(); |
379 | 385 | ||
380 | //register command line arguments as XML variables | 386 | //register command line arguments as XML variables |
381 | IEnumerator<KeyValuePair<string, string>> dict = m_CommandLine.GetEnumerator(); | 387 | IEnumerator<KeyValuePair<string, string>> dict = m_CommandLine.GetEnumerator(); |
382 | while (dict.MoveNext()) | 388 | while (dict.MoveNext()) |
383 | { | 389 | { |
384 | string name = dict.Current.Key.Trim(); | 390 | string name = dict.Current.Key.Trim(); |
@@ -386,447 +392,457 @@ namespace Prebuild.Core | |||
386 | pre.RegisterVariable(name, dict.Current.Value); | 392 | pre.RegisterVariable(name, dict.Current.Value); |
387 | } | 393 | } |
388 | 394 | ||
389 | string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML | 395 | string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML |
390 | 396 | ||
391 | // See if the user put into a pseudo target of "prebuild:preprocessed-input" to indicate they want to see the | 397 | // See if the user put into a pseudo target of "prebuild:preprocessed-input" to indicate they want to see the |
392 | // output before the system processes it. | 398 | // output before the system processes it. |
393 | if (m_CommandLine.WasPassed("ppi")) | 399 | if (m_CommandLine.WasPassed("ppi")) |
394 | { | 400 | { |
395 | // Get the filename if there is one, otherwise use a default. | 401 | // Get the filename if there is one, otherwise use a default. |
396 | string ppiFile = m_CommandLine["ppi"]; | 402 | string ppiFile = m_CommandLine["ppi"]; |
397 | if (ppiFile == null || ppiFile.Trim().Length == 0) | 403 | if (ppiFile == null || ppiFile.Trim().Length == 0) |
398 | { | 404 | { |
399 | ppiFile = "preprocessed-input.xml"; | 405 | ppiFile = "preprocessed-input.xml"; |
400 | } | 406 | } |
401 | 407 | ||
402 | // Write out the string to the given stream. | 408 | // Write out the string to the given stream. |
403 | try | 409 | try |
404 | { | 410 | { |
405 | using (StreamWriter ppiWriter = new StreamWriter(ppiFile)) | 411 | using (StreamWriter ppiWriter = new StreamWriter(ppiFile)) |
406 | { | 412 | { |
407 | ppiWriter.WriteLine(xml); | 413 | ppiWriter.WriteLine(xml); |
408 | } | 414 | } |
409 | } | 415 | } |
410 | catch(IOException ex) | 416 | catch(IOException ex) |
411 | { | 417 | { |
412 | Console.WriteLine("Could not write PPI file '{0}': {1}", ppiFile, ex.Message); | 418 | Console.WriteLine("Could not write PPI file '{0}': {1}", ppiFile, ex.Message); |
413 | } | 419 | } |
414 | 420 | ||
415 | // Finish processing this special tag. | 421 | // Finish processing this special tag. |
416 | return; | 422 | return; |
417 | } | 423 | } |
418 | 424 | ||
419 | m_CurrentDoc = new XmlDocument(); | 425 | m_CurrentDoc = new XmlDocument(); |
420 | try | 426 | try |
421 | { | 427 | { |
422 | #if NO_VALIDATE | 428 | #if NO_VALIDATE |
423 | XmlReader validator = XmlReader.Create(new StringReader(xml)); | 429 | XmlReader validator = XmlReader.Create(new StringReader(xml)); |
424 | m_CurrentDoc.Load(validator); | 430 | m_CurrentDoc.Load(validator); |
425 | #else | 431 | #else |
426 | XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml))); | 432 | XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml))); |
427 | 433 | ||
428 | //validate while reading from string into XmlDocument DOM structure in memory | 434 | //validate while reading from string into XmlDocument DOM structure in memory |
429 | foreach(XmlSchema schema in m_Schemas) | 435 | foreach(XmlSchema schema in m_Schemas) |
430 | { | 436 | { |
431 | validator.Schemas.Add(schema); | 437 | validator.Schemas.Add(schema); |
432 | } | 438 | } |
433 | m_CurrentDoc.Load(validator); | 439 | m_CurrentDoc.Load(validator); |
434 | #endif | 440 | #endif |
435 | } | 441 | } |
436 | catch(XmlException e) | 442 | catch(XmlException e) |
437 | { | 443 | { |
438 | throw new XmlException(e.ToString()); | 444 | throw new XmlException(e.ToString()); |
439 | } | 445 | } |
440 | 446 | ||
441 | //is there a purpose to writing it? An syntax/schema problem would have been found during pre.Process() and reported with details | 447 | //is there a purpose to writing it? An syntax/schema problem would have been found during pre.Process() and reported with details |
442 | if(m_CommandLine.WasPassed("ppo")) | 448 | if(m_CommandLine.WasPassed("ppo")) |
443 | { | 449 | { |
444 | string ppoFile = m_CommandLine["ppo"]; | 450 | string ppoFile = m_CommandLine["ppo"]; |
445 | if(ppoFile == null || ppoFile.Trim().Length < 1) | 451 | if(ppoFile == null || ppoFile.Trim().Length < 1) |
446 | { | 452 | { |
447 | ppoFile = "preprocessed.xml"; | 453 | ppoFile = "preprocessed.xml"; |
448 | } | 454 | } |
449 | 455 | ||
450 | StreamWriter writer = null; | 456 | StreamWriter writer = null; |
451 | try | 457 | try |
452 | { | 458 | { |
453 | writer = new StreamWriter(ppoFile); | 459 | writer = new StreamWriter(ppoFile); |
454 | writer.Write(xml); | 460 | writer.Write(xml); |
455 | } | 461 | } |
456 | catch(IOException ex) | 462 | catch(IOException ex) |
457 | { | 463 | { |
458 | Console.WriteLine("Could not write PPO file '{0}': {1}", ppoFile, ex.Message); | 464 | Console.WriteLine("Could not write PPO file '{0}': {1}", ppoFile, ex.Message); |
459 | } | 465 | } |
460 | finally | 466 | finally |
461 | { | 467 | { |
462 | if(writer != null) | 468 | if(writer != null) |
463 | { | 469 | { |
464 | writer.Close(); | 470 | writer.Close(); |
465 | } | 471 | } |
466 | } | 472 | } |
467 | return; | 473 | return; |
468 | } | 474 | } |
469 | //start reading the xml config file | 475 | //start reading the xml config file |
470 | XmlElement rootNode = m_CurrentDoc.DocumentElement; | 476 | XmlElement rootNode = m_CurrentDoc.DocumentElement; |
471 | //string suggestedVersion = Helper.AttributeValue(rootNode,"version","1.0"); | 477 | //string suggestedVersion = Helper.AttributeValue(rootNode,"version","1.0"); |
472 | Helper.CheckForOSVariables = Helper.ParseBoolean(rootNode,"checkOsVars",false); | 478 | Helper.CheckForOSVariables = Helper.ParseBoolean(rootNode,"checkOsVars",false); |
473 | 479 | ||
474 | foreach(XmlNode node in rootNode.ChildNodes)//solutions or if pre-proc instructions | 480 | foreach(XmlNode node in rootNode.ChildNodes)//solutions or if pre-proc instructions |
475 | { | 481 | { |
476 | IDataNode dataNode = ParseNode(node, null); | 482 | IDataNode dataNode = ParseNode(node, null); |
477 | if(dataNode is ProcessNode) | 483 | if(dataNode is ProcessNode) |
478 | { | 484 | { |
479 | ProcessNode proc = (ProcessNode)dataNode; | 485 | ProcessNode proc = (ProcessNode)dataNode; |
480 | if(proc.IsValid) | 486 | if(proc.IsValid) |
481 | { | 487 | { |
482 | ProcessFile(proc.Path); | 488 | ProcessFile(proc.Path); |
483 | } | 489 | } |
484 | } | 490 | } |
485 | else if(dataNode is SolutionNode) | 491 | else if(dataNode is SolutionNode) |
486 | { | 492 | { |
487 | solutions.Add((SolutionNode)dataNode); | 493 | solutions.Add((SolutionNode)dataNode); |
488 | } | 494 | } |
489 | } | 495 | } |
490 | } | 496 | } |
491 | catch(XmlSchemaException xse) | 497 | catch(XmlSchemaException xse) |
492 | { | 498 | { |
493 | m_Log.Write("XML validation error at line {0} in {1}:\n\n{2}", | 499 | m_Log.Write("XML validation error at line {0} in {1}:\n\n{2}", |
494 | xse.LineNumber, path, xse.Message); | 500 | xse.LineNumber, path, xse.Message); |
495 | } | 501 | } |
496 | finally | 502 | finally |
497 | { | 503 | { |
498 | m_CurrentWorkingDirectory.Pop(); | 504 | m_CurrentWorkingDirectory.Pop(); |
499 | } | 505 | } |
500 | } | 506 | } |
501 | 507 | ||
502 | #endregion | 508 | #endregion |
503 | 509 | ||
504 | #region Public Methods | 510 | #region Public Methods |
505 | 511 | ||
506 | /// <summary> | 512 | /// <summary> |
507 | /// Allows the project. | 513 | /// Allows the project. |
508 | /// </summary> | 514 | /// </summary> |
509 | /// <param name="projectGroupsFlags">The project groups flags.</param> | 515 | /// <param name="projectGroupsFlags">The project groups flags.</param> |
510 | /// <returns></returns> | 516 | /// <returns></returns> |
511 | public bool AllowProject(string projectGroupsFlags) | 517 | public bool AllowProject(string projectGroupsFlags) |
512 | { | 518 | { |
513 | if(m_ProjectGroups != null && m_ProjectGroups.Length > 0) | 519 | if(m_ProjectGroups != null && m_ProjectGroups.Length > 0) |
514 | { | 520 | { |
515 | if(projectGroupsFlags != null && projectGroupsFlags.Length == 0) | 521 | if(projectGroupsFlags != null && projectGroupsFlags.Length == 0) |
522 | { | ||
523 | foreach(string group in projectGroupsFlags.Split('|')) | ||
524 | { | ||
525 | if(Array.IndexOf(m_ProjectGroups, group) != -1) //if included in the filter list | ||
526 | { | ||
527 | return true; | ||
528 | } | ||
529 | } | ||
530 | } | ||
531 | return false;//not included in the list or no groups specified for the project | ||
532 | } | ||
533 | return true;//no filter specified in the command line args | ||
534 | } | ||
535 | |||
536 | /// <summary> | ||
537 | /// Gets the type of the node. | ||
538 | /// </summary> | ||
539 | /// <param name="node">The node.</param> | ||
540 | /// <returns></returns> | ||
541 | public Type GetNodeType(XmlNode node) | ||
542 | { | ||
543 | if( node == null ) | ||
544 | { | ||
545 | throw new ArgumentNullException("node"); | ||
546 | } | ||
547 | if(!m_Nodes.ContainsKey(node.Name)) | ||
548 | { | ||
549 | return null; | ||
550 | } | ||
551 | |||
552 | NodeEntry ne = m_Nodes[node.Name]; | ||
553 | return ne.Type; | ||
554 | } | ||
555 | |||
556 | /// <summary> | ||
557 | /// | ||
558 | /// </summary> | ||
559 | /// <param name="node"></param> | ||
560 | /// <param name="parent"></param> | ||
561 | /// <returns></returns> | ||
562 | public IDataNode ParseNode(XmlNode node, IDataNode parent) | ||
563 | { | ||
564 | return ParseNode(node, parent, null); | ||
565 | } | ||
566 | |||
567 | //Create an instance of the data node type that is mapped to the name of the xml DOM node | ||
568 | /// <summary> | ||
569 | /// Parses the node. | ||
570 | /// </summary> | ||
571 | /// <param name="node">The node.</param> | ||
572 | /// <param name="parent">The parent.</param> | ||
573 | /// <param name="preNode">The pre node.</param> | ||
574 | /// <returns></returns> | ||
575 | public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode) | ||
576 | { | ||
577 | IDataNode dataNode; | ||
578 | |||
579 | try | ||
580 | { | ||
581 | if( node == null ) | ||
582 | { | ||
583 | throw new ArgumentNullException("node"); | ||
584 | } | ||
585 | if(preNode == null) | ||
586 | { | ||
587 | if(!m_Nodes.ContainsKey(node.Name)) | ||
588 | { | ||
589 | Console.WriteLine("WARNING: Unknown XML node: " + node.Name); | ||
590 | return null; | ||
591 | } | ||
592 | |||
593 | NodeEntry ne = m_Nodes[node.Name]; | ||
594 | Type type = ne.Type; | ||
595 | //DataNodeAttribute dna = ne.Attribute; | ||
596 | |||
597 | dataNode = (IDataNode)type.Assembly.CreateInstance(type.FullName); | ||
598 | if(dataNode == null) | ||
599 | { | ||
600 | throw new System.Reflection.TargetException("Could not create new parser instance: " + type.FullName); | ||
601 | } | ||
602 | } | ||
603 | else | ||
604 | dataNode = preNode; | ||
605 | |||
606 | dataNode.Parent = parent; | ||
607 | if (cmdlineTargetFramework && dataNode is ProjectNode) | ||
516 | { | 608 | { |
517 | foreach(string group in projectGroupsFlags.Split('|')) | 609 | ((ProjectNode)dataNode).FrameworkVersion = m_TargetFramework; |
518 | { | ||
519 | if(Array.IndexOf(m_ProjectGroups, group) != -1) //if included in the filter list | ||
520 | { | ||
521 | return true; | ||
522 | } | ||
523 | } | ||
524 | } | 610 | } |
525 | return false;//not included in the list or no groups specified for the project | 611 | dataNode.Parse(node); |
526 | } | 612 | } |
527 | return true;//no filter specified in the command line args | 613 | catch(WarningException wex) |
528 | } | 614 | { |
529 | 615 | m_Log.Write(LogType.Warning, wex.Message); | |
530 | /// <summary> | 616 | return null; |
531 | /// Gets the type of the node. | 617 | } |
532 | /// </summary> | 618 | catch(FatalException fex) |
533 | /// <param name="node">The node.</param> | 619 | { |
534 | /// <returns></returns> | 620 | m_Log.WriteException(LogType.Error, fex); |
535 | public Type GetNodeType(XmlNode node) | 621 | throw; |
536 | { | 622 | } |
537 | if( node == null ) | 623 | catch(Exception ex) |
538 | { | 624 | { |
539 | throw new ArgumentNullException("node"); | 625 | m_Log.WriteException(LogType.Error, ex); |
540 | } | 626 | throw; |
541 | if(!m_Nodes.ContainsKey(node.Name)) | 627 | } |
542 | { | 628 | |
543 | return null; | 629 | return dataNode; |
544 | } | 630 | } |
545 | 631 | ||
546 | NodeEntry ne = m_Nodes[node.Name]; | 632 | /// <summary> |
547 | return ne.Type; | 633 | /// Initializes the specified target. |
548 | } | 634 | /// </summary> |
549 | 635 | /// <param name="target">The target.</param> | |
550 | /// <summary> | 636 | /// <param name="args">The args.</param> |
551 | /// | 637 | public void Initialize(LogTargets target, string[] args) |
552 | /// </summary> | 638 | { |
553 | /// <param name="node"></param> | 639 | CacheTargets(GetType().Assembly); |
554 | /// <param name="parent"></param> | 640 | CacheNodeTypes(GetType().Assembly); |
555 | /// <returns></returns> | 641 | CacheVersion(); |
556 | public IDataNode ParseNode(XmlNode node, IDataNode parent) | 642 | |
557 | { | 643 | m_CommandLine = new CommandLineCollection(args); |
558 | return ParseNode(node, parent, null); | 644 | |
559 | } | 645 | string logFile = null; |
560 | 646 | if(m_CommandLine.WasPassed("log")) | |
561 | //Create an instance of the data node type that is mapped to the name of the xml DOM node | 647 | { |
562 | /// <summary> | 648 | logFile = m_CommandLine["log"]; |
563 | /// Parses the node. | 649 | |
564 | /// </summary> | 650 | if(logFile != null && logFile.Length == 0) |
565 | /// <param name="node">The node.</param> | 651 | { |
566 | /// <param name="parent">The parent.</param> | 652 | logFile = "Prebuild.log"; |
567 | /// <param name="preNode">The pre node.</param> | 653 | } |
568 | /// <returns></returns> | 654 | } |
569 | public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode) | 655 | else |
570 | { | 656 | { |
571 | IDataNode dataNode; | 657 | target = target & ~LogTargets.File; //dont output to a file |
572 | 658 | } | |
573 | try | 659 | |
574 | { | 660 | m_Log = new Log(target, logFile); |
575 | if( node == null ) | 661 | LogBanner(); |
576 | { | 662 | |
577 | throw new ArgumentNullException("node"); | 663 | m_CurrentWorkingDirectory = new CurrentDirectory(); |
578 | } | ||
579 | if(preNode == null) | ||
580 | { | ||
581 | if(!m_Nodes.ContainsKey(node.Name)) | ||
582 | { | ||
583 | Console.WriteLine("WARNING: Unknown XML node: " + node.Name); | ||
584 | return null; | ||
585 | } | ||
586 | |||
587 | NodeEntry ne = m_Nodes[node.Name]; | ||
588 | Type type = ne.Type; | ||
589 | //DataNodeAttribute dna = ne.Attribute; | ||
590 | |||
591 | dataNode = (IDataNode)type.Assembly.CreateInstance(type.FullName); | ||
592 | if(dataNode == null) | ||
593 | { | ||
594 | throw new System.Reflection.TargetException("Could not create new parser instance: " + type.FullName); | ||
595 | } | ||
596 | } | ||
597 | else | ||
598 | dataNode = preNode; | ||
599 | |||
600 | dataNode.Parent = parent; | ||
601 | dataNode.Parse(node); | ||
602 | } | ||
603 | catch(WarningException wex) | ||
604 | { | ||
605 | m_Log.Write(LogType.Warning, wex.Message); | ||
606 | return null; | ||
607 | } | ||
608 | catch(FatalException fex) | ||
609 | { | ||
610 | m_Log.WriteException(LogType.Error, fex); | ||
611 | throw; | ||
612 | } | ||
613 | catch(Exception ex) | ||
614 | { | ||
615 | m_Log.WriteException(LogType.Error, ex); | ||
616 | throw; | ||
617 | } | ||
618 | |||
619 | return dataNode; | ||
620 | } | ||
621 | |||
622 | /// <summary> | ||
623 | /// Initializes the specified target. | ||
624 | /// </summary> | ||
625 | /// <param name="target">The target.</param> | ||
626 | /// <param name="args">The args.</param> | ||
627 | public void Initialize(LogTargets target, string[] args) | ||
628 | { | ||
629 | CacheTargets(GetType().Assembly); | ||
630 | CacheNodeTypes(GetType().Assembly); | ||
631 | CacheVersion(); | ||
632 | |||
633 | m_CommandLine = new CommandLineCollection(args); | ||
634 | |||
635 | string logFile = null; | ||
636 | if(m_CommandLine.WasPassed("log")) | ||
637 | { | ||
638 | logFile = m_CommandLine["log"]; | ||
639 | |||
640 | if(logFile != null && logFile.Length == 0) | ||
641 | { | ||
642 | logFile = "Prebuild.log"; | ||
643 | } | ||
644 | } | ||
645 | else | ||
646 | { | ||
647 | target = target & ~LogTargets.File; //dont output to a file | ||
648 | } | ||
649 | |||
650 | m_Log = new Log(target, logFile); | ||
651 | LogBanner(); | ||
652 | |||
653 | m_CurrentWorkingDirectory = new CurrentDirectory(); | ||
654 | 664 | ||
655 | m_Target = m_CommandLine["target"]; | 665 | m_Target = m_CommandLine["target"]; |
656 | m_Clean = m_CommandLine["clean"]; | 666 | m_Conditionals = m_CommandLine["conditionals"]; |
657 | string removeDirs = m_CommandLine["removedir"]; | 667 | if(m_CommandLine["targetframework"] != null) |
658 | if(removeDirs != null && removeDirs.Length == 0) | 668 | { |
659 | { | 669 | m_TargetFramework = (FrameworkVersion)Enum.Parse (typeof (FrameworkVersion), m_CommandLine["targetframework"]); |
660 | m_RemoveDirectories = removeDirs.Split('|'); | 670 | cmdlineTargetFramework = true; |
661 | } | 671 | } |
662 | 672 | m_Clean = m_CommandLine["clean"]; | |
663 | string flags = m_CommandLine["allowedgroups"];//allows filtering by specifying a pipe-delimited list of groups to include | 673 | string removeDirs = m_CommandLine["removedir"]; |
664 | if(flags != null && flags.Length == 0) | 674 | if(removeDirs != null && removeDirs.Length == 0) |
665 | { | 675 | { |
666 | m_ProjectGroups = flags.Split('|'); | 676 | m_RemoveDirectories = removeDirs.Split('|'); |
667 | } | 677 | } |
668 | m_PauseAfterFinish = m_CommandLine.WasPassed("pause"); | 678 | |
669 | 679 | string flags = m_CommandLine["allowedgroups"];//allows filtering by specifying a pipe-delimited list of groups to include | |
670 | LoadSchema(); | 680 | if(flags != null && flags.Length == 0) |
671 | } | 681 | { |
672 | 682 | m_ProjectGroups = flags.Split('|'); | |
673 | /// <summary> | 683 | } |
674 | /// Processes this instance. | 684 | m_PauseAfterFinish = m_CommandLine.WasPassed("pause"); |
675 | /// </summary> | 685 | |
676 | public void Process() | 686 | LoadSchema(); |
677 | { | 687 | } |
678 | bool perfomedOtherTask = false; | 688 | |
679 | if(m_RemoveDirectories != null && m_RemoveDirectories.Length > 0) | 689 | /// <summary> |
680 | { | 690 | /// Processes this instance. |
681 | try | 691 | /// </summary> |
682 | { | 692 | public void Process() |
683 | RemoveDirectories(".",m_RemoveDirectories); | 693 | { |
684 | } | 694 | bool perfomedOtherTask = false; |
685 | catch(IOException e) | 695 | if(m_RemoveDirectories != null && m_RemoveDirectories.Length > 0) |
686 | { | 696 | { |
687 | m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); | 697 | try |
688 | m_Log.WriteException(LogType.Error,e); | 698 | { |
689 | } | 699 | RemoveDirectories(".",m_RemoveDirectories); |
690 | catch(UnauthorizedAccessException e) | 700 | } |
691 | { | 701 | catch(IOException e) |
692 | m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); | 702 | { |
693 | m_Log.WriteException(LogType.Error,e); | 703 | m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); |
694 | } | 704 | m_Log.WriteException(LogType.Error,e); |
695 | perfomedOtherTask = true; | 705 | } |
696 | } | 706 | catch(UnauthorizedAccessException e) |
697 | 707 | { | |
698 | if(m_Target != null && m_Clean != null) | 708 | m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); |
699 | { | 709 | m_Log.WriteException(LogType.Error,e); |
700 | m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together"); | 710 | } |
701 | return; | 711 | perfomedOtherTask = true; |
702 | } | 712 | } |
703 | 713 | ||
714 | if(m_Target != null && m_Clean != null) | ||
715 | { | ||
716 | m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together"); | ||
717 | return; | ||
718 | } | ||
719 | |||
704 | if(m_Target == null && m_Clean == null) | 720 | if(m_Target == null && m_Clean == null) |
705 | { | 721 | { |
706 | if(perfomedOtherTask) //finished | 722 | if(perfomedOtherTask) //finished |
707 | { | 723 | { |
708 | return; | 724 | return; |
709 | } | 725 | } |
710 | m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file"); | 726 | m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file"); |
711 | return; | 727 | return; |
712 | } | 728 | } |
713 | 729 | ||
714 | string file = "./prebuild.xml"; | 730 | string file = "./prebuild.xml"; |
715 | if(m_CommandLine.WasPassed("file")) | 731 | if(m_CommandLine.WasPassed("file")) |
716 | { | 732 | { |
717 | file = m_CommandLine["file"]; | 733 | file = m_CommandLine["file"]; |
718 | } | 734 | } |
719 | 735 | ||
720 | ProcessFile(file); | 736 | ProcessFile(file); |
721 | 737 | ||
722 | string target = (m_Target != null ? m_Target.ToLower() : m_Clean.ToLower()); | 738 | string target = (m_Target != null ? m_Target.ToLower() : m_Clean.ToLower()); |
723 | bool clean = (m_Target == null); | 739 | bool clean = (m_Target == null); |
724 | if(clean && target != null && target.Length == 0) | 740 | if(clean && target != null && target.Length == 0) |
725 | { | 741 | { |
726 | target = "all"; | 742 | target = "all"; |
727 | } | 743 | } |
728 | if(clean && target == "all")//default to all if no target was specified for clean | 744 | if(clean && target == "all")//default to all if no target was specified for clean |
729 | { | 745 | { |
730 | //check if they passed yes | 746 | //check if they passed yes |
731 | if (!m_CommandLine.WasPassed("yes")) | 747 | if (!m_CommandLine.WasPassed("yes")) |
732 | { | 748 | { |
733 | Console.WriteLine("WARNING: This operation will clean ALL project files for all targets, are you sure? (y/n):"); | 749 | Console.WriteLine("WARNING: This operation will clean ALL project files for all targets, are you sure? (y/n):"); |
734 | string ret = Console.ReadLine(); | 750 | string ret = Console.ReadLine(); |
735 | if(ret == null) | 751 | if(ret == null) |
736 | { | 752 | { |
737 | return; | 753 | return; |
754 | } | ||
755 | ret = ret.Trim().ToLower(); | ||
756 | if((ret.ToLower() != "y" && ret.ToLower() != "yes")) | ||
757 | { | ||
758 | return; | ||
738 | } | 759 | } |
739 | ret = ret.Trim().ToLower(); | ||
740 | if((ret.ToLower() != "y" && ret.ToLower() != "yes")) | ||
741 | { | ||
742 | return; | ||
743 | } | ||
744 | } | ||
745 | //clean all targets (just cleaning vs2002 target didn't clean nant) | ||
746 | foreach(ITarget targ in m_Targets.Values) | ||
747 | { | ||
748 | targ.Clean(this); | ||
749 | } | 760 | } |
750 | } | 761 | //clean all targets (just cleaning vs2002 target didn't clean nant) |
751 | else | 762 | foreach(ITarget targ in m_Targets.Values) |
752 | { | 763 | { |
753 | if (!m_Targets.ContainsKey(target)) { | 764 | targ.Clean(this); |
754 | m_Log.Write(LogType.Error, "Unknown Target \"{0}\"", target); | 765 | } |
755 | return; | 766 | } |
756 | } | 767 | else |
757 | ITarget targ = m_Targets[target]; | 768 | { |
758 | 769 | if (!m_Targets.ContainsKey(target)) { | |
759 | if(clean) | 770 | m_Log.Write(LogType.Error, "Unknown Target \"{0}\"", target); |
760 | { | 771 | return; |
761 | targ.Clean(this); | 772 | } |
762 | } | 773 | ITarget targ = m_Targets[target]; |
763 | else | 774 | |
764 | { | 775 | if(clean) |
765 | targ.Write(this); | 776 | { |
766 | } | 777 | targ.Clean(this); |
767 | } | 778 | } |
768 | 779 | else | |
769 | m_Log.Flush(); | 780 | { |
770 | } | 781 | targ.Write(this); |
771 | 782 | } | |
772 | #endregion | 783 | } |
773 | 784 | ||
774 | #region IDisposable Members | 785 | m_Log.Flush(); |
775 | 786 | } | |
776 | /// <summary> | 787 | |
777 | /// | 788 | #endregion |
778 | /// </summary> | 789 | |
779 | public void Dispose() | 790 | #region IDisposable Members |
780 | { | 791 | |
781 | Dispose(true); | 792 | /// <summary> |
782 | GC.SuppressFinalize(this); | 793 | /// |
783 | } | 794 | /// </summary> |
784 | 795 | public void Dispose() | |
785 | /// <summary> | 796 | { |
786 | /// Dispose objects | 797 | Dispose(true); |
787 | /// </summary> | 798 | GC.SuppressFinalize(this); |
788 | /// <param name="disposing"> | 799 | } |
789 | /// If true, it will dispose close the handle | 800 | |
790 | /// </param> | 801 | /// <summary> |
791 | /// <remarks> | 802 | /// Dispose objects |
792 | /// Will dispose managed and unmanaged resources. | 803 | /// </summary> |
793 | /// </remarks> | 804 | /// <param name="disposing"> |
794 | protected virtual void Dispose(bool disposing) | 805 | /// If true, it will dispose close the handle |
795 | { | 806 | /// </param> |
796 | if (!disposed) | 807 | /// <remarks> |
797 | { | 808 | /// Will dispose managed and unmanaged resources. |
798 | if (disposing) | 809 | /// </remarks> |
799 | { | 810 | protected virtual void Dispose(bool disposing) |
811 | { | ||
812 | if (!disposed) | ||
813 | { | ||
814 | if (disposing) | ||
815 | { | ||
800 | GC.SuppressFinalize(this); | 816 | GC.SuppressFinalize(this); |
801 | if (m_Log != null) | 817 | if (m_Log != null) |
802 | { | 818 | { |
803 | m_Log.Close(); | 819 | m_Log.Close(); |
804 | m_Log = null; | 820 | m_Log = null; |
805 | } | 821 | } |
806 | } | 822 | } |
807 | } | 823 | } |
808 | disposed = true; | 824 | disposed = true; |
809 | } | 825 | } |
810 | 826 | ||
811 | /// <summary> | 827 | /// <summary> |
812 | /// | 828 | /// |
813 | /// </summary> | 829 | /// </summary> |
814 | ~Kernel() | 830 | ~Kernel() |
815 | { | 831 | { |
816 | Dispose(false); | 832 | Dispose(false); |
817 | } | 833 | } |
818 | 834 | ||
819 | /// <summary> | 835 | /// <summary> |
820 | /// Closes and destroys this object | 836 | /// Closes and destroys this object |
821 | /// </summary> | 837 | /// </summary> |
822 | /// <remarks> | 838 | /// <remarks> |
823 | /// Same as Dispose(true) | 839 | /// Same as Dispose(true) |
824 | /// </remarks> | 840 | /// </remarks> |
825 | public void Close() | 841 | public void Close() |
826 | { | 842 | { |
827 | Dispose(); | 843 | Dispose(); |
828 | } | 844 | } |
829 | 845 | ||
830 | #endregion | 846 | #endregion |
831 | } | 847 | } |
832 | } | 848 | } |
diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index e4b024f..4c415bb 100644 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Author")] | 38 | [DataNode("Author")] |
39 | public class AuthorNode : DataNode | 39 | public class AuthorNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Signature; | 43 | private string m_Signature; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the signature. | 50 | /// Gets the signature. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The signature.</value> | 52 | /// <value>The signature.</value> |
53 | public string Signature | 53 | public string Signature |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Signature; | 57 | return m_Signature; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Signature == null) | 77 | if(m_Signature == null) |
78 | { | 78 | { |
79 | m_Signature = ""; | 79 | m_Signature = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Signature = m_Signature.Trim(); | 82 | m_Signature = m_Signature.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs index bd564d5..71405f9 100644 --- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs index f334ea3..b8131b0 100644 --- a/Prebuild/src/Core/Nodes/CleanupNode.cs +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -35,40 +35,40 @@ namespace Prebuild.Core.Nodes | |||
35 | [DataNode("Cleanup")] | 35 | [DataNode("Cleanup")] |
36 | public class CleanupNode : DataNode | 36 | public class CleanupNode : DataNode |
37 | { | 37 | { |
38 | #region Fields | 38 | #region Fields |
39 | 39 | ||
40 | private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>(); | 40 | private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>(); |
41 | 41 | ||
42 | #endregion | 42 | #endregion |
43 | 43 | ||
44 | #region Properties | 44 | #region Properties |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Gets the signature. | 47 | /// Gets the signature. |
48 | /// </summary> | 48 | /// </summary> |
49 | /// <value>The signature.</value> | 49 | /// <value>The signature.</value> |
50 | public List<CleanFilesNode> CleanFiles | 50 | public List<CleanFilesNode> CleanFiles |
51 | { | 51 | { |
52 | get | 52 | get |
53 | { | 53 | { |
54 | return m_CleanFiles; | 54 | return m_CleanFiles; |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | #endregion | 58 | #endregion |
59 | 59 | ||
60 | #region Public Methods | 60 | #region Public Methods |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Parses the specified node. | 63 | /// Parses the specified node. |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <param name="node">The node.</param> | 65 | /// <param name="node">The node.</param> |
66 | public override void Parse(XmlNode node) | 66 | public override void Parse(XmlNode node) |
67 | { | 67 | { |
68 | if( node == null ) | 68 | if( node == null ) |
69 | { | 69 | { |
70 | throw new ArgumentNullException("node"); | 70 | throw new ArgumentNullException("node"); |
71 | } | 71 | } |
72 | 72 | ||
73 | foreach (XmlNode child in node.ChildNodes) | 73 | foreach (XmlNode child in node.ChildNodes) |
74 | { | 74 | { |
@@ -78,8 +78,8 @@ namespace Prebuild.Core.Nodes | |||
78 | m_CleanFiles.Add((CleanFilesNode)dataNode); | 78 | m_CleanFiles.Add((CleanFilesNode)dataNode); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | #endregion | 83 | #endregion |
84 | } | 84 | } |
85 | } \ No newline at end of file | 85 | } \ No newline at end of file |
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs index a101799..cd2f740 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,185 +32,185 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Configuration")] | 38 | [DataNode("Configuration")] |
39 | public class ConfigurationNode : DataNode, ICloneable, IComparable | 39 | public class ConfigurationNode : DataNode, ICloneable, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Name = "unknown"; | 43 | private string m_Name = "unknown"; |
44 | private string m_Platform = "AnyCPU"; | 44 | private string m_Platform = "AnyCPU"; |
45 | private OptionsNode m_Options; | 45 | private OptionsNode m_Options; |
46 | 46 | ||
47 | #endregion | 47 | #endregion |
48 | 48 | ||
49 | #region Constructors | 49 | #region Constructors |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. | 52 | /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. |
53 | /// </summary> | 53 | /// </summary> |
54 | public ConfigurationNode() | 54 | public ConfigurationNode() |
55 | { | 55 | { |
56 | m_Options = new OptionsNode(); | 56 | m_Options = new OptionsNode(); |
57 | } | 57 | } |
58 | 58 | ||
59 | #endregion | 59 | #endregion |
60 | 60 | ||
61 | #region Properties | 61 | #region Properties |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Gets or sets the parent. | 64 | /// Gets or sets the parent. |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <value>The parent.</value> | 66 | /// <value>The parent.</value> |
67 | public override IDataNode Parent | 67 | public override IDataNode Parent |
68 | { | 68 | { |
69 | get | 69 | get |
70 | { | 70 | { |
71 | return base.Parent; | 71 | return base.Parent; |
72 | } | 72 | } |
73 | set | 73 | set |
74 | { | 74 | { |
75 | base.Parent = value; | 75 | base.Parent = value; |
76 | if(base.Parent is SolutionNode) | 76 | if(base.Parent is SolutionNode) |
77 | { | 77 | { |
78 | SolutionNode node = (SolutionNode)base.Parent; | 78 | SolutionNode node = (SolutionNode)base.Parent; |
79 | if(node != null && node.Options != null) | 79 | if(node != null && node.Options != null) |
80 | { | 80 | { |
81 | node.Options.CopyTo(m_Options); | 81 | node.Options.CopyTo(m_Options); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Identifies the platform for this specific configuration. | 88 | /// Identifies the platform for this specific configuration. |
89 | /// </summary> | 89 | /// </summary> |
90 | public string Platform | 90 | public string Platform |
91 | { | 91 | { |
92 | get | 92 | get |
93 | { | 93 | { |
94 | return m_Platform; | 94 | return m_Platform; |
95 | } | 95 | } |
96 | set | 96 | set |
97 | { | 97 | { |
98 | switch ((value + "").ToLower()) | 98 | switch ((value + "").ToLower()) |
99 | { | 99 | { |
100 | case "x86": | 100 | case "x86": |
101 | case "x64": | 101 | case "x64": |
102 | m_Platform = value; | 102 | m_Platform = value; |
103 | break; | 103 | break; |
104 | case "itanium": | 104 | case "itanium": |
105 | m_Platform = "Itanium"; | 105 | m_Platform = "Itanium"; |
106 | break; | 106 | break; |
107 | default: | 107 | default: |
108 | m_Platform = "AnyCPU"; | 108 | m_Platform = "AnyCPU"; |
109 | break; | 109 | break; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Gets the name. | 115 | /// Gets the name. |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <value>The name.</value> | 117 | /// <value>The name.</value> |
118 | public string Name | 118 | public string Name |
119 | { | 119 | { |
120 | get | 120 | get |
121 | { | 121 | { |
122 | return m_Name; | 122 | return m_Name; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Gets the name and platform for the configuration. | 127 | /// Gets the name and platform for the configuration. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <value>The name and platform.</value> | 129 | /// <value>The name and platform.</value> |
130 | public string NameAndPlatform | 130 | public string NameAndPlatform |
131 | { | 131 | { |
132 | get | 132 | get |
133 | { | 133 | { |
134 | string platform = m_Platform; | 134 | string platform = m_Platform; |
135 | if (platform == "AnyCPU") | 135 | if (platform == "AnyCPU") |
136 | platform = "Any CPU"; | 136 | platform = "Any CPU"; |
137 | 137 | ||
138 | return String.Format("{0}|{1}", m_Name, platform); | 138 | return String.Format("{0}|{1}", m_Name, platform); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | /// <summary> | 142 | /// <summary> |
143 | /// Gets or sets the options. | 143 | /// Gets or sets the options. |
144 | /// </summary> | 144 | /// </summary> |
145 | /// <value>The options.</value> | 145 | /// <value>The options.</value> |
146 | public OptionsNode Options | 146 | public OptionsNode Options |
147 | { | 147 | { |
148 | get | 148 | get |
149 | { | 149 | { |
150 | return m_Options; | 150 | return m_Options; |
151 | } | 151 | } |
152 | set | 152 | set |
153 | { | 153 | { |
154 | m_Options = value; | 154 | m_Options = value; |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Public Methods | 160 | #region Public Methods |
161 | 161 | ||
162 | /// <summary> | 162 | /// <summary> |
163 | /// Parses the specified node. | 163 | /// Parses the specified node. |
164 | /// </summary> | 164 | /// </summary> |
165 | /// <param name="node">The node.</param> | 165 | /// <param name="node">The node.</param> |
166 | public override void Parse(XmlNode node) | 166 | public override void Parse(XmlNode node) |
167 | { | 167 | { |
168 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 168 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
169 | Platform = Helper.AttributeValue(node, "platform", m_Platform); | 169 | Platform = Helper.AttributeValue(node, "platform", m_Platform); |
170 | 170 | ||
171 | if (node == null) | 171 | if (node == null) |
172 | { | 172 | { |
173 | throw new ArgumentNullException("node"); | 173 | throw new ArgumentNullException("node"); |
174 | } | 174 | } |
175 | foreach(XmlNode child in node.ChildNodes) | 175 | foreach(XmlNode child in node.ChildNodes) |
176 | { | 176 | { |
177 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 177 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
178 | if(dataNode is OptionsNode) | 178 | if(dataNode is OptionsNode) |
179 | { | 179 | { |
180 | ((OptionsNode)dataNode).CopyTo(m_Options); | 180 | ((OptionsNode)dataNode).CopyTo(m_Options); |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | /// <summary> | 185 | /// <summary> |
186 | /// Copies to. | 186 | /// Copies to. |
187 | /// </summary> | 187 | /// </summary> |
188 | /// <param name="conf">The conf.</param> | 188 | /// <param name="conf">The conf.</param> |
189 | public void CopyTo(ConfigurationNode conf) | 189 | public void CopyTo(ConfigurationNode conf) |
190 | { | 190 | { |
191 | m_Options.CopyTo(conf.m_Options); | 191 | m_Options.CopyTo(conf.m_Options); |
192 | } | 192 | } |
193 | 193 | ||
194 | #endregion | 194 | #endregion |
195 | 195 | ||
196 | #region ICloneable Members | 196 | #region ICloneable Members |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// Creates a new object that is a copy of the current instance. | 199 | /// Creates a new object that is a copy of the current instance. |
200 | /// </summary> | 200 | /// </summary> |
201 | /// <returns> | 201 | /// <returns> |
202 | /// A new object that is a copy of this instance. | 202 | /// A new object that is a copy of this instance. |
203 | /// </returns> | 203 | /// </returns> |
204 | public object Clone() | 204 | public object Clone() |
205 | { | 205 | { |
206 | ConfigurationNode ret = new ConfigurationNode(); | 206 | ConfigurationNode ret = new ConfigurationNode(); |
207 | ret.m_Name = m_Name; | 207 | ret.m_Name = m_Name; |
208 | ret.m_Platform = m_Platform; | 208 | ret.m_Platform = m_Platform; |
209 | m_Options.CopyTo(ret.m_Options); | 209 | m_Options.CopyTo(ret.m_Options); |
210 | return ret; | 210 | return ret; |
211 | } | 211 | } |
212 | 212 | ||
213 | #endregion | 213 | #endregion |
214 | 214 | ||
215 | #region IComparable Members | 215 | #region IComparable Members |
216 | 216 | ||
@@ -221,5 +221,5 @@ namespace Prebuild.Core.Nodes | |||
221 | } | 221 | } |
222 | 222 | ||
223 | #endregion | 223 | #endregion |
224 | } | 224 | } |
225 | } | 225 | } |
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs index eba6550..1c38d9e 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -27,45 +27,45 @@ using System.Collections.Generic; | |||
27 | 27 | ||
28 | namespace Prebuild.Core.Nodes | 28 | namespace Prebuild.Core.Nodes |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// Implements a specialized list of configuration nodes which allows for lookup via | 31 | /// Implements a specialized list of configuration nodes which allows for lookup via |
32 | /// configuration name and platform. | 32 | /// configuration name and platform. |
33 | /// </summary> | 33 | /// </summary> |
34 | public class ConfigurationNodeCollection : List<ConfigurationNode> | 34 | public class ConfigurationNodeCollection : List<ConfigurationNode> |
35 | { | 35 | { |
36 | #region Properties | 36 | #region Properties |
37 | 37 | ||
38 | public ConfigurationNode this[string nameAndPlatform] | 38 | public ConfigurationNode this[string nameAndPlatform] |
39 | { | 39 | { |
40 | get | 40 | get |
41 | { | 41 | { |
42 | foreach (ConfigurationNode configurationNode in this) | 42 | foreach (ConfigurationNode configurationNode in this) |
43 | { | 43 | { |
44 | if (configurationNode.NameAndPlatform == nameAndPlatform) | 44 | if (configurationNode.NameAndPlatform == nameAndPlatform) |
45 | { | 45 | { |
46 | return configurationNode; | 46 | return configurationNode; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | return null; | 50 | return null; |
51 | } | 51 | } |
52 | 52 | ||
53 | set | 53 | set |
54 | { | 54 | { |
55 | // See if the node | 55 | // See if the node |
56 | ConfigurationNode configurationNode = this[nameAndPlatform]; | 56 | ConfigurationNode configurationNode = this[nameAndPlatform]; |
57 | 57 | ||
58 | if (configurationNode != null) | 58 | if (configurationNode != null) |
59 | { | 59 | { |
60 | this[IndexOf(configurationNode)] = value; | 60 | this[IndexOf(configurationNode)] = value; |
61 | } | 61 | } |
62 | else | 62 | else |
63 | { | 63 | { |
64 | Add(value); | 64 | Add(value); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 4f20588..318b13c 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,86 +32,86 @@ using System.IO; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | public abstract class DataNode : IDataNode | 38 | public abstract class DataNode : IDataNode |
39 | { | 39 | { |
40 | #region Fields | 40 | #region Fields |
41 | 41 | ||
42 | private IDataNode parent; | 42 | private IDataNode parent; |
43 | string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; | 43 | string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region IDataNode Members | 47 | #region IDataNode Members |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets or sets the parent. | 50 | /// Gets or sets the parent. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The parent.</value> | 52 | /// <value>The parent.</value> |
53 | public virtual IDataNode Parent | 53 | public virtual IDataNode Parent |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return parent; | 57 | return parent; |
58 | } | 58 | } |
59 | set | 59 | set |
60 | { | 60 | { |
61 | parent = value; | 61 | parent = value; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | public string[] WebTypes | 64 | public string[] WebTypes |
65 | { | 65 | { |
66 | get { return m_WebTypes; } | 66 | get { return m_WebTypes; } |
67 | } | 67 | } |
68 | /// <summary> | 68 | /// <summary> |
69 | /// Parses the specified node. | 69 | /// Parses the specified node. |
70 | /// </summary> | 70 | /// </summary> |
71 | /// <param name="node">The node.</param> | 71 | /// <param name="node">The node.</param> |
72 | public virtual void Parse(XmlNode node) | 72 | public virtual void Parse(XmlNode node) |
73 | { | 73 | { |
74 | } | 74 | } |
75 | public BuildAction GetBuildActionByFileName(string fileName) | 75 | public BuildAction GetBuildActionByFileName(string fileName) |
76 | { | 76 | { |
77 | string extension = Path.GetExtension(fileName).ToLower(); | 77 | string extension = Path.GetExtension(fileName).ToLower(); |
78 | foreach (string type in WebTypes) | 78 | foreach (string type in WebTypes) |
79 | { | 79 | { |
80 | if (extension == type) | 80 | if (extension == type) |
81 | return BuildAction.Content; | 81 | return BuildAction.Content; |
82 | } | 82 | } |
83 | return BuildAction.Compile; | 83 | return BuildAction.Compile; |
84 | } | 84 | } |
85 | /// <summary> | 85 | /// <summary> |
86 | /// Parses the file type to figure out what type it is | 86 | /// Parses the file type to figure out what type it is |
87 | /// </summary> | 87 | /// </summary> |
88 | /// <returns></returns> | 88 | /// <returns></returns> |
89 | public SubType GetSubTypeByFileName(string fileName) | 89 | public SubType GetSubTypeByFileName(string fileName) |
90 | { | 90 | { |
91 | string extension = System.IO.Path.GetExtension(fileName).ToLower(); | 91 | string extension = System.IO.Path.GetExtension(fileName).ToLower(); |
92 | string designer = String.Format(".designer{0}", extension); | 92 | string designer = String.Format(".designer{0}", extension); |
93 | string path = fileName.ToLower(); | 93 | string path = fileName.ToLower(); |
94 | if (extension == ".resx") | 94 | if (extension == ".resx") |
95 | { | 95 | { |
96 | return SubType.Designer; | 96 | return SubType.Designer; |
97 | } | 97 | } |
98 | else if (path.EndsWith(".settings")) | 98 | else if (path.EndsWith(".settings")) |
99 | { | 99 | { |
100 | return SubType.Settings; | 100 | return SubType.Settings; |
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | 104 | ||
105 | foreach (string type in WebTypes) | 105 | foreach (string type in WebTypes) |
106 | { | 106 | { |
107 | if (path.EndsWith(type)) | 107 | if (path.EndsWith(type)) |
108 | { | 108 | { |
109 | return SubType.CodeBehind; | 109 | return SubType.CodeBehind; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } | 112 | } |
113 | return SubType.Code; | 113 | return SubType.Code; |
114 | } | 114 | } |
115 | #endregion | 115 | #endregion |
116 | } | 116 | } |
117 | } | 117 | } |
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs index 974b74e..845db24 100644 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | |||
@@ -43,18 +43,18 @@ namespace Prebuild.Core.Nodes | |||
43 | providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; | 43 | providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; |
44 | case "System.Data.OracleClient": | 44 | case "System.Data.OracleClient": |
45 | providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; | 45 | providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; |
46 | case "System.Data.SqlClient": | 46 | case "System.Data.SqlClient": |
47 | providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; | 47 | providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; |
48 | case "System.Data.Odbc": | 48 | case "System.Data.Odbc": |
49 | providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; | 49 | providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; |
50 | 50 | ||
51 | default: | 51 | default: |
52 | throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); | 52 | throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); |
53 | } | 53 | } |
54 | } | 54 | } |
55 | else | 55 | else |
56 | providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); | 56 | providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); |
57 | 57 | ||
58 | connectionString = Helper.AttributeValue(node, "connectionString", connectionString); | 58 | connectionString = Helper.AttributeValue(node, "connectionString", connectionString); |
59 | 59 | ||
60 | base.Parse(node); | 60 | base.Parse(node); |
diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs index 713b47c..d1293a0 100644 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// The object representing the /Prebuild/Solution/Project/Description element | 36 | /// The object representing the /Prebuild/Solution/Project/Description element |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Description")] | 38 | [DataNode("Description")] |
39 | public class DescriptionNode : DataNode | 39 | public class DescriptionNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Value; | 43 | private string m_Value; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the description Value. | 50 | /// Gets the description Value. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The description Value.</value> | 52 | /// <value>The description Value.</value> |
53 | public string Value | 53 | public string Value |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Value; | 57 | return m_Value; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Value == null) | 77 | if(m_Value == null) |
78 | { | 78 | { |
79 | m_Value = ""; | 79 | m_Value = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Value = m_Value.Trim(); | 82 | m_Value = m_Value.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs index addbdb4..7f04cba 100644 --- a/Prebuild/src/Core/Nodes/ExcludeNode.cs +++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,31 +32,31 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Exclude")] | 38 | [DataNode("Exclude")] |
39 | public class ExcludeNode : DataNode | 39 | public class ExcludeNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Pattern = ""; | 43 | private string m_Pattern = ""; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the name. | 50 | /// Gets the name. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The name.</value> | 52 | /// <value>The name.</value> |
53 | public string Name | 53 | public string Name |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Pattern; | 57 | return m_Pattern; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Gets the pattern. | 62 | /// Gets the pattern. |
@@ -72,18 +72,18 @@ namespace Prebuild.Core.Nodes | |||
72 | 72 | ||
73 | #endregion | 73 | #endregion |
74 | 74 | ||
75 | #region Public Methods | 75 | #region Public Methods |
76 | 76 | ||
77 | /// <summary> | 77 | /// <summary> |
78 | /// Parses the specified node. | 78 | /// Parses the specified node. |
79 | /// </summary> | 79 | /// </summary> |
80 | /// <param name="node">The node.</param> | 80 | /// <param name="node">The node.</param> |
81 | public override void Parse(XmlNode node) | 81 | public override void Parse(XmlNode node) |
82 | { | 82 | { |
83 | m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); | 83 | m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); |
84 | m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); | 84 | m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); |
85 | } | 85 | } |
86 | 86 | ||
87 | #endregion | 87 | #endregion |
88 | } | 88 | } |
89 | } | 89 | } |
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index c66f123..b313ffa 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,193 +34,193 @@ using Prebuild.Core.Targets; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | public enum BuildAction | 40 | public enum BuildAction |
41 | { | 41 | { |
42 | /// <summary> | ||
43 | /// | ||
44 | /// </summary> | ||
45 | None, | ||
46 | /// <summary> | ||
47 | /// | ||
48 | /// </summary> | ||
49 | Compile, | ||
50 | /// <summary> | ||
51 | /// | ||
52 | /// </summary> | ||
53 | Content, | ||
54 | /// <summary> | ||
55 | /// | ||
56 | /// </summary> | ||
57 | EmbeddedResource, | ||
58 | /// <summary> | ||
59 | /// | ||
60 | /// </summary> | ||
61 | ApplicationDefinition, | ||
62 | /// <summary> | ||
63 | /// | ||
64 | /// </summary> | ||
65 | Page, | ||
42 | /// <summary> | 66 | /// <summary> |
43 | /// | 67 | /// |
44 | /// </summary> | ||
45 | None, | ||
46 | /// <summary> | ||
47 | /// | ||
48 | /// </summary> | ||
49 | Compile, | ||
50 | /// <summary> | ||
51 | /// | ||
52 | /// </summary> | ||
53 | Content, | ||
54 | /// <summary> | ||
55 | /// | ||
56 | /// </summary> | ||
57 | EmbeddedResource, | ||
58 | /// <summary> | ||
59 | /// | ||
60 | /// </summary> | ||
61 | ApplicationDefinition, | ||
62 | /// <summary> | ||
63 | /// | ||
64 | /// </summary> | ||
65 | Page, | ||
66 | /// <summary> | ||
67 | /// | ||
68 | /// </summary> | 68 | /// </summary> |
69 | Copy | 69 | Copy |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// | 73 | /// |
74 | /// </summary> | 74 | /// </summary> |
75 | public enum SubType | 75 | public enum SubType |
76 | { | 76 | { |
77 | /// <summary> | ||
78 | /// | ||
79 | /// </summary> | ||
80 | Code, | ||
81 | /// <summary> | ||
82 | /// | ||
83 | /// </summary> | ||
84 | Component, | ||
77 | /// <summary> | 85 | /// <summary> |
78 | /// | 86 | /// |
79 | /// </summary> | ||
80 | Code, | ||
81 | /// <summary> | ||
82 | /// | ||
83 | /// </summary> | ||
84 | Component, | ||
85 | /// <summary> | ||
86 | /// | ||
87 | /// </summary> | 87 | /// </summary> |
88 | Designer, | 88 | Designer, |
89 | /// <summary> | 89 | /// <summary> |
90 | /// | 90 | /// |
91 | /// </summary> | 91 | /// </summary> |
92 | Form, | 92 | Form, |
93 | /// <summary> | 93 | /// <summary> |
94 | /// | 94 | /// |
95 | /// </summary> | 95 | /// </summary> |
96 | Settings, | 96 | Settings, |
97 | /// <summary> | 97 | /// <summary> |
98 | /// | 98 | /// |
99 | /// </summary> | 99 | /// </summary> |
100 | UserControl, | 100 | UserControl, |
101 | /// <summary> | 101 | /// <summary> |
102 | /// | 102 | /// |
103 | /// </summary> | 103 | /// </summary> |
104 | CodeBehind, | 104 | CodeBehind, |
105 | } | 105 | } |
106 | 106 | ||
107 | public enum CopyToOutput | 107 | public enum CopyToOutput |
108 | { | 108 | { |
109 | Never, | 109 | Never, |
110 | Always, | 110 | Always, |
111 | PreserveNewest | 111 | PreserveNewest |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// | 115 | /// |
116 | /// </summary> | 116 | /// </summary> |
117 | [DataNode("File")] | 117 | [DataNode("File")] |
118 | public class FileNode : DataNode | 118 | public class FileNode : DataNode |
119 | { | 119 | { |
120 | #region Fields | 120 | #region Fields |
121 | 121 | ||
122 | private string m_Path; | 122 | private string m_Path; |
123 | private string m_ResourceName = ""; | 123 | private string m_ResourceName = ""; |
124 | private BuildAction? m_BuildAction; | 124 | private BuildAction? m_BuildAction; |
125 | private bool m_Valid; | 125 | private bool m_Valid; |
126 | private SubType? m_SubType; | 126 | private SubType? m_SubType; |
127 | private CopyToOutput m_CopyToOutput = CopyToOutput.Never; | 127 | private CopyToOutput m_CopyToOutput = CopyToOutput.Never; |
128 | private bool m_Link = false; | 128 | private bool m_Link = false; |
129 | private string m_LinkPath = string.Empty; | 129 | private string m_LinkPath = string.Empty; |
130 | private bool m_PreservePath = false; | 130 | private bool m_PreservePath = false; |
131 | 131 | ||
132 | 132 | ||
133 | #endregion | 133 | #endregion |
134 | 134 | ||
135 | #region Properties | 135 | #region Properties |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// | 138 | /// |
139 | /// </summary> | 139 | /// </summary> |
140 | public string Path | 140 | public string Path |
141 | { | 141 | { |
142 | get | 142 | get |
143 | { | 143 | { |
144 | return m_Path; | 144 | return m_Path; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// | 149 | /// |
150 | /// </summary> | 150 | /// </summary> |
151 | public string ResourceName | 151 | public string ResourceName |
152 | { | 152 | { |
153 | get | 153 | get |
154 | { | 154 | { |
155 | return m_ResourceName; | 155 | return m_ResourceName; |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// | 160 | /// |
161 | /// </summary> | 161 | /// </summary> |
162 | public BuildAction BuildAction | 162 | public BuildAction BuildAction |
163 | { | 163 | { |
164 | get | 164 | get |
165 | { | 165 | { |
166 | if (m_BuildAction != null) | 166 | if (m_BuildAction != null) |
167 | return m_BuildAction.Value; | 167 | return m_BuildAction.Value; |
168 | else | 168 | else |
169 | return GetBuildActionByFileName(this.Path); | 169 | return GetBuildActionByFileName(this.Path); |
170 | 170 | ||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | public CopyToOutput CopyToOutput | 174 | public CopyToOutput CopyToOutput |
175 | { | 175 | { |
176 | get | 176 | get |
177 | { | 177 | { |
178 | return this.m_CopyToOutput; | 178 | return this.m_CopyToOutput; |
179 | } | 179 | } |
180 | } | 180 | } |
181 | |||
182 | public bool IsLink | ||
183 | { | ||
184 | get | ||
185 | { | ||
186 | return this.m_Link; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | public string LinkPath | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return this.m_LinkPath; | ||
195 | } | ||
196 | } | ||
197 | /// <summary> | ||
198 | /// | ||
199 | /// </summary> | ||
200 | public SubType SubType | ||
201 | { | ||
202 | get | ||
203 | { | ||
204 | if (m_SubType != null) | ||
205 | return m_SubType.Value; | ||
206 | else | ||
207 | return GetSubTypeByFileName(this.Path); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /// <summary> | ||
212 | /// | ||
213 | /// </summary> | ||
214 | public bool IsValid | ||
215 | { | ||
216 | get | ||
217 | { | ||
218 | return m_Valid; | ||
219 | } | ||
220 | } | ||
181 | 221 | ||
182 | public bool IsLink | ||
183 | { | ||
184 | get | ||
185 | { | ||
186 | return this.m_Link; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | public string LinkPath | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return this.m_LinkPath; | ||
195 | } | ||
196 | } | ||
197 | /// <summary> | 222 | /// <summary> |
198 | /// | 223 | /// |
199 | /// </summary> | ||
200 | public SubType SubType | ||
201 | { | ||
202 | get | ||
203 | { | ||
204 | if (m_SubType != null) | ||
205 | return m_SubType.Value; | ||
206 | else | ||
207 | return GetSubTypeByFileName(this.Path); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /// <summary> | ||
212 | /// | ||
213 | /// </summary> | ||
214 | public bool IsValid | ||
215 | { | ||
216 | get | ||
217 | { | ||
218 | return m_Valid; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | /// <summary> | ||
223 | /// | ||
224 | /// </summary> | 224 | /// </summary> |
225 | /// <param name="file"></param> | 225 | /// <param name="file"></param> |
226 | /// <returns></returns> | 226 | /// <returns></returns> |
@@ -232,61 +232,61 @@ namespace Prebuild.Core.Nodes | |||
232 | } | 232 | } |
233 | } | 233 | } |
234 | 234 | ||
235 | #endregion | 235 | #endregion |
236 | 236 | ||
237 | #region Public Methods | 237 | #region Public Methods |
238 | 238 | ||
239 | /// <summary> | 239 | /// <summary> |
240 | /// | 240 | /// |
241 | /// </summary> | 241 | /// </summary> |
242 | /// <param name="node"></param> | 242 | /// <param name="node"></param> |
243 | public override void Parse(XmlNode node) | 243 | public override void Parse(XmlNode node) |
244 | { | 244 | { |
245 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); | 245 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); |
246 | if (buildAction != string.Empty) | 246 | if (buildAction != string.Empty) |
247 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); | 247 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); |
248 | string subType = Helper.AttributeValue(node, "subType", string.Empty); | 248 | string subType = Helper.AttributeValue(node, "subType", string.Empty); |
249 | if (subType != String.Empty) | 249 | if (subType != String.Empty) |
250 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); | 250 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); |
251 | 251 | ||
252 | Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); | 252 | Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); |
253 | 253 | ||
254 | 254 | ||
255 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); | 255 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); |
256 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); | 256 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); |
257 | if ( this.m_Link == true ) | 257 | if ( this.m_Link == true ) |
258 | { | 258 | { |
259 | this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); | 259 | this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); |
260 | } | 260 | } |
261 | this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); | 261 | this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); |
262 | this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); | 262 | this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); |
263 | 263 | ||
264 | if( node == null ) | 264 | if( node == null ) |
265 | { | 265 | { |
266 | throw new ArgumentNullException("node"); | 266 | throw new ArgumentNullException("node"); |
267 | } | 267 | } |
268 | 268 | ||
269 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 269 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
270 | if(m_Path == null) | 270 | if(m_Path == null) |
271 | { | 271 | { |
272 | m_Path = ""; | 272 | m_Path = ""; |
273 | } | 273 | } |
274 | 274 | ||
275 | m_Path = m_Path.Trim(); | 275 | m_Path = m_Path.Trim(); |
276 | m_Valid = true; | 276 | m_Valid = true; |
277 | if(!File.Exists(m_Path)) | 277 | if(!File.Exists(m_Path)) |
278 | { | 278 | { |
279 | m_Valid = false; | 279 | m_Valid = false; |
280 | Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); | 280 | Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); |
281 | } | 281 | } |
282 | 282 | ||
283 | if (System.IO.Path.GetExtension(m_Path) == ".settings") | 283 | if (System.IO.Path.GetExtension(m_Path) == ".settings") |
284 | { | 284 | { |
285 | m_SubType = SubType.Settings; | 285 | m_SubType = SubType.Settings; |
286 | m_BuildAction = BuildAction.None; | 286 | m_BuildAction = BuildAction.None; |
287 | } | 287 | } |
288 | } | 288 | } |
289 | 289 | ||
290 | #endregion | 290 | #endregion |
291 | } | 291 | } |
292 | } | 292 | } |
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index 58b54fb..16658f3 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,36 +34,36 @@ using System.IO; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Files")] | 40 | [DataNode("Files")] |
41 | public class FilesNode : DataNode | 41 | public class FilesNode : DataNode |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | private readonly List<string> m_Files = new List<string>(); | 45 | private readonly List<string> m_Files = new List<string>(); |
46 | private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>(); | 46 | private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>(); |
47 | private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>(); | 47 | private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>(); |
48 | private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>(); | 48 | private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>(); |
49 | private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>(); | 49 | private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>(); |
50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); | 50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); |
51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); | 51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); |
52 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); | 52 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); |
53 | private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); | 53 | private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); |
54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); | 54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); |
55 | 55 | ||
56 | #endregion | 56 | #endregion |
57 | 57 | ||
58 | #region Properties | 58 | #region Properties |
59 | 59 | ||
60 | public int Count | 60 | public int Count |
61 | { | 61 | { |
62 | get | 62 | get |
63 | { | 63 | { |
64 | return m_Files.Count; | 64 | return m_Files.Count; |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | public string[] Destinations | 68 | public string[] Destinations |
69 | { | 69 | { |
@@ -75,19 +75,19 @@ namespace Prebuild.Core.Nodes | |||
75 | get { return m_CopyFiles.Count; } | 75 | get { return m_CopyFiles.Count; } |
76 | } | 76 | } |
77 | 77 | ||
78 | #endregion | 78 | #endregion |
79 | 79 | ||
80 | #region Public Methods | 80 | #region Public Methods |
81 | 81 | ||
82 | public BuildAction GetBuildAction(string file) | 82 | public BuildAction GetBuildAction(string file) |
83 | { | 83 | { |
84 | if(!m_BuildActions.ContainsKey(file)) | 84 | if(!m_BuildActions.ContainsKey(file)) |
85 | { | 85 | { |
86 | return BuildAction.Compile; | 86 | return BuildAction.Compile; |
87 | } | 87 | } |
88 | 88 | ||
89 | return m_BuildActions[file]; | 89 | return m_BuildActions[file]; |
90 | } | 90 | } |
91 | 91 | ||
92 | public string GetDestinationPath(string file) | 92 | public string GetDestinationPath(string file) |
93 | { | 93 | { |
@@ -103,57 +103,57 @@ namespace Prebuild.Core.Nodes | |||
103 | return m_CopyFiles.GetValues(dest); | 103 | return m_CopyFiles.GetValues(dest); |
104 | } | 104 | } |
105 | 105 | ||
106 | public CopyToOutput GetCopyToOutput(string file) | 106 | public CopyToOutput GetCopyToOutput(string file) |
107 | { | 107 | { |
108 | if (!m_CopyToOutputs.ContainsKey(file)) | 108 | if (!m_CopyToOutputs.ContainsKey(file)) |
109 | { | 109 | { |
110 | return CopyToOutput.Never; | 110 | return CopyToOutput.Never; |
111 | } | 111 | } |
112 | return m_CopyToOutputs[file]; | 112 | return m_CopyToOutputs[file]; |
113 | } | 113 | } |
114 | 114 | ||
115 | public bool GetIsLink(string file) | 115 | public bool GetIsLink(string file) |
116 | { | 116 | { |
117 | if (!m_Links.ContainsKey(file)) | 117 | if (!m_Links.ContainsKey(file)) |
118 | { | 118 | { |
119 | return false; | 119 | return false; |
120 | } | 120 | } |
121 | return m_Links[file]; | 121 | return m_Links[file]; |
122 | } | 122 | } |
123 | 123 | ||
124 | public bool Contains(string file) | 124 | public bool Contains(string file) |
125 | { | 125 | { |
126 | return m_Files.Contains(file); | 126 | return m_Files.Contains(file); |
127 | } | 127 | } |
128 | 128 | ||
129 | public string GetLinkPath( string file ) | 129 | public string GetLinkPath( string file ) |
130 | { | 130 | { |
131 | if ( !m_LinkPaths.ContainsKey( file ) ) | 131 | if ( !m_LinkPaths.ContainsKey( file ) ) |
132 | { | 132 | { |
133 | return string.Empty; | 133 | return string.Empty; |
134 | } | 134 | } |
135 | return m_LinkPaths[ file ]; | 135 | return m_LinkPaths[ file ]; |
136 | } | 136 | } |
137 | 137 | ||
138 | public SubType GetSubType(string file) | 138 | public SubType GetSubType(string file) |
139 | { | 139 | { |
140 | if(!m_SubTypes.ContainsKey(file)) | 140 | if(!m_SubTypes.ContainsKey(file)) |
141 | { | 141 | { |
142 | return SubType.Code; | 142 | return SubType.Code; |
143 | } | 143 | } |
144 | 144 | ||
145 | return m_SubTypes[file]; | 145 | return m_SubTypes[file]; |
146 | } | 146 | } |
147 | 147 | ||
148 | public string GetResourceName(string file) | 148 | public string GetResourceName(string file) |
149 | { | 149 | { |
150 | if(!m_ResourceNames.ContainsKey(file)) | 150 | if(!m_ResourceNames.ContainsKey(file)) |
151 | { | 151 | { |
152 | return string.Empty; | 152 | return string.Empty; |
153 | } | 153 | } |
154 | 154 | ||
155 | return m_ResourceNames[file]; | 155 | return m_ResourceNames[file]; |
156 | } | 156 | } |
157 | 157 | ||
158 | public bool GetPreservePath( string file ) | 158 | public bool GetPreservePath( string file ) |
159 | { | 159 | { |
@@ -165,45 +165,45 @@ namespace Prebuild.Core.Nodes | |||
165 | return m_PreservePaths[ file ]; | 165 | return m_PreservePaths[ file ]; |
166 | } | 166 | } |
167 | 167 | ||
168 | public override void Parse(XmlNode node) | 168 | public override void Parse(XmlNode node) |
169 | { | 169 | { |
170 | if( node == null ) | 170 | if( node == null ) |
171 | { | 171 | { |
172 | throw new ArgumentNullException("node"); | 172 | throw new ArgumentNullException("node"); |
173 | } | 173 | } |
174 | foreach(XmlNode child in node.ChildNodes) | 174 | foreach(XmlNode child in node.ChildNodes) |
175 | { | 175 | { |
176 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 176 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
177 | if(dataNode is FileNode) | 177 | if(dataNode is FileNode) |
178 | { | 178 | { |
179 | FileNode fileNode = (FileNode)dataNode; | 179 | FileNode fileNode = (FileNode)dataNode; |
180 | if(fileNode.IsValid) | 180 | if(fileNode.IsValid) |
181 | { | 181 | { |
182 | if (!m_Files.Contains(fileNode.Path)) | 182 | if (!m_Files.Contains(fileNode.Path)) |
183 | { | 183 | { |
184 | m_Files.Add(fileNode.Path); | 184 | m_Files.Add(fileNode.Path); |
185 | m_BuildActions[fileNode.Path] = fileNode.BuildAction; | 185 | m_BuildActions[fileNode.Path] = fileNode.BuildAction; |
186 | m_SubTypes[fileNode.Path] = fileNode.SubType; | 186 | m_SubTypes[fileNode.Path] = fileNode.SubType; |
187 | m_ResourceNames[fileNode.Path] = fileNode.ResourceName; | 187 | m_ResourceNames[fileNode.Path] = fileNode.ResourceName; |
188 | m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; | 188 | m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; |
189 | m_Links[ fileNode.Path ] = fileNode.IsLink; | 189 | m_Links[ fileNode.Path ] = fileNode.IsLink; |
190 | m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; | 190 | m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; |
191 | m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; | 191 | m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; |
192 | 192 | ||
193 | } | 193 | } |
194 | } | 194 | } |
195 | } | 195 | } |
196 | else if(dataNode is MatchNode) | 196 | else if(dataNode is MatchNode) |
197 | { | 197 | { |
198 | foreach(string file in ((MatchNode)dataNode).Files) | 198 | foreach(string file in ((MatchNode)dataNode).Files) |
199 | { | 199 | { |
200 | MatchNode matchNode = (MatchNode)dataNode; | 200 | MatchNode matchNode = (MatchNode)dataNode; |
201 | if (!m_Files.Contains(file)) | 201 | if (!m_Files.Contains(file)) |
202 | { | 202 | { |
203 | m_Files.Add(file); | 203 | m_Files.Add(file); |
204 | if (matchNode.BuildAction == null) | 204 | if (matchNode.BuildAction == null) |
205 | m_BuildActions[file] = GetBuildActionByFileName(file); | 205 | m_BuildActions[file] = GetBuildActionByFileName(file); |
206 | else | 206 | else |
207 | m_BuildActions[file] = matchNode.BuildAction.Value; | 207 | m_BuildActions[file] = matchNode.BuildAction.Value; |
208 | 208 | ||
209 | if (matchNode.BuildAction == BuildAction.Copy) | 209 | if (matchNode.BuildAction == BuildAction.Copy) |
@@ -212,27 +212,27 @@ namespace Prebuild.Core.Nodes | |||
212 | m_DestinationPath[file] = matchNode.DestinationPath; | 212 | m_DestinationPath[file] = matchNode.DestinationPath; |
213 | } | 213 | } |
214 | 214 | ||
215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; | 215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; |
216 | m_ResourceNames[ file ] = matchNode.ResourceName; | 216 | m_ResourceNames[ file ] = matchNode.ResourceName; |
217 | m_PreservePaths[ file ] = matchNode.PreservePath; | 217 | m_PreservePaths[ file ] = matchNode.PreservePath; |
218 | m_Links[ file ] = matchNode.IsLink; | 218 | m_Links[ file ] = matchNode.IsLink; |
219 | m_LinkPaths[ file ] = matchNode.LinkPath; | 219 | m_LinkPaths[ file ] = matchNode.LinkPath; |
220 | m_CopyToOutputs[ file ] = matchNode.CopyToOutput; | 220 | m_CopyToOutputs[ file ] = matchNode.CopyToOutput; |
221 | 221 | ||
222 | } | 222 | } |
223 | } | 223 | } |
224 | } | 224 | } |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | // TODO: Check in to why StringCollection's enumerator doesn't implement | 228 | // TODO: Check in to why StringCollection's enumerator doesn't implement |
229 | // IEnumerator? | 229 | // IEnumerator? |
230 | public IEnumerator<string> GetEnumerator() | 230 | public IEnumerator<string> GetEnumerator() |
231 | { | 231 | { |
232 | return m_Files.GetEnumerator(); | 232 | return m_Files.GetEnumerator(); |
233 | } | 233 | } |
234 | 234 | ||
235 | #endregion | 235 | #endregion |
236 | 236 | ||
237 | } | 237 | } |
238 | } | 238 | } |
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index fe02277..000bde9 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -35,51 +35,51 @@ using Prebuild.Core.Utilities; | |||
35 | 35 | ||
36 | namespace Prebuild.Core.Nodes | 36 | namespace Prebuild.Core.Nodes |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | [DataNode("Match")] | 41 | [DataNode("Match")] |
42 | public class MatchNode : DataNode | 42 | public class MatchNode : DataNode |
43 | { | 43 | { |
44 | #region Fields | 44 | #region Fields |
45 | 45 | ||
46 | private readonly List<string> m_Files = new List<string>(); | 46 | private readonly List<string> m_Files = new List<string>(); |
47 | private Regex m_Regex; | 47 | private Regex m_Regex; |
48 | private BuildAction? m_BuildAction; | 48 | private BuildAction? m_BuildAction; |
49 | private SubType? m_SubType; | 49 | private SubType? m_SubType; |
50 | string m_ResourceName = ""; | 50 | string m_ResourceName = ""; |
51 | private CopyToOutput m_CopyToOutput; | 51 | private CopyToOutput m_CopyToOutput; |
52 | private bool m_Link; | 52 | private bool m_Link; |
53 | private string m_LinkPath; | 53 | private string m_LinkPath; |
54 | private bool m_PreservePath; | 54 | private bool m_PreservePath; |
55 | private string m_Destination = ""; | 55 | private string m_Destination = ""; |
56 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); | 56 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); |
57 | 57 | ||
58 | #endregion | 58 | #endregion |
59 | 59 | ||
60 | #region Properties | 60 | #region Properties |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// | 63 | /// |
64 | /// </summary> | 64 | /// </summary> |
65 | public IEnumerable<string> Files | 65 | public IEnumerable<string> Files |
66 | { | 66 | { |
67 | get | 67 | get |
68 | { | 68 | { |
69 | return m_Files; | 69 | return m_Files; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// | 74 | /// |
75 | /// </summary> | 75 | /// </summary> |
76 | public BuildAction? BuildAction | 76 | public BuildAction? BuildAction |
77 | { | 77 | { |
78 | get | 78 | get |
79 | { | 79 | { |
80 | return m_BuildAction; | 80 | return m_BuildAction; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | public string DestinationPath | 84 | public string DestinationPath |
85 | { | 85 | { |
@@ -88,50 +88,50 @@ namespace Prebuild.Core.Nodes | |||
88 | return m_Destination; | 88 | return m_Destination; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | /// <summary> | 91 | /// <summary> |
92 | /// | 92 | /// |
93 | /// </summary> | 93 | /// </summary> |
94 | public SubType? SubType | 94 | public SubType? SubType |
95 | { | 95 | { |
96 | get | 96 | get |
97 | { | 97 | { |
98 | return m_SubType; | 98 | return m_SubType; |
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | public CopyToOutput CopyToOutput | 102 | public CopyToOutput CopyToOutput |
103 | { | 103 | { |
104 | get | 104 | get |
105 | { | 105 | { |
106 | return m_CopyToOutput; | 106 | return m_CopyToOutput; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | public bool IsLink | 110 | public bool IsLink |
111 | { | 111 | { |
112 | get | 112 | get |
113 | { | 113 | { |
114 | return m_Link; | 114 | return m_Link; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | public string LinkPath | 118 | public string LinkPath |
119 | { | 119 | { |
120 | get | 120 | get |
121 | { | 121 | { |
122 | return m_LinkPath; | 122 | return m_LinkPath; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | /// <summary> | 125 | /// <summary> |
126 | /// | 126 | /// |
127 | /// </summary> | 127 | /// </summary> |
128 | public string ResourceName | 128 | public string ResourceName |
129 | { | 129 | { |
130 | get | 130 | get |
131 | { | 131 | { |
132 | return m_ResourceName; | 132 | return m_ResourceName; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | public bool PreservePath | 136 | public bool PreservePath |
137 | { | 137 | { |
@@ -141,27 +141,27 @@ namespace Prebuild.Core.Nodes | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | #endregion | 144 | #endregion |
145 | 145 | ||
146 | #region Private Methods | 146 | #region Private Methods |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// Recurses the directories. | 149 | /// Recurses the directories. |
150 | /// </summary> | 150 | /// </summary> |
151 | /// <param name="path">The path.</param> | 151 | /// <param name="path">The path.</param> |
152 | /// <param name="pattern">The pattern.</param> | 152 | /// <param name="pattern">The pattern.</param> |
153 | /// <param name="recurse">if set to <c>true</c> [recurse].</param> | 153 | /// <param name="recurse">if set to <c>true</c> [recurse].</param> |
154 | /// <param name="useRegex">if set to <c>true</c> [use regex].</param> | 154 | /// <param name="useRegex">if set to <c>true</c> [use regex].</param> |
155 | private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions) | 155 | private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions) |
156 | { | 156 | { |
157 | Match match; | 157 | Match match; |
158 | try | 158 | try |
159 | { | 159 | { |
160 | string[] files; | 160 | string[] files; |
161 | 161 | ||
162 | Boolean excludeFile; | 162 | Boolean excludeFile; |
163 | if(!useRegex) | 163 | if(!useRegex) |
164 | { | 164 | { |
165 | try | 165 | try |
166 | { | 166 | { |
167 | files = Directory.GetFiles(path, pattern); | 167 | files = Directory.GetFiles(path, pattern); |
@@ -169,7 +169,7 @@ namespace Prebuild.Core.Nodes | |||
169 | catch (IOException) | 169 | catch (IOException) |
170 | { | 170 | { |
171 | // swallow weird IOException error when running in a virtual box | 171 | // swallow weird IOException error when running in a virtual box |
172 | // guest OS on a network share when the host OS is not Windows. | 172 | // guest OS on a network share when the host OS is not Windows. |
173 | // This seems to happen on network shares | 173 | // This seems to happen on network shares |
174 | // when no files match, and may be related to this report: | 174 | // when no files match, and may be related to this report: |
175 | // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 | 175 | // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 |
@@ -177,20 +177,20 @@ namespace Prebuild.Core.Nodes | |||
177 | files = null; | 177 | files = null; |
178 | } | 178 | } |
179 | 179 | ||
180 | if(files != null) | 180 | if(files != null) |
181 | { | 181 | { |
182 | foreach (string file in files) | 182 | foreach (string file in files) |
183 | { | 183 | { |
184 | excludeFile = false; | 184 | excludeFile = false; |
185 | string fileTemp; | 185 | string fileTemp; |
186 | if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") | 186 | if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") |
187 | { | 187 | { |
188 | fileTemp = file.Substring(2); | 188 | fileTemp = file.Substring(2); |
189 | } | 189 | } |
190 | else | 190 | else |
191 | { | 191 | { |
192 | fileTemp = file; | 192 | fileTemp = file; |
193 | } | 193 | } |
194 | 194 | ||
195 | // Check all excludions and set flag if there are any hits. | 195 | // Check all excludions and set flag if there are any hits. |
196 | foreach ( ExcludeNode exclude in exclusions ) | 196 | foreach ( ExcludeNode exclude in exclusions ) |
@@ -205,18 +205,18 @@ namespace Prebuild.Core.Nodes | |||
205 | m_Files.Add( fileTemp ); | 205 | m_Files.Add( fileTemp ); |
206 | } | 206 | } |
207 | 207 | ||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | // don't call return here, because we may need to recursively search directories below | 211 | // don't call return here, because we may need to recursively search directories below |
212 | // this one, even if no matches were found in this directory. | 212 | // this one, even if no matches were found in this directory. |
213 | } | 213 | } |
214 | else | 214 | else |
215 | { | 215 | { |
216 | try | 216 | try |
217 | { | 217 | { |
218 | files = Directory.GetFiles(path); | 218 | files = Directory.GetFiles(path); |
219 | } | 219 | } |
220 | catch (IOException) | 220 | catch (IOException) |
221 | { | 221 | { |
222 | // swallow weird IOException error when running in a virtual box | 222 | // swallow weird IOException error when running in a virtual box |
@@ -248,12 +248,12 @@ namespace Prebuild.Core.Nodes | |||
248 | } | 248 | } |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
253 | if(recurse) | 253 | if(recurse) |
254 | { | 254 | { |
255 | string[] dirs = Directory.GetDirectories(path); | 255 | string[] dirs = Directory.GetDirectories(path); |
256 | if(dirs != null && dirs.Length > 0) | 256 | if(dirs != null && dirs.Length > 0) |
257 | { | 257 | { |
258 | foreach (string str in dirs) | 258 | foreach (string str in dirs) |
259 | { | 259 | { |
@@ -265,96 +265,96 @@ namespace Prebuild.Core.Nodes | |||
265 | RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); | 265 | RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); |
266 | } | 266 | } |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
270 | catch(DirectoryNotFoundException) | 270 | catch(DirectoryNotFoundException) |
271 | { | 271 | { |
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | catch(ArgumentException) | 274 | catch(ArgumentException) |
275 | { | 275 | { |
276 | return; | 276 | return; |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | #endregion | 280 | #endregion |
281 | 281 | ||
282 | #region Public Methods | 282 | #region Public Methods |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// | 285 | /// |
286 | /// </summary> | 286 | /// </summary> |
287 | /// <param name="node"></param> | 287 | /// <param name="node"></param> |
288 | public override void Parse(XmlNode node) | 288 | public override void Parse(XmlNode node) |
289 | { | 289 | { |
290 | if( node == null ) | 290 | if( node == null ) |
291 | { | 291 | { |
292 | throw new ArgumentNullException("node"); | 292 | throw new ArgumentNullException("node"); |
293 | } | 293 | } |
294 | string path = Helper.AttributeValue(node, "path", "."); | 294 | string path = Helper.AttributeValue(node, "path", "."); |
295 | string pattern = Helper.AttributeValue(node, "pattern", "*"); | 295 | string pattern = Helper.AttributeValue(node, "pattern", "*"); |
296 | string destination = Helper.AttributeValue(node, "destination", string.Empty); | 296 | string destination = Helper.AttributeValue(node, "destination", string.Empty); |
297 | bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); | 297 | bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); |
298 | bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); | 298 | bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); |
299 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); | 299 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); |
300 | if (buildAction != string.Empty) | 300 | if (buildAction != string.Empty) |
301 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); | 301 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); |
302 | 302 | ||
303 | 303 | ||
304 | //TODO: Figure out where the subtype node is being assigned | 304 | //TODO: Figure out where the subtype node is being assigned |
305 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); | 305 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); |
306 | //if (subType != String.Empty) | 306 | //if (subType != String.Empty) |
307 | // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); | 307 | // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); |
308 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); | 308 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); |
309 | m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); | 309 | m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); |
310 | m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); | 310 | m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); |
311 | if ( m_Link ) | 311 | if ( m_Link ) |
312 | { | 312 | { |
313 | m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); | 313 | m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); |
314 | } | 314 | } |
315 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); | 315 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); |
316 | 316 | ||
317 | if ( buildAction == "Copy") | 317 | if ( buildAction == "Copy") |
318 | m_Destination = destination; | 318 | m_Destination = destination; |
319 | 319 | ||
320 | if(path != null && path.Length == 0) | 320 | if(path != null && path.Length == 0) |
321 | path = ".";//use current directory | 321 | path = ".";//use current directory |
322 | 322 | ||
323 | //throw new WarningException("Match must have a 'path' attribute"); | 323 | //throw new WarningException("Match must have a 'path' attribute"); |
324 | 324 | ||
325 | if(pattern == null) | 325 | if(pattern == null) |
326 | { | 326 | { |
327 | throw new WarningException("Match must have a 'pattern' attribute"); | 327 | throw new WarningException("Match must have a 'pattern' attribute"); |
328 | } | 328 | } |
329 | 329 | ||
330 | path = Helper.NormalizePath(path); | 330 | path = Helper.NormalizePath(path); |
331 | if(!Directory.Exists(path)) | 331 | if(!Directory.Exists(path)) |
332 | { | 332 | { |
333 | throw new WarningException("Match path does not exist: {0}", path); | 333 | throw new WarningException("Match path does not exist: {0}", path); |
334 | } | 334 | } |
335 | 335 | ||
336 | try | 336 | try |
337 | { | 337 | { |
338 | if(useRegex) | 338 | if(useRegex) |
339 | { | 339 | { |
340 | m_Regex = new Regex(pattern); | 340 | m_Regex = new Regex(pattern); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | catch(ArgumentException ex) | 343 | catch(ArgumentException ex) |
344 | { | 344 | { |
345 | throw new WarningException("Could not compile regex pattern: {0}", ex.Message); | 345 | throw new WarningException("Could not compile regex pattern: {0}", ex.Message); |
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | foreach(XmlNode child in node.ChildNodes) | 349 | foreach(XmlNode child in node.ChildNodes) |
350 | { | 350 | { |
351 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 351 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
352 | if(dataNode is ExcludeNode) | 352 | if(dataNode is ExcludeNode) |
353 | { | 353 | { |
354 | ExcludeNode excludeNode = (ExcludeNode)dataNode; | 354 | ExcludeNode excludeNode = (ExcludeNode)dataNode; |
355 | m_Exclusions.Add( excludeNode ); | 355 | m_Exclusions.Add( excludeNode ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); | 359 | RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); |
360 | 360 | ||
@@ -371,8 +371,8 @@ namespace Prebuild.Core.Nodes | |||
371 | throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); | 371 | throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); |
372 | } | 372 | } |
373 | m_Regex = null; | 373 | m_Regex = null; |
374 | } | 374 | } |
375 | 375 | ||
376 | #endregion | 376 | #endregion |
377 | } | 377 | } |
378 | } | 378 | } |
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs index d45bd34..490fd6f 100644 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,273 +34,291 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Options")] | 40 | [DataNode("Options")] |
41 | public class OptionsNode : DataNode | 41 | public class OptionsNode : DataNode |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); | 45 | private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); |
46 | 46 | ||
47 | [OptionNode("CompilerDefines")] | 47 | [OptionNode("CompilerDefines")] |
48 | private string m_CompilerDefines = ""; | 48 | private string m_CompilerDefines = ""; |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// | 51 | /// |
52 | /// </summary> | 52 | /// </summary> |
53 | public string CompilerDefines | 53 | public string CompilerDefines |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_CompilerDefines; | 57 | return m_CompilerDefines; |
58 | } | 58 | } |
59 | set | 59 | set |
60 | { | 60 | { |
61 | m_CompilerDefines = value; | 61 | m_CompilerDefines = value; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | [OptionNode("OptimizeCode")] | 65 | [OptionNode("OptimizeCode")] |
66 | private bool m_OptimizeCode; | 66 | private bool m_OptimizeCode; |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// | 69 | /// |
70 | /// </summary> | 70 | /// </summary> |
71 | public bool OptimizeCode | 71 | public bool OptimizeCode |
72 | { | 72 | { |
73 | get | 73 | get |
74 | { | 74 | { |
75 | return m_OptimizeCode; | 75 | return m_OptimizeCode; |
76 | } | 76 | } |
77 | set | 77 | set |
78 | { | 78 | { |
79 | m_OptimizeCode = value; | 79 | m_OptimizeCode = value; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | [OptionNode("CheckUnderflowOverflow")] | 83 | [OptionNode("CheckUnderflowOverflow")] |
84 | private bool m_CheckUnderflowOverflow; | 84 | private bool m_CheckUnderflowOverflow; |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// | 87 | /// |
88 | /// </summary> | 88 | /// </summary> |
89 | public bool CheckUnderflowOverflow | 89 | public bool CheckUnderflowOverflow |
90 | { | 90 | { |
91 | get | 91 | get |
92 | { | 92 | { |
93 | return m_CheckUnderflowOverflow; | 93 | return m_CheckUnderflowOverflow; |
94 | } | 94 | } |
95 | set | 95 | set |
96 | { | 96 | { |
97 | m_CheckUnderflowOverflow = value; | 97 | m_CheckUnderflowOverflow = value; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | [OptionNode("AllowUnsafe")] | 101 | [OptionNode("AllowUnsafe")] |
102 | private bool m_AllowUnsafe; | 102 | private bool m_AllowUnsafe; |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// | 105 | /// |
106 | /// </summary> | 106 | /// </summary> |
107 | public bool AllowUnsafe | 107 | public bool AllowUnsafe |
108 | { | 108 | { |
109 | get | 109 | get |
110 | { | 110 | { |
111 | return m_AllowUnsafe; | 111 | return m_AllowUnsafe; |
112 | } | 112 | } |
113 | set | 113 | set |
114 | { | 114 | { |
115 | m_AllowUnsafe = value; | 115 | m_AllowUnsafe = value; |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | [OptionNode("PreBuildEvent")] | 119 | [OptionNode("PreBuildEvent")] |
120 | private string m_PreBuildEvent; | 120 | private string m_PreBuildEvent; |
121 | 121 | ||
122 | /// <summary> | 122 | /// <summary> |
123 | /// | 123 | /// |
124 | /// </summary> | 124 | /// </summary> |
125 | public string PreBuildEvent | 125 | public string PreBuildEvent |
126 | { | 126 | { |
127 | get | 127 | get |
128 | { | 128 | { |
129 | return m_PreBuildEvent; | 129 | return m_PreBuildEvent; |
130 | } | 130 | } |
131 | set | 131 | set |
132 | { | 132 | { |
133 | m_PreBuildEvent = value; | 133 | m_PreBuildEvent = value; |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | [OptionNode("PostBuildEvent")] | 137 | [OptionNode("PostBuildEvent")] |
138 | private string m_PostBuildEvent; | 138 | private string m_PostBuildEvent; |
139 | 139 | ||
140 | /// <summary> | 140 | /// <summary> |
141 | /// | 141 | /// |
142 | /// </summary> | 142 | /// </summary> |
143 | public string PostBuildEvent | 143 | public string PostBuildEvent |
144 | { | 144 | { |
145 | get | 145 | get |
146 | { | 146 | { |
147 | return m_PostBuildEvent; | 147 | return m_PostBuildEvent; |
148 | } | 148 | } |
149 | set | 149 | set |
150 | { | 150 | { |
151 | m_PostBuildEvent = value; | 151 | m_PostBuildEvent = value; |
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | [OptionNode("PreBuildEventArgs")] | 155 | [OptionNode("PreBuildEventArgs")] |
156 | private string m_PreBuildEventArgs; | 156 | private string m_PreBuildEventArgs; |
157 | 157 | ||
158 | /// <summary> | 158 | /// <summary> |
159 | /// | 159 | /// |
160 | /// </summary> | 160 | /// </summary> |
161 | public string PreBuildEventArgs | 161 | public string PreBuildEventArgs |
162 | { | 162 | { |
163 | get | 163 | get |
164 | { | 164 | { |
165 | return m_PreBuildEventArgs; | 165 | return m_PreBuildEventArgs; |
166 | } | 166 | } |
167 | set | 167 | set |
168 | { | 168 | { |
169 | m_PreBuildEventArgs = value; | 169 | m_PreBuildEventArgs = value; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | [OptionNode("PostBuildEventArgs")] | 173 | [OptionNode("PostBuildEventArgs")] |
174 | private string m_PostBuildEventArgs; | 174 | private string m_PostBuildEventArgs; |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// | 177 | /// |
178 | /// </summary> | 178 | /// </summary> |
179 | public string PostBuildEventArgs | 179 | public string PostBuildEventArgs |
180 | { | 180 | { |
181 | get | 181 | get |
182 | { | 182 | { |
183 | return m_PostBuildEventArgs; | 183 | return m_PostBuildEventArgs; |
184 | } | 184 | } |
185 | set | 185 | set |
186 | { | 186 | { |
187 | m_PostBuildEventArgs = value; | 187 | m_PostBuildEventArgs = value; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||
191 | [OptionNode("RunPostBuildEvent")] | 191 | [OptionNode("RunPostBuildEvent")] |
192 | private string m_RunPostBuildEvent; | 192 | private string m_RunPostBuildEvent; |
193 | 193 | ||
194 | /// <summary> | 194 | /// <summary> |
195 | /// | 195 | /// |
196 | /// </summary> | 196 | /// </summary> |
197 | public string RunPostBuildEvent | 197 | public string RunPostBuildEvent |
198 | { | 198 | { |
199 | get | 199 | get |
200 | { | 200 | { |
201 | return m_RunPostBuildEvent; | 201 | return m_RunPostBuildEvent; |
202 | } | 202 | } |
203 | set | 203 | set |
204 | { | 204 | { |
205 | m_RunPostBuildEvent = value; | 205 | m_RunPostBuildEvent = value; |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | ||
209 | [OptionNode("RunScript")] | 209 | [OptionNode("RunScript")] |
210 | private string m_RunScript; | 210 | private string m_RunScript; |
211 | 211 | ||
212 | /// <summary> | 212 | /// <summary> |
213 | /// | 213 | /// |
214 | /// </summary> | 214 | /// </summary> |
215 | public string RunScript | 215 | public string RunScript |
216 | { | 216 | { |
217 | get | 217 | get |
218 | { | 218 | { |
219 | return m_RunScript; | 219 | return m_RunScript; |
220 | } | 220 | } |
221 | set | 221 | set |
222 | { | 222 | { |
223 | m_RunScript = value; | 223 | m_RunScript = value; |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | [OptionNode("WarningLevel")] | 227 | [OptionNode("WarningLevel")] |
228 | private int m_WarningLevel = 4; | 228 | private int m_WarningLevel = 4; |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// | 231 | /// |
232 | /// </summary> | 232 | /// </summary> |
233 | public int WarningLevel | 233 | public int WarningLevel |
234 | { | 234 | { |
235 | get | 235 | get |
236 | { | 236 | { |
237 | return m_WarningLevel; | 237 | return m_WarningLevel; |
238 | } | 238 | } |
239 | set | 239 | set |
240 | { | 240 | { |
241 | m_WarningLevel = value; | 241 | m_WarningLevel = value; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | [OptionNode("WarningsAsErrors")] | 245 | [OptionNode("WarningsAsErrors")] |
246 | private bool m_WarningsAsErrors; | 246 | private bool m_WarningsAsErrors; |
247 | 247 | ||
248 | /// <summary> | 248 | /// <summary> |
249 | /// | 249 | /// |
250 | /// </summary> | 250 | /// </summary> |
251 | public bool WarningsAsErrors | 251 | public bool WarningsAsErrors |
252 | { | 252 | { |
253 | get | 253 | get |
254 | { | 254 | { |
255 | return m_WarningsAsErrors; | 255 | return m_WarningsAsErrors; |
256 | } | 256 | } |
257 | set | 257 | set |
258 | { | 258 | { |
259 | m_WarningsAsErrors = value; | 259 | m_WarningsAsErrors = value; |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | [OptionNode("SuppressWarnings")] | 263 | [OptionNode("SuppressWarnings")] |
264 | private string m_SuppressWarnings = ""; | 264 | private string m_SuppressWarnings = ""; |
265 | 265 | ||
266 | /// <summary> | 266 | /// <summary> |
267 | /// | 267 | /// |
268 | /// </summary> | 268 | /// </summary> |
269 | public string SuppressWarnings | 269 | public string SuppressWarnings |
270 | { | 270 | { |
271 | get | 271 | get |
272 | { | 272 | { |
273 | return m_SuppressWarnings; | 273 | return m_SuppressWarnings; |
274 | } | 274 | } |
275 | set | 275 | set |
276 | { | 276 | { |
277 | m_SuppressWarnings = value; | 277 | m_SuppressWarnings = value; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | [OptionNode("OutputPath")] | 281 | [OptionNode("Prefer32Bit")] |
282 | private string m_OutputPath = "bin/"; | 282 | private bool m_Prefer32Bit; |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// | 285 | /// |
286 | /// </summary> | 286 | /// </summary> |
287 | public string OutputPath | 287 | public bool Prefer32Bit |
288 | { | 288 | { |
289 | get | 289 | get |
290 | { | 290 | { |
291 | return m_OutputPath; | 291 | return m_Prefer32Bit; |
292 | } | 292 | } |
293 | set | 293 | set |
294 | { | 294 | { |
295 | m_OutputPath = value; | 295 | m_Prefer32Bit = value; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | |||
299 | [OptionNode("OutputPath")] | ||
300 | private string m_OutputPath = "bin/"; | ||
301 | |||
302 | /// <summary> | ||
303 | /// | ||
304 | /// </summary> | ||
305 | public string OutputPath | ||
306 | { | ||
307 | get | ||
308 | { | ||
309 | return m_OutputPath; | ||
310 | } | ||
311 | set | ||
312 | { | ||
313 | m_OutputPath = value; | ||
314 | } | ||
315 | } | ||
298 | 316 | ||
299 | [OptionNode("GenerateDocumentation")] | 317 | [OptionNode("GenerateDocumentation")] |
300 | private bool m_GenerateDocumentation; | 318 | private bool m_GenerateDocumentation; |
301 | 319 | ||
302 | /// <summary> | 320 | /// <summary> |
303 | /// | 321 | /// |
304 | /// </summary> | 322 | /// </summary> |
305 | public bool GenerateDocumentation | 323 | public bool GenerateDocumentation |
306 | { | 324 | { |
@@ -314,321 +332,321 @@ namespace Prebuild.Core.Nodes | |||
314 | } | 332 | } |
315 | } | 333 | } |
316 | 334 | ||
317 | [OptionNode("GenerateXmlDocFile")] | 335 | [OptionNode("GenerateXmlDocFile")] |
318 | private bool m_GenerateXmlDocFile; | 336 | private bool m_GenerateXmlDocFile; |
319 | 337 | ||
320 | /// <summary> | 338 | /// <summary> |
321 | /// | 339 | /// |
322 | /// </summary> | 340 | /// </summary> |
323 | public bool GenerateXmlDocFile | 341 | public bool GenerateXmlDocFile |
324 | { | 342 | { |
325 | get | 343 | get |
326 | { | 344 | { |
327 | return m_GenerateXmlDocFile; | 345 | return m_GenerateXmlDocFile; |
328 | } | 346 | } |
329 | set | 347 | set |
330 | { | 348 | { |
331 | m_GenerateXmlDocFile = value; | 349 | m_GenerateXmlDocFile = value; |
332 | } | 350 | } |
333 | } | 351 | } |
334 | 352 | ||
335 | [OptionNode("XmlDocFile")] | 353 | [OptionNode("XmlDocFile")] |
336 | private string m_XmlDocFile = ""; | 354 | private string m_XmlDocFile = ""; |
337 | 355 | ||
338 | /// <summary> | 356 | /// <summary> |
339 | /// | 357 | /// |
340 | /// </summary> | 358 | /// </summary> |
341 | public string XmlDocFile | 359 | public string XmlDocFile |
342 | { | 360 | { |
343 | get | 361 | get |
344 | { | 362 | { |
345 | return m_XmlDocFile; | 363 | return m_XmlDocFile; |
346 | } | 364 | } |
347 | set | 365 | set |
348 | { | 366 | { |
349 | m_XmlDocFile = value; | 367 | m_XmlDocFile = value; |
350 | } | 368 | } |
351 | } | 369 | } |
352 | 370 | ||
353 | [OptionNode("KeyFile")] | 371 | [OptionNode("KeyFile")] |
354 | private string m_KeyFile = ""; | 372 | private string m_KeyFile = ""; |
355 | 373 | ||
356 | /// <summary> | 374 | /// <summary> |
357 | /// | 375 | /// |
358 | /// </summary> | 376 | /// </summary> |
359 | public string KeyFile | 377 | public string KeyFile |
360 | { | 378 | { |
361 | get | 379 | get |
362 | { | 380 | { |
363 | return m_KeyFile; | 381 | return m_KeyFile; |
364 | } | 382 | } |
365 | set | 383 | set |
366 | { | 384 | { |
367 | m_KeyFile = value; | 385 | m_KeyFile = value; |
368 | } | 386 | } |
369 | } | 387 | } |
370 | 388 | ||
371 | [OptionNode("DebugInformation")] | 389 | [OptionNode("DebugInformation")] |
372 | private bool m_DebugInformation; | 390 | private bool m_DebugInformation; |
373 | 391 | ||
374 | /// <summary> | 392 | /// <summary> |
375 | /// | 393 | /// |
376 | /// </summary> | 394 | /// </summary> |
377 | public bool DebugInformation | 395 | public bool DebugInformation |
378 | { | 396 | { |
379 | get | 397 | get |
380 | { | 398 | { |
381 | return m_DebugInformation; | 399 | return m_DebugInformation; |
382 | } | 400 | } |
383 | set | 401 | set |
384 | { | 402 | { |
385 | m_DebugInformation = value; | 403 | m_DebugInformation = value; |
386 | } | 404 | } |
387 | } | 405 | } |
388 | 406 | ||
389 | [OptionNode("RegisterComInterop")] | 407 | [OptionNode("RegisterComInterop")] |
390 | private bool m_RegisterComInterop; | 408 | private bool m_RegisterComInterop; |
391 | 409 | ||
392 | /// <summary> | 410 | /// <summary> |
393 | /// | 411 | /// |
394 | /// </summary> | 412 | /// </summary> |
395 | public bool RegisterComInterop | 413 | public bool RegisterComInterop |
396 | { | 414 | { |
397 | get | 415 | get |
398 | { | 416 | { |
399 | return m_RegisterComInterop; | 417 | return m_RegisterComInterop; |
400 | } | 418 | } |
401 | set | 419 | set |
402 | { | 420 | { |
403 | m_RegisterComInterop = value; | 421 | m_RegisterComInterop = value; |
404 | } | 422 | } |
405 | } | 423 | } |
406 | 424 | ||
407 | [OptionNode("RemoveIntegerChecks")] | 425 | [OptionNode("RemoveIntegerChecks")] |
408 | private bool m_RemoveIntegerChecks; | 426 | private bool m_RemoveIntegerChecks; |
409 | 427 | ||
410 | /// <summary> | 428 | /// <summary> |
411 | /// | 429 | /// |
412 | /// </summary> | 430 | /// </summary> |
413 | public bool RemoveIntegerChecks | 431 | public bool RemoveIntegerChecks |
414 | { | 432 | { |
415 | get | 433 | get |
416 | { | 434 | { |
417 | return m_RemoveIntegerChecks; | 435 | return m_RemoveIntegerChecks; |
418 | } | 436 | } |
419 | set | 437 | set |
420 | { | 438 | { |
421 | m_RemoveIntegerChecks = value; | 439 | m_RemoveIntegerChecks = value; |
422 | } | 440 | } |
423 | } | 441 | } |
424 | 442 | ||
425 | [OptionNode("IncrementalBuild")] | 443 | [OptionNode("IncrementalBuild")] |
426 | private bool m_IncrementalBuild; | 444 | private bool m_IncrementalBuild; |
427 | 445 | ||
428 | /// <summary> | 446 | /// <summary> |
429 | /// | 447 | /// |
430 | /// </summary> | 448 | /// </summary> |
431 | public bool IncrementalBuild | 449 | public bool IncrementalBuild |
432 | { | 450 | { |
433 | get | 451 | get |
434 | { | 452 | { |
435 | return m_IncrementalBuild; | 453 | return m_IncrementalBuild; |
436 | } | 454 | } |
437 | set | 455 | set |
438 | { | 456 | { |
439 | m_IncrementalBuild = value; | 457 | m_IncrementalBuild = value; |
440 | } | 458 | } |
441 | } | 459 | } |
442 | 460 | ||
443 | [OptionNode("BaseAddress")] | 461 | [OptionNode("BaseAddress")] |
444 | private string m_BaseAddress = "285212672"; | 462 | private string m_BaseAddress = "285212672"; |
445 | 463 | ||
446 | /// <summary> | 464 | /// <summary> |
447 | /// | 465 | /// |
448 | /// </summary> | 466 | /// </summary> |
449 | public string BaseAddress | 467 | public string BaseAddress |
450 | { | 468 | { |
451 | get | 469 | get |
452 | { | 470 | { |
453 | return m_BaseAddress; | 471 | return m_BaseAddress; |
454 | } | 472 | } |
455 | set | 473 | set |
456 | { | 474 | { |
457 | m_BaseAddress = value; | 475 | m_BaseAddress = value; |
458 | } | 476 | } |
459 | } | 477 | } |
460 | 478 | ||
461 | [OptionNode("FileAlignment")] | 479 | [OptionNode("FileAlignment")] |
462 | private int m_FileAlignment = 4096; | 480 | private int m_FileAlignment = 4096; |
463 | 481 | ||
464 | /// <summary> | 482 | /// <summary> |
465 | /// | 483 | /// |
466 | /// </summary> | 484 | /// </summary> |
467 | public int FileAlignment | 485 | public int FileAlignment |
468 | { | 486 | { |
469 | get | 487 | get |
470 | { | 488 | { |
471 | return m_FileAlignment; | 489 | return m_FileAlignment; |
472 | } | 490 | } |
473 | set | 491 | set |
474 | { | 492 | { |
475 | m_FileAlignment = value; | 493 | m_FileAlignment = value; |
476 | } | 494 | } |
477 | } | 495 | } |
478 | 496 | ||
479 | [OptionNode("NoStdLib")] | 497 | [OptionNode("NoStdLib")] |
480 | private bool m_NoStdLib; | 498 | private bool m_NoStdLib; |
481 | 499 | ||
482 | /// <summary> | 500 | /// <summary> |
483 | /// | 501 | /// |
484 | /// </summary> | 502 | /// </summary> |
485 | public bool NoStdLib | 503 | public bool NoStdLib |
486 | { | 504 | { |
487 | get | 505 | get |
488 | { | 506 | { |
489 | return m_NoStdLib; | 507 | return m_NoStdLib; |
490 | } | 508 | } |
491 | set | 509 | set |
492 | { | 510 | { |
493 | m_NoStdLib = value; | 511 | m_NoStdLib = value; |
494 | } | 512 | } |
495 | } | 513 | } |
496 | 514 | ||
497 | private readonly List<string> m_FieldsDefined = new List<string>(); | 515 | private readonly List<string> m_FieldsDefined = new List<string>(); |
498 | 516 | ||
499 | #endregion | 517 | #endregion |
500 | 518 | ||
501 | #region Constructors | 519 | #region Constructors |
502 | 520 | ||
503 | /// <summary> | 521 | /// <summary> |
504 | /// Initializes the <see cref="OptionsNode"/> class. | 522 | /// Initializes the <see cref="OptionsNode"/> class. |
505 | /// </summary> | 523 | /// </summary> |
506 | static OptionsNode() | 524 | static OptionsNode() |
507 | { | 525 | { |
508 | Type t = typeof(OptionsNode); | 526 | Type t = typeof(OptionsNode); |
509 | 527 | ||
510 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) | 528 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) |
511 | { | 529 | { |
512 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); | 530 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); |
513 | if(attrs == null || attrs.Length < 1) | 531 | if(attrs == null || attrs.Length < 1) |
514 | { | 532 | { |
515 | continue; | 533 | continue; |
516 | } | 534 | } |
517 | 535 | ||
518 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; | 536 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; |
519 | m_OptionFields[ona.NodeName] = f; | 537 | m_OptionFields[ona.NodeName] = f; |
520 | } | 538 | } |
521 | } | 539 | } |
522 | 540 | ||
523 | #endregion | 541 | #endregion |
524 | 542 | ||
525 | #region Properties | 543 | #region Properties |
526 | 544 | ||
527 | /// <summary> | 545 | /// <summary> |
528 | /// Gets the <see cref="Object"/> at the specified index. | 546 | /// Gets the <see cref="Object"/> at the specified index. |
529 | /// </summary> | 547 | /// </summary> |
530 | /// <value></value> | 548 | /// <value></value> |
531 | public object this[string index] | 549 | public object this[string index] |
532 | { | 550 | { |
533 | get | 551 | get |
534 | { | 552 | { |
535 | if(!m_OptionFields.ContainsKey(index)) | 553 | if(!m_OptionFields.ContainsKey(index)) |
536 | { | 554 | { |
537 | return null; | 555 | return null; |
538 | } | 556 | } |
539 | 557 | ||
540 | FieldInfo f = m_OptionFields[index]; | 558 | FieldInfo f = m_OptionFields[index]; |
541 | return f.GetValue(this); | 559 | return f.GetValue(this); |
542 | } | 560 | } |
543 | } | 561 | } |
544 | 562 | ||
545 | /// <summary> | 563 | /// <summary> |
546 | /// Gets the <see cref="Object"/> at the specified index. | 564 | /// Gets the <see cref="Object"/> at the specified index. |
547 | /// </summary> | 565 | /// </summary> |
548 | /// <value></value> | 566 | /// <value></value> |
549 | public object this[string index, object defaultValue] | 567 | public object this[string index, object defaultValue] |
550 | { | 568 | { |
551 | get | 569 | get |
552 | { | 570 | { |
553 | object valueObject = this[index]; | 571 | object valueObject = this[index]; |
554 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) | 572 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) |
555 | { | 573 | { |
556 | return defaultValue; | 574 | return defaultValue; |
557 | } | 575 | } |
558 | return valueObject; | 576 | return valueObject; |
559 | } | 577 | } |
560 | } | 578 | } |
561 | 579 | ||
562 | 580 | ||
563 | #endregion | 581 | #endregion |
564 | 582 | ||
565 | #region Private Methods | 583 | #region Private Methods |
566 | 584 | ||
567 | private void FlagDefined(string name) | 585 | private void FlagDefined(string name) |
568 | { | 586 | { |
569 | if(!m_FieldsDefined.Contains(name)) | 587 | if(!m_FieldsDefined.Contains(name)) |
570 | { | 588 | { |
571 | m_FieldsDefined.Add(name); | 589 | m_FieldsDefined.Add(name); |
572 | } | 590 | } |
573 | } | 591 | } |
574 | 592 | ||
575 | private void SetOption(string nodeName, string val) | 593 | private void SetOption(string nodeName, string val) |
576 | { | 594 | { |
577 | lock(m_OptionFields) | 595 | lock(m_OptionFields) |
578 | { | 596 | { |
579 | if(!m_OptionFields.ContainsKey(nodeName)) | 597 | if(!m_OptionFields.ContainsKey(nodeName)) |
580 | { | 598 | { |
581 | return; | 599 | return; |
582 | } | 600 | } |
583 | 601 | ||
584 | FieldInfo f = m_OptionFields[nodeName]; | 602 | FieldInfo f = m_OptionFields[nodeName]; |
585 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); | 603 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); |
586 | FlagDefined(f.Name); | 604 | FlagDefined(f.Name); |
587 | } | 605 | } |
588 | } | 606 | } |
589 | 607 | ||
590 | #endregion | 608 | #endregion |
591 | 609 | ||
592 | #region Public Methods | 610 | #region Public Methods |
593 | 611 | ||
594 | /// <summary> | 612 | /// <summary> |
595 | /// Parses the specified node. | 613 | /// Parses the specified node. |
596 | /// </summary> | 614 | /// </summary> |
597 | /// <param name="node">The node.</param> | 615 | /// <param name="node">The node.</param> |
598 | public override void Parse(XmlNode node) | 616 | public override void Parse(XmlNode node) |
599 | { | 617 | { |
600 | if( node == null ) | 618 | if( node == null ) |
601 | { | 619 | { |
602 | throw new ArgumentNullException("node"); | 620 | throw new ArgumentNullException("node"); |
603 | } | 621 | } |
604 | 622 | ||
605 | foreach(XmlNode child in node.ChildNodes) | 623 | foreach(XmlNode child in node.ChildNodes) |
606 | { | 624 | { |
607 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); | 625 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); |
608 | } | 626 | } |
609 | } | 627 | } |
610 | 628 | ||
611 | /// <summary> | 629 | /// <summary> |
612 | /// Copies to. | 630 | /// Copies to. |
613 | /// </summary> | 631 | /// </summary> |
614 | /// <param name="opt">The opt.</param> | 632 | /// <param name="opt">The opt.</param> |
615 | public void CopyTo(OptionsNode opt) | 633 | public void CopyTo(OptionsNode opt) |
616 | { | 634 | { |
617 | if(opt == null) | 635 | if(opt == null) |
618 | { | 636 | { |
619 | return; | 637 | return; |
620 | } | 638 | } |
621 | 639 | ||
622 | foreach(FieldInfo f in m_OptionFields.Values) | 640 | foreach(FieldInfo f in m_OptionFields.Values) |
623 | { | 641 | { |
624 | if(m_FieldsDefined.Contains(f.Name)) | 642 | if(m_FieldsDefined.Contains(f.Name)) |
625 | { | 643 | { |
626 | f.SetValue(opt, f.GetValue(this)); | 644 | f.SetValue(opt, f.GetValue(this)); |
627 | opt.m_FieldsDefined.Add(f.Name); | 645 | opt.m_FieldsDefined.Add(f.Name); |
628 | } | 646 | } |
629 | } | 647 | } |
630 | } | 648 | } |
631 | 649 | ||
632 | #endregion | 650 | #endregion |
633 | } | 651 | } |
634 | } | 652 | } |
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index b05ffc6..8ca8e49 100644 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,77 +32,77 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Process")] | 38 | [DataNode("Process")] |
39 | public class ProcessNode : DataNode | 39 | public class ProcessNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Path; | 43 | private string m_Path; |
44 | private bool m_IsValid = true; | 44 | private bool m_IsValid = true; |
45 | 45 | ||
46 | #endregion | 46 | #endregion |
47 | 47 | ||
48 | #region Properties | 48 | #region Properties |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Gets the path. | 51 | /// Gets the path. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <value>The path.</value> | 53 | /// <value>The path.</value> |
54 | public string Path | 54 | public string Path |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return m_Path; | 58 | return m_Path; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Gets a value indicating whether this instance is valid. | 63 | /// Gets a value indicating whether this instance is valid. |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> | 65 | /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> |
66 | public bool IsValid | 66 | public bool IsValid |
67 | { | 67 | { |
68 | get | 68 | get |
69 | { | 69 | { |
70 | return m_IsValid; | 70 | return m_IsValid; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | #endregion | 74 | #endregion |
75 | 75 | ||
76 | #region Public Methods | 76 | #region Public Methods |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Parses the specified node. | 79 | /// Parses the specified node. |
80 | /// </summary> | 80 | /// </summary> |
81 | /// <param name="node">The node.</param> | 81 | /// <param name="node">The node.</param> |
82 | public override void Parse(XmlNode node) | 82 | public override void Parse(XmlNode node) |
83 | { | 83 | { |
84 | if( node == null ) | 84 | if( node == null ) |
85 | { | 85 | { |
86 | throw new ArgumentNullException("node"); | 86 | throw new ArgumentNullException("node"); |
87 | } | 87 | } |
88 | 88 | ||
89 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 89 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
90 | if(m_Path == null) | 90 | if(m_Path == null) |
91 | { | 91 | { |
92 | m_Path = ""; | 92 | m_Path = ""; |
93 | } | 93 | } |
94 | 94 | ||
95 | try | 95 | try |
96 | { | 96 | { |
97 | m_Path = Helper.ResolvePath(m_Path); | 97 | m_Path = Helper.ResolvePath(m_Path); |
98 | } | 98 | } |
99 | catch(ArgumentException) | 99 | catch(ArgumentException) |
100 | { | 100 | { |
101 | Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); | 101 | Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); |
102 | m_IsValid = false; | 102 | m_IsValid = false; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | #endregion | 106 | #endregion |
107 | } | 107 | } |
108 | } | 108 | } |
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index e02b11b..9622d89 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,190 +34,205 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A set of values that the Project's type can be | 38 | /// A set of values that the Project's type can be |
39 | /// </summary> | 39 | /// </summary> |
40 | public enum ProjectType | 40 | public enum ProjectType |
41 | { | 41 | { |
42 | /// <summary> | ||
43 | /// The project is a console executable | ||
44 | /// </summary> | ||
45 | Exe, | ||
46 | /// <summary> | ||
47 | /// The project is a windows executable | ||
48 | /// </summary> | ||
49 | WinExe, | ||
50 | /// <summary> | ||
51 | /// The project is a library | ||
52 | /// </summary> | ||
53 | Library, | ||
54 | /// <summary> | ||
55 | /// The project is a website | ||
56 | /// </summary> | ||
57 | Web, | ||
58 | } | ||
59 | |||
60 | /// <summary> | ||
61 | /// | ||
62 | /// </summary> | ||
63 | public enum ClrRuntime | ||
64 | { | ||
65 | /// <summary> | ||
66 | /// | ||
67 | /// </summary> | ||
68 | Microsoft, | ||
69 | /// <summary> | ||
70 | /// | ||
71 | /// </summary> | ||
72 | Mono | ||
73 | } | ||
74 | /// <summary> | ||
75 | /// The version of the .NET framework to use (Required for VS2008) | ||
76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> | ||
77 | /// </summary> | ||
78 | public enum FrameworkVersion | ||
79 | { | ||
80 | /// <summary> | ||
81 | /// .NET 2.0 | ||
82 | /// </summary> | ||
83 | v2_0, | ||
84 | /// <summary> | ||
85 | /// .NET 3.0 | ||
86 | /// </summary> | ||
87 | v3_0, | ||
88 | /// <summary> | ||
89 | /// .NET 3.5 | ||
90 | /// </summary> | ||
91 | v3_5, | ||
92 | /// <summary> | ||
93 | /// .NET 4.0 | ||
94 | /// </summary> | ||
95 | v4_0, | ||
42 | /// <summary> | 96 | /// <summary> |
43 | /// The project is a console executable | 97 | /// .NET 4.5 |
44 | /// </summary> | ||
45 | Exe, | ||
46 | /// <summary> | ||
47 | /// The project is a windows executable | ||
48 | /// </summary> | ||
49 | WinExe, | ||
50 | /// <summary> | ||
51 | /// The project is a library | ||
52 | /// </summary> | ||
53 | Library, | ||
54 | /// <summary> | ||
55 | /// The project is a website | ||
56 | /// </summary> | ||
57 | Web, | ||
58 | } | ||
59 | |||
60 | /// <summary> | ||
61 | /// | ||
62 | /// </summary> | ||
63 | public enum ClrRuntime | ||
64 | { | ||
65 | /// <summary> | ||
66 | /// | ||
67 | /// </summary> | ||
68 | Microsoft, | ||
69 | /// <summary> | ||
70 | /// | ||
71 | /// </summary> | ||
72 | Mono | ||
73 | } | ||
74 | /// <summary> | ||
75 | /// The version of the .NET framework to use (Required for VS2008) | ||
76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> | ||
77 | /// </summary> | ||
78 | public enum FrameworkVersion | ||
79 | { | ||
80 | /// <summary> | ||
81 | /// .NET 2.0 | ||
82 | /// </summary> | ||
83 | v2_0, | ||
84 | /// <summary> | ||
85 | /// .NET 3.0 | ||
86 | /// </summary> | 98 | /// </summary> |
87 | v3_0, | 99 | v4_5, |
88 | /// <summary> | 100 | /// <summary> |
89 | /// .NET 3.5 | 101 | /// .NET 4.5.1 |
90 | /// </summary> | 102 | /// </summary> |
91 | v3_5, | 103 | v4_5_1, |
92 | /// <summary> | 104 | /// <summary> |
93 | /// .NET 4.0 | 105 | /// .NET 4.6 |
94 | /// </summary> | 106 | /// </summary> |
95 | v4_0, | 107 | v4_6, |
96 | /// <summary> | 108 | /// <summary> |
97 | /// .NET 4.5 | 109 | /// .NET 4.6.1 |
98 | /// </summary> | 110 | /// </summary> |
99 | v4_5, | 111 | v4_6_1 |
100 | /// <summary> | ||
101 | /// .NET 4.5.1 | ||
102 | /// </summary> | ||
103 | v4_5_1 | ||
104 | } | 112 | } |
105 | /// <summary> | 113 | /// <summary> |
106 | /// The Node object representing /Prebuild/Solution/Project elements | 114 | /// The Node object representing /Prebuild/Solution/Project elements |
107 | /// </summary> | 115 | /// </summary> |
108 | [DataNode("Project")] | 116 | [DataNode("Project")] |
109 | public class ProjectNode : DataNode, IComparable | 117 | public class ProjectNode : DataNode, IComparable |
110 | { | 118 | { |
111 | #region Fields | 119 | #region Fields |
112 | 120 | ||
113 | private string m_Name = "unknown"; | 121 | private string m_Name = "unknown"; |
114 | private string m_Path = ""; | 122 | private string m_Path = ""; |
115 | private string m_FullPath = ""; | 123 | private string m_FullPath = ""; |
116 | private string m_AssemblyName; | 124 | private string m_AssemblyName; |
117 | private string m_AppIcon = ""; | 125 | private string m_AppIcon = ""; |
126 | private string m_ApplicationManifest = ""; | ||
118 | private string m_ConfigFile = ""; | 127 | private string m_ConfigFile = ""; |
119 | private string m_DesignerFolder = ""; | 128 | private string m_DesignerFolder = ""; |
120 | private string m_Language = "C#"; | 129 | private string m_Language = "C#"; |
121 | private ProjectType m_Type = ProjectType.Exe; | 130 | private ProjectType m_Type = ProjectType.Exe; |
122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; | 131 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; |
123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; | 132 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; |
124 | private string m_StartupObject = ""; | 133 | private bool m_useFramework = true; |
125 | private string m_RootNamespace; | 134 | private string m_StartupObject = ""; |
126 | private string m_FilterGroups = ""; | 135 | private string m_RootNamespace; |
127 | private string m_Version = ""; | 136 | private string m_FilterGroups = ""; |
128 | private Guid m_Guid; | 137 | private string m_Version = ""; |
138 | private Guid m_Guid; | ||
129 | private string m_DebugStartParameters; | 139 | private string m_DebugStartParameters; |
130 | 140 | ||
131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); | 141 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); |
132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); | 142 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); |
133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); | 143 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); |
134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); | 144 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); |
135 | private FilesNode m_Files; | 145 | private FilesNode m_Files; |
136 | 146 | ||
137 | #endregion | 147 | #endregion |
138 | 148 | ||
139 | #region Properties | 149 | #region Properties |
140 | 150 | ||
141 | /// <summary> | 151 | /// <summary> |
142 | /// Gets the name. | 152 | /// Gets the name. |
143 | /// </summary> | 153 | /// </summary> |
144 | /// <value>The name.</value> | 154 | /// <value>The name.</value> |
145 | public string Name | 155 | public string Name |
146 | { | 156 | { |
147 | get | 157 | get |
148 | { | 158 | { |
149 | return m_Name; | 159 | return m_Name; |
150 | } | 160 | } |
151 | } | 161 | } |
152 | /// <summary> | 162 | /// <summary> |
153 | /// The version of the .NET Framework to compile under | 163 | /// The version of the .NET Framework to compile under |
154 | /// </summary> | 164 | /// </summary> |
155 | public FrameworkVersion FrameworkVersion | 165 | public FrameworkVersion FrameworkVersion |
156 | { | 166 | { |
157 | get | 167 | get |
158 | { | 168 | { |
159 | return m_Framework; | 169 | return m_Framework; |
160 | } | 170 | } |
161 | } | 171 | set |
162 | /// <summary> | ||
163 | /// Gets the path. | ||
164 | /// </summary> | ||
165 | /// <value>The path.</value> | ||
166 | public string Path | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Path; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the filter groups. | ||
176 | /// </summary> | ||
177 | /// <value>The filter groups.</value> | ||
178 | public string FilterGroups | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_FilterGroups; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the project's version | ||
188 | /// </summary> | ||
189 | /// <value>The project's version.</value> | ||
190 | public string Version | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Version; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the full path. | ||
200 | /// </summary> | ||
201 | /// <value>The full path.</value> | ||
202 | public string FullPath | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | return m_FullPath; | ||
207 | } | ||
208 | } | ||
209 | |||
210 | /// <summary> | ||
211 | /// Gets the name of the assembly. | ||
212 | /// </summary> | ||
213 | /// <value>The name of the assembly.</value> | ||
214 | public string AssemblyName | ||
215 | { | ||
216 | get | ||
217 | { | 172 | { |
218 | return m_AssemblyName; | 173 | m_Framework = value; |
219 | } | 174 | m_useFramework = false; |
220 | } | 175 | } |
176 | } | ||
177 | /// <summary> | ||
178 | /// Gets the path. | ||
179 | /// </summary> | ||
180 | /// <value>The path.</value> | ||
181 | public string Path | ||
182 | { | ||
183 | get | ||
184 | { | ||
185 | return m_Path; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | /// <summary> | ||
190 | /// Gets the filter groups. | ||
191 | /// </summary> | ||
192 | /// <value>The filter groups.</value> | ||
193 | public string FilterGroups | ||
194 | { | ||
195 | get | ||
196 | { | ||
197 | return m_FilterGroups; | ||
198 | } | ||
199 | } | ||
200 | |||
201 | /// <summary> | ||
202 | /// Gets the project's version | ||
203 | /// </summary> | ||
204 | /// <value>The project's version.</value> | ||
205 | public string Version | ||
206 | { | ||
207 | get | ||
208 | { | ||
209 | return m_Version; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /// <summary> | ||
214 | /// Gets the full path. | ||
215 | /// </summary> | ||
216 | /// <value>The full path.</value> | ||
217 | public string FullPath | ||
218 | { | ||
219 | get | ||
220 | { | ||
221 | return m_FullPath; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /// <summary> | ||
226 | /// Gets the name of the assembly. | ||
227 | /// </summary> | ||
228 | /// <value>The name of the assembly.</value> | ||
229 | public string AssemblyName | ||
230 | { | ||
231 | get | ||
232 | { | ||
233 | return m_AssemblyName; | ||
234 | } | ||
235 | } | ||
221 | 236 | ||
222 | /// <summary> | 237 | /// <summary> |
223 | /// Gets the app icon. | 238 | /// Gets the app icon. |
@@ -232,347 +247,362 @@ namespace Prebuild.Core.Nodes | |||
232 | } | 247 | } |
233 | 248 | ||
234 | /// <summary> | 249 | /// <summary> |
235 | /// Gets the app icon. | 250 | /// Gets the Application Manifest. |
236 | /// </summary> | ||
237 | /// <value>The app icon.</value> | ||
238 | public string ConfigFile | ||
239 | { | ||
240 | get | ||
241 | { | ||
242 | return m_ConfigFile; | ||
243 | } | ||
244 | } | ||
245 | |||
246 | /// <summary> | ||
247 | /// | ||
248 | /// </summary> | ||
249 | public string DesignerFolder | ||
250 | { | ||
251 | get | ||
252 | { | ||
253 | return m_DesignerFolder; | ||
254 | } | ||
255 | } | ||
256 | |||
257 | /// <summary> | ||
258 | /// Gets the language. | ||
259 | /// </summary> | ||
260 | /// <value>The language.</value> | ||
261 | public string Language | ||
262 | { | ||
263 | get | ||
264 | { | ||
265 | return m_Language; | ||
266 | } | ||
267 | } | ||
268 | |||
269 | /// <summary> | ||
270 | /// Gets the type. | ||
271 | /// </summary> | ||
272 | /// <value>The type.</value> | ||
273 | public ProjectType Type | ||
274 | { | ||
275 | get | ||
276 | { | ||
277 | return m_Type; | ||
278 | } | ||
279 | } | ||
280 | |||
281 | /// <summary> | ||
282 | /// Gets the runtime. | ||
283 | /// </summary> | ||
284 | /// <value>The runtime.</value> | ||
285 | public ClrRuntime Runtime | ||
286 | { | ||
287 | get | ||
288 | { | ||
289 | return m_Runtime; | ||
290 | } | ||
291 | } | ||
292 | |||
293 | private bool m_GenerateAssemblyInfoFile; | ||
294 | |||
295 | /// <summary> | ||
296 | /// | ||
297 | /// </summary> | ||
298 | public bool GenerateAssemblyInfoFile | ||
299 | { | ||
300 | get | ||
301 | { | ||
302 | return m_GenerateAssemblyInfoFile; | ||
303 | } | ||
304 | set | ||
305 | { | ||
306 | m_GenerateAssemblyInfoFile = value; | ||
307 | } | ||
308 | } | ||
309 | |||
310 | /// <summary> | ||
311 | /// Gets the startup object. | ||
312 | /// </summary> | 251 | /// </summary> |
313 | /// <value>The startup object.</value> | 252 | /// <value>The Application Manifest.</value> |
314 | public string StartupObject | 253 | public string ApplicationManifest |
315 | { | 254 | { |
316 | get | 255 | get |
317 | { | 256 | { |
318 | return m_StartupObject; | 257 | return m_ApplicationManifest; |
319 | } | 258 | } |
320 | } | 259 | } |
321 | 260 | ||
322 | /// <summary> | 261 | /// <summary> |
323 | /// Gets the root namespace. | 262 | /// Gets the app icon. |
324 | /// </summary> | 263 | /// </summary> |
325 | /// <value>The root namespace.</value> | 264 | /// <value>The app icon.</value> |
326 | public string RootNamespace | 265 | public string ConfigFile |
327 | { | 266 | { |
328 | get | 267 | get |
329 | { | 268 | { |
330 | return m_RootNamespace; | 269 | return m_ConfigFile; |
331 | } | 270 | } |
332 | } | 271 | } |
333 | 272 | ||
334 | /// <summary> | 273 | /// <summary> |
335 | /// Gets the configurations. | 274 | /// |
336 | /// </summary> | 275 | /// </summary> |
337 | /// <value>The configurations.</value> | 276 | public string DesignerFolder |
277 | { | ||
278 | get | ||
279 | { | ||
280 | return m_DesignerFolder; | ||
281 | } | ||
282 | } | ||
283 | |||
284 | /// <summary> | ||
285 | /// Gets the language. | ||
286 | /// </summary> | ||
287 | /// <value>The language.</value> | ||
288 | public string Language | ||
289 | { | ||
290 | get | ||
291 | { | ||
292 | return m_Language; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | /// <summary> | ||
297 | /// Gets the type. | ||
298 | /// </summary> | ||
299 | /// <value>The type.</value> | ||
300 | public ProjectType Type | ||
301 | { | ||
302 | get | ||
303 | { | ||
304 | return m_Type; | ||
305 | } | ||
306 | } | ||
307 | |||
308 | /// <summary> | ||
309 | /// Gets the runtime. | ||
310 | /// </summary> | ||
311 | /// <value>The runtime.</value> | ||
312 | public ClrRuntime Runtime | ||
313 | { | ||
314 | get | ||
315 | { | ||
316 | return m_Runtime; | ||
317 | } | ||
318 | } | ||
319 | |||
320 | private bool m_GenerateAssemblyInfoFile; | ||
321 | |||
322 | /// <summary> | ||
323 | /// | ||
324 | /// </summary> | ||
325 | public bool GenerateAssemblyInfoFile | ||
326 | { | ||
327 | get | ||
328 | { | ||
329 | return m_GenerateAssemblyInfoFile; | ||
330 | } | ||
331 | set | ||
332 | { | ||
333 | m_GenerateAssemblyInfoFile = value; | ||
334 | } | ||
335 | } | ||
336 | |||
337 | /// <summary> | ||
338 | /// Gets the startup object. | ||
339 | /// </summary> | ||
340 | /// <value>The startup object.</value> | ||
341 | public string StartupObject | ||
342 | { | ||
343 | get | ||
344 | { | ||
345 | return m_StartupObject; | ||
346 | } | ||
347 | } | ||
348 | |||
349 | /// <summary> | ||
350 | /// Gets the root namespace. | ||
351 | /// </summary> | ||
352 | /// <value>The root namespace.</value> | ||
353 | public string RootNamespace | ||
354 | { | ||
355 | get | ||
356 | { | ||
357 | return m_RootNamespace; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /// <summary> | ||
362 | /// Gets the configurations. | ||
363 | /// </summary> | ||
364 | /// <value>The configurations.</value> | ||
338 | public List<ConfigurationNode> Configurations | 365 | public List<ConfigurationNode> Configurations |
339 | { | 366 | { |
340 | get | 367 | get |
341 | { | 368 | { |
342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); | 369 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); |
343 | tmp.Sort(); | 370 | tmp.Sort(); |
344 | return tmp; | 371 | return tmp; |
345 | } | 372 | } |
346 | } | 373 | } |
347 | 374 | ||
348 | /// <summary> | 375 | /// <summary> |
349 | /// Gets the configurations table. | 376 | /// Gets the configurations table. |
350 | /// </summary> | 377 | /// </summary> |
351 | /// <value>The configurations table.</value> | 378 | /// <value>The configurations table.</value> |
352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable | 379 | public Dictionary<string, ConfigurationNode> ConfigurationsTable |
353 | { | 380 | { |
354 | get | 381 | get |
355 | { | 382 | { |
356 | return m_Configurations; | 383 | return m_Configurations; |
357 | } | 384 | } |
358 | } | 385 | } |
359 | 386 | ||
360 | /// <summary> | 387 | /// <summary> |
361 | /// Gets the reference paths. | 388 | /// Gets the reference paths. |
362 | /// </summary> | 389 | /// </summary> |
363 | /// <value>The reference paths.</value> | 390 | /// <value>The reference paths.</value> |
364 | public List<ReferencePathNode> ReferencePaths | 391 | public List<ReferencePathNode> ReferencePaths |
365 | { | 392 | { |
366 | get | 393 | get |
367 | { | 394 | { |
368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); | 395 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); |
369 | tmp.Sort(); | 396 | tmp.Sort(); |
370 | return tmp; | 397 | return tmp; |
371 | } | 398 | } |
372 | } | 399 | } |
373 | 400 | ||
374 | /// <summary> | 401 | /// <summary> |
375 | /// Gets the references. | 402 | /// Gets the references. |
376 | /// </summary> | 403 | /// </summary> |
377 | /// <value>The references.</value> | 404 | /// <value>The references.</value> |
378 | public List<ReferenceNode> References | 405 | public List<ReferenceNode> References |
379 | { | 406 | { |
380 | get | 407 | get |
381 | { | 408 | { |
382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); | 409 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); |
383 | tmp.Sort(); | 410 | tmp.Sort(); |
384 | return tmp; | 411 | return tmp; |
385 | } | 412 | } |
386 | } | 413 | } |
387 | 414 | ||
388 | /// <summary> | 415 | /// <summary> |
389 | /// Gets the Authors list. | 416 | /// Gets the Authors list. |
390 | /// </summary> | 417 | /// </summary> |
391 | /// <value>The list of the project's authors.</value> | 418 | /// <value>The list of the project's authors.</value> |
392 | public List<AuthorNode> Authors | 419 | public List<AuthorNode> Authors |
393 | { | 420 | { |
394 | get | 421 | get |
395 | { | 422 | { |
396 | return m_Authors; | 423 | return m_Authors; |
397 | } | 424 | } |
398 | } | 425 | } |
399 | 426 | ||
400 | /// <summary> | 427 | /// <summary> |
401 | /// Gets the files. | 428 | /// Gets the files. |
402 | /// </summary> | 429 | /// </summary> |
403 | /// <value>The files.</value> | 430 | /// <value>The files.</value> |
404 | public FilesNode Files | 431 | public FilesNode Files |
405 | { | 432 | { |
406 | get | 433 | get |
407 | { | 434 | { |
408 | return m_Files; | 435 | return m_Files; |
409 | } | 436 | } |
410 | } | 437 | } |
411 | 438 | ||
412 | /// <summary> | 439 | /// <summary> |
413 | /// Gets or sets the parent. | 440 | /// Gets or sets the parent. |
414 | /// </summary> | 441 | /// </summary> |
415 | /// <value>The parent.</value> | 442 | /// <value>The parent.</value> |
416 | public override IDataNode Parent | 443 | public override IDataNode Parent |
417 | { | 444 | { |
418 | get | 445 | get |
419 | { | 446 | { |
420 | return base.Parent; | 447 | return base.Parent; |
421 | } | 448 | } |
422 | set | 449 | set |
423 | { | 450 | { |
424 | base.Parent = value; | 451 | base.Parent = value; |
425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) | 452 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) |
426 | { | 453 | { |
427 | SolutionNode parent = (SolutionNode)base.Parent; | 454 | SolutionNode parent = (SolutionNode)base.Parent; |
428 | foreach(ConfigurationNode conf in parent.Configurations) | 455 | foreach(ConfigurationNode conf in parent.Configurations) |
429 | { | 456 | { |
430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); | 457 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); |
431 | } | 458 | } |
432 | } | 459 | } |
433 | } | 460 | } |
434 | } | 461 | } |
435 | 462 | ||
436 | /// <summary> | 463 | /// <summary> |
437 | /// Gets the GUID. | 464 | /// Gets the GUID. |
438 | /// </summary> | 465 | /// </summary> |
439 | /// <value>The GUID.</value> | 466 | /// <value>The GUID.</value> |
440 | public Guid Guid | 467 | public Guid Guid |
441 | { | 468 | { |
442 | get | 469 | get |
443 | { | 470 | { |
444 | return m_Guid; | 471 | return m_Guid; |
445 | } | 472 | } |
446 | } | 473 | } |
447 | 474 | ||
448 | public string DebugStartParameters | 475 | public string DebugStartParameters |
449 | { | 476 | { |
450 | get | 477 | get |
451 | { | 478 | { |
452 | return m_DebugStartParameters; | 479 | return m_DebugStartParameters; |
453 | } | 480 | } |
454 | } | 481 | } |
455 | 482 | ||
456 | #endregion | 483 | #endregion |
457 | 484 | ||
458 | #region Private Methods | 485 | #region Private Methods |
459 | 486 | ||
460 | private void HandleConfiguration(ConfigurationNode conf) | 487 | private void HandleConfiguration(ConfigurationNode conf) |
461 | { | 488 | { |
462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, | 489 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, |
463 | //so it *may* override changes to the same properties for configurations defines at the project level | 490 | //so it *may* override changes to the same properties for configurations defines at the project level |
464 | { | 491 | { |
465 | foreach(ConfigurationNode confNode in m_Configurations.Values) | 492 | foreach(ConfigurationNode confNode in m_Configurations.Values) |
466 | { | 493 | { |
467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides | 494 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides |
468 | } | 495 | } |
469 | } | 496 | } |
470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) | 497 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) |
471 | { | 498 | { |
472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; | 499 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; |
473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides | 500 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides |
474 | } | 501 | } |
475 | else | 502 | else |
476 | { | 503 | { |
477 | m_Configurations[conf.NameAndPlatform] = conf; | 504 | m_Configurations[conf.NameAndPlatform] = conf; |
478 | } | 505 | } |
479 | } | 506 | } |
480 | 507 | ||
481 | #endregion | 508 | #endregion |
482 | 509 | ||
483 | #region Public Methods | 510 | #region Public Methods |
484 | 511 | ||
485 | /// <summary> | 512 | /// <summary> |
486 | /// Parses the specified node. | 513 | /// Parses the specified node. |
487 | /// </summary> | 514 | /// </summary> |
488 | /// <param name="node">The node.</param> | 515 | /// <param name="node">The node.</param> |
489 | public override void Parse(XmlNode node) | 516 | public override void Parse(XmlNode node) |
490 | { | 517 | { |
491 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 518 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
492 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 519 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); | 520 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); |
494 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 521 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); | 522 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); |
523 | m_ApplicationManifest = Helper.AttributeValue(node, "appmanifest", m_ApplicationManifest); | ||
496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); | 524 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); |
497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); | 525 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); |
498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); | 526 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); |
499 | m_Language = Helper.AttributeValue(node, "language", m_Language); | 527 | m_Language = Helper.AttributeValue(node, "language", m_Language); |
500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); | 528 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); |
501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); | 529 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); |
502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | 530 | if(m_useFramework) |
531 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | ||
532 | |||
503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); | 533 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); |
504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); | 534 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); |
505 | 535 | ||
506 | int hash = m_Name.GetHashCode(); | 536 | int hash = m_Name.GetHashCode(); |
507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | 537 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); | 538 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); |
509 | m_Guid = new Guid(guid); | 539 | m_Guid = new Guid(guid); |
510 | 540 | ||
511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); | 541 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); |
512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); | 542 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); |
513 | 543 | ||
514 | if(string.IsNullOrEmpty(m_AssemblyName)) | 544 | if(string.IsNullOrEmpty(m_AssemblyName)) |
515 | { | 545 | { |
516 | m_AssemblyName = m_Name; | 546 | m_AssemblyName = m_Name; |
517 | } | 547 | } |
518 | 548 | ||
519 | if(string.IsNullOrEmpty(m_RootNamespace)) | 549 | if(string.IsNullOrEmpty(m_RootNamespace)) |
520 | { | 550 | { |
521 | m_RootNamespace = m_Name; | 551 | m_RootNamespace = m_Name; |
522 | } | 552 | } |
523 | 553 | ||
524 | m_FullPath = m_Path; | 554 | m_FullPath = m_Path; |
525 | try | 555 | try |
526 | { | 556 | { |
527 | m_FullPath = Helper.ResolvePath(m_FullPath); | 557 | m_FullPath = Helper.ResolvePath(m_FullPath); |
528 | } | 558 | } |
529 | catch | 559 | catch |
530 | { | 560 | { |
531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); | 561 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); |
532 | } | 562 | } |
533 | 563 | ||
534 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 564 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
535 | try | 565 | try |
536 | { | 566 | { |
537 | Helper.SetCurrentDir(m_FullPath); | 567 | Helper.SetCurrentDir(m_FullPath); |
538 | 568 | ||
539 | if( node == null ) | 569 | if( node == null ) |
540 | { | 570 | { |
541 | throw new ArgumentNullException("node"); | 571 | throw new ArgumentNullException("node"); |
542 | } | 572 | } |
543 | 573 | ||
544 | foreach(XmlNode child in node.ChildNodes) | 574 | foreach(XmlNode child in node.ChildNodes) |
545 | { | 575 | { |
546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 576 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
547 | if(dataNode is ConfigurationNode) | 577 | if(dataNode is ConfigurationNode) |
548 | { | 578 | { |
549 | HandleConfiguration((ConfigurationNode)dataNode); | 579 | HandleConfiguration((ConfigurationNode)dataNode); |
550 | } | 580 | } |
551 | else if(dataNode is ReferencePathNode) | 581 | else if(dataNode is ReferencePathNode) |
552 | { | 582 | { |
553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); | 583 | m_ReferencePaths.Add((ReferencePathNode)dataNode); |
554 | } | 584 | } |
555 | else if(dataNode is ReferenceNode) | 585 | else if(dataNode is ReferenceNode) |
556 | { | 586 | { |
557 | m_References.Add((ReferenceNode)dataNode); | 587 | m_References.Add((ReferenceNode)dataNode); |
558 | } | 588 | } |
559 | else if(dataNode is AuthorNode) | 589 | else if(dataNode is AuthorNode) |
560 | { | 590 | { |
561 | m_Authors.Add((AuthorNode)dataNode); | 591 | m_Authors.Add((AuthorNode)dataNode); |
562 | } | 592 | } |
563 | else if(dataNode is FilesNode) | 593 | else if(dataNode is FilesNode) |
564 | { | 594 | { |
565 | m_Files = (FilesNode)dataNode; | 595 | m_Files = (FilesNode)dataNode; |
566 | } | 596 | } |
567 | } | 597 | } |
568 | } | 598 | } |
569 | finally | 599 | finally |
570 | { | 600 | { |
571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 601 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
572 | } | 602 | } |
573 | } | 603 | } |
574 | 604 | ||
575 | #endregion | 605 | #endregion |
576 | 606 | ||
577 | #region IComparable Members | 607 | #region IComparable Members |
578 | 608 | ||
@@ -582,6 +612,6 @@ namespace Prebuild.Core.Nodes | |||
582 | return m_Name.CompareTo(that.m_Name); | 612 | return m_Name.CompareTo(that.m_Name); |
583 | } | 613 | } |
584 | 614 | ||
585 | #endregion | 615 | #endregion |
586 | } | 616 | } |
587 | } | 617 | } |
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs index 9afb512..9c5d1a3 100644 --- a/Prebuild/src/Core/Nodes/ReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,104 +32,104 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Reference")] | 38 | [DataNode("Reference")] |
39 | public class ReferenceNode : DataNode, IComparable | 39 | public class ReferenceNode : DataNode, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Name = "unknown"; | 43 | private string m_Name = "unknown"; |
44 | private string m_Path; | 44 | private string m_Path; |
45 | private string m_LocalCopy; | 45 | private string m_LocalCopy; |
46 | private string m_Version; | 46 | private string m_Version; |
47 | 47 | ||
48 | #endregion | 48 | #endregion |
49 | 49 | ||
50 | #region Properties | 50 | #region Properties |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Gets the name. | 53 | /// Gets the name. |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <value>The name.</value> | 55 | /// <value>The name.</value> |
56 | public string Name | 56 | public string Name |
57 | { | 57 | { |
58 | get | 58 | get |
59 | { | 59 | { |
60 | return m_Name; | 60 | return m_Name; |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Gets the path. | 65 | /// Gets the path. |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <value>The path.</value> | 67 | /// <value>The path.</value> |
68 | public string Path | 68 | public string Path |
69 | { | 69 | { |
70 | get | 70 | get |
71 | { | 71 | { |
72 | return m_Path; | 72 | return m_Path; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Gets a value indicating whether [local copy specified]. | 77 | /// Gets a value indicating whether [local copy specified]. |
78 | /// </summary> | 78 | /// </summary> |
79 | /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> | 79 | /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> |
80 | public bool LocalCopySpecified | 80 | public bool LocalCopySpecified |
81 | { | 81 | { |
82 | get | 82 | get |
83 | { | 83 | { |
84 | return ( m_LocalCopy != null && m_LocalCopy.Length == 0); | 84 | return ( m_LocalCopy != null && m_LocalCopy.Length == 0); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Gets a value indicating whether [local copy]. | 89 | /// Gets a value indicating whether [local copy]. |
90 | /// </summary> | 90 | /// </summary> |
91 | /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> | 91 | /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> |
92 | public bool LocalCopy | 92 | public bool LocalCopy |
93 | { | 93 | { |
94 | get | 94 | get |
95 | { | 95 | { |
96 | if( m_LocalCopy == null) | 96 | if( m_LocalCopy == null) |
97 | { | 97 | { |
98 | return false; | 98 | return false; |
99 | } | 99 | } |
100 | return bool.Parse(m_LocalCopy); | 100 | return bool.Parse(m_LocalCopy); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Gets the version. | 105 | /// Gets the version. |
106 | /// </summary> | 106 | /// </summary> |
107 | /// <value>The version.</value> | 107 | /// <value>The version.</value> |
108 | public string Version | 108 | public string Version |
109 | { | 109 | { |
110 | get | 110 | get |
111 | { | 111 | { |
112 | return m_Version; | 112 | return m_Version; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | #endregion | 116 | #endregion |
117 | 117 | ||
118 | #region Public Methods | 118 | #region Public Methods |
119 | 119 | ||
120 | /// <summary> | 120 | /// <summary> |
121 | /// Parses the specified node. | 121 | /// Parses the specified node. |
122 | /// </summary> | 122 | /// </summary> |
123 | /// <param name="node">The node.</param> | 123 | /// <param name="node">The node.</param> |
124 | public override void Parse(XmlNode node) | 124 | public override void Parse(XmlNode node) |
125 | { | 125 | { |
126 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 126 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
127 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 127 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
128 | m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); | 128 | m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); |
129 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 129 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
130 | } | 130 | } |
131 | 131 | ||
132 | #endregion | 132 | #endregion |
133 | 133 | ||
134 | #region IComparable Members | 134 | #region IComparable Members |
135 | 135 | ||
@@ -140,5 +140,5 @@ namespace Prebuild.Core.Nodes | |||
140 | } | 140 | } |
141 | 141 | ||
142 | #endregion | 142 | #endregion |
143 | } | 143 | } |
144 | } | 144 | } |
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs index 29c63c5..7331cd7 100644 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -32,57 +32,57 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("ReferencePath")] | 38 | [DataNode("ReferencePath")] |
39 | public class ReferencePathNode : DataNode, IComparable | 39 | public class ReferencePathNode : DataNode, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Path; | 43 | private string m_Path; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the path. | 50 | /// Gets the path. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The path.</value> | 52 | /// <value>The path.</value> |
53 | public string Path | 53 | public string Path |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Path; | 57 | return m_Path; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Path == null) | 77 | if(m_Path == null) |
78 | { | 78 | { |
79 | m_Path = ""; | 79 | m_Path = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Path = m_Path.Trim(); | 82 | m_Path = m_Path.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | 86 | ||
87 | #region IComparable Members | 87 | #region IComparable Members |
88 | 88 | ||
@@ -93,5 +93,5 @@ namespace Prebuild.Core.Nodes | |||
93 | } | 93 | } |
94 | 94 | ||
95 | #endregion | 95 | #endregion |
96 | } | 96 | } |
97 | } | 97 | } |
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs index e1d5b3b..10c0223 100644 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,35 +34,35 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Solution")] | 40 | [DataNode("Solution")] |
41 | [DataNode("EmbeddedSolution")] | 41 | [DataNode("EmbeddedSolution")] |
42 | [DebuggerDisplay("{Name}")] | 42 | [DebuggerDisplay("{Name}")] |
43 | public class SolutionNode : DataNode | 43 | public class SolutionNode : DataNode |
44 | { | 44 | { |
45 | #region Fields | 45 | #region Fields |
46 | 46 | ||
47 | private Guid m_Guid = Guid.NewGuid(); | 47 | private Guid m_Guid = Guid.NewGuid(); |
48 | private string m_Name = "unknown"; | 48 | private string m_Name = "unknown"; |
49 | private string m_Path = ""; | 49 | private string m_Path = ""; |
50 | private string m_FullPath = ""; | 50 | private string m_FullPath = ""; |
51 | private string m_ActiveConfig; | 51 | private string m_ActiveConfig; |
52 | private string m_Version = "1.0.0"; | 52 | private string m_Version = "1.0.0"; |
53 | 53 | ||
54 | private OptionsNode m_Options; | 54 | private OptionsNode m_Options; |
55 | private FilesNode m_Files; | 55 | private FilesNode m_Files; |
56 | private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); | 56 | private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); |
57 | private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>(); | 57 | private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>(); |
58 | private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>(); | 58 | private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>(); |
59 | private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>(); | 59 | private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>(); |
60 | private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>(); | 60 | private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>(); |
61 | private CleanupNode m_Cleanup; | 61 | private CleanupNode m_Cleanup; |
62 | 62 | ||
63 | #endregion | 63 | #endregion |
64 | 64 | ||
65 | #region Properties | 65 | #region Properties |
66 | public override IDataNode Parent | 66 | public override IDataNode Parent |
67 | { | 67 | { |
68 | get | 68 | get |
@@ -84,142 +84,142 @@ namespace Prebuild.Core.Nodes | |||
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | public CleanupNode Cleanup | 87 | public CleanupNode Cleanup |
88 | { | 88 | { |
89 | get | 89 | get |
90 | { | 90 | { |
91 | return m_Cleanup; | 91 | return m_Cleanup; |
92 | } | 92 | } |
93 | set | 93 | set |
94 | { | 94 | { |
95 | m_Cleanup = value; | 95 | m_Cleanup = value; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | public Guid Guid | 99 | public Guid Guid |
100 | { | 100 | { |
101 | get | 101 | get |
102 | { | 102 | { |
103 | return m_Guid; | 103 | return m_Guid; |
104 | } | 104 | } |
105 | set | 105 | set |
106 | { | 106 | { |
107 | m_Guid = value; | 107 | m_Guid = value; |
108 | } | ||
109 | } | ||
110 | /// <summary> | ||
111 | /// Gets or sets the active config. | ||
112 | /// </summary> | ||
113 | /// <value>The active config.</value> | ||
114 | public string ActiveConfig | ||
115 | { | ||
116 | get | ||
117 | { | ||
118 | return m_ActiveConfig; | ||
119 | } | ||
120 | set | ||
121 | { | ||
122 | m_ActiveConfig = value; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | /// <summary> | ||
127 | /// Gets the name. | ||
128 | /// </summary> | ||
129 | /// <value>The name.</value> | ||
130 | public string Name | ||
131 | { | ||
132 | get | ||
133 | { | ||
134 | return m_Name; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// Gets the path. | ||
140 | /// </summary> | ||
141 | /// <value>The path.</value> | ||
142 | public string Path | ||
143 | { | ||
144 | get | ||
145 | { | ||
146 | return m_Path; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
151 | /// Gets the full path. | ||
152 | /// </summary> | ||
153 | /// <value>The full path.</value> | ||
154 | public string FullPath | ||
155 | { | ||
156 | get | ||
157 | { | ||
158 | return m_FullPath; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// Gets the version. | ||
164 | /// </summary> | ||
165 | /// <value>The version.</value> | ||
166 | public string Version | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Version; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the options. | ||
176 | /// </summary> | ||
177 | /// <value>The options.</value> | ||
178 | public OptionsNode Options | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_Options; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the files. | ||
188 | /// </summary> | ||
189 | /// <value>The files.</value> | ||
190 | public FilesNode Files | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Files; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the configurations. | ||
200 | /// </summary> | ||
201 | /// <value>The configurations.</value> | ||
202 | public ConfigurationNodeCollection Configurations | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); | ||
207 | tmp.AddRange(ConfigurationsTable); | ||
208 | return tmp; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | /// <summary> | ||
213 | /// Gets the configurations table. | ||
214 | /// </summary> | ||
215 | /// <value>The configurations table.</value> | ||
216 | public ConfigurationNodeCollection ConfigurationsTable | ||
217 | { | ||
218 | get | ||
219 | { | ||
220 | return m_Configurations; | ||
221 | } | 108 | } |
222 | } | 109 | } |
110 | /// <summary> | ||
111 | /// Gets or sets the active config. | ||
112 | /// </summary> | ||
113 | /// <value>The active config.</value> | ||
114 | public string ActiveConfig | ||
115 | { | ||
116 | get | ||
117 | { | ||
118 | return m_ActiveConfig; | ||
119 | } | ||
120 | set | ||
121 | { | ||
122 | m_ActiveConfig = value; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | /// <summary> | ||
127 | /// Gets the name. | ||
128 | /// </summary> | ||
129 | /// <value>The name.</value> | ||
130 | public string Name | ||
131 | { | ||
132 | get | ||
133 | { | ||
134 | return m_Name; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// Gets the path. | ||
140 | /// </summary> | ||
141 | /// <value>The path.</value> | ||
142 | public string Path | ||
143 | { | ||
144 | get | ||
145 | { | ||
146 | return m_Path; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
151 | /// Gets the full path. | ||
152 | /// </summary> | ||
153 | /// <value>The full path.</value> | ||
154 | public string FullPath | ||
155 | { | ||
156 | get | ||
157 | { | ||
158 | return m_FullPath; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// Gets the version. | ||
164 | /// </summary> | ||
165 | /// <value>The version.</value> | ||
166 | public string Version | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Version; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the options. | ||
176 | /// </summary> | ||
177 | /// <value>The options.</value> | ||
178 | public OptionsNode Options | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_Options; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the files. | ||
188 | /// </summary> | ||
189 | /// <value>The files.</value> | ||
190 | public FilesNode Files | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Files; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the configurations. | ||
200 | /// </summary> | ||
201 | /// <value>The configurations.</value> | ||
202 | public ConfigurationNodeCollection Configurations | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); | ||
207 | tmp.AddRange(ConfigurationsTable); | ||
208 | return tmp; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | /// <summary> | ||
213 | /// Gets the configurations table. | ||
214 | /// </summary> | ||
215 | /// <value>The configurations table.</value> | ||
216 | public ConfigurationNodeCollection ConfigurationsTable | ||
217 | { | ||
218 | get | ||
219 | { | ||
220 | return m_Configurations; | ||
221 | } | ||
222 | } | ||
223 | /// <summary> | 223 | /// <summary> |
224 | /// Gets the database projects. | 224 | /// Gets the database projects. |
225 | /// </summary> | 225 | /// </summary> |
@@ -250,106 +250,106 @@ namespace Prebuild.Core.Nodes | |||
250 | return m_Solutions; | 250 | return m_Solutions; |
251 | } | 251 | } |
252 | } | 252 | } |
253 | /// <summary> | 253 | /// <summary> |
254 | /// Gets the projects. | 254 | /// Gets the projects. |
255 | /// </summary> | 255 | /// </summary> |
256 | /// <value>The projects.</value> | 256 | /// <value>The projects.</value> |
257 | public ICollection<ProjectNode> Projects | 257 | public ICollection<ProjectNode> Projects |
258 | { | 258 | { |
259 | get | 259 | get |
260 | { | 260 | { |
261 | List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values); | 261 | List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values); |
262 | tmp.Sort(); | 262 | tmp.Sort(); |
263 | return tmp; | 263 | return tmp; |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | /// <summary> | 267 | /// <summary> |
268 | /// Gets the projects table. | 268 | /// Gets the projects table. |
269 | /// </summary> | 269 | /// </summary> |
270 | /// <value>The projects table.</value> | 270 | /// <value>The projects table.</value> |
271 | public Dictionary<string, ProjectNode> ProjectsTable | 271 | public Dictionary<string, ProjectNode> ProjectsTable |
272 | { | 272 | { |
273 | get | 273 | get |
274 | { | 274 | { |
275 | return m_Projects; | 275 | return m_Projects; |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | /// <summary> | 279 | /// <summary> |
280 | /// Gets the projects table. | 280 | /// Gets the projects table. |
281 | /// </summary> | 281 | /// </summary> |
282 | /// <value>The projects table.</value> | 282 | /// <value>The projects table.</value> |
283 | public List<ProjectNode> ProjectsTableOrder | 283 | public List<ProjectNode> ProjectsTableOrder |
284 | { | 284 | { |
285 | get | 285 | get |
286 | { | 286 | { |
287 | return m_ProjectsOrder; | 287 | return m_ProjectsOrder; |
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | #endregion | 291 | #endregion |
292 | 292 | ||
293 | #region Public Methods | 293 | #region Public Methods |
294 | 294 | ||
295 | /// <summary> | 295 | /// <summary> |
296 | /// Parses the specified node. | 296 | /// Parses the specified node. |
297 | /// </summary> | 297 | /// </summary> |
298 | /// <param name="node">The node.</param> | 298 | /// <param name="node">The node.</param> |
299 | public override void Parse(XmlNode node) | 299 | public override void Parse(XmlNode node) |
300 | { | 300 | { |
301 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 301 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
302 | m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); | 302 | m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); |
303 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 303 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
304 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 304 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
305 | 305 | ||
306 | m_FullPath = m_Path; | 306 | m_FullPath = m_Path; |
307 | try | 307 | try |
308 | { | 308 | { |
309 | m_FullPath = Helper.ResolvePath(m_FullPath); | 309 | m_FullPath = Helper.ResolvePath(m_FullPath); |
310 | } | 310 | } |
311 | catch | 311 | catch |
312 | { | 312 | { |
313 | throw new WarningException("Could not resolve solution path: {0}", m_Path); | 313 | throw new WarningException("Could not resolve solution path: {0}", m_Path); |
314 | } | 314 | } |
315 | 315 | ||
316 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 316 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
317 | try | 317 | try |
318 | { | 318 | { |
319 | Helper.SetCurrentDir(m_FullPath); | 319 | Helper.SetCurrentDir(m_FullPath); |
320 | 320 | ||
321 | if( node == null ) | 321 | if( node == null ) |
322 | { | 322 | { |
323 | throw new ArgumentNullException("node"); | 323 | throw new ArgumentNullException("node"); |
324 | } | 324 | } |
325 | 325 | ||
326 | foreach(XmlNode child in node.ChildNodes) | 326 | foreach(XmlNode child in node.ChildNodes) |
327 | { | 327 | { |
328 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 328 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
329 | if(dataNode is OptionsNode) | 329 | if(dataNode is OptionsNode) |
330 | { | 330 | { |
331 | m_Options = (OptionsNode)dataNode; | 331 | m_Options = (OptionsNode)dataNode; |
332 | } | 332 | } |
333 | else if(dataNode is FilesNode) | 333 | else if(dataNode is FilesNode) |
334 | { | 334 | { |
335 | m_Files = (FilesNode)dataNode; | 335 | m_Files = (FilesNode)dataNode; |
336 | } | 336 | } |
337 | else if(dataNode is ConfigurationNode) | 337 | else if(dataNode is ConfigurationNode) |
338 | { | 338 | { |
339 | ConfigurationNode configurationNode = (ConfigurationNode) dataNode; | 339 | ConfigurationNode configurationNode = (ConfigurationNode) dataNode; |
340 | m_Configurations[configurationNode.NameAndPlatform] = configurationNode; | 340 | m_Configurations[configurationNode.NameAndPlatform] = configurationNode; |
341 | 341 | ||
342 | // If the active configuration is null, then we populate it. | 342 | // If the active configuration is null, then we populate it. |
343 | if (ActiveConfig == null) | 343 | if (ActiveConfig == null) |
344 | { | 344 | { |
345 | ActiveConfig = configurationNode.Name; | 345 | ActiveConfig = configurationNode.Name; |
346 | } | 346 | } |
347 | } | 347 | } |
348 | else if(dataNode is ProjectNode) | 348 | else if(dataNode is ProjectNode) |
349 | { | 349 | { |
350 | m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; | 350 | m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; |
351 | m_ProjectsOrder.Add((ProjectNode)dataNode); | 351 | m_ProjectsOrder.Add((ProjectNode)dataNode); |
352 | } | 352 | } |
353 | else if(dataNode is SolutionNode) | 353 | else if(dataNode is SolutionNode) |
354 | { | 354 | { |
355 | m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; | 355 | m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; |
@@ -369,14 +369,14 @@ namespace Prebuild.Core.Nodes | |||
369 | throw new WarningException("There can only be one Cleanup node."); | 369 | throw new WarningException("There can only be one Cleanup node."); |
370 | m_Cleanup = (CleanupNode)dataNode; | 370 | m_Cleanup = (CleanupNode)dataNode; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | } | 373 | } |
374 | finally | 374 | finally |
375 | { | 375 | { |
376 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 376 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | #endregion | 380 | #endregion |
381 | } | 381 | } |
382 | } | 382 | } |
diff --git a/Prebuild/src/Core/Parse/IfContext.cs b/Prebuild/src/Core/Parse/IfContext.cs index 7729d3b..3c79d38 100644 --- a/Prebuild/src/Core/Parse/IfContext.cs +++ b/Prebuild/src/Core/Parse/IfContext.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -27,128 +27,128 @@ using System; | |||
27 | 27 | ||
28 | namespace Prebuild.Core.Parse | 28 | namespace Prebuild.Core.Parse |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// | 31 | /// |
32 | /// </summary> | 32 | /// </summary> |
33 | public enum IfState | 33 | public enum IfState |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | None, | 38 | None, |
39 | /// <summary> | 39 | /// <summary> |
40 | /// | 40 | /// |
41 | /// </summary> | 41 | /// </summary> |
42 | If, | 42 | If, |
43 | /// <summary> | 43 | /// <summary> |
44 | /// | 44 | /// |
45 | /// </summary> | 45 | /// </summary> |
46 | ElseIf, | 46 | ElseIf, |
47 | /// <summary> | 47 | /// <summary> |
48 | /// | 48 | /// |
49 | /// </summary> | 49 | /// </summary> |
50 | Else | 50 | Else |
51 | } | 51 | } |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Summary description for IfContext. | 54 | /// Summary description for IfContext. |
55 | /// </summary> | 55 | /// </summary> |
56 | // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/) | 56 | // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/) |
57 | public class IfContext | 57 | public class IfContext |
58 | { | 58 | { |
59 | #region Properties | 59 | #region Properties |
60 | 60 | ||
61 | bool m_Active; | 61 | bool m_Active; |
62 | bool m_Keep; | 62 | bool m_Keep; |
63 | bool m_EverKept; | 63 | bool m_EverKept; |
64 | IfState m_State = IfState.None; | 64 | IfState m_State = IfState.None; |
65 | 65 | ||
66 | #endregion | 66 | #endregion |
67 | 67 | ||
68 | #region Constructors | 68 | #region Constructors |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Initializes a new instance of the <see cref="IfContext"/> class. | 71 | /// Initializes a new instance of the <see cref="IfContext"/> class. |
72 | /// </summary> | 72 | /// </summary> |
73 | /// <param name="active">if set to <c>true</c> [active].</param> | 73 | /// <param name="active">if set to <c>true</c> [active].</param> |
74 | /// <param name="keep">if set to <c>true</c> [keep].</param> | 74 | /// <param name="keep">if set to <c>true</c> [keep].</param> |
75 | /// <param name="state">The state.</param> | 75 | /// <param name="state">The state.</param> |
76 | public IfContext(bool active, bool keep, IfState state) | 76 | public IfContext(bool active, bool keep, IfState state) |
77 | { | 77 | { |
78 | m_Active = active; | 78 | m_Active = active; |
79 | m_Keep = keep; | 79 | m_Keep = keep; |
80 | m_EverKept = keep; | 80 | m_EverKept = keep; |
81 | m_State = state; | 81 | m_State = state; |
82 | } | 82 | } |
83 | 83 | ||
84 | #endregion | 84 | #endregion |
85 | 85 | ||
86 | #region Properties | 86 | #region Properties |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active. | 89 | /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active. |
90 | /// </summary> | 90 | /// </summary> |
91 | /// <value><c>true</c> if active; otherwise, <c>false</c>.</value> | 91 | /// <value><c>true</c> if active; otherwise, <c>false</c>.</value> |
92 | public bool Active | 92 | public bool Active |
93 | { | 93 | { |
94 | get | 94 | get |
95 | { | 95 | { |
96 | return m_Active; | 96 | return m_Active; |
97 | } | 97 | } |
98 | set | 98 | set |
99 | { | 99 | { |
100 | m_Active = value; | 100 | m_Active = value; |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep. | 105 | /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep. |
106 | /// </summary> | 106 | /// </summary> |
107 | /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value> | 107 | /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value> |
108 | public bool Keep | 108 | public bool Keep |
109 | { | 109 | { |
110 | get | 110 | get |
111 | { | 111 | { |
112 | return m_Keep; | 112 | return m_Keep; |
113 | } | 113 | } |
114 | set | 114 | set |
115 | { | 115 | { |
116 | m_Keep = value; | 116 | m_Keep = value; |
117 | if(m_Keep) | 117 | if(m_Keep) |
118 | { | 118 | { |
119 | m_EverKept = true; | 119 | m_EverKept = true; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Gets a value indicating whether [ever kept]. | 125 | /// Gets a value indicating whether [ever kept]. |
126 | /// </summary> | 126 | /// </summary> |
127 | /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value> | 127 | /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value> |
128 | public bool EverKept | 128 | public bool EverKept |
129 | { | 129 | { |
130 | get | 130 | get |
131 | { | 131 | { |
132 | return m_EverKept; | 132 | return m_EverKept; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | /// <summary> | 136 | /// <summary> |
137 | /// Gets or sets the state. | 137 | /// Gets or sets the state. |
138 | /// </summary> | 138 | /// </summary> |
139 | /// <value>The state.</value> | 139 | /// <value>The state.</value> |
140 | public IfState State | 140 | public IfState State |
141 | { | 141 | { |
142 | get | 142 | get |
143 | { | 143 | { |
144 | return m_State; | 144 | return m_State; |
145 | } | 145 | } |
146 | set | 146 | set |
147 | { | 147 | { |
148 | m_State = value; | 148 | m_State = value; |
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | #endregion | 152 | #endregion |
153 | } | 153 | } |
154 | } | 154 | } |
diff --git a/Prebuild/src/Core/Parse/Preprocessor.cs b/Prebuild/src/Core/Parse/Preprocessor.cs index 0cd6e82..0648fad 100644 --- a/Prebuild/src/Core/Parse/Preprocessor.cs +++ b/Prebuild/src/Core/Parse/Preprocessor.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -31,336 +31,336 @@ using System.Xml; | |||
31 | 31 | ||
32 | namespace Prebuild.Core.Parse | 32 | namespace Prebuild.Core.Parse |
33 | { | 33 | { |
34 | /// <summary> | 34 | /// <summary> |
35 | /// | 35 | /// |
36 | /// </summary> | 36 | /// </summary> |
37 | public enum OperatorSymbol | 37 | public enum OperatorSymbol |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// | 40 | /// |
41 | /// </summary> | 41 | /// </summary> |
42 | None, | 42 | None, |
43 | /// <summary> | 43 | /// <summary> |
44 | /// | 44 | /// |
45 | /// </summary> | 45 | /// </summary> |
46 | Equal, | 46 | Equal, |
47 | /// <summary> | 47 | /// <summary> |
48 | /// | 48 | /// |
49 | /// </summary> | 49 | /// </summary> |
50 | NotEqual, | 50 | NotEqual, |
51 | /// <summary> | 51 | /// <summary> |
52 | /// | 52 | /// |
53 | /// </summary> | 53 | /// </summary> |
54 | LessThan, | 54 | LessThan, |
55 | /// <summary> | 55 | /// <summary> |
56 | /// | 56 | /// |
57 | /// </summary> | 57 | /// </summary> |
58 | GreaterThan, | 58 | GreaterThan, |
59 | /// <summary> | 59 | /// <summary> |
60 | /// | 60 | /// |
61 | /// </summary> | 61 | /// </summary> |
62 | LessThanEqual, | 62 | LessThanEqual, |
63 | /// <summary> | 63 | /// <summary> |
64 | /// | 64 | /// |
65 | /// </summary> | 65 | /// </summary> |
66 | GreaterThanEqual | 66 | GreaterThanEqual |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// | 70 | /// |
71 | /// </summary> | 71 | /// </summary> |
72 | public class Preprocessor | 72 | public class Preprocessor |
73 | { | 73 | { |
74 | #region Constants | 74 | #region Constants |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Includes the regex to look for file tags in the <?include | 77 | /// Includes the regex to look for file tags in the <?include |
78 | /// ?> processing instruction. | 78 | /// ?> processing instruction. |
79 | /// </summary> | 79 | /// </summary> |
80 | private static readonly Regex includeFileRegex = new Regex("file=\"(.+?)\""); | 80 | private static readonly Regex includeFileRegex = new Regex("file=\"(.+?)\""); |
81 | 81 | ||
82 | #endregion | 82 | #endregion |
83 | 83 | ||
84 | #region Fields | 84 | #region Fields |
85 | 85 | ||
86 | readonly XmlDocument m_OutDoc = new XmlDocument(); | 86 | readonly XmlDocument m_OutDoc = new XmlDocument(); |
87 | readonly Stack<IfContext> m_IfStack = new Stack<IfContext>(); | 87 | readonly Stack<IfContext> m_IfStack = new Stack<IfContext>(); |
88 | readonly Dictionary<string, object> m_Variables = new Dictionary<string, object>(); | 88 | readonly Dictionary<string, object> m_Variables = new Dictionary<string, object>(); |
89 | 89 | ||
90 | #endregion | 90 | #endregion |
91 | 91 | ||
92 | #region Constructors | 92 | #region Constructors |
93 | 93 | ||
94 | /// <summary> | 94 | /// <summary> |
95 | /// Initializes a new instance of the <see cref="Preprocessor"/> class. | 95 | /// Initializes a new instance of the <see cref="Preprocessor"/> class. |
96 | /// </summary> | 96 | /// </summary> |
97 | public Preprocessor() | 97 | public Preprocessor() |
98 | { | 98 | { |
99 | RegisterVariable("OS", GetOS()); | 99 | RegisterVariable("OS", GetOS()); |
100 | RegisterVariable("RuntimeVersion", Environment.Version.Major); | 100 | RegisterVariable("RuntimeVersion", Environment.Version.Major); |
101 | RegisterVariable("RuntimeMajor", Environment.Version.Major); | 101 | RegisterVariable("RuntimeMajor", Environment.Version.Major); |
102 | RegisterVariable("RuntimeMinor", Environment.Version.Minor); | 102 | RegisterVariable("RuntimeMinor", Environment.Version.Minor); |
103 | RegisterVariable("RuntimeRevision", Environment.Version.Revision); | 103 | RegisterVariable("RuntimeRevision", Environment.Version.Revision); |
104 | } | 104 | } |
105 | 105 | ||
106 | #endregion | 106 | #endregion |
107 | 107 | ||
108 | #region Properties | 108 | #region Properties |
109 | 109 | ||
110 | /// <summary> | 110 | /// <summary> |
111 | /// Gets the processed doc. | 111 | /// Gets the processed doc. |
112 | /// </summary> | 112 | /// </summary> |
113 | /// <value>The processed doc.</value> | 113 | /// <value>The processed doc.</value> |
114 | public XmlDocument ProcessedDoc | 114 | public XmlDocument ProcessedDoc |
115 | { | 115 | { |
116 | get | 116 | get |
117 | { | 117 | { |
118 | return m_OutDoc; | 118 | return m_OutDoc; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | #endregion | 122 | #endregion |
123 | 123 | ||
124 | #region Private Methods | 124 | #region Private Methods |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Parts of this code were taken from NAnt and is subject to the GPL | 127 | /// Parts of this code were taken from NAnt and is subject to the GPL |
128 | /// as per NAnt's license. Thanks to the NAnt guys for this little gem. | 128 | /// as per NAnt's license. Thanks to the NAnt guys for this little gem. |
129 | /// </summary> | 129 | /// </summary> |
130 | /// <returns></returns> | 130 | /// <returns></returns> |
131 | public static string GetOS() | 131 | public static string GetOS() |
132 | { | 132 | { |
133 | PlatformID platId = Environment.OSVersion.Platform; | 133 | PlatformID platId = Environment.OSVersion.Platform; |
134 | if(platId == PlatformID.Win32NT || platId == PlatformID.Win32Windows) | 134 | if(platId == PlatformID.Win32NT || platId == PlatformID.Win32Windows) |
135 | { | 135 | { |
136 | return "Win32"; | 136 | return "Win32"; |
137 | } | 137 | } |
138 | 138 | ||
139 | if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa")) | 139 | if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa")) |
140 | { | 140 | { |
141 | return "MACOSX"; | 141 | return "MACOSX"; |
142 | } | 142 | } |
143 | 143 | ||
144 | /* | 144 | /* |
145 | * .NET 1.x, under Mono, the UNIX code is 128. Under | 145 | * .NET 1.x, under Mono, the UNIX code is 128. Under |
146 | * .NET 2.x, Mono or MS, the UNIX code is 4 | 146 | * .NET 2.x, Mono or MS, the UNIX code is 4 |
147 | */ | 147 | */ |
148 | if(Environment.Version.Major == 1) | 148 | if(Environment.Version.Major == 1) |
149 | { | 149 | { |
150 | if((int)platId == 128) | 150 | if((int)platId == 128) |
151 | { | 151 | { |
152 | return "UNIX"; | 152 | return "UNIX"; |
153 | } | 153 | } |
154 | } | 154 | } |
155 | else if((int)platId == 4) | 155 | else if((int)platId == 4) |
156 | { | 156 | { |
157 | return "UNIX"; | 157 | return "UNIX"; |
158 | } | 158 | } |
159 | 159 | ||
160 | return "Unknown"; | 160 | return "Unknown"; |
161 | } | 161 | } |
162 | 162 | ||
163 | private static bool CompareNum(OperatorSymbol oper, int val1, int val2) | 163 | private static bool CompareNum(OperatorSymbol oper, int val1, int val2) |
164 | { | 164 | { |
165 | switch(oper) | 165 | switch(oper) |
166 | { | 166 | { |
167 | case OperatorSymbol.Equal: | 167 | case OperatorSymbol.Equal: |
168 | return (val1 == val2); | 168 | return (val1 == val2); |
169 | case OperatorSymbol.NotEqual: | 169 | case OperatorSymbol.NotEqual: |
170 | return (val1 != val2); | 170 | return (val1 != val2); |
171 | case OperatorSymbol.LessThan: | 171 | case OperatorSymbol.LessThan: |
172 | return (val1 < val2); | 172 | return (val1 < val2); |
173 | case OperatorSymbol.LessThanEqual: | 173 | case OperatorSymbol.LessThanEqual: |
174 | return (val1 <= val2); | 174 | return (val1 <= val2); |
175 | case OperatorSymbol.GreaterThan: | 175 | case OperatorSymbol.GreaterThan: |
176 | return (val1 > val2); | 176 | return (val1 > val2); |
177 | case OperatorSymbol.GreaterThanEqual: | 177 | case OperatorSymbol.GreaterThanEqual: |
178 | return (val1 >= val2); | 178 | return (val1 >= val2); |
179 | } | 179 | } |
180 | 180 | ||
181 | throw new WarningException("Unknown operator type"); | 181 | throw new WarningException("Unknown operator type"); |
182 | } | 182 | } |
183 | 183 | ||
184 | private static bool CompareStr(OperatorSymbol oper, string val1, string val2) | 184 | private static bool CompareStr(OperatorSymbol oper, string val1, string val2) |
185 | { | 185 | { |
186 | switch(oper) | 186 | switch(oper) |
187 | { | 187 | { |
188 | case OperatorSymbol.Equal: | 188 | case OperatorSymbol.Equal: |
189 | return (val1 == val2); | 189 | return (val1 == val2); |
190 | case OperatorSymbol.NotEqual: | 190 | case OperatorSymbol.NotEqual: |
191 | return (val1 != val2); | 191 | return (val1 != val2); |
192 | case OperatorSymbol.LessThan: | 192 | case OperatorSymbol.LessThan: |
193 | return (val1.CompareTo(val2) < 0); | 193 | return (val1.CompareTo(val2) < 0); |
194 | case OperatorSymbol.LessThanEqual: | 194 | case OperatorSymbol.LessThanEqual: |
195 | return (val1.CompareTo(val2) <= 0); | 195 | return (val1.CompareTo(val2) <= 0); |
196 | case OperatorSymbol.GreaterThan: | 196 | case OperatorSymbol.GreaterThan: |
197 | return (val1.CompareTo(val2) > 0); | 197 | return (val1.CompareTo(val2) > 0); |
198 | case OperatorSymbol.GreaterThanEqual: | 198 | case OperatorSymbol.GreaterThanEqual: |
199 | return (val1.CompareTo(val2) >= 0); | 199 | return (val1.CompareTo(val2) >= 0); |
200 | } | 200 | } |
201 | 201 | ||
202 | throw new WarningException("Unknown operator type"); | 202 | throw new WarningException("Unknown operator type"); |
203 | } | 203 | } |
204 | 204 | ||
205 | private static char NextChar(int idx, string str) | 205 | private static char NextChar(int idx, string str) |
206 | { | 206 | { |
207 | if((idx + 1) >= str.Length) | 207 | if((idx + 1) >= str.Length) |
208 | { | 208 | { |
209 | return Char.MaxValue; | 209 | return Char.MaxValue; |
210 | } | 210 | } |
211 | 211 | ||
212 | return str[idx + 1]; | 212 | return str[idx + 1]; |
213 | } | 213 | } |
214 | // Very very simple expression parser. Can only match expressions of the form | 214 | // Very very simple expression parser. Can only match expressions of the form |
215 | // <var> <op> <value>: | 215 | // <var> <op> <value>: |
216 | // OS = Windows | 216 | // OS = Windows |
217 | // OS != Linux | 217 | // OS != Linux |
218 | // RuntimeMinor > 0 | 218 | // RuntimeMinor > 0 |
219 | private bool ParseExpression(string exp) | 219 | private bool ParseExpression(string exp) |
220 | { | 220 | { |
221 | if(exp == null) | 221 | if(exp == null) |
222 | { | 222 | { |
223 | throw new ArgumentException("Invalid expression, cannot be null"); | 223 | throw new ArgumentException("Invalid expression, cannot be null"); |
224 | } | 224 | } |
225 | 225 | ||
226 | exp = exp.Trim(); | 226 | exp = exp.Trim(); |
227 | if(exp.Length < 1) | 227 | if(exp.Length < 1) |
228 | { | 228 | { |
229 | throw new ArgumentException("Invalid expression, cannot be 0 length"); | 229 | throw new ArgumentException("Invalid expression, cannot be 0 length"); |
230 | } | 230 | } |
231 | 231 | ||
232 | string id = ""; | 232 | string id = ""; |
233 | string str = ""; | 233 | string str = ""; |
234 | OperatorSymbol oper = OperatorSymbol.None; | 234 | OperatorSymbol oper = OperatorSymbol.None; |
235 | bool inStr = false; | 235 | bool inStr = false; |
236 | 236 | ||
237 | for(int i = 0; i < exp.Length; i++) | 237 | for(int i = 0; i < exp.Length; i++) |
238 | { | 238 | { |
239 | char c = exp[i]; | 239 | char c = exp[i]; |
240 | if(Char.IsWhiteSpace(c)) | 240 | if(Char.IsWhiteSpace(c)) |
241 | { | 241 | { |
242 | continue; | 242 | continue; |
243 | } | 243 | } |
244 | 244 | ||
245 | if(Char.IsLetterOrDigit(c) || c == '_') | 245 | if(Char.IsLetterOrDigit(c) || c == '_') |
246 | { | 246 | { |
247 | if(inStr) | 247 | if(inStr) |
248 | { | 248 | { |
249 | str += c; | 249 | str += c; |
250 | } | 250 | } |
251 | else | 251 | else |
252 | { | 252 | { |
253 | id += c; | 253 | id += c; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | else if(c == '\"') | 256 | else if(c == '\"') |
257 | { | 257 | { |
258 | inStr = !inStr; | 258 | inStr = !inStr; |
259 | if(inStr) | 259 | if(inStr) |
260 | { | 260 | { |
261 | str = ""; | 261 | str = ""; |
262 | } | 262 | } |
263 | } | 263 | } |
264 | else | 264 | else |
265 | { | 265 | { |
266 | if(inStr) | 266 | if(inStr) |
267 | { | 267 | { |
268 | str += c; | 268 | str += c; |
269 | } | 269 | } |
270 | else | 270 | else |
271 | { | 271 | { |
272 | switch(c) | 272 | switch(c) |
273 | { | 273 | { |
274 | case '=': | 274 | case '=': |
275 | oper = OperatorSymbol.Equal; | 275 | oper = OperatorSymbol.Equal; |
276 | break; | 276 | break; |
277 | 277 | ||
278 | case '!': | 278 | case '!': |
279 | if(NextChar(i, exp) == '=') | 279 | if(NextChar(i, exp) == '=') |
280 | { | 280 | { |
281 | oper = OperatorSymbol.NotEqual; | 281 | oper = OperatorSymbol.NotEqual; |
282 | } | 282 | } |
283 | 283 | ||
284 | break; | 284 | break; |
285 | 285 | ||
286 | case '<': | 286 | case '<': |
287 | if(NextChar(i, exp) == '=') | 287 | if(NextChar(i, exp) == '=') |
288 | { | 288 | { |
289 | oper = OperatorSymbol.LessThanEqual; | 289 | oper = OperatorSymbol.LessThanEqual; |
290 | } | 290 | } |
291 | else | 291 | else |
292 | { | 292 | { |
293 | oper = OperatorSymbol.LessThan; | 293 | oper = OperatorSymbol.LessThan; |
294 | } | 294 | } |
295 | 295 | ||
296 | break; | 296 | break; |
297 | 297 | ||
298 | case '>': | 298 | case '>': |
299 | if(NextChar(i, exp) == '=') | 299 | if(NextChar(i, exp) == '=') |
300 | { | 300 | { |
301 | oper = OperatorSymbol.GreaterThanEqual; | 301 | oper = OperatorSymbol.GreaterThanEqual; |
302 | } | 302 | } |
303 | else | 303 | else |
304 | { | 304 | { |
305 | oper = OperatorSymbol.GreaterThan; | 305 | oper = OperatorSymbol.GreaterThan; |
306 | } | 306 | } |
307 | 307 | ||
308 | break; | 308 | break; |
309 | } | 309 | } |
310 | } | 310 | } |
311 | } | 311 | } |
312 | } | 312 | } |
313 | 313 | ||
314 | 314 | ||
315 | if(inStr) | 315 | if(inStr) |
316 | { | 316 | { |
317 | throw new WarningException("Expected end of string in expression"); | 317 | throw new WarningException("Expected end of string in expression"); |
318 | } | 318 | } |
319 | 319 | ||
320 | if(oper == OperatorSymbol.None) | 320 | if(oper == OperatorSymbol.None) |
321 | { | 321 | { |
322 | throw new WarningException("Expected operator in expression"); | 322 | throw new WarningException("Expected operator in expression"); |
323 | } | 323 | } |
324 | if(id.Length < 1) | 324 | if(id.Length < 1) |
325 | { | 325 | { |
326 | throw new WarningException("Expected identifier in expression"); | 326 | throw new WarningException("Expected identifier in expression"); |
327 | } | 327 | } |
328 | if(str.Length < 1) | 328 | if(str.Length < 1) |
329 | { | 329 | { |
330 | throw new WarningException("Expected value in expression"); | 330 | throw new WarningException("Expected value in expression"); |
331 | } | 331 | } |
332 | 332 | ||
333 | bool ret; | 333 | bool ret; |
334 | try | 334 | try |
335 | { | 335 | { |
336 | object val = m_Variables[id.ToLower()]; | 336 | object val = m_Variables[id.ToLower()]; |
337 | if(val == null) | 337 | if(val == null) |
338 | { | 338 | { |
339 | throw new WarningException("Unknown identifier '{0}'", id); | 339 | throw new WarningException("Unknown identifier '{0}'", id); |
340 | } | 340 | } |
341 | 341 | ||
342 | Type t = val.GetType(); | 342 | Type t = val.GetType(); |
343 | if(t.IsAssignableFrom(typeof(int))) | 343 | if(t.IsAssignableFrom(typeof(int))) |
344 | { | 344 | { |
345 | int numVal = (int)val; | 345 | int numVal = (int)val; |
346 | int numVal2 = Int32.Parse(str); | 346 | int numVal2 = Int32.Parse(str); |
347 | ret = CompareNum(oper, numVal, numVal2); | 347 | ret = CompareNum(oper, numVal, numVal2); |
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | string strVal = val.ToString(); | 351 | string strVal = val.ToString(); |
352 | string strVal2 = str; | 352 | string strVal2 = str; |
353 | ret = CompareStr(oper, strVal, strVal2); | 353 | ret = CompareStr(oper, strVal, strVal2); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | catch(ArgumentException ex) | 356 | catch(ArgumentException ex) |
357 | { | 357 | { |
358 | ex.ToString(); | 358 | ex.ToString(); |
359 | throw new WarningException("Invalid value type for system variable '{0}', expected int", id); | 359 | throw new WarningException("Invalid value type for system variable '{0}', expected int", id); |
360 | } | 360 | } |
361 | 361 | ||
362 | return ret; | 362 | return ret; |
363 | } | 363 | } |
364 | 364 | ||
365 | /// <summary> | 365 | /// <summary> |
366 | /// Taken from current Prebuild included in OpenSim 0.7.x | 366 | /// Taken from current Prebuild included in OpenSim 0.7.x |
@@ -376,13 +376,13 @@ namespace Prebuild.Core.Parse | |||
376 | if (!include.Contains ("*")) { | 376 | if (!include.Contains ("*")) { |
377 | return; | 377 | return; |
378 | } | 378 | } |
379 | 379 | ||
380 | // Console.WriteLine("Processing {0}", include); | 380 | // Console.WriteLine("Processing {0}", include); |
381 | 381 | ||
382 | // Break up the include into pre and post wildcard sections | 382 | // Break up the include into pre and post wildcard sections |
383 | string preWildcard = include.Substring (0, include.IndexOf ("*")); | 383 | string preWildcard = include.Substring (0, include.IndexOf ("*")); |
384 | string postWildcard = include.Substring (include.IndexOf ("*") + 2); | 384 | string postWildcard = include.Substring (include.IndexOf ("*") + 2); |
385 | 385 | ||
386 | // If preWildcard is a directory, recurse | 386 | // If preWildcard is a directory, recurse |
387 | if (Directory.Exists (preWildcard)) { | 387 | if (Directory.Exists (preWildcard)) { |
388 | string[] directories = Directory.GetDirectories (preWildcard); | 388 | string[] directories = Directory.GetDirectories (preWildcard); |
@@ -390,7 +390,7 @@ namespace Prebuild.Core.Parse | |||
390 | Array.Reverse (directories); | 390 | Array.Reverse (directories); |
391 | foreach (string dirPath in directories) { | 391 | foreach (string dirPath in directories) { |
392 | //Console.WriteLine ("Scanning : {0}", dirPath); | 392 | //Console.WriteLine ("Scanning : {0}", dirPath); |
393 | 393 | ||
394 | string includeFile = Path.Combine (dirPath, postWildcard); | 394 | string includeFile = Path.Combine (dirPath, postWildcard); |
395 | if (includeFile.Contains ("*")) { | 395 | if (includeFile.Contains ("*")) { |
396 | // postWildcard included another wildcard, recurse. | 396 | // postWildcard included another wildcard, recurse. |
@@ -408,10 +408,10 @@ namespace Prebuild.Core.Parse | |||
408 | // preWildcard is not a path to a directory, so the wildcard is in the filename | 408 | // preWildcard is not a path to a directory, so the wildcard is in the filename |
409 | string searchFilename = Path.GetFileName (preWildcard.Substring (preWildcard.IndexOf ("/") + 1) + "*" + postWildcard); | 409 | string searchFilename = Path.GetFileName (preWildcard.Substring (preWildcard.IndexOf ("/") + 1) + "*" + postWildcard); |
410 | Console.WriteLine ("searchFilename: {0}", searchFilename); | 410 | Console.WriteLine ("searchFilename: {0}", searchFilename); |
411 | 411 | ||
412 | string searchDirectory = Path.GetDirectoryName (preWildcard); | 412 | string searchDirectory = Path.GetDirectoryName (preWildcard); |
413 | Console.WriteLine ("searchDirectory: {0}", searchDirectory); | 413 | Console.WriteLine ("searchDirectory: {0}", searchDirectory); |
414 | 414 | ||
415 | string[] files = Directory.GetFiles (searchDirectory, searchFilename); | 415 | string[] files = Directory.GetFiles (searchDirectory, searchFilename); |
416 | Array.Sort (files); | 416 | Array.Sort (files); |
417 | Array.Reverse (files); | 417 | Array.Reverse (files); |
@@ -426,227 +426,227 @@ namespace Prebuild.Core.Parse | |||
426 | } | 426 | } |
427 | } | 427 | } |
428 | 428 | ||
429 | #endregion | 429 | #endregion |
430 | 430 | ||
431 | #region Public Methods | 431 | #region Public Methods |
432 | 432 | ||
433 | /// <summary> | 433 | /// <summary> |
434 | /// | 434 | /// |
435 | /// </summary> | 435 | /// </summary> |
436 | /// <param name="name"></param> | 436 | /// <param name="name"></param> |
437 | /// <param name="variableValue"></param> | 437 | /// <param name="variableValue"></param> |
438 | public void RegisterVariable(string name, object variableValue) | 438 | public void RegisterVariable(string name, object variableValue) |
439 | { | 439 | { |
440 | if(name == null || variableValue == null) | 440 | if(name == null || variableValue == null) |
441 | { | 441 | { |
442 | return; | 442 | return; |
443 | } | 443 | } |
444 | 444 | ||
445 | m_Variables[name.ToLower()] = variableValue; | 445 | m_Variables[name.ToLower()] = variableValue; |
446 | } | 446 | } |
447 | 447 | ||
448 | /// <summary> | 448 | /// <summary> |
449 | /// Performs validation on the xml source as well as evaluates conditional and flow expresions | 449 | /// Performs validation on the xml source as well as evaluates conditional and flow expresions |
450 | /// </summary> | 450 | /// </summary> |
451 | /// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception> | 451 | /// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception> |
452 | /// <param name="initialReader"></param> | 452 | /// <param name="initialReader"></param> |
453 | /// <returns>the output xml </returns> | 453 | /// <returns>the output xml </returns> |
454 | public string Process(XmlReader initialReader) | 454 | public string Process(XmlReader initialReader) |
455 | { | 455 | { |
456 | if(initialReader == null) | 456 | if(initialReader == null) |
457 | { | 457 | { |
458 | throw new ArgumentException("Invalid XML reader to pre-process"); | 458 | throw new ArgumentException("Invalid XML reader to pre-process"); |
459 | } | 459 | } |
460 | 460 | ||
461 | IfContext context = new IfContext(true, true, IfState.None); | 461 | IfContext context = new IfContext(true, true, IfState.None); |
462 | StringWriter xmlText = new StringWriter(); | 462 | StringWriter xmlText = new StringWriter(); |
463 | XmlTextWriter writer = new XmlTextWriter(xmlText); | 463 | XmlTextWriter writer = new XmlTextWriter(xmlText); |
464 | writer.Formatting = Formatting.Indented; | 464 | writer.Formatting = Formatting.Indented; |
465 | 465 | ||
466 | // Create a queue of XML readers and add the initial | 466 | // Create a queue of XML readers and add the initial |
467 | // reader to it. Then we process until we run out of | 467 | // reader to it. Then we process until we run out of |
468 | // readers which lets the <?include?> operation add more | 468 | // readers which lets the <?include?> operation add more |
469 | // readers to generate a multi-file parser and not require | 469 | // readers to generate a multi-file parser and not require |
470 | // XML fragments that a recursive version would use. | 470 | // XML fragments that a recursive version would use. |
471 | Stack<XmlReader> readerStack = new Stack<XmlReader>(); | 471 | Stack<XmlReader> readerStack = new Stack<XmlReader>(); |
472 | readerStack.Push(initialReader); | 472 | readerStack.Push(initialReader); |
473 | 473 | ||
474 | while(readerStack.Count > 0) | 474 | while(readerStack.Count > 0) |
475 | { | 475 | { |
476 | // Pop off the next reader. | 476 | // Pop off the next reader. |
477 | XmlReader reader = readerStack.Pop(); | 477 | XmlReader reader = readerStack.Pop(); |
478 | 478 | ||
479 | // Process through this XML reader until it is | 479 | // Process through this XML reader until it is |
480 | // completed (or it is replaced by the include | 480 | // completed (or it is replaced by the include |
481 | // operation). | 481 | // operation). |
482 | while(reader.Read()) | 482 | while(reader.Read()) |
483 | { | 483 | { |
484 | // The prebuild file has a series of processing | 484 | // The prebuild file has a series of processing |
485 | // instructions which allow for specific | 485 | // instructions which allow for specific |
486 | // inclusions based on operating system or to | 486 | // inclusions based on operating system or to |
487 | // include additional files. | 487 | // include additional files. |
488 | if(reader.NodeType == XmlNodeType.ProcessingInstruction) | 488 | if(reader.NodeType == XmlNodeType.ProcessingInstruction) |
489 | { | 489 | { |
490 | bool ignore = false; | 490 | bool ignore = false; |
491 | 491 | ||
492 | switch(reader.LocalName) | 492 | switch(reader.LocalName) |
493 | { | 493 | { |
494 | case "include": | 494 | case "include": |
495 | // use regular expressions to parse out the attributes. | 495 | // use regular expressions to parse out the attributes. |
496 | MatchCollection matches = includeFileRegex.Matches(reader.Value); | 496 | MatchCollection matches = includeFileRegex.Matches(reader.Value); |
497 | 497 | ||
498 | // make sure there is only one file attribute. | 498 | // make sure there is only one file attribute. |
499 | if(matches.Count > 1) | 499 | if(matches.Count > 1) |
500 | { | 500 | { |
501 | throw new WarningException("An <?include ?> node was found, but it specified more than one file."); | 501 | throw new WarningException("An <?include ?> node was found, but it specified more than one file."); |
502 | } | 502 | } |
503 | 503 | ||
504 | if(matches.Count == 0) | 504 | if(matches.Count == 0) |
505 | { | 505 | { |
506 | throw new WarningException("An <?include ?> node was found, but it did not specify the file attribute."); | 506 | throw new WarningException("An <?include ?> node was found, but it did not specify the file attribute."); |
507 | } | 507 | } |
508 | 508 | ||
509 | // ***** Adding for wildcard handling | 509 | // ***** Adding for wildcard handling |
510 | // Push current reader back onto the stack. | 510 | // Push current reader back onto the stack. |
511 | readerStack.Push (reader); | 511 | readerStack.Push (reader); |
512 | 512 | ||
513 | // Pull the file out from the regex and make sure it is a valid file before using it. | 513 | // Pull the file out from the regex and make sure it is a valid file before using it. |
514 | string filename = matches[0].Groups[1].Value; | 514 | string filename = matches[0].Groups[1].Value; |
515 | 515 | ||
516 | filename = String.Join (Path.DirectorySeparatorChar.ToString (), filename.Split (new char[] { '/', '\\' })); | 516 | filename = String.Join (Path.DirectorySeparatorChar.ToString (), filename.Split (new char[] { '/', '\\' })); |
517 | 517 | ||
518 | if (!filename.Contains ("*")) { | 518 | if (!filename.Contains ("*")) { |
519 | 519 | ||
520 | FileInfo includeFile = new FileInfo (filename); | 520 | FileInfo includeFile = new FileInfo (filename); |
521 | if (!includeFile.Exists) { | 521 | if (!includeFile.Exists) { |
522 | throw new WarningException ("Cannot include file: " + includeFile.FullName); | 522 | throw new WarningException ("Cannot include file: " + includeFile.FullName); |
523 | } | 523 | } |
524 | 524 | ||
525 | // Create a new reader object for this file. Then put the old reader back on the stack and start | 525 | // Create a new reader object for this file. Then put the old reader back on the stack and start |
526 | // processing using this new XML reader. | 526 | // processing using this new XML reader. |
527 | 527 | ||
528 | XmlReader newReader = new XmlTextReader (includeFile.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); | 528 | XmlReader newReader = new XmlTextReader (includeFile.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); |
529 | reader = newReader; | 529 | reader = newReader; |
530 | readerStack.Push (reader); | 530 | readerStack.Push (reader); |
531 | 531 | ||
532 | } else { | 532 | } else { |
533 | WildCardInclude (readerStack, filename); | 533 | WildCardInclude (readerStack, filename); |
534 | } | 534 | } |
535 | 535 | ||
536 | reader = (XmlReader)readerStack.Pop (); | 536 | reader = (XmlReader)readerStack.Pop (); |
537 | ignore = true; | 537 | ignore = true; |
538 | break; | 538 | break; |
539 | 539 | ||
540 | case "if": | 540 | case "if": |
541 | m_IfStack.Push(context); | 541 | m_IfStack.Push(context); |
542 | context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If); | 542 | context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If); |
543 | ignore = true; | 543 | ignore = true; |
544 | break; | 544 | break; |
545 | 545 | ||
546 | case "elseif": | 546 | case "elseif": |
547 | if(m_IfStack.Count == 0) | 547 | if(m_IfStack.Count == 0) |
548 | { | 548 | { |
549 | throw new WarningException("Unexpected 'elseif' outside of 'if'"); | 549 | throw new WarningException("Unexpected 'elseif' outside of 'if'"); |
550 | } | 550 | } |
551 | if(context.State != IfState.If && context.State != IfState.ElseIf) | 551 | if(context.State != IfState.If && context.State != IfState.ElseIf) |
552 | { | 552 | { |
553 | throw new WarningException("Unexpected 'elseif' outside of 'if'"); | 553 | throw new WarningException("Unexpected 'elseif' outside of 'if'"); |
554 | } | 554 | } |
555 | 555 | ||
556 | context.State = IfState.ElseIf; | 556 | context.State = IfState.ElseIf; |
557 | if(!context.EverKept) | 557 | if(!context.EverKept) |
558 | { | 558 | { |
559 | context.Keep = ParseExpression(reader.Value); | 559 | context.Keep = ParseExpression(reader.Value); |
560 | } | 560 | } |
561 | else | 561 | else |
562 | { | 562 | { |
563 | context.Keep = false; | 563 | context.Keep = false; |
564 | } | 564 | } |
565 | 565 | ||
566 | ignore = true; | 566 | ignore = true; |
567 | break; | 567 | break; |
568 | 568 | ||
569 | case "else": | 569 | case "else": |
570 | if(m_IfStack.Count == 0) | 570 | if(m_IfStack.Count == 0) |
571 | { | 571 | { |
572 | throw new WarningException("Unexpected 'else' outside of 'if'"); | 572 | throw new WarningException("Unexpected 'else' outside of 'if'"); |
573 | } | 573 | } |
574 | if(context.State != IfState.If && context.State != IfState.ElseIf) | 574 | if(context.State != IfState.If && context.State != IfState.ElseIf) |
575 | { | 575 | { |
576 | throw new WarningException("Unexpected 'else' outside of 'if'"); | 576 | throw new WarningException("Unexpected 'else' outside of 'if'"); |
577 | } | 577 | } |
578 | 578 | ||
579 | context.State = IfState.Else; | 579 | context.State = IfState.Else; |
580 | context.Keep = !context.EverKept; | 580 | context.Keep = !context.EverKept; |
581 | ignore = true; | 581 | ignore = true; |
582 | break; | 582 | break; |
583 | 583 | ||
584 | case "endif": | 584 | case "endif": |
585 | if(m_IfStack.Count == 0) | 585 | if(m_IfStack.Count == 0) |
586 | { | 586 | { |
587 | throw new WarningException("Unexpected 'endif' outside of 'if'"); | 587 | throw new WarningException("Unexpected 'endif' outside of 'if'"); |
588 | } | 588 | } |
589 | 589 | ||
590 | context = m_IfStack.Pop(); | 590 | context = m_IfStack.Pop(); |
591 | ignore = true; | 591 | ignore = true; |
592 | break; | 592 | break; |
593 | } | 593 | } |
594 | 594 | ||
595 | if(ignore) | 595 | if(ignore) |
596 | { | 596 | { |
597 | continue; | 597 | continue; |
598 | } | 598 | } |
599 | }//end pre-proc instruction | 599 | }//end pre-proc instruction |
600 | 600 | ||
601 | if(!context.Active || !context.Keep) | 601 | if(!context.Active || !context.Keep) |
602 | { | 602 | { |
603 | continue; | 603 | continue; |
604 | } | 604 | } |
605 | 605 | ||
606 | switch(reader.NodeType) | 606 | switch(reader.NodeType) |
607 | { | 607 | { |
608 | case XmlNodeType.Element: | 608 | case XmlNodeType.Element: |
609 | bool empty = reader.IsEmptyElement; | 609 | bool empty = reader.IsEmptyElement; |
610 | writer.WriteStartElement(reader.Name); | 610 | writer.WriteStartElement(reader.Name); |
611 | 611 | ||
612 | while (reader.MoveToNextAttribute()) | 612 | while (reader.MoveToNextAttribute()) |
613 | { | 613 | { |
614 | writer.WriteAttributeString(reader.Name, reader.Value); | 614 | writer.WriteAttributeString(reader.Name, reader.Value); |
615 | } | 615 | } |
616 | 616 | ||
617 | if(empty) | 617 | if(empty) |
618 | { | 618 | { |
619 | writer.WriteEndElement(); | 619 | writer.WriteEndElement(); |
620 | } | 620 | } |
621 | 621 | ||
622 | break; | 622 | break; |
623 | 623 | ||
624 | case XmlNodeType.EndElement: | 624 | case XmlNodeType.EndElement: |
625 | writer.WriteEndElement(); | 625 | writer.WriteEndElement(); |
626 | break; | 626 | break; |
627 | 627 | ||
628 | case XmlNodeType.Text: | 628 | case XmlNodeType.Text: |
629 | writer.WriteString(reader.Value); | 629 | writer.WriteString(reader.Value); |
630 | break; | 630 | break; |
631 | 631 | ||
632 | case XmlNodeType.CDATA: | 632 | case XmlNodeType.CDATA: |
633 | writer.WriteCData(reader.Value); | 633 | writer.WriteCData(reader.Value); |
634 | break; | 634 | break; |
635 | 635 | ||
636 | default: | 636 | default: |
637 | break; | 637 | break; |
638 | } | 638 | } |
639 | } | 639 | } |
640 | 640 | ||
641 | if(m_IfStack.Count != 0) | 641 | if(m_IfStack.Count != 0) |
642 | { | 642 | { |
643 | throw new WarningException("Mismatched 'if', 'endif' pair"); | 643 | throw new WarningException("Mismatched 'if', 'endif' pair"); |
644 | } | 644 | } |
645 | } | 645 | } |
646 | 646 | ||
647 | return xmlText.ToString(); | 647 | return xmlText.ToString(); |
648 | } | 648 | } |
649 | 649 | ||
650 | #endregion | 650 | #endregion |
651 | } | 651 | } |
652 | } | 652 | } |
diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs index c52c4f1..485e4dd 100644 --- a/Prebuild/src/Core/Targets/AutotoolsTarget.cs +++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs | |||
@@ -51,10 +51,10 @@ POSSIBILITY OF SUCH DAMAGE. | |||
51 | distribute, sublicense, and/or sell copies of the Software, and to | 51 | distribute, sublicense, and/or sell copies of the Software, and to |
52 | permit persons to whom the Software is furnished to do so, subject to | 52 | permit persons to whom the Software is furnished to do so, subject to |
53 | the following conditions: | 53 | the following conditions: |
54 | 54 | ||
55 | The above copyright notice and this permission notice shall be | 55 | The above copyright notice and this permission notice shall be |
56 | included in all copies or substantial portions of the Software. | 56 | included in all copies or substantial portions of the Software. |
57 | 57 | ||
58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
59 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | 59 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
60 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 60 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
@@ -156,7 +156,7 @@ namespace Prebuild.Core.Targets | |||
156 | 156 | ||
157 | 157 | ||
158 | /// <summary> | 158 | /// <summary> |
159 | /// | 159 | /// |
160 | /// </summary> | 160 | /// </summary> |
161 | [Target("autotools")] | 161 | [Target("autotools")] |
162 | public class AutotoolsTarget : ITarget | 162 | public class AutotoolsTarget : ITarget |
@@ -650,7 +650,7 @@ namespace Prebuild.Core.Targets | |||
650 | string tempAssemblyFile = Path.Combine(Path.GetTempPath(), project.Name + "-temp.dll"); | 650 | string tempAssemblyFile = Path.Combine(Path.GetTempPath(), project.Name + "-temp.dll"); |
651 | System.CodeDom.Compiler.CompilerParameters cparam = | 651 | System.CodeDom.Compiler.CompilerParameters cparam = |
652 | new System.CodeDom.Compiler.CompilerParameters(args, tempAssemblyFile); | 652 | new System.CodeDom.Compiler.CompilerParameters(args, tempAssemblyFile); |
653 | 653 | ||
654 | System.CodeDom.Compiler.CompilerResults cr = | 654 | System.CodeDom.Compiler.CompilerResults cr = |
655 | cscp.CompileAssemblyFromFile(cparam, sources); | 655 | cscp.CompileAssemblyFromFile(cparam, sources); |
656 | 656 | ||
@@ -673,11 +673,11 @@ namespace Prebuild.Core.Targets | |||
673 | if (File.Exists(tempAssemblyFile)) | 673 | if (File.Exists(tempAssemblyFile)) |
674 | File.Delete(tempAssemblyFile); | 674 | File.Delete(tempAssemblyFile); |
675 | } | 675 | } |
676 | catch | 676 | catch |
677 | { | 677 | { |
678 | Console.WriteLine("Error! '{0}'", e); | 678 | Console.WriteLine("Error! '{0}'", e); |
679 | } | 679 | } |
680 | 680 | ||
681 | } | 681 | } |
682 | 682 | ||
683 | // Tell the user if there's a problem copying the file | 683 | // Tell the user if there's a problem copying the file |
@@ -977,7 +977,7 @@ namespace Prebuild.Core.Targets | |||
977 | 977 | ||
978 | if(autotoolsStream == null) { | 978 | if(autotoolsStream == null) { |
979 | 979 | ||
980 | /* | 980 | /* |
981 | * try without the default namespace prepended, in | 981 | * try without the default namespace prepended, in |
982 | * case prebuild.exe assembly was compiled with | 982 | * case prebuild.exe assembly was compiled with |
983 | * something other than Visual Studio .NET | 983 | * something other than Visual Studio .NET |
diff --git a/Prebuild/src/Core/Targets/DebugTarget.cs b/Prebuild/src/Core/Targets/DebugTarget.cs index be8aea9..d78064f 100644 --- a/Prebuild/src/Core/Targets/DebugTarget.cs +++ b/Prebuild/src/Core/Targets/DebugTarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -41,62 +41,62 @@ using Prebuild.Core.Nodes; | |||
41 | #if (DEBUG && _DEBUG_TARGET) | 41 | #if (DEBUG && _DEBUG_TARGET) |
42 | namespace Prebuild.Core.Targets | 42 | namespace Prebuild.Core.Targets |
43 | { | 43 | { |
44 | [Target("debug")] | 44 | [Target("debug")] |
45 | public class DebugTarget : ITarget | 45 | public class DebugTarget : ITarget |
46 | { | 46 | { |
47 | #region Fields | 47 | #region Fields |
48 | 48 | ||
49 | private Kernel m_Kernel = null; | 49 | private Kernel m_Kernel = null; |
50 | 50 | ||
51 | #endregion | 51 | #endregion |
52 | 52 | ||
53 | #region ITarget Members | 53 | #region ITarget Members |
54 | 54 | ||
55 | public void Write() | 55 | public void Write() |
56 | { | 56 | { |
57 | foreach(SolutionNode s in m_Kernel.Solutions) | 57 | foreach(SolutionNode s in m_Kernel.Solutions) |
58 | { | 58 | { |
59 | Console.WriteLine("Solution [ {0}, {1} ]", s.Name, s.Path); | 59 | Console.WriteLine("Solution [ {0}, {1} ]", s.Name, s.Path); |
60 | foreach(string file in s.Files) | 60 | foreach(string file in s.Files) |
61 | { | 61 | { |
62 | Console.WriteLine("\tFile [ {0} ]", file); | 62 | Console.WriteLine("\tFile [ {0} ]", file); |
63 | } | 63 | } |
64 | 64 | ||
65 | foreach(ProjectNode proj in s.Projects) | 65 | foreach(ProjectNode proj in s.Projects) |
66 | { | 66 | { |
67 | Console.WriteLine("\tProject [ {0}, {1}. {2} ]", proj.Name, proj.Path, proj.Language); | 67 | Console.WriteLine("\tProject [ {0}, {1}. {2} ]", proj.Name, proj.Path, proj.Language); |
68 | foreach(string file in proj.Files) | 68 | foreach(string file in proj.Files) |
69 | Console.WriteLine("\t\tFile [ {0} ]", file); | 69 | Console.WriteLine("\t\tFile [ {0} ]", file); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | public void Clean() | 74 | public void Clean() |
75 | { | 75 | { |
76 | Console.WriteLine("Not implemented"); | 76 | Console.WriteLine("Not implemented"); |
77 | } | 77 | } |
78 | 78 | ||
79 | public string Name | 79 | public string Name |
80 | { | 80 | { |
81 | get | 81 | get |
82 | { | 82 | { |
83 | return "debug"; | 83 | return "debug"; |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | public Kernel Kernel | 87 | public Kernel Kernel |
88 | { | 88 | { |
89 | get | 89 | get |
90 | { | 90 | { |
91 | return m_Kernel; | 91 | return m_Kernel; |
92 | } | 92 | } |
93 | set | 93 | set |
94 | { | 94 | { |
95 | m_Kernel = value; | 95 | m_Kernel = value; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | #endregion | 99 | #endregion |
100 | } | 100 | } |
101 | } | 101 | } |
102 | #endif | 102 | #endif |
diff --git a/Prebuild/src/Core/Targets/MakefileTarget.cs b/Prebuild/src/Core/Targets/MakefileTarget.cs index 8fe1c44..54046dd 100644 --- a/Prebuild/src/Core/Targets/MakefileTarget.cs +++ b/Prebuild/src/Core/Targets/MakefileTarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004 Crestez Leonard (cleonard@go.ro) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
diff --git a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs index 85fe2db..ea6d2c2 100644 --- a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs +++ b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -35,481 +35,481 @@ using Prebuild.Core.Utilities; | |||
35 | 35 | ||
36 | namespace Prebuild.Core.Targets | 36 | namespace Prebuild.Core.Targets |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | [Target("monodev")] | 41 | [Target("monodev")] |
42 | public class MonoDevelopTarget : ITarget | 42 | public class MonoDevelopTarget : ITarget |
43 | { | 43 | { |
44 | #region Fields | 44 | #region Fields |
45 | 45 | ||
46 | private Kernel m_Kernel; | 46 | private Kernel m_Kernel; |
47 | 47 | ||
48 | #endregion | 48 | #endregion |
49 | 49 | ||
50 | #region Private Methods | 50 | #region Private Methods |
51 | 51 | ||
52 | private static string PrependPath(string path) | 52 | private static string PrependPath(string path) |
53 | { | 53 | { |
54 | string tmpPath = Helper.NormalizePath(path, '/'); | 54 | string tmpPath = Helper.NormalizePath(path, '/'); |
55 | Regex regex = new Regex(@"(\w):/(\w+)"); | 55 | Regex regex = new Regex(@"(\w):/(\w+)"); |
56 | Match match = regex.Match(tmpPath); | 56 | Match match = regex.Match(tmpPath); |
57 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') | 57 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') |
58 | { | 58 | { |
59 | tmpPath = Helper.NormalizePath(tmpPath); | 59 | tmpPath = Helper.NormalizePath(tmpPath); |
60 | } | 60 | } |
61 | else | 61 | else |
62 | { | 62 | { |
63 | tmpPath = Helper.NormalizePath("./" + tmpPath); | 63 | tmpPath = Helper.NormalizePath("./" + tmpPath); |
64 | } | 64 | } |
65 | 65 | ||
66 | return tmpPath; | 66 | return tmpPath; |
67 | } | 67 | } |
68 | 68 | ||
69 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) | 69 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) |
70 | { | 70 | { |
71 | string ret = "<ProjectReference type=\""; | 71 | string ret = "<ProjectReference type=\""; |
72 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 72 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
73 | { | 73 | { |
74 | ret += "Project\""; | 74 | ret += "Project\""; |
75 | ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\" refto=\"" + refr.Name + "\" />"; | 75 | ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\" refto=\"" + refr.Name + "\" />"; |
76 | } | 76 | } |
77 | else | 77 | else |
78 | { | 78 | { |
79 | ProjectNode project = (ProjectNode)refr.Parent; | 79 | ProjectNode project = (ProjectNode)refr.Parent; |
80 | string fileRef = FindFileReference(refr.Name, project); | 80 | string fileRef = FindFileReference(refr.Name, project); |
81 | 81 | ||
82 | if(refr.Path != null || fileRef != null) | 82 | if(refr.Path != null || fileRef != null) |
83 | { | 83 | { |
84 | ret += "Assembly\" refto=\""; | 84 | ret += "Assembly\" refto=\""; |
85 | 85 | ||
86 | string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; | 86 | string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; |
87 | 87 | ||
88 | ret += finalPath; | 88 | ret += finalPath; |
89 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; | 89 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; |
90 | return ret; | 90 | return ret; |
91 | } | 91 | } |
92 | 92 | ||
93 | ret += "Gac\""; | 93 | ret += "Gac\""; |
94 | ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\""; | 94 | ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\""; |
95 | ret += " refto=\""; | 95 | ret += " refto=\""; |
96 | try | 96 | try |
97 | { | 97 | { |
98 | /* | 98 | /* |
99 | Day changed to 28 Mar 2007 | 99 | Day changed to 28 Mar 2007 |
100 | ... | 100 | ... |
101 | 08:09 < cj> is there anything that replaces Assembly.LoadFromPartialName() ? | 101 | 08:09 < cj> is there anything that replaces Assembly.LoadFromPartialName() ? |
102 | 08:09 < jonp> no | 102 | 08:09 < jonp> no |
103 | 08:10 < jonp> in their infinite wisdom [sic], microsoft decided that the | 103 | 08:10 < jonp> in their infinite wisdom [sic], microsoft decided that the |
104 | ability to load any assembly version by-name was an inherently | 104 | ability to load any assembly version by-name was an inherently |
105 | bad idea | 105 | bad idea |
106 | 08:11 < cj> I'm thinking of a bunch of four-letter words right now... | 106 | 08:11 < cj> I'm thinking of a bunch of four-letter words right now... |
107 | 08:11 < cj> security through making it difficult for the developer!!! | 107 | 08:11 < cj> security through making it difficult for the developer!!! |
108 | 08:12 < jonp> just use the Obsolete API | 108 | 08:12 < jonp> just use the Obsolete API |
109 | 08:12 < jonp> it should still work | 109 | 08:12 < jonp> it should still work |
110 | 08:12 < cj> alrighty. | 110 | 08:12 < cj> alrighty. |
111 | 08:12 < jonp> you just get warnings when using it | 111 | 08:12 < jonp> you just get warnings when using it |
112 | */ | 112 | */ |
113 | Assembly assem = Assembly.LoadWithPartialName(refr.Name); | 113 | Assembly assem = Assembly.LoadWithPartialName(refr.Name); |
114 | ret += assem.FullName; | 114 | ret += assem.FullName; |
115 | //ret += refr.Name; | 115 | //ret += refr.Name; |
116 | } | 116 | } |
117 | catch (System.NullReferenceException e) | 117 | catch (System.NullReferenceException e) |
118 | { | 118 | { |
119 | e.ToString(); | 119 | e.ToString(); |
120 | ret += refr.Name; | 120 | ret += refr.Name; |
121 | } | 121 | } |
122 | ret += "\" />"; | 122 | ret += "\" />"; |
123 | } | 123 | } |
124 | 124 | ||
125 | return ret; | 125 | return ret; |
126 | } | 126 | } |
127 | 127 | ||
128 | private static string FindFileReference(string refName, ProjectNode project) | 128 | private static string FindFileReference(string refName, ProjectNode project) |
129 | { | 129 | { |
130 | foreach(ReferencePathNode refPath in project.ReferencePaths) | 130 | foreach(ReferencePathNode refPath in project.ReferencePaths) |
131 | { | 131 | { |
132 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); | 132 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); |
133 | 133 | ||
134 | if(File.Exists(fullPath)) | 134 | if(File.Exists(fullPath)) |
135 | { | 135 | { |
136 | return fullPath; | 136 | return fullPath; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | return null; | 140 | return null; |
141 | } | 141 | } |
142 | 142 | ||
143 | /// <summary> | 143 | /// <summary> |
144 | /// Gets the XML doc file. | 144 | /// Gets the XML doc file. |
145 | /// </summary> | 145 | /// </summary> |
146 | /// <param name="project">The project.</param> | 146 | /// <param name="project">The project.</param> |
147 | /// <param name="conf">The conf.</param> | 147 | /// <param name="conf">The conf.</param> |
148 | /// <returns></returns> | 148 | /// <returns></returns> |
149 | public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) | 149 | public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) |
150 | { | 150 | { |
151 | if( conf == null ) | 151 | if( conf == null ) |
152 | { | 152 | { |
153 | throw new ArgumentNullException("conf"); | 153 | throw new ArgumentNullException("conf"); |
154 | } | 154 | } |
155 | if( project == null ) | 155 | if( project == null ) |
156 | { | 156 | { |
157 | throw new ArgumentNullException("project"); | 157 | throw new ArgumentNullException("project"); |
158 | } | 158 | } |
159 | string docFile = (string)conf.Options["XmlDocFile"]; | 159 | string docFile = (string)conf.Options["XmlDocFile"]; |
160 | if(docFile != null && docFile.Length == 0)//default to assembly name if not specified | 160 | if(docFile != null && docFile.Length == 0)//default to assembly name if not specified |
161 | { | 161 | { |
162 | return "False"; | 162 | return "False"; |
163 | } | 163 | } |
164 | return "True"; | 164 | return "True"; |
165 | } | 165 | } |
166 | 166 | ||
167 | private void WriteProject(SolutionNode solution, ProjectNode project) | 167 | private void WriteProject(SolutionNode solution, ProjectNode project) |
168 | { | 168 | { |
169 | string csComp = "Mcs"; | 169 | string csComp = "Mcs"; |
170 | string netRuntime = "Mono"; | 170 | string netRuntime = "Mono"; |
171 | if(project.Runtime == ClrRuntime.Microsoft) | 171 | if(project.Runtime == ClrRuntime.Microsoft) |
172 | { | 172 | { |
173 | csComp = "Csc"; | 173 | csComp = "Csc"; |
174 | netRuntime = "MsNet"; | 174 | netRuntime = "MsNet"; |
175 | } | 175 | } |
176 | 176 | ||
177 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); | 177 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); |
178 | StreamWriter ss = new StreamWriter(projFile); | 178 | StreamWriter ss = new StreamWriter(projFile); |
179 | 179 | ||
180 | m_Kernel.CurrentWorkingDirectory.Push(); | 180 | m_Kernel.CurrentWorkingDirectory.Push(); |
181 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); | 181 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); |
182 | 182 | ||
183 | using(ss) | 183 | using(ss) |
184 | { | 184 | { |
185 | ss.WriteLine( | 185 | ss.WriteLine( |
186 | "<Project name=\"{0}\" description=\"\" standardNamespace=\"{1}\" newfilesearch=\"None\" enableviewstate=\"True\" fileversion=\"2.0\" language=\"C#\" clr-version=\"Net_2_0\" ctype=\"DotNetProject\">", | 186 | "<Project name=\"{0}\" description=\"\" standardNamespace=\"{1}\" newfilesearch=\"None\" enableviewstate=\"True\" fileversion=\"2.0\" language=\"C#\" clr-version=\"Net_2_0\" ctype=\"DotNetProject\">", |
187 | project.Name, | 187 | project.Name, |
188 | project.RootNamespace | 188 | project.RootNamespace |
189 | ); | 189 | ); |
190 | 190 | ||
191 | int count = 0; | 191 | int count = 0; |
192 | 192 | ||
193 | ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); | 193 | ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); |
194 | 194 | ||
195 | foreach(ConfigurationNode conf in project.Configurations) | 195 | foreach(ConfigurationNode conf in project.Configurations) |
196 | { | 196 | { |
197 | ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"DotNetProjectConfiguration\">", conf.Name); | 197 | ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"DotNetProjectConfiguration\">", conf.Name); |
198 | ss.Write(" <Output"); | 198 | ss.Write(" <Output"); |
199 | ss.Write(" directory=\"{0}\"", Helper.EndPath(Helper.NormalizePath(".\\" + conf.Options["OutputPath"].ToString()))); | 199 | ss.Write(" directory=\"{0}\"", Helper.EndPath(Helper.NormalizePath(".\\" + conf.Options["OutputPath"].ToString()))); |
200 | ss.Write(" assembly=\"{0}\"", project.AssemblyName); | 200 | ss.Write(" assembly=\"{0}\"", project.AssemblyName); |
201 | ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); | 201 | ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); |
202 | //ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); | 202 | //ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); |
203 | //ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); | 203 | //ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); |
204 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) | 204 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) |
205 | { | 205 | { |
206 | ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); | 206 | ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); |
207 | } | 207 | } |
208 | else | 208 | else |
209 | { | 209 | { |
210 | ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); | 210 | ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); |
211 | } | 211 | } |
212 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) | 212 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) |
213 | { | 213 | { |
214 | ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); | 214 | ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); |
215 | } | 215 | } |
216 | else | 216 | else |
217 | { | 217 | { |
218 | ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); | 218 | ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); |
219 | } | 219 | } |
220 | ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); | 220 | ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); |
221 | ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); | 221 | ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); |
222 | ss.WriteLine(" />"); | 222 | ss.WriteLine(" />"); |
223 | 223 | ||
224 | ss.Write(" <Build"); | 224 | ss.Write(" <Build"); |
225 | ss.Write(" debugmode=\"True\""); | 225 | ss.Write(" debugmode=\"True\""); |
226 | if (project.Type == ProjectType.WinExe) | 226 | if (project.Type == ProjectType.WinExe) |
227 | { | 227 | { |
228 | ss.Write(" target=\"{0}\"", ProjectType.Exe.ToString()); | 228 | ss.Write(" target=\"{0}\"", ProjectType.Exe.ToString()); |
229 | } | 229 | } |
230 | else | 230 | else |
231 | { | 231 | { |
232 | ss.Write(" target=\"{0}\"", project.Type); | 232 | ss.Write(" target=\"{0}\"", project.Type); |
233 | } | 233 | } |
234 | ss.WriteLine(" />"); | 234 | ss.WriteLine(" />"); |
235 | 235 | ||
236 | ss.Write(" <Execution"); | 236 | ss.Write(" <Execution"); |
237 | ss.Write(" runwithwarnings=\"{0}\"", !conf.Options.WarningsAsErrors); | 237 | ss.Write(" runwithwarnings=\"{0}\"", !conf.Options.WarningsAsErrors); |
238 | ss.Write(" consolepause=\"True\""); | 238 | ss.Write(" consolepause=\"True\""); |
239 | ss.Write(" runtime=\"{0}\"", netRuntime); | 239 | ss.Write(" runtime=\"{0}\"", netRuntime); |
240 | ss.Write(" clr-version=\"Net_2_0\""); | 240 | ss.Write(" clr-version=\"Net_2_0\""); |
241 | ss.WriteLine(" />"); | 241 | ss.WriteLine(" />"); |
242 | 242 | ||
243 | ss.Write(" <CodeGeneration"); | 243 | ss.Write(" <CodeGeneration"); |
244 | ss.Write(" compiler=\"{0}\"", csComp); | 244 | ss.Write(" compiler=\"{0}\"", csComp); |
245 | ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); | 245 | ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); |
246 | ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); | 246 | ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); |
247 | ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); | 247 | ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); |
248 | ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); | 248 | ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); |
249 | ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); | 249 | ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); |
250 | ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); | 250 | ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); |
251 | ss.Write(" mainclass=\"{0}\"", project.StartupObject); | 251 | ss.Write(" mainclass=\"{0}\"", project.StartupObject); |
252 | ss.Write(" target=\"{0}\"", project.Type); | 252 | ss.Write(" target=\"{0}\"", project.Type); |
253 | ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); | 253 | ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); |
254 | ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); | 254 | ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); |
255 | ss.Write(" win32Icon=\"{0}\"", project.AppIcon); | 255 | ss.Write(" win32Icon=\"{0}\"", project.AppIcon); |
256 | ss.Write(" ctype=\"CSharpCompilerParameters\""); | 256 | ss.Write(" ctype=\"CSharpCompilerParameters\""); |
257 | ss.WriteLine(" />"); | 257 | ss.WriteLine(" />"); |
258 | ss.WriteLine(" </Configuration>"); | 258 | ss.WriteLine(" </Configuration>"); |
259 | 259 | ||
260 | count++; | 260 | count++; |
261 | } | 261 | } |
262 | ss.WriteLine(" </Configurations>"); | 262 | ss.WriteLine(" </Configurations>"); |
263 | 263 | ||
264 | ss.Write(" <DeploymentInformation"); | 264 | ss.Write(" <DeploymentInformation"); |
265 | ss.Write(" target=\"\""); | 265 | ss.Write(" target=\"\""); |
266 | ss.Write(" script=\"\""); | 266 | ss.Write(" script=\"\""); |
267 | ss.Write(" strategy=\"File\""); | 267 | ss.Write(" strategy=\"File\""); |
268 | ss.WriteLine(">"); | 268 | ss.WriteLine(">"); |
269 | ss.WriteLine(" <excludeFiles />"); | 269 | ss.WriteLine(" <excludeFiles />"); |
270 | ss.WriteLine(" </DeploymentInformation>"); | 270 | ss.WriteLine(" </DeploymentInformation>"); |
271 | 271 | ||
272 | ss.WriteLine(" <Contents>"); | 272 | ss.WriteLine(" <Contents>"); |
273 | foreach(string file in project.Files) | 273 | foreach(string file in project.Files) |
274 | { | 274 | { |
275 | string buildAction; | 275 | string buildAction; |
276 | string dependson = ""; | 276 | string dependson = ""; |
277 | string resource_id = ""; | 277 | string resource_id = ""; |
278 | string copyToOutput = ""; | 278 | string copyToOutput = ""; |
279 | 279 | ||
280 | switch(project.Files.GetBuildAction(file)) | 280 | switch(project.Files.GetBuildAction(file)) |
281 | { | 281 | { |
282 | case BuildAction.None: | 282 | case BuildAction.None: |
283 | buildAction = "Nothing"; | 283 | buildAction = "Nothing"; |
284 | break; | 284 | break; |
285 | 285 | ||
286 | case BuildAction.Content: | 286 | case BuildAction.Content: |
287 | buildAction = "Exclude"; | 287 | buildAction = "Exclude"; |
288 | break; | 288 | break; |
289 | 289 | ||
290 | case BuildAction.EmbeddedResource: | 290 | case BuildAction.EmbeddedResource: |
291 | buildAction = "EmbedAsResource"; | 291 | buildAction = "EmbedAsResource"; |
292 | break; | 292 | break; |
293 | 293 | ||
294 | default: | 294 | default: |
295 | buildAction = "Compile"; | 295 | buildAction = "Compile"; |
296 | break; | 296 | break; |
297 | } | 297 | } |
298 | 298 | ||
299 | if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never) | 299 | if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never) |
300 | buildAction = "FileCopy"; | 300 | buildAction = "FileCopy"; |
301 | 301 | ||
302 | // Sort of a hack, we try and resolve the path and make it relative, if we can. | 302 | // Sort of a hack, we try and resolve the path and make it relative, if we can. |
303 | string extension = Path.GetExtension(file); | 303 | string extension = Path.GetExtension(file); |
304 | string designer_format = string.Format(".Designer{0}", extension); | 304 | string designer_format = string.Format(".Designer{0}", extension); |
305 | 305 | ||
306 | if (file.EndsWith(designer_format)) | 306 | if (file.EndsWith(designer_format)) |
307 | { | 307 | { |
308 | string basename = file.Substring(0, file.LastIndexOf(designer_format)); | 308 | string basename = file.Substring(0, file.LastIndexOf(designer_format)); |
309 | string[] extensions = new string[] { ".cs", ".resx", ".settings" }; | 309 | string[] extensions = new string[] { ".cs", ".resx", ".settings" }; |
310 | 310 | ||
311 | foreach(string ext in extensions) | 311 | foreach(string ext in extensions) |
312 | { | 312 | { |
313 | if (project.Files.Contains(basename + ext)) | 313 | if (project.Files.Contains(basename + ext)) |
314 | { | 314 | { |
315 | dependson = string.Format(" dependson=\"{0}{1}\"", basename, ext); | 315 | dependson = string.Format(" dependson=\"{0}{1}\"", basename, ext); |
316 | break; | 316 | break; |
317 | } | 317 | } |
318 | } | 318 | } |
319 | } | 319 | } |
320 | if (extension == ".resx") | 320 | if (extension == ".resx") |
321 | { | 321 | { |
322 | buildAction = "EmbedAsResource"; | 322 | buildAction = "EmbedAsResource"; |
323 | string basename = file.Substring(0, file.LastIndexOf(".resx")); | 323 | string basename = file.Substring(0, file.LastIndexOf(".resx")); |
324 | 324 | ||
325 | // Visual Studio type resx + form dependency | 325 | // Visual Studio type resx + form dependency |
326 | if (project.Files.Contains(basename + ".cs")) | 326 | if (project.Files.Contains(basename + ".cs")) |
327 | { | 327 | { |
328 | dependson = string.Format(" dependson=\"{0}{1}\"", basename, ".cs"); | 328 | dependson = string.Format(" dependson=\"{0}{1}\"", basename, ".cs"); |
329 | } | 329 | } |
330 | 330 | ||
331 | // We need to specify a resources file name to avoid MissingManifestResourceExceptions | 331 | // We need to specify a resources file name to avoid MissingManifestResourceExceptions |
332 | // in libraries that are built. | 332 | // in libraries that are built. |
333 | resource_id = string.Format(" resource_id=\"{0}.{1}.resources\"", | 333 | resource_id = string.Format(" resource_id=\"{0}.{1}.resources\"", |
334 | project.AssemblyName, basename.Replace("/", ".")); | 334 | project.AssemblyName, basename.Replace("/", ".")); |
335 | } | 335 | } |
336 | 336 | ||
337 | switch(project.Files.GetCopyToOutput(file)) | 337 | switch(project.Files.GetCopyToOutput(file)) |
338 | { | 338 | { |
339 | case CopyToOutput.Always: | 339 | case CopyToOutput.Always: |
340 | copyToOutput = string.Format(" copyToOutputDirectory=\"Always\""); | 340 | copyToOutput = string.Format(" copyToOutputDirectory=\"Always\""); |
341 | break; | 341 | break; |
342 | case CopyToOutput.PreserveNewest: | 342 | case CopyToOutput.PreserveNewest: |
343 | copyToOutput = string.Format(" copyToOutputDirectory=\"PreserveNewest\""); | 343 | copyToOutput = string.Format(" copyToOutputDirectory=\"PreserveNewest\""); |
344 | break; | 344 | break; |
345 | } | 345 | } |
346 | 346 | ||
347 | // Sort of a hack, we try and resolve the path and make it relative, if we can. | 347 | // Sort of a hack, we try and resolve the path and make it relative, if we can. |
348 | string filePath = PrependPath(file); | 348 | string filePath = PrependPath(file); |
349 | ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\"{2}{3}{4} />", | 349 | ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\"{2}{3}{4} />", |
350 | filePath, buildAction, dependson, resource_id, copyToOutput); | 350 | filePath, buildAction, dependson, resource_id, copyToOutput); |
351 | } | 351 | } |
352 | ss.WriteLine(" </Contents>"); | 352 | ss.WriteLine(" </Contents>"); |
353 | 353 | ||
354 | ss.WriteLine(" <References>"); | 354 | ss.WriteLine(" <References>"); |
355 | foreach(ReferenceNode refr in project.References) | 355 | foreach(ReferenceNode refr in project.References) |
356 | { | 356 | { |
357 | ss.WriteLine(" {0}", BuildReference(solution, refr)); | 357 | ss.WriteLine(" {0}", BuildReference(solution, refr)); |
358 | } | 358 | } |
359 | ss.WriteLine(" </References>"); | 359 | ss.WriteLine(" </References>"); |
360 | 360 | ||
361 | 361 | ||
362 | ss.WriteLine("</Project>"); | 362 | ss.WriteLine("</Project>"); |
363 | } | 363 | } |
364 | 364 | ||
365 | m_Kernel.CurrentWorkingDirectory.Pop(); | 365 | m_Kernel.CurrentWorkingDirectory.Pop(); |
366 | } | 366 | } |
367 | 367 | ||
368 | private void WriteCombine(SolutionNode solution) | 368 | private void WriteCombine(SolutionNode solution) |
369 | { | 369 | { |
370 | m_Kernel.Log.Write("Creating MonoDevelop combine and project files"); | 370 | m_Kernel.Log.Write("Creating MonoDevelop combine and project files"); |
371 | foreach(ProjectNode project in solution.Projects) | 371 | foreach(ProjectNode project in solution.Projects) |
372 | { | 372 | { |
373 | if(m_Kernel.AllowProject(project.FilterGroups)) | 373 | if(m_Kernel.AllowProject(project.FilterGroups)) |
374 | { | 374 | { |
375 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); | 375 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); |
376 | WriteProject(solution, project); | 376 | WriteProject(solution, project); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | m_Kernel.Log.Write(""); | 380 | m_Kernel.Log.Write(""); |
381 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); | 381 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); |
382 | StreamWriter ss = new StreamWriter(combFile); | 382 | StreamWriter ss = new StreamWriter(combFile); |
383 | 383 | ||
384 | m_Kernel.CurrentWorkingDirectory.Push(); | 384 | m_Kernel.CurrentWorkingDirectory.Push(); |
385 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); | 385 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); |
386 | 386 | ||
387 | int count = 0; | 387 | int count = 0; |
388 | 388 | ||
389 | using(ss) | 389 | using(ss) |
390 | { | 390 | { |
391 | ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name); | 391 | ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name); |
392 | 392 | ||
393 | count = 0; | 393 | count = 0; |
394 | foreach(ConfigurationNode conf in solution.Configurations) | 394 | foreach(ConfigurationNode conf in solution.Configurations) |
395 | { | 395 | { |
396 | if(count == 0) | 396 | if(count == 0) |
397 | { | 397 | { |
398 | ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); | 398 | ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); |
399 | } | 399 | } |
400 | 400 | ||
401 | ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name); | 401 | ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name); |
402 | foreach(ProjectNode project in solution.Projects) | 402 | foreach(ProjectNode project in solution.Projects) |
403 | { | 403 | { |
404 | ss.WriteLine(" <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name); | 404 | ss.WriteLine(" <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name); |
405 | } | 405 | } |
406 | ss.WriteLine(" </Configuration>"); | 406 | ss.WriteLine(" </Configuration>"); |
407 | 407 | ||
408 | count++; | 408 | count++; |
409 | } | 409 | } |
410 | ss.WriteLine(" </Configurations>"); | 410 | ss.WriteLine(" </Configurations>"); |
411 | 411 | ||
412 | count = 0; | 412 | count = 0; |
413 | 413 | ||
414 | foreach(ProjectNode project in solution.Projects) | 414 | foreach(ProjectNode project in solution.Projects) |
415 | { | 415 | { |
416 | if(count == 0) | 416 | if(count == 0) |
417 | ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); | 417 | ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); |
418 | 418 | ||
419 | ss.WriteLine(" <Execute type=\"None\" entry=\"{0}\" />", project.Name); | 419 | ss.WriteLine(" <Execute type=\"None\" entry=\"{0}\" />", project.Name); |
420 | count++; | 420 | count++; |
421 | } | 421 | } |
422 | ss.WriteLine(" </StartMode>"); | 422 | ss.WriteLine(" </StartMode>"); |
423 | 423 | ||
424 | ss.WriteLine(" <Entries>"); | 424 | ss.WriteLine(" <Entries>"); |
425 | foreach(ProjectNode project in solution.Projects) | 425 | foreach(ProjectNode project in solution.Projects) |
426 | { | 426 | { |
427 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 427 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
428 | ss.WriteLine(" <Entry filename=\"{0}\" />", | 428 | ss.WriteLine(" <Entry filename=\"{0}\" />", |
429 | Helper.MakeFilePath(path, project.Name, "mdp")); | 429 | Helper.MakeFilePath(path, project.Name, "mdp")); |
430 | } | 430 | } |
431 | ss.WriteLine(" </Entries>"); | 431 | ss.WriteLine(" </Entries>"); |
432 | 432 | ||
433 | ss.WriteLine("</Combine>"); | 433 | ss.WriteLine("</Combine>"); |
434 | } | 434 | } |
435 | 435 | ||
436 | m_Kernel.CurrentWorkingDirectory.Pop(); | 436 | m_Kernel.CurrentWorkingDirectory.Pop(); |
437 | } | 437 | } |
438 | 438 | ||
439 | private void CleanProject(ProjectNode project) | 439 | private void CleanProject(ProjectNode project) |
440 | { | 440 | { |
441 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); | 441 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); |
442 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); | 442 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); |
443 | Helper.DeleteIfExists(projectFile); | 443 | Helper.DeleteIfExists(projectFile); |
444 | } | 444 | } |
445 | 445 | ||
446 | private void CleanSolution(SolutionNode solution) | 446 | private void CleanSolution(SolutionNode solution) |
447 | { | 447 | { |
448 | m_Kernel.Log.Write("Cleaning MonoDevelop combine and project files for", solution.Name); | 448 | m_Kernel.Log.Write("Cleaning MonoDevelop combine and project files for", solution.Name); |
449 | 449 | ||
450 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); | 450 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); |
451 | Helper.DeleteIfExists(slnFile); | 451 | Helper.DeleteIfExists(slnFile); |
452 | 452 | ||
453 | foreach(ProjectNode project in solution.Projects) | 453 | foreach(ProjectNode project in solution.Projects) |
454 | { | 454 | { |
455 | CleanProject(project); | 455 | CleanProject(project); |
456 | } | 456 | } |
457 | 457 | ||
458 | m_Kernel.Log.Write(""); | 458 | m_Kernel.Log.Write(""); |
459 | } | 459 | } |
460 | 460 | ||
461 | #endregion | 461 | #endregion |
462 | 462 | ||
463 | #region ITarget Members | 463 | #region ITarget Members |
464 | 464 | ||
465 | /// <summary> | 465 | /// <summary> |
466 | /// Writes the specified kern. | 466 | /// Writes the specified kern. |
467 | /// </summary> | 467 | /// </summary> |
468 | /// <param name="kern">The kern.</param> | 468 | /// <param name="kern">The kern.</param> |
469 | public void Write(Kernel kern) | 469 | public void Write(Kernel kern) |
470 | { | 470 | { |
471 | if( kern == null ) | 471 | if( kern == null ) |
472 | { | 472 | { |
473 | throw new ArgumentNullException("kern"); | 473 | throw new ArgumentNullException("kern"); |
474 | } | 474 | } |
475 | m_Kernel = kern; | 475 | m_Kernel = kern; |
476 | foreach(SolutionNode solution in kern.Solutions) | 476 | foreach(SolutionNode solution in kern.Solutions) |
477 | { | 477 | { |
478 | WriteCombine(solution); | 478 | WriteCombine(solution); |
479 | } | 479 | } |
480 | m_Kernel = null; | 480 | m_Kernel = null; |
481 | } | 481 | } |
482 | 482 | ||
483 | /// <summary> | 483 | /// <summary> |
484 | /// Cleans the specified kern. | 484 | /// Cleans the specified kern. |
485 | /// </summary> | 485 | /// </summary> |
486 | /// <param name="kern">The kern.</param> | 486 | /// <param name="kern">The kern.</param> |
487 | public virtual void Clean(Kernel kern) | 487 | public virtual void Clean(Kernel kern) |
488 | { | 488 | { |
489 | if( kern == null ) | 489 | if( kern == null ) |
490 | { | 490 | { |
491 | throw new ArgumentNullException("kern"); | 491 | throw new ArgumentNullException("kern"); |
492 | } | 492 | } |
493 | m_Kernel = kern; | 493 | m_Kernel = kern; |
494 | foreach(SolutionNode sol in kern.Solutions) | 494 | foreach(SolutionNode sol in kern.Solutions) |
495 | { | 495 | { |
496 | CleanSolution(sol); | 496 | CleanSolution(sol); |
497 | } | 497 | } |
498 | m_Kernel = null; | 498 | m_Kernel = null; |
499 | } | 499 | } |
500 | 500 | ||
501 | /// <summary> | 501 | /// <summary> |
502 | /// Gets the name. | 502 | /// Gets the name. |
503 | /// </summary> | 503 | /// </summary> |
504 | /// <value>The name.</value> | 504 | /// <value>The name.</value> |
505 | public string Name | 505 | public string Name |
506 | { | 506 | { |
507 | get | 507 | get |
508 | { | 508 | { |
509 | return "sharpdev"; | 509 | return "sharpdev"; |
510 | } | 510 | } |
511 | } | 511 | } |
512 | 512 | ||
513 | #endregion | 513 | #endregion |
514 | } | 514 | } |
515 | } | 515 | } |
diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs index 21bc80e..925f5ca 100644 --- a/Prebuild/src/Core/Targets/NAntTarget.cs +++ b/Prebuild/src/Core/Targets/NAntTarget.cs | |||
@@ -47,36 +47,36 @@ using Prebuild.Core.Utilities; | |||
47 | 47 | ||
48 | namespace Prebuild.Core.Targets | 48 | namespace Prebuild.Core.Targets |
49 | { | 49 | { |
50 | /// <summary> | 50 | /// <summary> |
51 | /// | 51 | /// |
52 | /// </summary> | 52 | /// </summary> |
53 | [Target("nant")] | 53 | [Target("nant")] |
54 | public class NAntTarget : ITarget | 54 | public class NAntTarget : ITarget |
55 | { | 55 | { |
56 | #region Fields | 56 | #region Fields |
57 | 57 | ||
58 | private Kernel m_Kernel; | 58 | private Kernel m_Kernel; |
59 | 59 | ||
60 | #endregion | 60 | #endregion |
61 | 61 | ||
62 | #region Private Methods | 62 | #region Private Methods |
63 | 63 | ||
64 | private static string PrependPath(string path) | 64 | private static string PrependPath(string path) |
65 | { | 65 | { |
66 | string tmpPath = Helper.NormalizePath(path, '/'); | 66 | string tmpPath = Helper.NormalizePath(path, '/'); |
67 | Regex regex = new Regex(@"(\w):/(\w+)"); | 67 | Regex regex = new Regex(@"(\w):/(\w+)"); |
68 | Match match = regex.Match(tmpPath); | 68 | Match match = regex.Match(tmpPath); |
69 | //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') | 69 | //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') |
70 | //{ | 70 | //{ |
71 | tmpPath = Helper.NormalizePath(tmpPath); | 71 | tmpPath = Helper.NormalizePath(tmpPath); |
72 | //} | 72 | //} |
73 | // else | 73 | // else |
74 | // { | 74 | // { |
75 | // tmpPath = Helper.NormalizePath("./" + tmpPath); | 75 | // tmpPath = Helper.NormalizePath("./" + tmpPath); |
76 | // } | 76 | // } |
77 | 77 | ||
78 | return tmpPath; | 78 | return tmpPath; |
79 | } | 79 | } |
80 | 80 | ||
81 | private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr) | 81 | private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr) |
82 | { | 82 | { |
@@ -85,7 +85,7 @@ namespace Prebuild.Core.Targets | |||
85 | { | 85 | { |
86 | return refr.Path; | 86 | return refr.Path; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (solution.ProjectsTable.ContainsKey(refr.Name)) | 89 | if (solution.ProjectsTable.ContainsKey(refr.Name)) |
90 | { | 90 | { |
91 | ProjectNode projectRef = (ProjectNode) solution.ProjectsTable[refr.Name]; | 91 | ProjectNode projectRef = (ProjectNode) solution.ProjectsTable[refr.Name]; |
@@ -113,7 +113,7 @@ namespace Prebuild.Core.Targets | |||
113 | return refr.Name + ".dll"; | 113 | return refr.Name + ".dll"; |
114 | } | 114 | } |
115 | 115 | ||
116 | public static string GetRefFileName(string refName) | 116 | public static string GetRefFileName(string refName) |
117 | { | 117 | { |
118 | if (ExtensionSpecified(refName)) | 118 | if (ExtensionSpecified(refName)) |
119 | { | 119 | { |
@@ -140,11 +140,11 @@ namespace Prebuild.Core.Targets | |||
140 | return extension; | 140 | return extension; |
141 | } | 141 | } |
142 | 142 | ||
143 | private static string FindFileReference(string refName, ProjectNode project) | 143 | private static string FindFileReference(string refName, ProjectNode project) |
144 | { | 144 | { |
145 | foreach (ReferencePathNode refPath in project.ReferencePaths) | 145 | foreach (ReferencePathNode refPath in project.ReferencePaths) |
146 | { | 146 | { |
147 | string fullPath = Helper.MakeFilePath(refPath.Path, refName); | 147 | string fullPath = Helper.MakeFilePath(refPath.Path, refName); |
148 | 148 | ||
149 | if (File.Exists(fullPath)) | 149 | if (File.Exists(fullPath)) |
150 | { | 150 | { |
@@ -153,10 +153,10 @@ namespace Prebuild.Core.Targets | |||
153 | 153 | ||
154 | fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); | 154 | fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); |
155 | 155 | ||
156 | if (File.Exists(fullPath)) | 156 | if (File.Exists(fullPath)) |
157 | { | 157 | { |
158 | return fullPath; | 158 | return fullPath; |
159 | } | 159 | } |
160 | 160 | ||
161 | fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe"); | 161 | fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe"); |
162 | 162 | ||
@@ -164,162 +164,205 @@ namespace Prebuild.Core.Targets | |||
164 | { | 164 | { |
165 | return fullPath; | 165 | return fullPath; |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | return null; | 169 | return null; |
170 | } | 170 | } |
171 | 171 | ||
172 | /// <summary> | 172 | /// <summary> |
173 | /// Gets the XML doc file. | 173 | /// Gets the XML doc file. |
174 | /// </summary> | 174 | /// </summary> |
175 | /// <param name="project">The project.</param> | 175 | /// <param name="project">The project.</param> |
176 | /// <param name="conf">The conf.</param> | 176 | /// <param name="conf">The conf.</param> |
177 | /// <returns></returns> | 177 | /// <returns></returns> |
178 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) | 178 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) |
179 | { | 179 | { |
180 | if (conf == null) | 180 | if (conf == null) |
181 | { | 181 | { |
182 | throw new ArgumentNullException("conf"); | 182 | throw new ArgumentNullException("conf"); |
183 | } | 183 | } |
184 | if (project == null) | 184 | if (project == null) |
185 | { | 185 | { |
186 | throw new ArgumentNullException("project"); | 186 | throw new ArgumentNullException("project"); |
187 | } | 187 | } |
188 | string docFile = (string)conf.Options["XmlDocFile"]; | 188 | string docFile = (string)conf.Options["XmlDocFile"]; |
189 | // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified | 189 | // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified |
190 | // { | 190 | // { |
191 | // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; | 191 | // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; |
192 | // } | 192 | // } |
193 | return docFile; | 193 | return docFile; |
194 | } | 194 | } |
195 | 195 | ||
196 | private void WriteProject(SolutionNode solution, ProjectNode project) | 196 | private void WriteProject(SolutionNode solution, ProjectNode project) |
197 | { | 197 | { |
198 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); | 198 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); |
199 | StreamWriter ss = new StreamWriter(projFile); | 199 | StreamWriter ss = new StreamWriter(projFile); |
200 | 200 | ||
201 | m_Kernel.CurrentWorkingDirectory.Push(); | 201 | m_Kernel.CurrentWorkingDirectory.Push(); |
202 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); | 202 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); |
203 | bool hasDoc = false; | 203 | bool hasDoc = false; |
204 | 204 | ||
205 | using (ss) | 205 | using (ss) |
206 | { | 206 | { |
207 | ss.WriteLine("<?xml version=\"1.0\" ?>"); | 207 | ss.WriteLine("<?xml version=\"1.0\" ?>"); |
208 | ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name); | 208 | ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name); |
209 | ss.WriteLine(" <target name=\"{0}\">", "build"); | 209 | ss.WriteLine(" <target name=\"{0}\">", "build"); |
210 | ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />"); | 210 | ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />"); |
211 | ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />"); | 211 | ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />"); |
212 | 212 | ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\" flatten=\"true\">"); | |
213 | ss.Write(" <csc "); | 213 | ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">"); |
214 | ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower()); | 214 | foreach (ReferenceNode refr in project.References) |
215 | ss.Write(" debug=\"{0}\"", "${build.debug}"); | 215 | { |
216 | ss.Write(" platform=\"${build.platform}\""); | 216 | if (refr.LocalCopy) |
217 | 217 | { | |
218 | 218 | ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)) + "\" />", '/')); | |
219 | foreach (ConfigurationNode conf in project.Configurations) | 219 | } |
220 | { | 220 | } |
221 | if (conf.Options.KeyFile != "") | 221 | |
222 | { | 222 | ss.WriteLine(" </fileset>"); |
223 | ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile); | 223 | ss.WriteLine(" </copy>"); |
224 | break; | 224 | if (project.ConfigFile != null && project.ConfigFile.Length!=0) |
225 | } | 225 | { |
226 | } | 226 | ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${project::get-base-directory()}/${build.dir}/${project::get-name()}"); |
227 | foreach (ConfigurationNode conf in project.Configurations) | 227 | |
228 | { | 228 | if (project.Type == ProjectType.Library) |
229 | ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe); | 229 | { |
230 | break; | 230 | ss.Write(".dll.config\""); |
231 | } | 231 | } |
232 | foreach (ConfigurationNode conf in project.Configurations) | 232 | else |
233 | { | 233 | { |
234 | ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors); | 234 | ss.Write(".exe.config\""); |
235 | break; | 235 | } |
236 | } | 236 | ss.WriteLine(" />"); |
237 | foreach (ConfigurationNode conf in project.Configurations) | 237 | } |
238 | { | 238 | |
239 | ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines); | 239 | // Add the content files to just be copied |
240 | break; | 240 | ss.WriteLine(" {0}", "<copy todir=\"${project::get-base-directory()}/${build.dir}\">"); |
241 | } | 241 | ss.WriteLine(" {0}", "<fileset basedir=\".\">"); |
242 | foreach (ConfigurationNode conf in project.Configurations) | 242 | |
243 | { | 243 | foreach (string file in project.Files) |
244 | ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); | 244 | { |
245 | break; | 245 | // Ignore if we aren't content |
246 | } | 246 | if (project.Files.GetBuildAction(file) != BuildAction.Content) |
247 | 247 | continue; | |
248 | ss.Write(" main=\"{0}\"", project.StartupObject); | 248 | |
249 | 249 | // Create a include tag | |
250 | foreach (ConfigurationNode conf in project.Configurations) | 250 | ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); |
251 | { | 251 | } |
252 | if (GetXmlDocFile(project, conf) != "") | 252 | |
253 | { | 253 | ss.WriteLine(" {0}", "</fileset>"); |
254 | ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf)); | 254 | ss.WriteLine(" {0}", "</copy>"); |
255 | hasDoc = true; | 255 | |
256 | } | 256 | ss.Write(" <csc "); |
257 | break; | 257 | ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower()); |
258 | } | 258 | ss.Write(" debug=\"{0}\"", "${build.debug}"); |
259 | ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}"); | 259 | ss.Write(" platform=\"${build.platform}\""); |
260 | if (project.Type == ProjectType.Library) | 260 | |
261 | { | 261 | |
262 | ss.Write(".dll\""); | 262 | foreach (ConfigurationNode conf in project.Configurations) |
263 | } | 263 | { |
264 | else | 264 | if (conf.Options.KeyFile != "") |
265 | { | 265 | { |
266 | ss.Write(".exe\""); | 266 | ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile); |
267 | } | 267 | break; |
268 | if (project.AppIcon != null && project.AppIcon.Length != 0) | 268 | } |
269 | { | 269 | } |
270 | ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/')); | 270 | foreach (ConfigurationNode conf in project.Configurations) |
271 | } | 271 | { |
272 | ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe); | ||
273 | break; | ||
274 | } | ||
275 | foreach (ConfigurationNode conf in project.Configurations) | ||
276 | { | ||
277 | ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors); | ||
278 | break; | ||
279 | } | ||
280 | foreach (ConfigurationNode conf in project.Configurations) | ||
281 | { | ||
282 | ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines); | ||
283 | break; | ||
284 | } | ||
285 | foreach (ConfigurationNode conf in project.Configurations) | ||
286 | { | ||
287 | ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); | ||
288 | break; | ||
289 | } | ||
290 | |||
291 | ss.Write(" main=\"{0}\"", project.StartupObject); | ||
292 | |||
293 | foreach (ConfigurationNode conf in project.Configurations) | ||
294 | { | ||
295 | if (GetXmlDocFile(project, conf) != "") | ||
296 | { | ||
297 | ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf)); | ||
298 | hasDoc = true; | ||
299 | } | ||
300 | break; | ||
301 | } | ||
302 | ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}"); | ||
303 | if (project.Type == ProjectType.Library) | ||
304 | { | ||
305 | ss.Write(".dll\""); | ||
306 | } | ||
307 | else | ||
308 | { | ||
309 | ss.Write(".exe\""); | ||
310 | } | ||
311 | if (project.AppIcon != null && project.AppIcon.Length != 0) | ||
312 | { | ||
313 | ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/')); | ||
314 | } | ||
272 | // This disables a very different behavior between VS and NAnt. With Nant, | 315 | // This disables a very different behavior between VS and NAnt. With Nant, |
273 | // If you have using System.Xml; it will ensure System.Xml.dll is referenced, | 316 | // If you have using System.Xml; it will ensure System.Xml.dll is referenced, |
274 | // but not in VS. This will force the behaviors to match, so when it works | 317 | // but not in VS. This will force the behaviors to match, so when it works |
275 | // in nant, it will work in VS. | 318 | // in nant, it will work in VS. |
276 | ss.Write(" noconfig=\"true\""); | 319 | ss.Write(" noconfig=\"true\""); |
277 | ss.WriteLine(">"); | 320 | ss.WriteLine(">"); |
278 | ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace); | 321 | ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace); |
279 | foreach (string file in project.Files) | 322 | foreach (string file in project.Files) |
280 | { | 323 | { |
281 | switch (project.Files.GetBuildAction(file)) | 324 | switch (project.Files.GetBuildAction(file)) |
282 | { | 325 | { |
283 | case BuildAction.EmbeddedResource: | 326 | case BuildAction.EmbeddedResource: |
284 | ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); | 327 | ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); |
285 | break; | 328 | break; |
286 | default: | 329 | default: |
287 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) | 330 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) |
288 | { | 331 | { |
289 | ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx"); | 332 | ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx"); |
290 | } | 333 | } |
291 | break; | 334 | break; |
292 | } | 335 | } |
293 | } | 336 | } |
294 | //if (project.Files.GetSubType(file).ToString() != "Code") | 337 | //if (project.Files.GetSubType(file).ToString() != "Code") |
295 | //{ | 338 | //{ |
296 | // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); | 339 | // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); |
297 | 340 | ||
298 | ss.WriteLine(" </resources>"); | 341 | ss.WriteLine(" </resources>"); |
299 | ss.WriteLine(" <sources failonempty=\"true\">"); | 342 | ss.WriteLine(" <sources failonempty=\"true\">"); |
300 | foreach (string file in project.Files) | 343 | foreach (string file in project.Files) |
301 | { | 344 | { |
302 | switch (project.Files.GetBuildAction(file)) | 345 | switch (project.Files.GetBuildAction(file)) |
303 | { | 346 | { |
304 | case BuildAction.Compile: | 347 | case BuildAction.Compile: |
305 | ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); | 348 | ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); |
306 | break; | 349 | break; |
307 | default: | 350 | default: |
308 | break; | 351 | break; |
309 | } | 352 | } |
310 | } | 353 | } |
311 | ss.WriteLine(" </sources>"); | 354 | ss.WriteLine(" </sources>"); |
312 | ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">"); | 355 | ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">"); |
313 | ss.WriteLine(" <lib>"); | 356 | ss.WriteLine(" <lib>"); |
314 | ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />"); | 357 | ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />"); |
315 | foreach(ReferencePathNode refPath in project.ReferencePaths) | 358 | foreach(ReferencePathNode refPath in project.ReferencePaths) |
316 | { | 359 | { |
317 | ss.WriteLine(" <include name=\"${project::get-base-directory()}/" + refPath.Path.TrimEnd('/', '\\') + "\" />"); | 360 | ss.WriteLine(" <include name=\"${project::get-base-directory()}/" + refPath.Path.TrimEnd('/', '\\') + "\" />"); |
318 | } | 361 | } |
319 | ss.WriteLine(" </lib>"); | 362 | ss.WriteLine(" </lib>"); |
320 | foreach (ReferenceNode refr in project.References) | 363 | foreach (ReferenceNode refr in project.References) |
321 | { | 364 | { |
322 | string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); | 365 | string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); |
323 | if (refr.Path != null) { | 366 | if (refr.Path != null) { |
324 | if (ExtensionSpecified(refr.Name)) | 367 | if (ExtensionSpecified(refr.Name)) |
325 | { | 368 | { |
@@ -334,12 +377,12 @@ namespace Prebuild.Core.Targets | |||
334 | { | 377 | { |
335 | ss.WriteLine (" <include name=\"" + path + "\" />"); | 378 | ss.WriteLine (" <include name=\"" + path + "\" />"); |
336 | } | 379 | } |
337 | } | 380 | } |
338 | ss.WriteLine(" </references>"); | 381 | ss.WriteLine(" </references>"); |
339 | 382 | ||
340 | ss.WriteLine(" </csc>"); | 383 | ss.WriteLine(" </csc>"); |
341 | 384 | ||
342 | foreach (ConfigurationNode conf in project.Configurations) | 385 | foreach (ConfigurationNode conf in project.Configurations) |
343 | { | 386 | { |
344 | if (!String.IsNullOrEmpty(conf.Options.OutputPath)) | 387 | if (!String.IsNullOrEmpty(conf.Options.OutputPath)) |
345 | { | 388 | { |
@@ -361,170 +404,170 @@ namespace Prebuild.Core.Targets | |||
361 | } | 404 | } |
362 | } | 405 | } |
363 | 406 | ||
364 | ss.WriteLine(" </target>"); | 407 | ss.WriteLine(" </target>"); |
365 | 408 | ||
366 | ss.WriteLine(" <target name=\"clean\">"); | 409 | ss.WriteLine(" <target name=\"clean\">"); |
367 | ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />"); | 410 | ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />"); |
368 | ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); | 411 | ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); |
369 | ss.WriteLine(" </target>"); | 412 | ss.WriteLine(" </target>"); |
370 | 413 | ||
371 | ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">"); | 414 | ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">"); |
372 | if (hasDoc) | 415 | if (hasDoc) |
373 | { | 416 | { |
374 | ss.WriteLine(" <property name=\"doc.target\" value=\"\" />"); | 417 | ss.WriteLine(" <property name=\"doc.target\" value=\"\" />"); |
375 | ss.WriteLine(" <if test=\"${platform::is-unix()}\">"); | 418 | ss.WriteLine(" <if test=\"${platform::is-unix()}\">"); |
376 | ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />"); | 419 | ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />"); |
377 | ss.WriteLine(" </if>"); | 420 | ss.WriteLine(" </if>"); |
378 | ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">"); | 421 | ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">"); |
379 | ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">"); | 422 | ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">"); |
380 | ss.Write(" <include name=\"${build.dir}/${project::get-name()}"); | 423 | ss.Write(" <include name=\"${build.dir}/${project::get-name()}"); |
381 | if (project.Type == ProjectType.Library) | 424 | if (project.Type == ProjectType.Library) |
382 | { | 425 | { |
383 | ss.WriteLine(".dll\" />"); | 426 | ss.WriteLine(".dll\" />"); |
384 | } | 427 | } |
385 | else | 428 | else |
386 | { | 429 | { |
387 | ss.WriteLine(".exe\" />"); | 430 | ss.WriteLine(".exe\" />"); |
388 | } | 431 | } |
389 | 432 | ||
390 | ss.WriteLine(" </assemblies>"); | 433 | ss.WriteLine(" </assemblies>"); |
391 | ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">"); | 434 | ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">"); |
392 | ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>"); | 435 | ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>"); |
393 | ss.WriteLine(" </summaries>"); | 436 | ss.WriteLine(" </summaries>"); |
394 | ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">"); | 437 | ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">"); |
395 | ss.WriteLine(" <include name=\"${build.dir}\" />"); | 438 | ss.WriteLine(" <include name=\"${build.dir}\" />"); |
396 | // foreach(ReferenceNode refr in project.References) | 439 | // foreach(ReferenceNode refr in project.References) |
397 | // { | 440 | // { |
398 | // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/'); | 441 | // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/'); |
399 | // if (path != "") | 442 | // if (path != "") |
400 | // { | 443 | // { |
401 | // ss.WriteLine(" <include name=\"{0}\" />", path); | 444 | // ss.WriteLine(" <include name=\"{0}\" />", path); |
402 | // } | 445 | // } |
403 | // } | 446 | // } |
404 | ss.WriteLine(" </referencepaths>"); | 447 | ss.WriteLine(" </referencepaths>"); |
405 | ss.WriteLine(" <documenters>"); | 448 | ss.WriteLine(" <documenters>"); |
406 | ss.WriteLine(" <documenter name=\"MSDN\">"); | 449 | ss.WriteLine(" <documenter name=\"MSDN\">"); |
407 | ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />"); | 450 | ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />"); |
408 | ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />"); | 451 | ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />"); |
409 | ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />"); | 452 | ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />"); |
410 | ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />"); | 453 | ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />"); |
411 | ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />"); | 454 | ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />"); |
412 | ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />"); | 455 | ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />"); |
413 | ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />"); | 456 | ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />"); |
414 | ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />"); | 457 | ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />"); |
415 | ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />"); | 458 | ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />"); |
416 | ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />"); | 459 | ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />"); |
417 | ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />"); | 460 | ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />"); |
418 | ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />"); | 461 | ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />"); |
419 | ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />"); | 462 | ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />"); |
420 | ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />"); | 463 | ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />"); |
421 | ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />"); | 464 | ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />"); |
422 | ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />"); | 465 | ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />"); |
423 | ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />"); | 466 | ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />"); |
424 | ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />"); | 467 | ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />"); |
425 | ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />"); | 468 | ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />"); |
426 | ss.WriteLine(" </documenter>"); | 469 | ss.WriteLine(" </documenter>"); |
427 | ss.WriteLine(" </documenters>"); | 470 | ss.WriteLine(" </documenters>"); |
428 | ss.WriteLine(" </ndoc>"); | 471 | ss.WriteLine(" </ndoc>"); |
429 | } | 472 | } |
430 | ss.WriteLine(" </target>"); | 473 | ss.WriteLine(" </target>"); |
431 | ss.WriteLine("</project>"); | 474 | ss.WriteLine("</project>"); |
432 | } | 475 | } |
433 | m_Kernel.CurrentWorkingDirectory.Pop(); | 476 | m_Kernel.CurrentWorkingDirectory.Pop(); |
434 | } | 477 | } |
435 | 478 | ||
436 | private void WriteCombine(SolutionNode solution) | 479 | private void WriteCombine(SolutionNode solution) |
437 | { | 480 | { |
438 | m_Kernel.Log.Write("Creating NAnt build files"); | 481 | m_Kernel.Log.Write("Creating NAnt build files"); |
439 | foreach (ProjectNode project in solution.Projects) | 482 | foreach (ProjectNode project in solution.Projects) |
440 | { | 483 | { |
441 | if (m_Kernel.AllowProject(project.FilterGroups)) | 484 | if (m_Kernel.AllowProject(project.FilterGroups)) |
442 | { | 485 | { |
443 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); | 486 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); |
444 | WriteProject(solution, project); | 487 | WriteProject(solution, project); |
445 | } | 488 | } |
446 | } | 489 | } |
447 | 490 | ||
448 | m_Kernel.Log.Write(""); | 491 | m_Kernel.Log.Write(""); |
449 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); | 492 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); |
450 | StreamWriter ss = new StreamWriter(combFile); | 493 | StreamWriter ss = new StreamWriter(combFile); |
451 | 494 | ||
452 | m_Kernel.CurrentWorkingDirectory.Push(); | 495 | m_Kernel.CurrentWorkingDirectory.Push(); |
453 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); | 496 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); |
454 | 497 | ||
455 | using (ss) | 498 | using (ss) |
456 | { | 499 | { |
457 | ss.WriteLine("<?xml version=\"1.0\" ?>"); | 500 | ss.WriteLine("<?xml version=\"1.0\" ?>"); |
458 | ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name); | 501 | ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name); |
459 | ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>"); | 502 | ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>"); |
460 | ss.WriteLine(); | 503 | ss.WriteLine(); |
461 | 504 | ||
462 | //ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />"); | 505 | //ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />"); |
463 | //ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />"); | 506 | //ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />"); |
464 | ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />"); | 507 | ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />"); |
465 | ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />"); | 508 | ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />"); |
466 | ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />"); | 509 | ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />"); |
467 | ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />"); | 510 | ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />"); |
468 | 511 | ||
469 | // Use the active configuration, which is the first configuration name in the prebuild file. | 512 | // Use the active configuration, which is the first configuration name in the prebuild file. |
470 | Dictionary<string,string> emittedConfigurations = new Dictionary<string, string>(); | 513 | Dictionary<string,string> emittedConfigurations = new Dictionary<string, string>(); |
471 | 514 | ||
472 | ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig); | 515 | ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig); |
473 | ss.WriteLine(); | 516 | ss.WriteLine(); |
474 | 517 | ||
475 | foreach (ConfigurationNode conf in solution.Configurations) | 518 | foreach (ConfigurationNode conf in solution.Configurations) |
476 | { | 519 | { |
477 | // If the name isn't in the emitted configurations, we give a high level target to the | 520 | // If the name isn't in the emitted configurations, we give a high level target to the |
478 | // platform specific on. This lets "Debug" point to "Debug-AnyCPU". | 521 | // platform specific on. This lets "Debug" point to "Debug-AnyCPU". |
479 | if (!emittedConfigurations.ContainsKey(conf.Name)) | 522 | if (!emittedConfigurations.ContainsKey(conf.Name)) |
480 | { | 523 | { |
481 | // Add it to the dictionary so we only emit one. | 524 | // Add it to the dictionary so we only emit one. |
482 | emittedConfigurations.Add(conf.Name, conf.Platform); | 525 | emittedConfigurations.Add(conf.Name, conf.Platform); |
483 | 526 | ||
484 | // Write out the target block. | 527 | // Write out the target block. |
485 | ss.WriteLine(" <target name=\"{0}\" description=\"{0}|{1}\" depends=\"{0}-{1}\">", conf.Name, conf.Platform); | 528 | ss.WriteLine(" <target name=\"{0}\" description=\"{0}|{1}\" depends=\"{0}-{1}\">", conf.Name, conf.Platform); |
486 | ss.WriteLine(" </target>"); | 529 | ss.WriteLine(" </target>"); |
487 | ss.WriteLine(); | 530 | ss.WriteLine(); |
488 | } | 531 | } |
489 | 532 | ||
490 | // Write out the target for the configuration. | 533 | // Write out the target for the configuration. |
491 | ss.WriteLine(" <target name=\"{0}-{1}\" description=\"{0}|{1}\">", conf.Name, conf.Platform); | 534 | ss.WriteLine(" <target name=\"{0}-{1}\" description=\"{0}|{1}\">", conf.Name, conf.Platform); |
492 | ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name); | 535 | ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name); |
493 | ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower()); | 536 | ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower()); |
494 | ss.WriteLine("\t\t <property name=\"build.platform\" value=\"{0}\" />", conf.Platform); | 537 | ss.WriteLine("\t\t <property name=\"build.platform\" value=\"{0}\" />", conf.Platform); |
495 | ss.WriteLine(" </target>"); | 538 | ss.WriteLine(" </target>"); |
496 | ss.WriteLine(); | 539 | ss.WriteLine(); |
497 | } | 540 | } |
498 | 541 | ||
499 | ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">"); | 542 | ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">"); |
500 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />"); | 543 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />"); |
501 | ss.WriteLine(" </target>"); | 544 | ss.WriteLine(" </target>"); |
502 | ss.WriteLine(); | 545 | ss.WriteLine(); |
503 | 546 | ||
504 | ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">"); | 547 | ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">"); |
505 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />"); | 548 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />"); |
506 | ss.WriteLine(" </target>"); | 549 | ss.WriteLine(" </target>"); |
507 | ss.WriteLine(); | 550 | ss.WriteLine(); |
508 | 551 | ||
509 | ss.WriteLine(" <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">"); | 552 | ss.WriteLine(" <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">"); |
510 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />"); | 553 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />"); |
511 | ss.WriteLine(" </target>"); | 554 | ss.WriteLine(" </target>"); |
512 | ss.WriteLine(); | 555 | ss.WriteLine(); |
513 | 556 | ||
514 | ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">"); | 557 | ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">"); |
515 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />"); | 558 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />"); |
516 | ss.WriteLine(" </target>"); | 559 | ss.WriteLine(" </target>"); |
517 | ss.WriteLine(); | 560 | ss.WriteLine(); |
518 | 561 | ||
519 | ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">"); | 562 | ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">"); |
520 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />"); | 563 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />"); |
521 | ss.WriteLine(" </target>"); | 564 | ss.WriteLine(" </target>"); |
522 | ss.WriteLine(); | 565 | ss.WriteLine(); |
523 | 566 | ||
524 | ss.WriteLine(" <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">"); | 567 | ss.WriteLine(" <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">"); |
525 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />"); | 568 | ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />"); |
526 | ss.WriteLine(" </target>"); | 569 | ss.WriteLine(" </target>"); |
527 | ss.WriteLine(); | 570 | ss.WriteLine(); |
528 | 571 | ||
529 | ss.WriteLine(" <target name=\"init\" description=\"\">"); | 572 | ss.WriteLine(" <target name=\"init\" description=\"\">"); |
530 | ss.WriteLine(" <call target=\"${project.config}\" />"); | 573 | ss.WriteLine(" <call target=\"${project.config}\" />"); |
@@ -594,24 +637,6 @@ namespace Prebuild.Core.Targets | |||
594 | ss.WriteLine(" <target name=\"clean\" description=\"\">"); | 637 | ss.WriteLine(" <target name=\"clean\" description=\"\">"); |
595 | ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />"); | 638 | ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />"); |
596 | //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />"); | 639 | //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />"); |
597 | |||
598 | // justincc: FIXME FIXME FIXME - A temporary OpenSim hack to clean up files when "nant clean" is executed. | ||
599 | // Should be replaced with extreme prejudice once anybody finds out if the CleanFiles stuff works or there is | ||
600 | // another working mechanism for specifying this stuff | ||
601 | ss.WriteLine(" <delete failonerror=\"false\">"); | ||
602 | ss.WriteLine(" <fileset basedir=\"${bin.dir}\">"); | ||
603 | ss.WriteLine(" <include name=\"OpenSim*.dll\"/>"); | ||
604 | ss.WriteLine(" <include name=\"OpenSim*.dll.mdb\"/>"); | ||
605 | ss.WriteLine(" <include name=\"OpenSim*.exe\"/>"); | ||
606 | ss.WriteLine(" <include name=\"OpenSim*.exe.mdb\"/>"); | ||
607 | ss.WriteLine(" <include name=\"ScriptEngines/*\"/>"); | ||
608 | ss.WriteLine(" <include name=\"Physics/*.dll\"/>"); | ||
609 | ss.WriteLine(" <include name=\"Physics/*.dll.mdb\"/>"); | ||
610 | ss.WriteLine(" <exclude name=\"OpenSim.32BitLaunch.exe\"/>"); | ||
611 | ss.WriteLine(" <exclude name=\"ScriptEngines/Default.lsl\"/>"); | ||
612 | ss.WriteLine(" </fileset>"); | ||
613 | ss.WriteLine(" </delete>"); | ||
614 | |||
615 | if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0) | 640 | if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0) |
616 | { | 641 | { |
617 | foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles) | 642 | foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles) |
@@ -625,7 +650,7 @@ namespace Prebuild.Core.Targets | |||
625 | } | 650 | } |
626 | } | 651 | } |
627 | 652 | ||
628 | ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); | 653 | ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); |
629 | foreach (ProjectNode project in solution.Projects) | 654 | foreach (ProjectNode project in solution.Projects) |
630 | { | 655 | { |
631 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 656 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
diff --git a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs index 40a210d..66dd1bc 100644 --- a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs +++ b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -29,11 +29,11 @@ using Prebuild.Core.Attributes; | |||
29 | 29 | ||
30 | namespace Prebuild.Core.Targets | 30 | namespace Prebuild.Core.Targets |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// | 33 | /// |
34 | /// </summary> | 34 | /// </summary> |
35 | [Target("sharpdev2")] | 35 | [Target("sharpdev2")] |
36 | public class SharpDevelop2Target : VS2005Target | 36 | public class SharpDevelop2Target : VS2005Target |
37 | { | 37 | { |
38 | #region Properties | 38 | #region Properties |
39 | public override string VersionName | 39 | public override string VersionName |
@@ -45,38 +45,38 @@ namespace Prebuild.Core.Targets | |||
45 | } | 45 | } |
46 | #endregion | 46 | #endregion |
47 | 47 | ||
48 | #region Public Methods | 48 | #region Public Methods |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Writes the specified kern. | 51 | /// Writes the specified kern. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <param name="kern">The kern.</param> | 53 | /// <param name="kern">The kern.</param> |
54 | public override void Write(Kernel kern) | 54 | public override void Write(Kernel kern) |
55 | { | 55 | { |
56 | base.Write(kern); | 56 | base.Write(kern); |
57 | } | 57 | } |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Cleans the specified kern. | 60 | /// Cleans the specified kern. |
61 | /// </summary> | 61 | /// </summary> |
62 | /// <param name="kern">The kern.</param> | 62 | /// <param name="kern">The kern.</param> |
63 | public override void Clean(Kernel kern) | 63 | public override void Clean(Kernel kern) |
64 | { | 64 | { |
65 | base.Clean(kern); | 65 | base.Clean(kern); |
66 | } | 66 | } |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// Gets the name. | 69 | /// Gets the name. |
70 | /// </summary> | 70 | /// </summary> |
71 | /// <value>The name.</value> | 71 | /// <value>The name.</value> |
72 | public override string Name | 72 | public override string Name |
73 | { | 73 | { |
74 | get | 74 | get |
75 | { | 75 | { |
76 | return "sharpdev2"; | 76 | return "sharpdev2"; |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | #endregion | 80 | #endregion |
81 | } | 81 | } |
82 | } | 82 | } |
diff --git a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs index acab9f4..8e32050 100644 --- a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs +++ b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,392 +34,392 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Targets | 35 | namespace Prebuild.Core.Targets |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [Target("sharpdev")] | 40 | [Target("sharpdev")] |
41 | public class SharpDevelopTarget : ITarget | 41 | public class SharpDevelopTarget : ITarget |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | private Kernel m_Kernel; | 45 | private Kernel m_Kernel; |
46 | 46 | ||
47 | #endregion | 47 | #endregion |
48 | 48 | ||
49 | #region Private Methods | 49 | #region Private Methods |
50 | 50 | ||
51 | private static string PrependPath(string path) | 51 | private static string PrependPath(string path) |
52 | { | 52 | { |
53 | string tmpPath = Helper.NormalizePath(path, '/'); | 53 | string tmpPath = Helper.NormalizePath(path, '/'); |
54 | Regex regex = new Regex(@"(\w):/(\w+)"); | 54 | Regex regex = new Regex(@"(\w):/(\w+)"); |
55 | Match match = regex.Match(tmpPath); | 55 | Match match = regex.Match(tmpPath); |
56 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') | 56 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') |
57 | { | 57 | { |
58 | tmpPath = Helper.NormalizePath(tmpPath); | 58 | tmpPath = Helper.NormalizePath(tmpPath); |
59 | } | 59 | } |
60 | else | 60 | else |
61 | { | 61 | { |
62 | tmpPath = Helper.NormalizePath("./" + tmpPath); | 62 | tmpPath = Helper.NormalizePath("./" + tmpPath); |
63 | } | 63 | } |
64 | 64 | ||
65 | return tmpPath; | 65 | return tmpPath; |
66 | } | 66 | } |
67 | 67 | ||
68 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) | 68 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) |
69 | { | 69 | { |
70 | string ret = "<Reference type=\""; | 70 | string ret = "<Reference type=\""; |
71 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 71 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
72 | { | 72 | { |
73 | ret += "Project\" refto=\"" + refr.Name; | 73 | ret += "Project\" refto=\"" + refr.Name; |
74 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; | 74 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; |
75 | } | 75 | } |
76 | else | 76 | else |
77 | { | 77 | { |
78 | ProjectNode project = (ProjectNode)refr.Parent; | 78 | ProjectNode project = (ProjectNode)refr.Parent; |
79 | string fileRef = FindFileReference(refr.Name, project); | 79 | string fileRef = FindFileReference(refr.Name, project); |
80 | 80 | ||
81 | if(refr.Path != null || fileRef != null) | 81 | if(refr.Path != null || fileRef != null) |
82 | { | 82 | { |
83 | ret += "Assembly\" refto=\""; | 83 | ret += "Assembly\" refto=\""; |
84 | 84 | ||
85 | string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; | 85 | string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; |
86 | 86 | ||
87 | ret += finalPath; | 87 | ret += finalPath; |
88 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; | 88 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; |
89 | return ret; | 89 | return ret; |
90 | } | 90 | } |
91 | 91 | ||
92 | ret += "Gac\" refto=\""; | 92 | ret += "Gac\" refto=\""; |
93 | try | 93 | try |
94 | { | 94 | { |
95 | //Assembly assem = Assembly.Load(refr.Name); | 95 | //Assembly assem = Assembly.Load(refr.Name); |
96 | ret += refr.Name;// assem.FullName; | 96 | ret += refr.Name;// assem.FullName; |
97 | } | 97 | } |
98 | catch (System.NullReferenceException e) | 98 | catch (System.NullReferenceException e) |
99 | { | 99 | { |
100 | e.ToString(); | 100 | e.ToString(); |
101 | ret += refr.Name; | 101 | ret += refr.Name; |
102 | } | 102 | } |
103 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; | 103 | ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; |
104 | } | 104 | } |
105 | 105 | ||
106 | return ret; | 106 | return ret; |
107 | } | 107 | } |
108 | 108 | ||
109 | private static string FindFileReference(string refName, ProjectNode project) | 109 | private static string FindFileReference(string refName, ProjectNode project) |
110 | { | 110 | { |
111 | foreach(ReferencePathNode refPath in project.ReferencePaths) | 111 | foreach(ReferencePathNode refPath in project.ReferencePaths) |
112 | { | 112 | { |
113 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); | 113 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); |
114 | 114 | ||
115 | if(File.Exists(fullPath)) | 115 | if(File.Exists(fullPath)) |
116 | { | 116 | { |
117 | return fullPath; | 117 | return fullPath; |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | return null; | 121 | return null; |
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Gets the XML doc file. | 125 | /// Gets the XML doc file. |
126 | /// </summary> | 126 | /// </summary> |
127 | /// <param name="project">The project.</param> | 127 | /// <param name="project">The project.</param> |
128 | /// <param name="conf">The conf.</param> | 128 | /// <param name="conf">The conf.</param> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
130 | public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) | 130 | public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) |
131 | { | 131 | { |
132 | if( conf == null ) | 132 | if( conf == null ) |
133 | { | 133 | { |
134 | throw new ArgumentNullException("conf"); | 134 | throw new ArgumentNullException("conf"); |
135 | } | 135 | } |
136 | if( project == null ) | 136 | if( project == null ) |
137 | { | 137 | { |
138 | throw new ArgumentNullException("project"); | 138 | throw new ArgumentNullException("project"); |
139 | } | 139 | } |
140 | string docFile = (string)conf.Options["XmlDocFile"]; | 140 | string docFile = (string)conf.Options["XmlDocFile"]; |
141 | if(docFile != null && docFile.Length == 0)//default to assembly name if not specified | 141 | if(docFile != null && docFile.Length == 0)//default to assembly name if not specified |
142 | { | 142 | { |
143 | return "False"; | 143 | return "False"; |
144 | } | 144 | } |
145 | return "True"; | 145 | return "True"; |
146 | } | 146 | } |
147 | 147 | ||
148 | private void WriteProject(SolutionNode solution, ProjectNode project) | 148 | private void WriteProject(SolutionNode solution, ProjectNode project) |
149 | { | 149 | { |
150 | string csComp = "Csc"; | 150 | string csComp = "Csc"; |
151 | string netRuntime = "MsNet"; | 151 | string netRuntime = "MsNet"; |
152 | if(project.Runtime == ClrRuntime.Mono) | 152 | if(project.Runtime == ClrRuntime.Mono) |
153 | { | 153 | { |
154 | csComp = "Mcs"; | 154 | csComp = "Mcs"; |
155 | netRuntime = "Mono"; | 155 | netRuntime = "Mono"; |
156 | } | 156 | } |
157 | 157 | ||
158 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); | 158 | string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); |
159 | StreamWriter ss = new StreamWriter(projFile); | 159 | StreamWriter ss = new StreamWriter(projFile); |
160 | 160 | ||
161 | m_Kernel.CurrentWorkingDirectory.Push(); | 161 | m_Kernel.CurrentWorkingDirectory.Push(); |
162 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); | 162 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); |
163 | 163 | ||
164 | using(ss) | 164 | using(ss) |
165 | { | 165 | { |
166 | ss.WriteLine( | 166 | ss.WriteLine( |
167 | "<Project name=\"{0}\" standardNamespace=\"{1}\" description=\"\" newfilesearch=\"None\" enableviewstate=\"True\" version=\"1.1\" projecttype=\"C#\">", | 167 | "<Project name=\"{0}\" standardNamespace=\"{1}\" description=\"\" newfilesearch=\"None\" enableviewstate=\"True\" version=\"1.1\" projecttype=\"C#\">", |
168 | project.Name, | 168 | project.Name, |
169 | project.RootNamespace | 169 | project.RootNamespace |
170 | ); | 170 | ); |
171 | 171 | ||
172 | ss.WriteLine(" <Contents>"); | 172 | ss.WriteLine(" <Contents>"); |
173 | foreach(string file in project.Files) | 173 | foreach(string file in project.Files) |
174 | { | 174 | { |
175 | string buildAction = "Compile"; | 175 | string buildAction = "Compile"; |
176 | switch(project.Files.GetBuildAction(file)) | 176 | switch(project.Files.GetBuildAction(file)) |
177 | { | 177 | { |
178 | case BuildAction.None: | 178 | case BuildAction.None: |
179 | buildAction = "Nothing"; | 179 | buildAction = "Nothing"; |
180 | break; | 180 | break; |
181 | 181 | ||
182 | case BuildAction.Content: | 182 | case BuildAction.Content: |
183 | buildAction = "Exclude"; | 183 | buildAction = "Exclude"; |
184 | break; | 184 | break; |
185 | 185 | ||
186 | case BuildAction.EmbeddedResource: | 186 | case BuildAction.EmbeddedResource: |
187 | buildAction = "EmbedAsResource"; | 187 | buildAction = "EmbedAsResource"; |
188 | break; | 188 | break; |
189 | 189 | ||
190 | default: | 190 | default: |
191 | buildAction = "Compile"; | 191 | buildAction = "Compile"; |
192 | break; | 192 | break; |
193 | } | 193 | } |
194 | 194 | ||
195 | // Sort of a hack, we try and resolve the path and make it relative, if we can. | 195 | // Sort of a hack, we try and resolve the path and make it relative, if we can. |
196 | string filePath = PrependPath(file); | 196 | string filePath = PrependPath(file); |
197 | ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction); | 197 | ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction); |
198 | } | 198 | } |
199 | ss.WriteLine(" </Contents>"); | 199 | ss.WriteLine(" </Contents>"); |
200 | 200 | ||
201 | ss.WriteLine(" <References>"); | 201 | ss.WriteLine(" <References>"); |
202 | foreach(ReferenceNode refr in project.References) | 202 | foreach(ReferenceNode refr in project.References) |
203 | { | 203 | { |
204 | ss.WriteLine(" {0}", BuildReference(solution, refr)); | 204 | ss.WriteLine(" {0}", BuildReference(solution, refr)); |
205 | } | 205 | } |
206 | ss.WriteLine(" </References>"); | 206 | ss.WriteLine(" </References>"); |
207 | 207 | ||
208 | ss.Write(" <DeploymentInformation"); | 208 | ss.Write(" <DeploymentInformation"); |
209 | ss.Write(" target=\"\""); | 209 | ss.Write(" target=\"\""); |
210 | ss.Write(" script=\"\""); | 210 | ss.Write(" script=\"\""); |
211 | ss.Write(" strategy=\"File\""); | 211 | ss.Write(" strategy=\"File\""); |
212 | ss.WriteLine(" />"); | 212 | ss.WriteLine(" />"); |
213 | 213 | ||
214 | int count = 0; | 214 | int count = 0; |
215 | 215 | ||
216 | ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); | 216 | ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); |
217 | 217 | ||
218 | foreach(ConfigurationNode conf in project.Configurations) | 218 | foreach(ConfigurationNode conf in project.Configurations) |
219 | { | 219 | { |
220 | ss.Write(" <Configuration"); | 220 | ss.Write(" <Configuration"); |
221 | ss.Write(" runwithwarnings=\"True\""); | 221 | ss.Write(" runwithwarnings=\"True\""); |
222 | ss.Write(" name=\"{0}\"", conf.Name); | 222 | ss.Write(" name=\"{0}\"", conf.Name); |
223 | ss.WriteLine(">"); | 223 | ss.WriteLine(">"); |
224 | ss.Write(" <CodeGeneration"); | 224 | ss.Write(" <CodeGeneration"); |
225 | ss.Write(" runtime=\"{0}\"", netRuntime); | 225 | ss.Write(" runtime=\"{0}\"", netRuntime); |
226 | ss.Write(" compiler=\"{0}\"", csComp); | 226 | ss.Write(" compiler=\"{0}\"", csComp); |
227 | ss.Write(" compilerversion=\"\""); | 227 | ss.Write(" compilerversion=\"\""); |
228 | ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); | 228 | ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); |
229 | ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); | 229 | ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); |
230 | ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); | 230 | ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); |
231 | ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); | 231 | ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); |
232 | ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); | 232 | ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); |
233 | ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); | 233 | ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); |
234 | ss.Write(" mainclass=\"{0}\"", project.StartupObject); | 234 | ss.Write(" mainclass=\"{0}\"", project.StartupObject); |
235 | ss.Write(" target=\"{0}\"", project.Type); | 235 | ss.Write(" target=\"{0}\"", project.Type); |
236 | ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); | 236 | ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); |
237 | ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); | 237 | ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); |
238 | ss.Write(" win32Icon=\"{0}\"", Helper.NormalizePath(".\\" + project.AppIcon)); | 238 | ss.Write(" win32Icon=\"{0}\"", Helper.NormalizePath(".\\" + project.AppIcon)); |
239 | ss.Write(" noconfig=\"{0}\"", "False"); | 239 | ss.Write(" noconfig=\"{0}\"", "False"); |
240 | ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); | 240 | ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); |
241 | ss.WriteLine(" />"); | 241 | ss.WriteLine(" />"); |
242 | 242 | ||
243 | ss.Write(" <Execution"); | 243 | ss.Write(" <Execution"); |
244 | ss.Write(" commandlineparameters=\"\""); | 244 | ss.Write(" commandlineparameters=\"\""); |
245 | ss.Write(" consolepause=\"True\""); | 245 | ss.Write(" consolepause=\"True\""); |
246 | ss.WriteLine(" />"); | 246 | ss.WriteLine(" />"); |
247 | 247 | ||
248 | ss.Write(" <Output"); | 248 | ss.Write(" <Output"); |
249 | ss.Write(" directory=\".\\{0}\"", Helper.NormalizePath(conf.Options["OutputPath"].ToString())); | 249 | ss.Write(" directory=\".\\{0}\"", Helper.NormalizePath(conf.Options["OutputPath"].ToString())); |
250 | ss.Write(" assembly=\"{0}\"", project.AssemblyName); | 250 | ss.Write(" assembly=\"{0}\"", project.AssemblyName); |
251 | ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); | 251 | ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); |
252 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) | 252 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) |
253 | { | 253 | { |
254 | ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); | 254 | ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); |
255 | } | 255 | } |
256 | else | 256 | else |
257 | { | 257 | { |
258 | ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); | 258 | ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); |
259 | } | 259 | } |
260 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) | 260 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) |
261 | { | 261 | { |
262 | ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); | 262 | ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); |
263 | } | 263 | } |
264 | else | 264 | else |
265 | { | 265 | { |
266 | ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); | 266 | ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); |
267 | } | 267 | } |
268 | ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); | 268 | ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); |
269 | ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); | 269 | ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); |
270 | ss.WriteLine(" />"); | 270 | ss.WriteLine(" />"); |
271 | ss.WriteLine(" </Configuration>"); | 271 | ss.WriteLine(" </Configuration>"); |
272 | 272 | ||
273 | count++; | 273 | count++; |
274 | } | 274 | } |
275 | ss.WriteLine(" </Configurations>"); | 275 | ss.WriteLine(" </Configurations>"); |
276 | ss.WriteLine("</Project>"); | 276 | ss.WriteLine("</Project>"); |
277 | } | 277 | } |
278 | 278 | ||
279 | m_Kernel.CurrentWorkingDirectory.Pop(); | 279 | m_Kernel.CurrentWorkingDirectory.Pop(); |
280 | } | 280 | } |
281 | 281 | ||
282 | private void WriteCombine(SolutionNode solution) | 282 | private void WriteCombine(SolutionNode solution) |
283 | { | 283 | { |
284 | m_Kernel.Log.Write("Creating SharpDevelop combine and project files"); | 284 | m_Kernel.Log.Write("Creating SharpDevelop combine and project files"); |
285 | foreach(ProjectNode project in solution.Projects) | 285 | foreach(ProjectNode project in solution.Projects) |
286 | { | 286 | { |
287 | if(m_Kernel.AllowProject(project.FilterGroups)) | 287 | if(m_Kernel.AllowProject(project.FilterGroups)) |
288 | { | 288 | { |
289 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); | 289 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); |
290 | WriteProject(solution, project); | 290 | WriteProject(solution, project); |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | m_Kernel.Log.Write(""); | 294 | m_Kernel.Log.Write(""); |
295 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); | 295 | string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); |
296 | StreamWriter ss = new StreamWriter(combFile); | 296 | StreamWriter ss = new StreamWriter(combFile); |
297 | 297 | ||
298 | m_Kernel.CurrentWorkingDirectory.Push(); | 298 | m_Kernel.CurrentWorkingDirectory.Push(); |
299 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); | 299 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); |
300 | 300 | ||
301 | using(ss) | 301 | using(ss) |
302 | { | 302 | { |
303 | ss.WriteLine("<Combine fileversion=\"1.0\" name=\"{0}\" description=\"\">", solution.Name); | 303 | ss.WriteLine("<Combine fileversion=\"1.0\" name=\"{0}\" description=\"\">", solution.Name); |
304 | 304 | ||
305 | int count = 0; | 305 | int count = 0; |
306 | foreach(ProjectNode project in solution.Projects) | 306 | foreach(ProjectNode project in solution.Projects) |
307 | { | 307 | { |
308 | if(count == 0) | 308 | if(count == 0) |
309 | ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); | 309 | ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); |
310 | 310 | ||
311 | ss.WriteLine(" <Execute entry=\"{0}\" type=\"None\" />", project.Name); | 311 | ss.WriteLine(" <Execute entry=\"{0}\" type=\"None\" />", project.Name); |
312 | count++; | 312 | count++; |
313 | } | 313 | } |
314 | ss.WriteLine(" </StartMode>"); | 314 | ss.WriteLine(" </StartMode>"); |
315 | 315 | ||
316 | ss.WriteLine(" <Entries>"); | 316 | ss.WriteLine(" <Entries>"); |
317 | foreach(ProjectNode project in solution.Projects) | 317 | foreach(ProjectNode project in solution.Projects) |
318 | { | 318 | { |
319 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 319 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
320 | ss.WriteLine(" <Entry filename=\"{0}\" />", | 320 | ss.WriteLine(" <Entry filename=\"{0}\" />", |
321 | Helper.MakeFilePath(path, project.Name, "prjx")); | 321 | Helper.MakeFilePath(path, project.Name, "prjx")); |
322 | } | 322 | } |
323 | ss.WriteLine(" </Entries>"); | 323 | ss.WriteLine(" </Entries>"); |
324 | 324 | ||
325 | count = 0; | 325 | count = 0; |
326 | foreach(ConfigurationNode conf in solution.Configurations) | 326 | foreach(ConfigurationNode conf in solution.Configurations) |
327 | { | 327 | { |
328 | if(count == 0) | 328 | if(count == 0) |
329 | { | 329 | { |
330 | ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); | 330 | ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); |
331 | } | 331 | } |
332 | 332 | ||
333 | ss.WriteLine(" <Configuration name=\"{0}\">", conf.Name); | 333 | ss.WriteLine(" <Configuration name=\"{0}\">", conf.Name); |
334 | foreach(ProjectNode project in solution.Projects) | 334 | foreach(ProjectNode project in solution.Projects) |
335 | { | 335 | { |
336 | ss.WriteLine(" <Entry name=\"{0}\" configurationname=\"{1}\" build=\"True\" />", project.Name, conf.Name); | 336 | ss.WriteLine(" <Entry name=\"{0}\" configurationname=\"{1}\" build=\"True\" />", project.Name, conf.Name); |
337 | } | 337 | } |
338 | ss.WriteLine(" </Configuration>"); | 338 | ss.WriteLine(" </Configuration>"); |
339 | 339 | ||
340 | count++; | 340 | count++; |
341 | } | 341 | } |
342 | ss.WriteLine(" </Configurations>"); | 342 | ss.WriteLine(" </Configurations>"); |
343 | ss.WriteLine("</Combine>"); | 343 | ss.WriteLine("</Combine>"); |
344 | } | 344 | } |
345 | 345 | ||
346 | m_Kernel.CurrentWorkingDirectory.Pop(); | 346 | m_Kernel.CurrentWorkingDirectory.Pop(); |
347 | } | 347 | } |
348 | 348 | ||
349 | private void CleanProject(ProjectNode project) | 349 | private void CleanProject(ProjectNode project) |
350 | { | 350 | { |
351 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); | 351 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); |
352 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); | 352 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); |
353 | Helper.DeleteIfExists(projectFile); | 353 | Helper.DeleteIfExists(projectFile); |
354 | } | 354 | } |
355 | 355 | ||
356 | private void CleanSolution(SolutionNode solution) | 356 | private void CleanSolution(SolutionNode solution) |
357 | { | 357 | { |
358 | m_Kernel.Log.Write("Cleaning SharpDevelop combine and project files for", solution.Name); | 358 | m_Kernel.Log.Write("Cleaning SharpDevelop combine and project files for", solution.Name); |
359 | 359 | ||
360 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); | 360 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); |
361 | Helper.DeleteIfExists(slnFile); | 361 | Helper.DeleteIfExists(slnFile); |
362 | 362 | ||
363 | foreach(ProjectNode project in solution.Projects) | 363 | foreach(ProjectNode project in solution.Projects) |
364 | { | 364 | { |
365 | CleanProject(project); | 365 | CleanProject(project); |
366 | } | 366 | } |
367 | 367 | ||
368 | m_Kernel.Log.Write(""); | 368 | m_Kernel.Log.Write(""); |
369 | } | 369 | } |
370 | 370 | ||
371 | #endregion | 371 | #endregion |
372 | 372 | ||
373 | #region ITarget Members | 373 | #region ITarget Members |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// Writes the specified kern. | 376 | /// Writes the specified kern. |
377 | /// </summary> | 377 | /// </summary> |
378 | /// <param name="kern">The kern.</param> | 378 | /// <param name="kern">The kern.</param> |
379 | public void Write(Kernel kern) | 379 | public void Write(Kernel kern) |
380 | { | 380 | { |
381 | if( kern == null ) | 381 | if( kern == null ) |
382 | { | 382 | { |
383 | throw new ArgumentNullException("kern"); | 383 | throw new ArgumentNullException("kern"); |
384 | } | 384 | } |
385 | m_Kernel = kern; | 385 | m_Kernel = kern; |
386 | foreach(SolutionNode solution in kern.Solutions) | 386 | foreach(SolutionNode solution in kern.Solutions) |
387 | { | 387 | { |
388 | WriteCombine(solution); | 388 | WriteCombine(solution); |
389 | } | 389 | } |
390 | m_Kernel = null; | 390 | m_Kernel = null; |
391 | } | 391 | } |
392 | 392 | ||
393 | /// <summary> | 393 | /// <summary> |
394 | /// Cleans the specified kern. | 394 | /// Cleans the specified kern. |
395 | /// </summary> | 395 | /// </summary> |
396 | /// <param name="kern">The kern.</param> | 396 | /// <param name="kern">The kern.</param> |
397 | public virtual void Clean(Kernel kern) | 397 | public virtual void Clean(Kernel kern) |
398 | { | 398 | { |
399 | if( kern == null ) | 399 | if( kern == null ) |
400 | { | 400 | { |
401 | throw new ArgumentNullException("kern"); | 401 | throw new ArgumentNullException("kern"); |
402 | } | 402 | } |
403 | m_Kernel = kern; | 403 | m_Kernel = kern; |
404 | foreach(SolutionNode sol in kern.Solutions) | 404 | foreach(SolutionNode sol in kern.Solutions) |
405 | { | 405 | { |
406 | CleanSolution(sol); | 406 | CleanSolution(sol); |
407 | } | 407 | } |
408 | m_Kernel = null; | 408 | m_Kernel = null; |
409 | } | 409 | } |
410 | 410 | ||
411 | /// <summary> | 411 | /// <summary> |
412 | /// Gets the name. | 412 | /// Gets the name. |
413 | /// </summary> | 413 | /// </summary> |
414 | /// <value>The name.</value> | 414 | /// <value>The name.</value> |
415 | public string Name | 415 | public string Name |
416 | { | 416 | { |
417 | get | 417 | get |
418 | { | 418 | { |
419 | return "sharpdev"; | 419 | return "sharpdev"; |
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
423 | #endregion | 423 | #endregion |
424 | } | 424 | } |
425 | } | 425 | } |
diff --git a/Prebuild/src/Core/Targets/ToolInfo.cs b/Prebuild/src/Core/Targets/ToolInfo.cs index 984d20e..935c674 100644 --- a/Prebuild/src/Core/Targets/ToolInfo.cs +++ b/Prebuild/src/Core/Targets/ToolInfo.cs | |||
@@ -4,194 +4,194 @@ using System.Text; | |||
4 | 4 | ||
5 | namespace Prebuild.Core.Targets | 5 | namespace Prebuild.Core.Targets |
6 | { | 6 | { |
7 | /// <summary> | 7 | /// <summary> |
8 | /// | 8 | /// |
9 | /// </summary> | 9 | /// </summary> |
10 | public struct ToolInfo | 10 | public struct ToolInfo |
11 | { | 11 | { |
12 | string name; | 12 | string name; |
13 | string guid; | 13 | string guid; |
14 | string fileExtension; | 14 | string fileExtension; |
15 | string xmlTag; | 15 | string xmlTag; |
16 | string importProject; | 16 | string importProject; |
17 | 17 | ||
18 | /// <summary> | 18 | /// <summary> |
19 | /// Gets or sets the name. | 19 | /// Gets or sets the name. |
20 | /// </summary> | 20 | /// </summary> |
21 | /// <value>The name.</value> | 21 | /// <value>The name.</value> |
22 | public string Name | 22 | public string Name |
23 | { | 23 | { |
24 | get | 24 | get |
25 | { | 25 | { |
26 | return name; | 26 | return name; |
27 | } | 27 | } |
28 | set | 28 | set |
29 | { | 29 | { |
30 | name = value; | 30 | name = value; |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | /// <summary> | 34 | /// <summary> |
35 | /// Gets or sets the GUID. | 35 | /// Gets or sets the GUID. |
36 | /// </summary> | 36 | /// </summary> |
37 | /// <value>The GUID.</value> | 37 | /// <value>The GUID.</value> |
38 | public string Guid | 38 | public string Guid |
39 | { | 39 | { |
40 | get | 40 | get |
41 | { | 41 | { |
42 | return guid; | 42 | return guid; |
43 | } | 43 | } |
44 | set | 44 | set |
45 | { | 45 | { |
46 | guid = value; | 46 | guid = value; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Gets or sets the file extension. | 51 | /// Gets or sets the file extension. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <value>The file extension.</value> | 53 | /// <value>The file extension.</value> |
54 | public string FileExtension | 54 | public string FileExtension |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return fileExtension; | 58 | return fileExtension; |
59 | } | 59 | } |
60 | set | 60 | set |
61 | { | 61 | { |
62 | fileExtension = value; | 62 | fileExtension = value; |
63 | } | 63 | } |
64 | } | 64 | } |
65 | public string LanguageExtension | 65 | public string LanguageExtension |
66 | { | 66 | { |
67 | get | 67 | get |
68 | { | 68 | { |
69 | switch (this.Name) | 69 | switch (this.Name) |
70 | { | 70 | { |
71 | case "C#": | 71 | case "C#": |
72 | return ".cs"; | 72 | return ".cs"; |
73 | case "VisualBasic": | 73 | case "VisualBasic": |
74 | return ".vb"; | 74 | return ".vb"; |
75 | case "Boo": | 75 | case "Boo": |
76 | return ".boo"; | 76 | return ".boo"; |
77 | default: | 77 | default: |
78 | return ".cs"; | 78 | return ".cs"; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | /// <summary> | 82 | /// <summary> |
83 | /// Gets or sets the XML tag. | 83 | /// Gets or sets the XML tag. |
84 | /// </summary> | 84 | /// </summary> |
85 | /// <value>The XML tag.</value> | 85 | /// <value>The XML tag.</value> |
86 | public string XmlTag | 86 | public string XmlTag |
87 | { | 87 | { |
88 | get | 88 | get |
89 | { | 89 | { |
90 | return xmlTag; | 90 | return xmlTag; |
91 | } | 91 | } |
92 | set | 92 | set |
93 | { | 93 | { |
94 | xmlTag = value; | 94 | xmlTag = value; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Gets or sets the import project property. | 99 | /// Gets or sets the import project property. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <value>The ImportProject tag.</value> | 101 | /// <value>The ImportProject tag.</value> |
102 | public string ImportProject | 102 | public string ImportProject |
103 | { | 103 | { |
104 | get | 104 | get |
105 | { | 105 | { |
106 | return importProject; | 106 | return importProject; |
107 | } | 107 | } |
108 | set | 108 | set |
109 | { | 109 | { |
110 | importProject = value; | 110 | importProject = value; |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. | 115 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <param name="name">The name.</param> | 117 | /// <param name="name">The name.</param> |
118 | /// <param name="guid">The GUID.</param> | 118 | /// <param name="guid">The GUID.</param> |
119 | /// <param name="fileExtension">The file extension.</param> | 119 | /// <param name="fileExtension">The file extension.</param> |
120 | /// <param name="xml">The XML.</param> | 120 | /// <param name="xml">The XML.</param> |
121 | /// <param name="importProject">The import project.</param> | 121 | /// <param name="importProject">The import project.</param> |
122 | public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject) | 122 | public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject) |
123 | { | 123 | { |
124 | this.name = name; | 124 | this.name = name; |
125 | this.guid = guid; | 125 | this.guid = guid; |
126 | this.fileExtension = fileExtension; | 126 | this.fileExtension = fileExtension; |
127 | this.xmlTag = xml; | 127 | this.xmlTag = xml; |
128 | this.importProject = importProject; | 128 | this.importProject = importProject; |
129 | } | 129 | } |
130 | 130 | ||
131 | /// <summary> | 131 | /// <summary> |
132 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. | 132 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. |
133 | /// </summary> | 133 | /// </summary> |
134 | /// <param name="name">The name.</param> | 134 | /// <param name="name">The name.</param> |
135 | /// <param name="guid">The GUID.</param> | 135 | /// <param name="guid">The GUID.</param> |
136 | /// <param name="fileExtension">The file extension.</param> | 136 | /// <param name="fileExtension">The file extension.</param> |
137 | /// <param name="xml">The XML.</param> | 137 | /// <param name="xml">The XML.</param> |
138 | public ToolInfo(string name, string guid, string fileExtension, string xml) | 138 | public ToolInfo(string name, string guid, string fileExtension, string xml) |
139 | { | 139 | { |
140 | this.name = name; | 140 | this.name = name; |
141 | this.guid = guid; | 141 | this.guid = guid; |
142 | this.fileExtension = fileExtension; | 142 | this.fileExtension = fileExtension; |
143 | this.xmlTag = xml; | 143 | this.xmlTag = xml; |
144 | this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets"; | 144 | this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets"; |
145 | } | 145 | } |
146 | 146 | ||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Equals operator | 148 | /// Equals operator |
149 | /// </summary> | 149 | /// </summary> |
150 | /// <param name="obj">ToolInfo to compare</param> | 150 | /// <param name="obj">ToolInfo to compare</param> |
151 | /// <returns>true if toolInfos are equal</returns> | 151 | /// <returns>true if toolInfos are equal</returns> |
152 | public override bool Equals(object obj) | 152 | public override bool Equals(object obj) |
153 | { | 153 | { |
154 | if (obj == null) | 154 | if (obj == null) |
155 | { | 155 | { |
156 | throw new ArgumentNullException("obj"); | 156 | throw new ArgumentNullException("obj"); |
157 | } | 157 | } |
158 | if (obj.GetType() != typeof(ToolInfo)) | 158 | if (obj.GetType() != typeof(ToolInfo)) |
159 | return false; | 159 | return false; |
160 | 160 | ||
161 | ToolInfo c = (ToolInfo)obj; | 161 | ToolInfo c = (ToolInfo)obj; |
162 | return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject)); | 162 | return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject)); |
163 | } | 163 | } |
164 | 164 | ||
165 | /// <summary> | 165 | /// <summary> |
166 | /// Equals operator | 166 | /// Equals operator |
167 | /// </summary> | 167 | /// </summary> |
168 | /// <param name="c1">ToolInfo to compare</param> | 168 | /// <param name="c1">ToolInfo to compare</param> |
169 | /// <param name="c2">ToolInfo to compare</param> | 169 | /// <param name="c2">ToolInfo to compare</param> |
170 | /// <returns>True if toolInfos are equal</returns> | 170 | /// <returns>True if toolInfos are equal</returns> |
171 | public static bool operator ==(ToolInfo c1, ToolInfo c2) | 171 | public static bool operator ==(ToolInfo c1, ToolInfo c2) |
172 | { | 172 | { |
173 | return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag)); | 173 | return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag)); |
174 | } | 174 | } |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// Not equals operator | 177 | /// Not equals operator |
178 | /// </summary> | 178 | /// </summary> |
179 | /// <param name="c1">ToolInfo to compare</param> | 179 | /// <param name="c1">ToolInfo to compare</param> |
180 | /// <param name="c2">ToolInfo to compare</param> | 180 | /// <param name="c2">ToolInfo to compare</param> |
181 | /// <returns>True if toolInfos are not equal</returns> | 181 | /// <returns>True if toolInfos are not equal</returns> |
182 | public static bool operator !=(ToolInfo c1, ToolInfo c2) | 182 | public static bool operator !=(ToolInfo c1, ToolInfo c2) |
183 | { | 183 | { |
184 | return !(c1 == c2); | 184 | return !(c1 == c2); |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// Hash Code | 188 | /// Hash Code |
189 | /// </summary> | 189 | /// </summary> |
190 | /// <returns>Hash code</returns> | 190 | /// <returns>Hash code</returns> |
191 | public override int GetHashCode() | 191 | public override int GetHashCode() |
192 | { | 192 | { |
193 | return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode(); | 193 | return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode(); |
194 | 194 | ||
195 | } | 195 | } |
196 | } | 196 | } |
197 | } | 197 | } |
diff --git a/Prebuild/src/Core/Targets/VS2002Target.cs b/Prebuild/src/Core/Targets/VS2002Target.cs index d7f6dd1..2292624 100644 --- a/Prebuild/src/Core/Targets/VS2002Target.cs +++ b/Prebuild/src/Core/Targets/VS2002Target.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -29,59 +29,59 @@ using Prebuild.Core.Attributes; | |||
29 | 29 | ||
30 | namespace Prebuild.Core.Targets | 30 | namespace Prebuild.Core.Targets |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// | 33 | /// |
34 | /// </summary> | 34 | /// </summary> |
35 | [Target("vs2002")] | 35 | [Target("vs2002")] |
36 | public class VS2002Target : VS2003Target | 36 | public class VS2002Target : VS2003Target |
37 | { | 37 | { |
38 | #region Private Methods | 38 | #region Private Methods |
39 | 39 | ||
40 | private void SetVS2002() | 40 | private void SetVS2002() |
41 | { | 41 | { |
42 | this.SolutionVersion = "7.00"; | 42 | this.SolutionVersion = "7.00"; |
43 | this.ProductVersion = "7.0.9254"; | 43 | this.ProductVersion = "7.0.9254"; |
44 | this.SchemaVersion = "1.0"; | 44 | this.SchemaVersion = "1.0"; |
45 | this.VersionName = "2002"; | 45 | this.VersionName = "2002"; |
46 | this.Version = VSVersion.VS70; | 46 | this.Version = VSVersion.VS70; |
47 | } | 47 | } |
48 | 48 | ||
49 | #endregion | 49 | #endregion |
50 | 50 | ||
51 | #region Public Methods | 51 | #region Public Methods |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Writes the specified kern. | 54 | /// Writes the specified kern. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="kern">The kern.</param> | 56 | /// <param name="kern">The kern.</param> |
57 | public override void Write(Kernel kern) | 57 | public override void Write(Kernel kern) |
58 | { | 58 | { |
59 | SetVS2002(); | 59 | SetVS2002(); |
60 | base.Write(kern); | 60 | base.Write(kern); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Cleans the specified kern. | 64 | /// Cleans the specified kern. |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <param name="kern">The kern.</param> | 66 | /// <param name="kern">The kern.</param> |
67 | public override void Clean(Kernel kern) | 67 | public override void Clean(Kernel kern) |
68 | { | 68 | { |
69 | SetVS2002(); | 69 | SetVS2002(); |
70 | base.Clean(kern); | 70 | base.Clean(kern); |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Gets the name. | 74 | /// Gets the name. |
75 | /// </summary> | 75 | /// </summary> |
76 | /// <value>The name.</value> | 76 | /// <value>The name.</value> |
77 | public override string Name | 77 | public override string Name |
78 | { | 78 | { |
79 | get | 79 | get |
80 | { | 80 | { |
81 | return "vs2002"; | 81 | return "vs2002"; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/Prebuild/src/Core/Targets/VS2003Target.cs b/Prebuild/src/Core/Targets/VS2003Target.cs index f4b4517..10e2dc4 100644 --- a/Prebuild/src/Core/Targets/VS2003Target.cs +++ b/Prebuild/src/Core/Targets/VS2003Target.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,560 +34,560 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Targets | 35 | namespace Prebuild.Core.Targets |
36 | { | 36 | { |
37 | [Target("vs2003")] | 37 | [Target("vs2003")] |
38 | public class VS2003Target : ITarget | 38 | public class VS2003Target : ITarget |
39 | { | 39 | { |
40 | 40 | ||
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | string solutionVersion = "8.00"; | 43 | string solutionVersion = "8.00"; |
44 | string productVersion = "7.10.3077"; | 44 | string productVersion = "7.10.3077"; |
45 | string schemaVersion = "2.0"; | 45 | string schemaVersion = "2.0"; |
46 | string versionName = "2003"; | 46 | string versionName = "2003"; |
47 | VSVersion version = VSVersion.VS71; | 47 | VSVersion version = VSVersion.VS71; |
48 | 48 | ||
49 | readonly Dictionary<string, ToolInfo> m_Tools = new Dictionary<string, ToolInfo>(); | 49 | readonly Dictionary<string, ToolInfo> m_Tools = new Dictionary<string, ToolInfo>(); |
50 | Kernel m_Kernel; | 50 | Kernel m_Kernel; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Gets or sets the solution version. | 53 | /// Gets or sets the solution version. |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <value>The solution version.</value> | 55 | /// <value>The solution version.</value> |
56 | protected string SolutionVersion | 56 | protected string SolutionVersion |
57 | { | 57 | { |
58 | get | 58 | get |
59 | { | 59 | { |
60 | return solutionVersion; | 60 | return solutionVersion; |
61 | } | 61 | } |
62 | set | 62 | set |
63 | { | 63 | { |
64 | solutionVersion = value; | 64 | solutionVersion = value; |
65 | } | 65 | } |
66 | } | 66 | } |
67 | /// <summary> | 67 | /// <summary> |
68 | /// Gets or sets the product version. | 68 | /// Gets or sets the product version. |
69 | /// </summary> | 69 | /// </summary> |
70 | /// <value>The product version.</value> | 70 | /// <value>The product version.</value> |
71 | protected string ProductVersion | 71 | protected string ProductVersion |
72 | { | 72 | { |
73 | get | 73 | get |
74 | { | 74 | { |
75 | return productVersion; | 75 | return productVersion; |
76 | } | 76 | } |
77 | set | 77 | set |
78 | { | 78 | { |
79 | productVersion = value; | 79 | productVersion = value; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | /// <summary> | 82 | /// <summary> |
83 | /// Gets or sets the schema version. | 83 | /// Gets or sets the schema version. |
84 | /// </summary> | 84 | /// </summary> |
85 | /// <value>The schema version.</value> | 85 | /// <value>The schema version.</value> |
86 | protected string SchemaVersion | 86 | protected string SchemaVersion |
87 | { | 87 | { |
88 | get | 88 | get |
89 | { | 89 | { |
90 | return schemaVersion; | 90 | return schemaVersion; |
91 | } | 91 | } |
92 | set | 92 | set |
93 | { | 93 | { |
94 | schemaVersion = value; | 94 | schemaVersion = value; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | /// <summary> | 97 | /// <summary> |
98 | /// Gets or sets the name of the version. | 98 | /// Gets or sets the name of the version. |
99 | /// </summary> | 99 | /// </summary> |
100 | /// <value>The name of the version.</value> | 100 | /// <value>The name of the version.</value> |
101 | protected string VersionName | 101 | protected string VersionName |
102 | { | 102 | { |
103 | get | 103 | get |
104 | { | 104 | { |
105 | return versionName; | 105 | return versionName; |
106 | } | 106 | } |
107 | set | 107 | set |
108 | { | 108 | { |
109 | versionName = value; | 109 | versionName = value; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | /// <summary> | 112 | /// <summary> |
113 | /// Gets or sets the version. | 113 | /// Gets or sets the version. |
114 | /// </summary> | 114 | /// </summary> |
115 | /// <value>The version.</value> | 115 | /// <value>The version.</value> |
116 | protected VSVersion Version | 116 | protected VSVersion Version |
117 | { | 117 | { |
118 | get | 118 | get |
119 | { | 119 | { |
120 | return version; | 120 | return version; |
121 | } | 121 | } |
122 | set | 122 | set |
123 | { | 123 | { |
124 | version = value; | 124 | version = value; |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | #endregion | 128 | #endregion |
129 | 129 | ||
130 | #region Constructors | 130 | #region Constructors |
131 | 131 | ||
132 | /// <summary> | 132 | /// <summary> |
133 | /// Initializes a new instance of the <see cref="VS2003Target"/> class. | 133 | /// Initializes a new instance of the <see cref="VS2003Target"/> class. |
134 | /// </summary> | 134 | /// </summary> |
135 | public VS2003Target() | 135 | public VS2003Target() |
136 | { | 136 | { |
137 | m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP"); | 137 | m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP"); |
138 | m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic"); | 138 | m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic"); |
139 | } | 139 | } |
140 | 140 | ||
141 | #endregion | 141 | #endregion |
142 | 142 | ||
143 | #region Private Methods | 143 | #region Private Methods |
144 | 144 | ||
145 | private string MakeRefPath(ProjectNode project) | 145 | private string MakeRefPath(ProjectNode project) |
146 | { | 146 | { |
147 | string ret = ""; | 147 | string ret = ""; |
148 | foreach(ReferencePathNode node in project.ReferencePaths) | 148 | foreach(ReferencePathNode node in project.ReferencePaths) |
149 | { | 149 | { |
150 | try | 150 | try |
151 | { | 151 | { |
152 | string fullPath = Helper.ResolvePath(node.Path); | 152 | string fullPath = Helper.ResolvePath(node.Path); |
153 | if(ret.Length < 1) | 153 | if(ret.Length < 1) |
154 | { | 154 | { |
155 | ret = fullPath; | 155 | ret = fullPath; |
156 | } | 156 | } |
157 | else | 157 | else |
158 | { | 158 | { |
159 | ret += ";" + fullPath; | 159 | ret += ";" + fullPath; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | catch(ArgumentException) | 162 | catch(ArgumentException) |
163 | { | 163 | { |
164 | m_Kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); | 164 | m_Kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | return ret; | 168 | return ret; |
169 | } | 169 | } |
170 | 170 | ||
171 | private void WriteProject(SolutionNode solution, ProjectNode project) | 171 | private void WriteProject(SolutionNode solution, ProjectNode project) |
172 | { | 172 | { |
173 | if(!m_Tools.ContainsKey(project.Language)) | 173 | if(!m_Tools.ContainsKey(project.Language)) |
174 | { | 174 | { |
175 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); | 175 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); |
176 | } | 176 | } |
177 | 177 | ||
178 | ToolInfo toolInfo = m_Tools[project.Language]; | 178 | ToolInfo toolInfo = m_Tools[project.Language]; |
179 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); | 179 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); |
180 | StreamWriter ps = new StreamWriter(projectFile); | 180 | StreamWriter ps = new StreamWriter(projectFile); |
181 | 181 | ||
182 | m_Kernel.CurrentWorkingDirectory.Push(); | 182 | m_Kernel.CurrentWorkingDirectory.Push(); |
183 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); | 183 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); |
184 | 184 | ||
185 | using(ps) | 185 | using(ps) |
186 | { | 186 | { |
187 | ps.WriteLine("<VisualStudioProject>"); | 187 | ps.WriteLine("<VisualStudioProject>"); |
188 | ps.WriteLine(" <{0}", toolInfo.XmlTag); | 188 | ps.WriteLine(" <{0}", toolInfo.XmlTag); |
189 | ps.WriteLine("\t\t\t\tProjectType = \"Local\""); | 189 | ps.WriteLine("\t\t\t\tProjectType = \"Local\""); |
190 | ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", ProductVersion); | 190 | ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", ProductVersion); |
191 | ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", SchemaVersion); | 191 | ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", SchemaVersion); |
192 | ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper()); | 192 | ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper()); |
193 | ps.WriteLine("\t\t>"); | 193 | ps.WriteLine("\t\t>"); |
194 | 194 | ||
195 | ps.WriteLine("\t\t\t\t<Build>"); | 195 | ps.WriteLine("\t\t\t\t<Build>"); |
196 | ps.WriteLine(" <Settings"); | 196 | ps.WriteLine(" <Settings"); |
197 | ps.WriteLine("\t\t\t\t ApplicationIcon = \"{0}\"",project.AppIcon); | 197 | ps.WriteLine("\t\t\t\t ApplicationIcon = \"{0}\"",project.AppIcon); |
198 | ps.WriteLine("\t\t\t\t AssemblyKeyContainerName = \"\""); | 198 | ps.WriteLine("\t\t\t\t AssemblyKeyContainerName = \"\""); |
199 | ps.WriteLine("\t\t\t\t AssemblyName = \"{0}\"", project.AssemblyName); | 199 | ps.WriteLine("\t\t\t\t AssemblyName = \"{0}\"", project.AssemblyName); |
200 | ps.WriteLine("\t\t\t\t AssemblyOriginatorKeyFile = \"\""); | 200 | ps.WriteLine("\t\t\t\t AssemblyOriginatorKeyFile = \"\""); |
201 | ps.WriteLine("\t\t\t\t DefaultClientScript = \"JScript\""); | 201 | ps.WriteLine("\t\t\t\t DefaultClientScript = \"JScript\""); |
202 | ps.WriteLine("\t\t\t\t DefaultHTMLPageLayout = \"Grid\""); | 202 | ps.WriteLine("\t\t\t\t DefaultHTMLPageLayout = \"Grid\""); |
203 | ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\""); | 203 | ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\""); |
204 | ps.WriteLine("\t\t\t\t DelaySign = \"false\""); | 204 | ps.WriteLine("\t\t\t\t DelaySign = \"false\""); |
205 | 205 | ||
206 | if(Version == VSVersion.VS70) | 206 | if(Version == VSVersion.VS70) |
207 | { | 207 | { |
208 | ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\""); | 208 | ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\""); |
209 | } | 209 | } |
210 | 210 | ||
211 | ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type); | 211 | ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type); |
212 | 212 | ||
213 | foreach(ConfigurationNode conf in project.Configurations) | 213 | foreach(ConfigurationNode conf in project.Configurations) |
214 | { | 214 | { |
215 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) | 215 | if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) |
216 | { | 216 | { |
217 | ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); | 217 | ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); |
218 | } | 218 | } |
219 | else | 219 | else |
220 | { | 220 | { |
221 | ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", conf.Options["PreBuildEvent"]); | 221 | ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", conf.Options["PreBuildEvent"]); |
222 | } | 222 | } |
223 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) | 223 | if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) |
224 | { | 224 | { |
225 | ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); | 225 | ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); |
226 | } | 226 | } |
227 | else | 227 | else |
228 | { | 228 | { |
229 | ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", conf.Options["PostBuildEvent"]); | 229 | ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", conf.Options["PostBuildEvent"]); |
230 | } | 230 | } |
231 | if (conf.Options["RunPostBuildEvent"] == null) | 231 | if (conf.Options["RunPostBuildEvent"] == null) |
232 | { | 232 | { |
233 | ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", "OnBuildSuccess"); | 233 | ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", "OnBuildSuccess"); |
234 | } | 234 | } |
235 | else | 235 | else |
236 | { | 236 | { |
237 | ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", conf.Options["RunPostBuildEvent"]); | 237 | ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", conf.Options["RunPostBuildEvent"]); |
238 | } | 238 | } |
239 | break; | 239 | break; |
240 | } | 240 | } |
241 | 241 | ||
242 | ps.WriteLine("\t\t\t\t RootNamespace = \"{0}\"", project.RootNamespace); | 242 | ps.WriteLine("\t\t\t\t RootNamespace = \"{0}\"", project.RootNamespace); |
243 | ps.WriteLine("\t\t\t\t StartupObject = \"{0}\"", project.StartupObject); | 243 | ps.WriteLine("\t\t\t\t StartupObject = \"{0}\"", project.StartupObject); |
244 | ps.WriteLine("\t\t >"); | 244 | ps.WriteLine("\t\t >"); |
245 | 245 | ||
246 | foreach(ConfigurationNode conf in project.Configurations) | 246 | foreach(ConfigurationNode conf in project.Configurations) |
247 | { | 247 | { |
248 | ps.WriteLine("\t\t\t\t <Config"); | 248 | ps.WriteLine("\t\t\t\t <Config"); |
249 | ps.WriteLine("\t\t\t\t Name = \"{0}\"", conf.Name); | 249 | ps.WriteLine("\t\t\t\t Name = \"{0}\"", conf.Name); |
250 | ps.WriteLine("\t\t\t\t AllowUnsafeBlocks = \"{0}\"", conf.Options["AllowUnsafe"].ToString().ToLower()); | 250 | ps.WriteLine("\t\t\t\t AllowUnsafeBlocks = \"{0}\"", conf.Options["AllowUnsafe"].ToString().ToLower()); |
251 | ps.WriteLine("\t\t\t\t BaseAddress = \"{0}\"", conf.Options["BaseAddress"]); | 251 | ps.WriteLine("\t\t\t\t BaseAddress = \"{0}\"", conf.Options["BaseAddress"]); |
252 | ps.WriteLine("\t\t\t\t CheckForOverflowUnderflow = \"{0}\"", conf.Options["CheckUnderflowOverflow"].ToString().ToLower()); | 252 | ps.WriteLine("\t\t\t\t CheckForOverflowUnderflow = \"{0}\"", conf.Options["CheckUnderflowOverflow"].ToString().ToLower()); |
253 | ps.WriteLine("\t\t\t\t ConfigurationOverrideFile = \"\""); | 253 | ps.WriteLine("\t\t\t\t ConfigurationOverrideFile = \"\""); |
254 | ps.WriteLine("\t\t\t\t DefineConstants = \"{0}\"", conf.Options["CompilerDefines"]); | 254 | ps.WriteLine("\t\t\t\t DefineConstants = \"{0}\"", conf.Options["CompilerDefines"]); |
255 | ps.WriteLine("\t\t\t\t DocumentationFile = \"{0}\"", GetXmlDocFile(project, conf));//default to the assembly name | 255 | ps.WriteLine("\t\t\t\t DocumentationFile = \"{0}\"", GetXmlDocFile(project, conf));//default to the assembly name |
256 | ps.WriteLine("\t\t\t\t DebugSymbols = \"{0}\"", conf.Options["DebugInformation"].ToString().ToLower()); | 256 | ps.WriteLine("\t\t\t\t DebugSymbols = \"{0}\"", conf.Options["DebugInformation"].ToString().ToLower()); |
257 | ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]); | 257 | ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]); |
258 | ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower()); | 258 | ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower()); |
259 | 259 | ||
260 | if(Version == VSVersion.VS71) | 260 | if(Version == VSVersion.VS71) |
261 | { | 261 | { |
262 | ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower()); | 262 | ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower()); |
263 | ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower()); | 263 | ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower()); |
264 | } | 264 | } |
265 | 265 | ||
266 | ps.WriteLine("\t\t\t\t Optimize = \"{0}\"", conf.Options["OptimizeCode"].ToString().ToLower()); | 266 | ps.WriteLine("\t\t\t\t Optimize = \"{0}\"", conf.Options["OptimizeCode"].ToString().ToLower()); |
267 | ps.WriteLine(" OutputPath = \"{0}\"", | 267 | ps.WriteLine(" OutputPath = \"{0}\"", |
268 | Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); | 268 | Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); |
269 | ps.WriteLine(" RegisterForComInterop = \"{0}\"", conf.Options["RegisterComInterop"].ToString().ToLower()); | 269 | ps.WriteLine(" RegisterForComInterop = \"{0}\"", conf.Options["RegisterComInterop"].ToString().ToLower()); |
270 | ps.WriteLine(" RemoveIntegerChecks = \"{0}\"", conf.Options["RemoveIntegerChecks"].ToString().ToLower()); | 270 | ps.WriteLine(" RemoveIntegerChecks = \"{0}\"", conf.Options["RemoveIntegerChecks"].ToString().ToLower()); |
271 | ps.WriteLine(" TreatWarningsAsErrors = \"{0}\"", conf.Options["WarningsAsErrors"].ToString().ToLower()); | 271 | ps.WriteLine(" TreatWarningsAsErrors = \"{0}\"", conf.Options["WarningsAsErrors"].ToString().ToLower()); |
272 | ps.WriteLine(" WarningLevel = \"{0}\"", conf.Options["WarningLevel"]); | 272 | ps.WriteLine(" WarningLevel = \"{0}\"", conf.Options["WarningLevel"]); |
273 | ps.WriteLine(" />"); | 273 | ps.WriteLine(" />"); |
274 | } | 274 | } |
275 | 275 | ||
276 | ps.WriteLine(" </Settings>"); | 276 | ps.WriteLine(" </Settings>"); |
277 | 277 | ||
278 | ps.WriteLine(" <References>"); | 278 | ps.WriteLine(" <References>"); |
279 | foreach(ReferenceNode refr in project.References) | 279 | foreach(ReferenceNode refr in project.References) |
280 | { | 280 | { |
281 | ps.WriteLine(" <Reference"); | 281 | ps.WriteLine(" <Reference"); |
282 | ps.WriteLine(" Name = \"{0}\"", refr.Name); | 282 | ps.WriteLine(" Name = \"{0}\"", refr.Name); |
283 | ps.WriteLine(" AssemblyName = \"{0}\"", refr.Name); | 283 | ps.WriteLine(" AssemblyName = \"{0}\"", refr.Name); |
284 | 284 | ||
285 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 285 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
286 | { | 286 | { |
287 | ProjectNode refProject = solution.ProjectsTable[refr.Name]; | 287 | ProjectNode refProject = solution.ProjectsTable[refr.Name]; |
288 | ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper()); | 288 | ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper()); |
289 | ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToUpper()); | 289 | ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToUpper()); |
290 | } | 290 | } |
291 | else | 291 | else |
292 | { | 292 | { |
293 | if(refr.Path != null) | 293 | if(refr.Path != null) |
294 | { | 294 | { |
295 | ps.WriteLine(" HintPath = \"{0}\"", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); | 295 | ps.WriteLine(" HintPath = \"{0}\"", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); |
296 | } | 296 | } |
297 | 297 | ||
298 | } | 298 | } |
299 | 299 | ||
300 | if(refr.LocalCopySpecified) | 300 | if(refr.LocalCopySpecified) |
301 | { | 301 | { |
302 | ps.WriteLine(" Private = \"{0}\"",refr.LocalCopy); | 302 | ps.WriteLine(" Private = \"{0}\"",refr.LocalCopy); |
303 | } | 303 | } |
304 | 304 | ||
305 | ps.WriteLine(" />"); | 305 | ps.WriteLine(" />"); |
306 | } | 306 | } |
307 | ps.WriteLine(" </References>"); | 307 | ps.WriteLine(" </References>"); |
308 | 308 | ||
309 | ps.WriteLine(" </Build>"); | 309 | ps.WriteLine(" </Build>"); |
310 | ps.WriteLine(" <Files>"); | 310 | ps.WriteLine(" <Files>"); |
311 | 311 | ||
312 | ps.WriteLine(" <Include>"); | 312 | ps.WriteLine(" <Include>"); |
313 | 313 | ||
314 | foreach(string file in project.Files) | 314 | foreach(string file in project.Files) |
315 | { | 315 | { |
316 | string fileName = file.Replace(".\\", ""); | 316 | string fileName = file.Replace(".\\", ""); |
317 | ps.WriteLine(" <File"); | 317 | ps.WriteLine(" <File"); |
318 | ps.WriteLine(" RelPath = \"{0}\"", fileName); | 318 | ps.WriteLine(" RelPath = \"{0}\"", fileName); |
319 | ps.WriteLine(" SubType = \"{0}\"", project.Files.GetSubType(file)); | 319 | ps.WriteLine(" SubType = \"{0}\"", project.Files.GetSubType(file)); |
320 | ps.WriteLine(" BuildAction = \"{0}\"", project.Files.GetBuildAction(file)); | 320 | ps.WriteLine(" BuildAction = \"{0}\"", project.Files.GetBuildAction(file)); |
321 | ps.WriteLine(" />"); | 321 | ps.WriteLine(" />"); |
322 | 322 | ||
323 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) | 323 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) |
324 | { | 324 | { |
325 | ps.WriteLine(" <File"); | 325 | ps.WriteLine(" <File"); |
326 | ps.WriteLine(" RelPath = \"{0}\"", fileName.Substring(0, fileName.LastIndexOf('.')) + ".resx"); | 326 | ps.WriteLine(" RelPath = \"{0}\"", fileName.Substring(0, fileName.LastIndexOf('.')) + ".resx"); |
327 | int slash = fileName.LastIndexOf('\\'); | 327 | int slash = fileName.LastIndexOf('\\'); |
328 | if (slash == -1) | 328 | if (slash == -1) |
329 | { | 329 | { |
330 | ps.WriteLine(" DependentUpon = \"{0}\"", fileName); | 330 | ps.WriteLine(" DependentUpon = \"{0}\"", fileName); |
331 | } | 331 | } |
332 | else | 332 | else |
333 | { | 333 | { |
334 | ps.WriteLine(" DependentUpon = \"{0}\"", fileName.Substring(slash + 1, fileName.Length - slash - 1)); | 334 | ps.WriteLine(" DependentUpon = \"{0}\"", fileName.Substring(slash + 1, fileName.Length - slash - 1)); |
335 | } | 335 | } |
336 | ps.WriteLine(" BuildAction = \"{0}\"", "EmbeddedResource"); | 336 | ps.WriteLine(" BuildAction = \"{0}\"", "EmbeddedResource"); |
337 | ps.WriteLine(" />"); | 337 | ps.WriteLine(" />"); |
338 | 338 | ||
339 | } | 339 | } |
340 | } | 340 | } |
341 | ps.WriteLine(" </Include>"); | 341 | ps.WriteLine(" </Include>"); |
342 | 342 | ||
343 | ps.WriteLine(" </Files>"); | 343 | ps.WriteLine(" </Files>"); |
344 | ps.WriteLine(" </{0}>", toolInfo.XmlTag); | 344 | ps.WriteLine(" </{0}>", toolInfo.XmlTag); |
345 | ps.WriteLine("</VisualStudioProject>"); | 345 | ps.WriteLine("</VisualStudioProject>"); |
346 | } | 346 | } |
347 | 347 | ||
348 | ps = new StreamWriter(projectFile + ".user"); | 348 | ps = new StreamWriter(projectFile + ".user"); |
349 | using(ps) | 349 | using(ps) |
350 | { | 350 | { |
351 | ps.WriteLine("<VisualStudioProject>"); | 351 | ps.WriteLine("<VisualStudioProject>"); |
352 | ps.WriteLine(" <{0}>", toolInfo.XmlTag); | 352 | ps.WriteLine(" <{0}>", toolInfo.XmlTag); |
353 | ps.WriteLine(" <Build>"); | 353 | ps.WriteLine(" <Build>"); |
354 | 354 | ||
355 | ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); | 355 | ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); |
356 | foreach(ConfigurationNode conf in project.Configurations) | 356 | foreach(ConfigurationNode conf in project.Configurations) |
357 | { | 357 | { |
358 | ps.WriteLine(" <Config"); | 358 | ps.WriteLine(" <Config"); |
359 | ps.WriteLine(" Name = \"{0}\"", conf.Name); | 359 | ps.WriteLine(" Name = \"{0}\"", conf.Name); |
360 | ps.WriteLine(" />"); | 360 | ps.WriteLine(" />"); |
361 | } | 361 | } |
362 | ps.WriteLine(" </Settings>"); | 362 | ps.WriteLine(" </Settings>"); |
363 | 363 | ||
364 | ps.WriteLine(" </Build>"); | 364 | ps.WriteLine(" </Build>"); |
365 | ps.WriteLine(" </{0}>", toolInfo.XmlTag); | 365 | ps.WriteLine(" </{0}>", toolInfo.XmlTag); |
366 | ps.WriteLine("</VisualStudioProject>"); | 366 | ps.WriteLine("</VisualStudioProject>"); |
367 | } | 367 | } |
368 | 368 | ||
369 | m_Kernel.CurrentWorkingDirectory.Pop(); | 369 | m_Kernel.CurrentWorkingDirectory.Pop(); |
370 | } | 370 | } |
371 | 371 | ||
372 | /// <summary> | 372 | /// <summary> |
373 | /// Gets the XML doc file. | 373 | /// Gets the XML doc file. |
374 | /// </summary> | 374 | /// </summary> |
375 | /// <param name="project">The project.</param> | 375 | /// <param name="project">The project.</param> |
376 | /// <param name="conf">The conf.</param> | 376 | /// <param name="conf">The conf.</param> |
377 | /// <returns></returns> | 377 | /// <returns></returns> |
378 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) | 378 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) |
379 | { | 379 | { |
380 | if( conf == null ) | 380 | if( conf == null ) |
381 | { | 381 | { |
382 | throw new ArgumentNullException("conf"); | 382 | throw new ArgumentNullException("conf"); |
383 | } | 383 | } |
384 | if( project == null ) | 384 | if( project == null ) |
385 | { | 385 | { |
386 | throw new ArgumentNullException("project"); | 386 | throw new ArgumentNullException("project"); |
387 | } | 387 | } |
388 | // if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false | 388 | // if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false |
389 | // { | 389 | // { |
390 | // return string.Empty; | 390 | // return string.Empty; |
391 | // } | 391 | // } |
392 | 392 | ||
393 | //default to "AssemblyName.xml" | 393 | //default to "AssemblyName.xml" |
394 | //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; | 394 | //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; |
395 | //return (string)conf.Options["XmlDocFile", defaultValue]; | 395 | //return (string)conf.Options["XmlDocFile", defaultValue]; |
396 | 396 | ||
397 | //default to no XmlDocFile file | 397 | //default to no XmlDocFile file |
398 | return (string)conf.Options["XmlDocFile", ""]; | 398 | return (string)conf.Options["XmlDocFile", ""]; |
399 | } | 399 | } |
400 | 400 | ||
401 | private void WriteSolution(SolutionNode solution) | 401 | private void WriteSolution(SolutionNode solution) |
402 | { | 402 | { |
403 | m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", VersionName); | 403 | m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", VersionName); |
404 | 404 | ||
405 | foreach(ProjectNode project in solution.Projects) | 405 | foreach(ProjectNode project in solution.Projects) |
406 | { | 406 | { |
407 | if(m_Kernel.AllowProject(project.FilterGroups)) | 407 | if(m_Kernel.AllowProject(project.FilterGroups)) |
408 | { | 408 | { |
409 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); | 409 | m_Kernel.Log.Write("...Creating project: {0}", project.Name); |
410 | WriteProject(solution, project); | 410 | WriteProject(solution, project); |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | m_Kernel.Log.Write(""); | 414 | m_Kernel.Log.Write(""); |
415 | string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); | 415 | string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); |
416 | StreamWriter ss = new StreamWriter(solutionFile); | 416 | StreamWriter ss = new StreamWriter(solutionFile); |
417 | 417 | ||
418 | m_Kernel.CurrentWorkingDirectory.Push(); | 418 | m_Kernel.CurrentWorkingDirectory.Push(); |
419 | Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); | 419 | Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); |
420 | 420 | ||
421 | using(ss) | 421 | using(ss) |
422 | { | 422 | { |
423 | ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); | 423 | ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); |
424 | foreach(ProjectNode project in solution.Projects) | 424 | foreach(ProjectNode project in solution.Projects) |
425 | { | 425 | { |
426 | if(!m_Tools.ContainsKey(project.Language)) | 426 | if(!m_Tools.ContainsKey(project.Language)) |
427 | { | 427 | { |
428 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); | 428 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); |
429 | } | 429 | } |
430 | 430 | ||
431 | ToolInfo toolInfo = m_Tools[project.Language]; | 431 | ToolInfo toolInfo = m_Tools[project.Language]; |
432 | 432 | ||
433 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 433 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
434 | ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"", | 434 | ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"", |
435 | toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name, | 435 | toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name, |
436 | toolInfo.FileExtension), project.Guid.ToString().ToUpper()); | 436 | toolInfo.FileExtension), project.Guid.ToString().ToUpper()); |
437 | 437 | ||
438 | ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject"); | 438 | ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject"); |
439 | ss.WriteLine("\tEndProjectSection"); | 439 | ss.WriteLine("\tEndProjectSection"); |
440 | 440 | ||
441 | ss.WriteLine("EndProject"); | 441 | ss.WriteLine("EndProject"); |
442 | } | 442 | } |
443 | 443 | ||
444 | ss.WriteLine("Global"); | 444 | ss.WriteLine("Global"); |
445 | 445 | ||
446 | ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution"); | 446 | ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution"); |
447 | foreach(ConfigurationNode conf in solution.Configurations) | 447 | foreach(ConfigurationNode conf in solution.Configurations) |
448 | { | 448 | { |
449 | ss.WriteLine("\t\t{0} = {0}", conf.Name); | 449 | ss.WriteLine("\t\t{0} = {0}", conf.Name); |
450 | } | 450 | } |
451 | ss.WriteLine("\tEndGlobalSection"); | 451 | ss.WriteLine("\tEndGlobalSection"); |
452 | 452 | ||
453 | ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution"); | 453 | ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution"); |
454 | foreach(ProjectNode project in solution.Projects) | 454 | foreach(ProjectNode project in solution.Projects) |
455 | { | 455 | { |
456 | for(int i = 0; i < project.References.Count; i++) | 456 | for(int i = 0; i < project.References.Count; i++) |
457 | { | 457 | { |
458 | ReferenceNode refr = project.References[i]; | 458 | ReferenceNode refr = project.References[i]; |
459 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 459 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
460 | { | 460 | { |
461 | ProjectNode refProject = solution.ProjectsTable[refr.Name]; | 461 | ProjectNode refProject = solution.ProjectsTable[refr.Name]; |
462 | ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})", | 462 | ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})", |
463 | project.Guid.ToString().ToUpper() | 463 | project.Guid.ToString().ToUpper() |
464 | , i, | 464 | , i, |
465 | refProject.Guid.ToString().ToUpper() | 465 | refProject.Guid.ToString().ToUpper() |
466 | ); | 466 | ); |
467 | } | 467 | } |
468 | } | 468 | } |
469 | } | 469 | } |
470 | ss.WriteLine("\tEndGlobalSection"); | 470 | ss.WriteLine("\tEndGlobalSection"); |
471 | 471 | ||
472 | ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution"); | 472 | ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution"); |
473 | foreach(ProjectNode project in solution.Projects) | 473 | foreach(ProjectNode project in solution.Projects) |
474 | { | 474 | { |
475 | foreach(ConfigurationNode conf in solution.Configurations) | 475 | foreach(ConfigurationNode conf in solution.Configurations) |
476 | { | 476 | { |
477 | ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET", | 477 | ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET", |
478 | project.Guid.ToString().ToUpper(), | 478 | project.Guid.ToString().ToUpper(), |
479 | conf.Name); | 479 | conf.Name); |
480 | 480 | ||
481 | ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET", | 481 | ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET", |
482 | project.Guid.ToString().ToUpper(), | 482 | project.Guid.ToString().ToUpper(), |
483 | conf.Name); | 483 | conf.Name); |
484 | } | 484 | } |
485 | } | 485 | } |
486 | ss.WriteLine("\tEndGlobalSection"); | 486 | ss.WriteLine("\tEndGlobalSection"); |
487 | 487 | ||
488 | if(solution.Files != null) | 488 | if(solution.Files != null) |
489 | { | 489 | { |
490 | ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution"); | 490 | ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution"); |
491 | foreach(string file in solution.Files) | 491 | foreach(string file in solution.Files) |
492 | { | 492 | { |
493 | ss.WriteLine("\t\t{0} = {0}", file); | 493 | ss.WriteLine("\t\t{0} = {0}", file); |
494 | } | 494 | } |
495 | ss.WriteLine("\tEndGlobalSection"); | 495 | ss.WriteLine("\tEndGlobalSection"); |
496 | } | 496 | } |
497 | 497 | ||
498 | ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution"); | 498 | ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution"); |
499 | ss.WriteLine("\tEndGlobalSection"); | 499 | ss.WriteLine("\tEndGlobalSection"); |
500 | ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution"); | 500 | ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution"); |
501 | ss.WriteLine("\tEndGlobalSection"); | 501 | ss.WriteLine("\tEndGlobalSection"); |
502 | 502 | ||
503 | ss.WriteLine("EndGlobal"); | 503 | ss.WriteLine("EndGlobal"); |
504 | } | 504 | } |
505 | 505 | ||
506 | m_Kernel.CurrentWorkingDirectory.Pop(); | 506 | m_Kernel.CurrentWorkingDirectory.Pop(); |
507 | } | 507 | } |
508 | 508 | ||
509 | private void CleanProject(ProjectNode project) | 509 | private void CleanProject(ProjectNode project) |
510 | { | 510 | { |
511 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); | 511 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); |
512 | 512 | ||
513 | ToolInfo toolInfo = m_Tools[project.Language]; | 513 | ToolInfo toolInfo = m_Tools[project.Language]; |
514 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); | 514 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); |
515 | string userFile = projectFile + ".user"; | 515 | string userFile = projectFile + ".user"; |
516 | 516 | ||
517 | Helper.DeleteIfExists(projectFile); | 517 | Helper.DeleteIfExists(projectFile); |
518 | Helper.DeleteIfExists(userFile); | 518 | Helper.DeleteIfExists(userFile); |
519 | } | 519 | } |
520 | 520 | ||
521 | private void CleanSolution(SolutionNode solution) | 521 | private void CleanSolution(SolutionNode solution) |
522 | { | 522 | { |
523 | m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", VersionName, solution.Name); | 523 | m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", VersionName, solution.Name); |
524 | 524 | ||
525 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); | 525 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); |
526 | string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); | 526 | string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); |
527 | 527 | ||
528 | Helper.DeleteIfExists(slnFile); | 528 | Helper.DeleteIfExists(slnFile); |
529 | Helper.DeleteIfExists(suoFile); | 529 | Helper.DeleteIfExists(suoFile); |
530 | 530 | ||
531 | foreach(ProjectNode project in solution.Projects) | 531 | foreach(ProjectNode project in solution.Projects) |
532 | { | 532 | { |
533 | CleanProject(project); | 533 | CleanProject(project); |
534 | } | 534 | } |
535 | 535 | ||
536 | m_Kernel.Log.Write(""); | 536 | m_Kernel.Log.Write(""); |
537 | } | 537 | } |
538 | 538 | ||
539 | #endregion | 539 | #endregion |
540 | 540 | ||
541 | #region ITarget Members | 541 | #region ITarget Members |
542 | 542 | ||
543 | /// <summary> | 543 | /// <summary> |
544 | /// Writes the specified kern. | 544 | /// Writes the specified kern. |
545 | /// </summary> | 545 | /// </summary> |
546 | /// <param name="kern">The kern.</param> | 546 | /// <param name="kern">The kern.</param> |
547 | public virtual void Write(Kernel kern) | 547 | public virtual void Write(Kernel kern) |
548 | { | 548 | { |
549 | if( kern == null ) | 549 | if( kern == null ) |
550 | { | 550 | { |
551 | throw new ArgumentNullException("kern"); | 551 | throw new ArgumentNullException("kern"); |
552 | } | 552 | } |
553 | m_Kernel = kern; | 553 | m_Kernel = kern; |
554 | foreach(SolutionNode sol in m_Kernel.Solutions) | 554 | foreach(SolutionNode sol in m_Kernel.Solutions) |
555 | { | 555 | { |
556 | WriteSolution(sol); | 556 | WriteSolution(sol); |
557 | } | 557 | } |
558 | m_Kernel = null; | 558 | m_Kernel = null; |
559 | } | 559 | } |
560 | 560 | ||
561 | /// <summary> | 561 | /// <summary> |
562 | /// Cleans the specified kern. | 562 | /// Cleans the specified kern. |
563 | /// </summary> | 563 | /// </summary> |
564 | /// <param name="kern">The kern.</param> | 564 | /// <param name="kern">The kern.</param> |
565 | public virtual void Clean(Kernel kern) | 565 | public virtual void Clean(Kernel kern) |
566 | { | 566 | { |
567 | if( kern == null ) | 567 | if( kern == null ) |
568 | { | 568 | { |
569 | throw new ArgumentNullException("kern"); | 569 | throw new ArgumentNullException("kern"); |
570 | } | 570 | } |
571 | m_Kernel = kern; | 571 | m_Kernel = kern; |
572 | foreach(SolutionNode sol in m_Kernel.Solutions) | 572 | foreach(SolutionNode sol in m_Kernel.Solutions) |
573 | { | 573 | { |
574 | CleanSolution(sol); | 574 | CleanSolution(sol); |
575 | } | 575 | } |
576 | m_Kernel = null; | 576 | m_Kernel = null; |
577 | } | 577 | } |
578 | 578 | ||
579 | /// <summary> | 579 | /// <summary> |
580 | /// Gets the name. | 580 | /// Gets the name. |
581 | /// </summary> | 581 | /// </summary> |
582 | /// <value>The name.</value> | 582 | /// <value>The name.</value> |
583 | public virtual string Name | 583 | public virtual string Name |
584 | { | 584 | { |
585 | get | 585 | get |
586 | { | 586 | { |
587 | return "vs2003"; | 587 | return "vs2003"; |
588 | } | 588 | } |
589 | } | 589 | } |
590 | 590 | ||
591 | #endregion | 591 | #endregion |
592 | } | 592 | } |
593 | } | 593 | } |
diff --git a/Prebuild/src/Core/Targets/VS2005Target.cs b/Prebuild/src/Core/Targets/VS2005Target.cs index e5a0939..9c70e26 100644 --- a/Prebuild/src/Core/Targets/VS2005Target.cs +++ b/Prebuild/src/Core/Targets/VS2005Target.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com) | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -35,7 +35,7 @@ using Prebuild.Core.Utilities; | |||
35 | namespace Prebuild.Core.Targets | 35 | namespace Prebuild.Core.Targets |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [Target("vs2005")] | 40 | [Target("vs2005")] |
41 | public class VS2005Target : VSGenericTarget | 41 | public class VS2005Target : VSGenericTarget |
@@ -137,9 +137,9 @@ namespace Prebuild.Core.Targets | |||
137 | /// <summary> | 137 | /// <summary> |
138 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. | 138 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. |
139 | /// </summary> | 139 | /// </summary> |
140 | public VS2005Target() | 140 | public VS2005Target() |
141 | : base() | 141 | : base() |
142 | { | 142 | { |
143 | } | 143 | } |
144 | 144 | ||
145 | #endregion | 145 | #endregion |
diff --git a/Prebuild/src/Core/Targets/VS2008Target.cs b/Prebuild/src/Core/Targets/VS2008Target.cs index a3f3aca..fee4f7f 100644 --- a/Prebuild/src/Core/Targets/VS2008Target.cs +++ b/Prebuild/src/Core/Targets/VS2008Target.cs | |||
@@ -11,86 +11,86 @@ using System.CodeDom.Compiler; | |||
11 | namespace Prebuild.Core.Targets | 11 | namespace Prebuild.Core.Targets |
12 | { | 12 | { |
13 | 13 | ||
14 | /// <summary> | 14 | /// <summary> |
15 | /// | 15 | /// |
16 | /// </summary> | 16 | /// </summary> |
17 | [Target("vs2008")] | 17 | [Target("vs2008")] |
18 | public class VS2008Target : VSGenericTarget | 18 | public class VS2008Target : VSGenericTarget |
19 | { | 19 | { |
20 | #region Fields | 20 | #region Fields |
21 | string solutionVersion = "10.00"; | 21 | string solutionVersion = "10.00"; |
22 | string productVersion = "9.0.21022"; | 22 | string productVersion = "9.0.21022"; |
23 | string schemaVersion = "2.0"; | 23 | string schemaVersion = "2.0"; |
24 | string versionName = "Visual Studio 2008"; | 24 | string versionName = "Visual Studio 2008"; |
25 | string name = "vs2008"; | 25 | string name = "vs2008"; |
26 | VSVersion version = VSVersion.VS90; | 26 | VSVersion version = VSVersion.VS90; |
27 | 27 | ||
28 | /// <summary> | 28 | /// <summary> |
29 | /// Gets or sets the solution version. | 29 | /// Gets or sets the solution version. |
30 | /// </summary> | 30 | /// </summary> |
31 | /// <value>The solution version.</value> | 31 | /// <value>The solution version.</value> |
32 | public override string SolutionVersion | 32 | public override string SolutionVersion |
33 | { | 33 | { |
34 | get | 34 | get |
35 | { | 35 | { |
36 | return solutionVersion; | 36 | return solutionVersion; |
37 | } | 37 | } |
38 | } | 38 | } |
39 | /// <summary> | 39 | /// <summary> |
40 | /// Gets or sets the product version. | 40 | /// Gets or sets the product version. |
41 | /// </summary> | 41 | /// </summary> |
42 | /// <value>The product version.</value> | 42 | /// <value>The product version.</value> |
43 | public override string ProductVersion | 43 | public override string ProductVersion |
44 | { | 44 | { |
45 | get | 45 | get |
46 | { | 46 | { |
47 | return productVersion; | 47 | return productVersion; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | /// <summary> | 50 | /// <summary> |
51 | /// Gets or sets the schema version. | 51 | /// Gets or sets the schema version. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <value>The schema version.</value> | 53 | /// <value>The schema version.</value> |
54 | public override string SchemaVersion | 54 | public override string SchemaVersion |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return schemaVersion; | 58 | return schemaVersion; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | /// <summary> | 61 | /// <summary> |
62 | /// Gets or sets the name of the version. | 62 | /// Gets or sets the name of the version. |
63 | /// </summary> | 63 | /// </summary> |
64 | /// <value>The name of the version.</value> | 64 | /// <value>The name of the version.</value> |
65 | public override string VersionName | 65 | public override string VersionName |
66 | { | 66 | { |
67 | get | 67 | get |
68 | { | 68 | { |
69 | return versionName; | 69 | return versionName; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | /// <summary> | 72 | /// <summary> |
73 | /// Gets or sets the version. | 73 | /// Gets or sets the version. |
74 | /// </summary> | 74 | /// </summary> |
75 | /// <value>The version.</value> | 75 | /// <value>The version.</value> |
76 | public override VSVersion Version | 76 | public override VSVersion Version |
77 | { | 77 | { |
78 | get | 78 | get |
79 | { | 79 | { |
80 | return version; | 80 | return version; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | /// <summary> | 83 | /// <summary> |
84 | /// Gets the name. | 84 | /// Gets the name. |
85 | /// </summary> | 85 | /// </summary> |
86 | /// <value>The name.</value> | 86 | /// <value>The name.</value> |
87 | public override string Name | 87 | public override string Name |
88 | { | 88 | { |
89 | get | 89 | get |
90 | { | 90 | { |
91 | return name; | 91 | return name; |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) | 95 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) |
96 | { | 96 | { |
@@ -110,18 +110,18 @@ namespace Prebuild.Core.Targets | |||
110 | get { return "# Visual Studio 2008"; } | 110 | get { return "# Visual Studio 2008"; } |
111 | } | 111 | } |
112 | 112 | ||
113 | #endregion | 113 | #endregion |
114 | 114 | ||
115 | #region Constructors | 115 | #region Constructors |
116 | 116 | ||
117 | /// <summary> | 117 | /// <summary> |
118 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. | 118 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. |
119 | /// </summary> | 119 | /// </summary> |
120 | public VS2008Target() | 120 | public VS2008Target() |
121 | : base() | 121 | : base() |
122 | { | 122 | { |
123 | } | 123 | } |
124 | 124 | ||
125 | #endregion | 125 | #endregion |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/Prebuild/src/Core/Targets/VS2010Target.cs b/Prebuild/src/Core/Targets/VS2010Target.cs index b4c79dc..e8aeab5 100644 --- a/Prebuild/src/Core/Targets/VS2010Target.cs +++ b/Prebuild/src/Core/Targets/VS2010Target.cs | |||
@@ -11,96 +11,96 @@ using System.CodeDom.Compiler; | |||
11 | namespace Prebuild.Core.Targets | 11 | namespace Prebuild.Core.Targets |
12 | { | 12 | { |
13 | 13 | ||
14 | /// <summary> | 14 | /// <summary> |
15 | /// | 15 | /// |
16 | /// </summary> | 16 | /// </summary> |
17 | [Target("vs2010")] | 17 | [Target("vs2010")] |
18 | public class VS2010Target : VSGenericTarget | 18 | public class VS2010Target : VSGenericTarget |
19 | { | 19 | { |
20 | #region Fields | 20 | #region Fields |
21 | 21 | ||
22 | string solutionVersion = "11.00"; | 22 | string solutionVersion = "11.00"; |
23 | string productVersion = "9.0.30729"; | 23 | string productVersion = "9.0.30729"; |
24 | string schemaVersion = "2.0"; | 24 | string schemaVersion = "2.0"; |
25 | string versionName = "Visual Studio 2010"; | 25 | string versionName = "Visual Studio 2010"; |
26 | string name = "vs2010"; | 26 | string name = "vs2010"; |
27 | VSVersion version = VSVersion.VS10; | 27 | VSVersion version = VSVersion.VS10; |
28 | 28 | ||
29 | #endregion | 29 | #endregion |
30 | 30 | ||
31 | #region Properties | 31 | #region Properties |
32 | 32 | ||
33 | /// <summary> | 33 | /// <summary> |
34 | /// Gets or sets the solution version. | 34 | /// Gets or sets the solution version. |
35 | /// </summary> | 35 | /// </summary> |
36 | /// <value>The solution version.</value> | 36 | /// <value>The solution version.</value> |
37 | public override string SolutionVersion | 37 | public override string SolutionVersion |
38 | { | 38 | { |
39 | get | 39 | get |
40 | { | 40 | { |
41 | return solutionVersion; | 41 | return solutionVersion; |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Gets or sets the product version. | 46 | /// Gets or sets the product version. |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <value>The product version.</value> | 48 | /// <value>The product version.</value> |
49 | public override string ProductVersion | 49 | public override string ProductVersion |
50 | { | 50 | { |
51 | get | 51 | get |
52 | { | 52 | { |
53 | return productVersion; | 53 | return productVersion; |
54 | } | 54 | } |
55 | } | 55 | } |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Gets or sets the schema version. | 58 | /// Gets or sets the schema version. |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <value>The schema version.</value> | 60 | /// <value>The schema version.</value> |
61 | public override string SchemaVersion | 61 | public override string SchemaVersion |
62 | { | 62 | { |
63 | get | 63 | get |
64 | { | 64 | { |
65 | return schemaVersion; | 65 | return schemaVersion; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Gets or sets the name of the version. | 70 | /// Gets or sets the name of the version. |
71 | /// </summary> | 71 | /// </summary> |
72 | /// <value>The name of the version.</value> | 72 | /// <value>The name of the version.</value> |
73 | public override string VersionName | 73 | public override string VersionName |
74 | { | 74 | { |
75 | get | 75 | get |
76 | { | 76 | { |
77 | return versionName; | 77 | return versionName; |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Gets or sets the version. | 82 | /// Gets or sets the version. |
83 | /// </summary> | 83 | /// </summary> |
84 | /// <value>The version.</value> | 84 | /// <value>The version.</value> |
85 | public override VSVersion Version | 85 | public override VSVersion Version |
86 | { | 86 | { |
87 | get | 87 | get |
88 | { | 88 | { |
89 | return version; | 89 | return version; |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
93 | /// <summary> | 93 | /// <summary> |
94 | /// Gets the name. | 94 | /// Gets the name. |
95 | /// </summary> | 95 | /// </summary> |
96 | /// <value>The name.</value> | 96 | /// <value>The name.</value> |
97 | public override string Name | 97 | public override string Name |
98 | { | 98 | { |
99 | get | 99 | get |
100 | { | 100 | { |
101 | return name; | 101 | return name; |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) | 105 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) |
106 | { | 106 | { |
@@ -110,7 +110,7 @@ namespace Prebuild.Core.Targets | |||
110 | case FrameworkVersion.v4_5: | 110 | case FrameworkVersion.v4_5: |
111 | case FrameworkVersion.v4_0: | 111 | case FrameworkVersion.v4_0: |
112 | case FrameworkVersion.v3_5: | 112 | case FrameworkVersion.v3_5: |
113 | return "ToolsVersion=\"4.0\""; | 113 | return "ToolsVersion=\"4.0\""; |
114 | case FrameworkVersion.v3_0: | 114 | case FrameworkVersion.v3_0: |
115 | return "ToolsVersion=\"3.0\""; | 115 | return "ToolsVersion=\"3.0\""; |
116 | default: | 116 | default: |
@@ -123,18 +123,18 @@ namespace Prebuild.Core.Targets | |||
123 | get { return "# Visual Studio 2010"; } | 123 | get { return "# Visual Studio 2010"; } |
124 | } | 124 | } |
125 | 125 | ||
126 | #endregion | 126 | #endregion |
127 | 127 | ||
128 | #region Constructors | 128 | #region Constructors |
129 | 129 | ||
130 | /// <summary> | 130 | /// <summary> |
131 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. | 131 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. |
132 | /// </summary> | 132 | /// </summary> |
133 | public VS2010Target() | 133 | public VS2010Target() |
134 | : base() | 134 | : base() |
135 | { | 135 | { |
136 | } | 136 | } |
137 | 137 | ||
138 | #endregion | 138 | #endregion |
139 | } | 139 | } |
140 | } | 140 | } |
diff --git a/Prebuild/src/Core/Targets/VS2012Target.cs b/Prebuild/src/Core/Targets/VS2012Target.cs new file mode 100644 index 0000000..e21c97a --- /dev/null +++ b/Prebuild/src/Core/Targets/VS2012Target.cs | |||
@@ -0,0 +1,138 @@ | |||
1 | using System; | ||
2 | |||
3 | using Prebuild.Core.Attributes; | ||
4 | using Prebuild.Core.Nodes; | ||
5 | |||
6 | namespace Prebuild.Core.Targets | ||
7 | { | ||
8 | |||
9 | /// <summary> | ||
10 | /// | ||
11 | /// </summary> | ||
12 | [Target("vs2012")] | ||
13 | public class VS2012Target : VSGenericTarget | ||
14 | { | ||
15 | #region Fields | ||
16 | |||
17 | string solutionVersion = "12.00"; | ||
18 | string productVersion = "11.0.61030.0"; | ||
19 | string schemaVersion = "2.0"; | ||
20 | string versionName = "Visual Studio 2012"; | ||
21 | string name = "vs2012"; | ||
22 | VSVersion version = VSVersion.VS11; | ||
23 | |||
24 | #endregion | ||
25 | |||
26 | #region Properties | ||
27 | |||
28 | /// <summary> | ||
29 | /// Gets or sets the solution version. | ||
30 | /// </summary> | ||
31 | /// <value>The solution version.</value> | ||
32 | public override string SolutionVersion | ||
33 | { | ||
34 | get | ||
35 | { | ||
36 | return solutionVersion; | ||
37 | } | ||
38 | } | ||
39 | |||
40 | /// <summary> | ||
41 | /// Gets or sets the product version. | ||
42 | /// </summary> | ||
43 | /// <value>The product version.</value> | ||
44 | public override string ProductVersion | ||
45 | { | ||
46 | get | ||
47 | { | ||
48 | return productVersion; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | /// <summary> | ||
53 | /// Gets or sets the schema version. | ||
54 | /// </summary> | ||
55 | /// <value>The schema version.</value> | ||
56 | public override string SchemaVersion | ||
57 | { | ||
58 | get | ||
59 | { | ||
60 | return schemaVersion; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | /// <summary> | ||
65 | /// Gets or sets the name of the version. | ||
66 | /// </summary> | ||
67 | /// <value>The name of the version.</value> | ||
68 | public override string VersionName | ||
69 | { | ||
70 | get | ||
71 | { | ||
72 | return versionName; | ||
73 | } | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Gets or sets the version. | ||
78 | /// </summary> | ||
79 | /// <value>The version.</value> | ||
80 | public override VSVersion Version | ||
81 | { | ||
82 | get | ||
83 | { | ||
84 | return version; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | /// <summary> | ||
89 | /// Gets the name. | ||
90 | /// </summary> | ||
91 | /// <value>The name.</value> | ||
92 | public override string Name | ||
93 | { | ||
94 | get | ||
95 | { | ||
96 | return name; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) | ||
101 | { | ||
102 | switch (frameworkVersion) | ||
103 | { | ||
104 | case FrameworkVersion.v4_6_1: | ||
105 | case FrameworkVersion.v4_6: | ||
106 | return "ToolsVersion=\"14.0\""; | ||
107 | case FrameworkVersion.v4_5_1: | ||
108 | case FrameworkVersion.v4_5: | ||
109 | case FrameworkVersion.v4_0: | ||
110 | case FrameworkVersion.v3_5: | ||
111 | return "ToolsVersion=\"4.0\""; | ||
112 | case FrameworkVersion.v3_0: | ||
113 | return "ToolsVersion=\"3.0\""; | ||
114 | default: | ||
115 | return "ToolsVersion=\"2.0\""; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | public override string SolutionTag | ||
120 | { | ||
121 | get { return "# Visual Studio 2012"; } | ||
122 | } | ||
123 | |||
124 | #endregion | ||
125 | |||
126 | #region Constructors | ||
127 | |||
128 | /// <summary> | ||
129 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. | ||
130 | /// </summary> | ||
131 | public VS2012Target() | ||
132 | : base() | ||
133 | { | ||
134 | } | ||
135 | |||
136 | #endregion | ||
137 | } | ||
138 | } | ||
diff --git a/Prebuild/src/Core/Targets/VS2013Target.cs b/Prebuild/src/Core/Targets/VS2013Target.cs new file mode 100644 index 0000000..96d8294 --- /dev/null +++ b/Prebuild/src/Core/Targets/VS2013Target.cs | |||
@@ -0,0 +1,139 @@ | |||
1 | using System; | ||
2 | |||
3 | using Prebuild.Core.Attributes; | ||
4 | using Prebuild.Core.Nodes; | ||
5 | |||
6 | namespace Prebuild.Core.Targets | ||
7 | { | ||
8 | |||
9 | /// <summary> | ||
10 | /// | ||
11 | /// </summary> | ||
12 | [Target("vs2013")] | ||
13 | public class VS2013Target : VSGenericTarget | ||
14 | { | ||
15 | #region Fields | ||
16 | |||
17 | string solutionVersion = "12.00"; | ||
18 | string productVersion = "12.0.31101"; | ||
19 | string schemaVersion = "2.0"; | ||
20 | string versionName = "Visual Studio 2013"; | ||
21 | string name = "vs2013"; | ||
22 | VSVersion version = VSVersion.VS12; | ||
23 | |||
24 | #endregion | ||
25 | |||
26 | #region Properties | ||
27 | |||
28 | /// <summary> | ||
29 | /// Gets or sets the solution version. | ||
30 | /// </summary> | ||
31 | /// <value>The solution version.</value> | ||
32 | public override string SolutionVersion | ||
33 | { | ||
34 | get | ||
35 | { | ||
36 | return solutionVersion; | ||
37 | } | ||
38 | } | ||
39 | |||
40 | /// <summary> | ||
41 | /// Gets or sets the product version. | ||
42 | /// </summary> | ||
43 | /// <value>The product version.</value> | ||
44 | public override string ProductVersion | ||
45 | { | ||
46 | get | ||
47 | { | ||
48 | return productVersion; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | /// <summary> | ||
53 | /// Gets or sets the schema version. | ||
54 | /// </summary> | ||
55 | /// <value>The schema version.</value> | ||
56 | public override string SchemaVersion | ||
57 | { | ||
58 | get | ||
59 | { | ||
60 | return schemaVersion; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | /// <summary> | ||
65 | /// Gets or sets the name of the version. | ||
66 | /// </summary> | ||
67 | /// <value>The name of the version.</value> | ||
68 | public override string VersionName | ||
69 | { | ||
70 | get | ||
71 | { | ||
72 | return versionName; | ||
73 | } | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Gets or sets the version. | ||
78 | /// </summary> | ||
79 | /// <value>The version.</value> | ||
80 | public override VSVersion Version | ||
81 | { | ||
82 | get | ||
83 | { | ||
84 | return version; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | /// <summary> | ||
89 | /// Gets the name. | ||
90 | /// </summary> | ||
91 | /// <value>The name.</value> | ||
92 | public override string Name | ||
93 | { | ||
94 | get | ||
95 | { | ||
96 | return name; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) | ||
101 | { | ||
102 | switch (frameworkVersion) | ||
103 | { | ||
104 | case FrameworkVersion.v4_6_1: | ||
105 | case FrameworkVersion.v4_6: | ||
106 | return "ToolsVersion=\"14.0\""; | ||
107 | case FrameworkVersion.v4_5_1: | ||
108 | case FrameworkVersion.v4_5: | ||
109 | return "ToolsVersion=\"12.0\""; | ||
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 | |||
120 | public override string SolutionTag | ||
121 | { | ||
122 | get { return "# Visual Studio 2013"; } | ||
123 | } | ||
124 | |||
125 | #endregion | ||
126 | |||
127 | #region Constructors | ||
128 | |||
129 | /// <summary> | ||
130 | /// Initializes a new instance of the <see cref="VS2005Target"/> class. | ||
131 | /// </summary> | ||
132 | public VS2013Target() | ||
133 | : base() | ||
134 | { | ||
135 | } | ||
136 | |||
137 | #endregion | ||
138 | } | ||
139 | } | ||
diff --git a/Prebuild/src/Core/Targets/VS2015Target.cs b/Prebuild/src/Core/Targets/VS2015Target.cs new file mode 100644 index 0000000..b487979 --- /dev/null +++ b/Prebuild/src/Core/Targets/VS2015Target.cs | |||
@@ -0,0 +1,143 @@ | |||
1 | using System; | ||
2 | using System.IO; | ||
3 | using System.Text; | ||
4 | |||
5 | using Prebuild.Core.Attributes; | ||
6 | using Prebuild.Core.Interfaces; | ||
7 | using Prebuild.Core.Nodes; | ||
8 | using Prebuild.Core.Utilities; | ||
9 | using System.CodeDom.Compiler; | ||
10 | |||
11 | namespace Prebuild.Core.Targets | ||
12 | { | ||
13 | |||
14 | /// <summary> | ||
15 | /// | ||
16 | /// </summary> | ||
17 | [Target("vs2015")] | ||
18 | public class VS2015Target : VSGenericTarget | ||
19 | { | ||
20 | #region Fields | ||
21 | |||
22 | string solutionVersion = "12.00"; | ||
23 | string productVersion = "14.0.23107.0"; | ||
24 | string schemaVersion = "2.0"; | ||
25 | string versionName = "Visual Studio 14"; | ||
26 | string name = "vs2015"; | ||
27 | VSVersion version = VSVersion.VS15; | ||
28 | |||
29 | #endregion | ||
30 | |||
31 | #region Properties | ||
32 | |||
33 | /// <summary> | ||
34 | /// Gets or sets the solution version. | ||
35 | /// </summary> | ||
36 | /// <value>The solution version.</value> | ||
37 | public override string SolutionVersion | ||
38 | { | ||
39 | get | ||
40 | { | ||
41 | return solutionVersion; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | /// <summary> | ||
46 | /// Gets or sets the product version. | ||
47 | /// </summary> | ||
48 | /// <value>The product version.</value> | ||
49 | public override string ProductVersion | ||
50 | { | ||
51 | get | ||
52 | { | ||
53 | return productVersion; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | /// <summary> | ||
58 | /// Gets or sets the schema version. | ||
59 | /// </summary> | ||
60 | /// <value>The schema version.</value> | ||
61 | public override string SchemaVersion | ||
62 | { | ||
63 | get | ||
64 | { | ||
65 | return schemaVersion; | ||
66 | } | ||
67 | } | ||
68 | |||
69 | /// <summary> | ||
70 | /// Gets or sets the name of the version. | ||
71 | /// </summary> | ||
72 | /// <value>The name of the version.</value> | ||
73 | public override string VersionName | ||
74 | { | ||
75 | get | ||
76 | { | ||
77 | return versionName; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | /// <summary> | ||
82 | /// Gets or sets the version. | ||
83 | /// </summary> | ||
84 | /// <value>The version.</value> | ||
85 | public override VSVersion Version | ||
86 | { | ||
87 | get | ||
88 | { | ||
89 | return version; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | /// <summary> | ||
94 | /// Gets the name. | ||
95 | /// </summary> | ||
96 | /// <value>The name.</value> | ||
97 | public override string Name | ||
98 | { | ||
99 | get | ||
100 | { | ||
101 | return name; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) | ||
106 | { | ||
107 | switch (frameworkVersion) | ||
108 | { | ||
109 | case FrameworkVersion.v4_6_1: | ||
110 | case FrameworkVersion.v4_6: | ||
111 | return "ToolsVersion=\"14.0\""; | ||
112 | case FrameworkVersion.v4_5: | ||
113 | return "ToolsVersion=\"12.0\""; | ||
114 | case FrameworkVersion.v4_0: | ||
115 | case FrameworkVersion.v3_5: | ||
116 | return "ToolsVersion=\"4.0\""; | ||
117 | case FrameworkVersion.v3_0: | ||
118 | return "ToolsVersion=\"3.0\""; | ||
119 | default: | ||
120 | return "ToolsVersion=\"2.0\""; | ||
121 | } | ||
122 | } | ||
123 | |||
124 | public override string SolutionTag | ||
125 | { | ||
126 | get { return "# Visual Studio 14"; } | ||
127 | } | ||
128 | |||
129 | #endregion | ||
130 | |||
131 | #region Constructors | ||
132 | |||
133 | /// <summary> | ||
134 | /// Initializes a new instance of the <see cref="VS2012Target"/> class. | ||
135 | /// </summary> | ||
136 | public VS2015Target() | ||
137 | : base() | ||
138 | { | ||
139 | } | ||
140 | |||
141 | #endregion | ||
142 | } | ||
143 | } \ No newline at end of file | ||
diff --git a/Prebuild/src/Core/Targets/VSGenericTarget.cs b/Prebuild/src/Core/Targets/VSGenericTarget.cs index 400788b..c12120f 100644 --- a/Prebuild/src/Core/Targets/VSGenericTarget.cs +++ b/Prebuild/src/Core/Targets/VSGenericTarget.cs | |||
@@ -35,141 +35,141 @@ using System.CodeDom.Compiler; | |||
35 | namespace Prebuild.Core.Targets | 35 | namespace Prebuild.Core.Targets |
36 | { | 36 | { |
37 | 37 | ||
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | public abstract class VSGenericTarget : ITarget | 41 | public abstract class VSGenericTarget : ITarget |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>(); | 45 | readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>(); |
46 | // NameValueCollection CopyFiles = new NameValueCollection(); | 46 | // NameValueCollection CopyFiles = new NameValueCollection(); |
47 | Kernel kernel; | 47 | Kernel kernel; |
48 | #endregion | 48 | #endregion |
49 | 49 | ||
50 | #region Properties | 50 | #region Properties |
51 | /// <summary> | 51 | /// <summary> |
52 | /// Gets or sets the solution version. | 52 | /// Gets or sets the solution version. |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <value>The solution version.</value> | 54 | /// <value>The solution version.</value> |
55 | public abstract string SolutionVersion { get; } | 55 | public abstract string SolutionVersion { get; } |
56 | /// <summary> | 56 | /// <summary> |
57 | /// Gets or sets the product version. | 57 | /// Gets or sets the product version. |
58 | /// </summary> | 58 | /// </summary> |
59 | /// <value>The product version.</value> | 59 | /// <value>The product version.</value> |
60 | public abstract string ProductVersion { get; } | 60 | public abstract string ProductVersion { get; } |
61 | /// <summary> | 61 | /// <summary> |
62 | /// Gets or sets the schema version. | 62 | /// Gets or sets the schema version. |
63 | /// </summary> | 63 | /// </summary> |
64 | /// <value>The schema version.</value> | 64 | /// <value>The schema version.</value> |
65 | public abstract string SchemaVersion { get; } | 65 | public abstract string SchemaVersion { get; } |
66 | /// <summary> | 66 | /// <summary> |
67 | /// Gets or sets the name of the version. | 67 | /// Gets or sets the name of the version. |
68 | /// </summary> | 68 | /// </summary> |
69 | /// <value>The name of the version.</value> | 69 | /// <value>The name of the version.</value> |
70 | public abstract string VersionName { get; } | 70 | public abstract string VersionName { get; } |
71 | /// <summary> | 71 | /// <summary> |
72 | /// Gets or sets the version. | 72 | /// Gets or sets the version. |
73 | /// </summary> | 73 | /// </summary> |
74 | /// <value>The version.</value> | 74 | /// <value>The version.</value> |
75 | public abstract VSVersion Version { get; } | 75 | public abstract VSVersion Version { get; } |
76 | /// <summary> | 76 | /// <summary> |
77 | /// Gets the name. | 77 | /// Gets the name. |
78 | /// </summary> | 78 | /// </summary> |
79 | /// <value>The name.</value> | 79 | /// <value>The name.</value> |
80 | public abstract string Name { get; } | 80 | public abstract string Name { get; } |
81 | 81 | ||
82 | protected abstract string GetToolsVersionXml(FrameworkVersion version); | 82 | protected abstract string GetToolsVersionXml(FrameworkVersion version); |
83 | public abstract string SolutionTag { get; } | 83 | public abstract string SolutionTag { get; } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | 86 | ||
87 | #region Constructors | 87 | #region Constructors |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Initializes a new instance of the <see cref="VSGenericTarget"/> class. | 90 | /// Initializes a new instance of the <see cref="VSGenericTarget"/> class. |
91 | /// </summary> | 91 | /// </summary> |
92 | protected VSGenericTarget() | 92 | protected VSGenericTarget() |
93 | { | 93 | { |
94 | tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets"); | 94 | tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSharp.targets"); |
95 | tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); | 95 | tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); |
96 | tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); | 96 | tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); |
97 | tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); | 97 | tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); |
98 | tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); | 98 | tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); |
99 | } | 99 | } |
100 | 100 | ||
101 | #endregion | 101 | #endregion |
102 | 102 | ||
103 | #region Private Methods | 103 | #region Private Methods |
104 | 104 | ||
105 | private string MakeRefPath(ProjectNode project) | 105 | private string MakeRefPath(ProjectNode project) |
106 | { | 106 | { |
107 | string ret = ""; | 107 | string ret = ""; |
108 | foreach (ReferencePathNode node in project.ReferencePaths) | 108 | foreach (ReferencePathNode node in project.ReferencePaths) |
109 | { | 109 | { |
110 | try | 110 | try |
111 | { | 111 | { |
112 | string fullPath = Helper.ResolvePath(node.Path); | 112 | string fullPath = Helper.ResolvePath(node.Path); |
113 | if (ret.Length < 1) | 113 | if (ret.Length < 1) |
114 | { | 114 | { |
115 | ret = fullPath; | 115 | ret = fullPath; |
116 | } | 116 | } |
117 | else | 117 | else |
118 | { | 118 | { |
119 | ret += ";" + fullPath; | 119 | ret += ";" + fullPath; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | catch (ArgumentException) | 122 | catch (ArgumentException) |
123 | { | 123 | { |
124 | kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); | 124 | kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | return ret; | 128 | return ret; |
129 | } | 129 | } |
130 | 130 | ||
131 | private static ProjectNode FindProjectInSolution(string name, SolutionNode solution) | 131 | private static ProjectNode FindProjectInSolution(string name, SolutionNode solution) |
132 | { | 132 | { |
133 | SolutionNode node = solution; | 133 | SolutionNode node = solution; |
134 | 134 | ||
135 | while (node.Parent is SolutionNode) | 135 | while (node.Parent is SolutionNode) |
136 | node = node.Parent as SolutionNode; | 136 | node = node.Parent as SolutionNode; |
137 | 137 | ||
138 | return FindProjectInSolutionRecursively(name, node); | 138 | return FindProjectInSolutionRecursively(name, node); |
139 | } | 139 | } |
140 | 140 | ||
141 | private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution) | 141 | private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution) |
142 | { | 142 | { |
143 | if (solution.ProjectsTable.ContainsKey(name)) | 143 | if (solution.ProjectsTable.ContainsKey(name)) |
144 | return solution.ProjectsTable[name]; | 144 | return solution.ProjectsTable[name]; |
145 | 145 | ||
146 | foreach (SolutionNode child in solution.Solutions) | 146 | foreach (SolutionNode child in solution.Solutions) |
147 | { | 147 | { |
148 | ProjectNode node = FindProjectInSolutionRecursively(name, child); | 148 | ProjectNode node = FindProjectInSolutionRecursively(name, child); |
149 | if (node != null) | 149 | if (node != null) |
150 | return node; | 150 | return node; |
151 | } | 151 | } |
152 | 152 | ||
153 | return null; | 153 | return null; |
154 | } | 154 | } |
155 | 155 | ||
156 | private void WriteProject(SolutionNode solution, ProjectNode project) | 156 | private void WriteProject(SolutionNode solution, ProjectNode project) |
157 | { | 157 | { |
158 | if (!tools.ContainsKey(project.Language)) | 158 | if (!tools.ContainsKey(project.Language)) |
159 | { | 159 | { |
160 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); | 160 | throw new UnknownLanguageException("Unknown .NET language: " + project.Language); |
161 | } | 161 | } |
162 | 162 | ||
163 | ToolInfo toolInfo = tools[project.Language]; | 163 | ToolInfo toolInfo = tools[project.Language]; |
164 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); | 164 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); |
165 | StreamWriter ps = new StreamWriter(projectFile); | 165 | StreamWriter ps = new StreamWriter(projectFile); |
166 | 166 | ||
167 | kernel.CurrentWorkingDirectory.Push(); | 167 | kernel.CurrentWorkingDirectory.Push(); |
168 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); | 168 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); |
169 | 169 | ||
170 | #region Project File | 170 | #region Project File |
171 | using (ps) | 171 | using (ps) |
172 | { | 172 | { |
173 | string targets = ""; | 173 | string targets = ""; |
174 | 174 | ||
175 | if(project.Files.CopyFiles > 0) | 175 | if(project.Files.CopyFiles > 0) |
@@ -177,347 +177,354 @@ namespace Prebuild.Core.Targets | |||
177 | else | 177 | else |
178 | targets = "Build"; | 178 | targets = "Build"; |
179 | 179 | ||
180 | ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion)); | 180 | ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion)); |
181 | ps.WriteLine(" <PropertyGroup>"); | 181 | ps.WriteLine(" <PropertyGroup>"); |
182 | ps.WriteLine(" <ProjectType>Local</ProjectType>"); | 182 | ps.WriteLine(" <ProjectType>Local</ProjectType>"); |
183 | ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion); | 183 | ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion); |
184 | ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion); | 184 | ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion); |
185 | ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper()); | 185 | ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper()); |
186 | 186 | ||
187 | // Visual Studio has a hard coded guid for the project type | 187 | // Visual Studio has a hard coded guid for the project type |
188 | if (project.Type == ProjectType.Web) | 188 | if (project.Type == ProjectType.Web) |
189 | ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>"); | 189 | ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>"); |
190 | ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>"); | 190 | ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>"); |
191 | ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon); | 191 | ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon); |
192 | ps.WriteLine(" <AssemblyKeyContainerName>"); | 192 | ps.WriteLine(" <AssemblyKeyContainerName>"); |
193 | ps.WriteLine(" </AssemblyKeyContainerName>"); | 193 | ps.WriteLine(" </AssemblyKeyContainerName>"); |
194 | ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName); | 194 | ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName); |
195 | foreach (ConfigurationNode conf in project.Configurations) | 195 | foreach (ConfigurationNode conf in project.Configurations) |
196 | { | ||
197 | if (conf.Options.KeyFile != "") | ||
198 | { | ||
199 | ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile); | ||
200 | ps.WriteLine(" <SignAssembly>true</SignAssembly>"); | ||
201 | break; | ||
202 | } | ||
203 | } | ||
204 | ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>"); | ||
205 | ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>"); | ||
206 | ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>"); | ||
207 | ps.WriteLine(" <DelaySign>false</DelaySign>"); | ||
208 | ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", ".")); | ||
209 | |||
210 | ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString()); | ||
211 | ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder); | ||
212 | ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace); | ||
213 | ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject); | ||
214 | if (string.IsNullOrEmpty(project.DebugStartParameters)) | ||
215 | { | ||
216 | ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters); | ||
217 | } | ||
218 | ps.WriteLine(" <FileUpgradeFlags>"); | ||
219 | ps.WriteLine(" </FileUpgradeFlags>"); | ||
220 | |||
221 | ps.WriteLine(" </PropertyGroup>"); | ||
222 | if (!string.IsNullOrEmpty(project.ApplicationManifest)) | ||
196 | { | 223 | { |
197 | if (conf.Options.KeyFile != "") | 224 | ps.WriteLine(" <PropertyGroup>"); |
198 | { | 225 | ps.WriteLine(" <ApplicationManifest>" + project.ApplicationManifest + "</ApplicationManifest>"); |
199 | ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile); | ||
200 | ps.WriteLine(" <SignAssembly>true</SignAssembly>"); | ||
201 | break; | ||
202 | } | ||
203 | } | ||
204 | ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>"); | ||
205 | ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>"); | ||
206 | ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>"); | ||
207 | ps.WriteLine(" <DelaySign>false</DelaySign>"); | ||
208 | ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", ".")); | ||
209 | |||
210 | ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString()); | ||
211 | ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder); | ||
212 | ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace); | ||
213 | ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject); | ||
214 | if (string.IsNullOrEmpty(project.DebugStartParameters)) | ||
215 | { | ||
216 | ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters); | ||
217 | } | ||
218 | ps.WriteLine(" <FileUpgradeFlags>"); | ||
219 | ps.WriteLine(" </FileUpgradeFlags>"); | ||
220 | |||
221 | ps.WriteLine(" </PropertyGroup>"); | ||
222 | |||
223 | foreach (ConfigurationNode conf in project.Configurations) | ||
224 | { | ||
225 | ps.Write(" <PropertyGroup "); | ||
226 | ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform); | ||
227 | ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]); | ||
228 | ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]); | ||
229 | ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]); | ||
230 | ps.WriteLine(" <ConfigurationOverrideFile>"); | ||
231 | ps.WriteLine(" </ConfigurationOverrideFile>"); | ||
232 | ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]); | ||
233 | ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString())); | ||
234 | ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]); | ||
235 | ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]); | ||
236 | ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]); | ||
237 | if (project.Type != ProjectType.Web) | ||
238 | ps.WriteLine(" <OutputPath>{0}</OutputPath>", | ||
239 | Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); | ||
240 | else | ||
241 | ps.WriteLine(" <OutputPath>{0}</OutputPath>", | ||
242 | Helper.EndPath(Helper.NormalizePath("bin\\"))); | ||
243 | |||
244 | ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]); | ||
245 | ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]); | ||
246 | ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]); | ||
247 | ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]); | ||
248 | ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]); | ||
249 | ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]); | ||
250 | ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform); | ||
251 | ps.WriteLine(" </PropertyGroup>"); | 226 | ps.WriteLine(" </PropertyGroup>"); |
252 | } | 227 | } |
253 | 228 | foreach (ConfigurationNode conf in project.Configurations) | |
254 | //ps.WriteLine(" </Settings>"); | 229 | { |
255 | 230 | ps.Write(" <PropertyGroup "); | |
256 | Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>(); | 231 | ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform); |
257 | List<ReferenceNode> otherReferences = new List<ReferenceNode>(); | 232 | ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]); |
258 | 233 | ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]); | |
259 | foreach (ReferenceNode refr in project.References) | 234 | ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]); |
260 | { | 235 | ps.WriteLine(" <ConfigurationOverrideFile>"); |
261 | ProjectNode projectNode = FindProjectInSolution(refr.Name, solution); | 236 | ps.WriteLine(" </ConfigurationOverrideFile>"); |
262 | 237 | ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", | |
263 | if (projectNode == null) | 238 | conf.Options["CompilerDefines"].ToString() == "" ? this.kernel.ForcedConditionals : conf.Options["CompilerDefines"] + ";" + kernel.ForcedConditionals); |
264 | otherReferences.Add(refr); | 239 | ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString())); |
265 | else | 240 | ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]); |
266 | projectReferences.Add(refr, projectNode); | 241 | ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]); |
267 | } | 242 | ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]); |
268 | // Assembly References | 243 | if (project.Type != ProjectType.Web) |
269 | ps.WriteLine(" <ItemGroup>"); | 244 | ps.WriteLine(" <OutputPath>{0}</OutputPath>", |
270 | 245 | Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); | |
271 | foreach (ReferenceNode refr in otherReferences) | 246 | else |
272 | { | 247 | ps.WriteLine(" <OutputPath>{0}</OutputPath>", |
273 | ps.Write(" <Reference"); | 248 | Helper.EndPath(Helper.NormalizePath("bin\\"))); |
274 | ps.Write(" Include=\""); | 249 | |
275 | ps.Write(refr.Name); | 250 | ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]); |
276 | ps.WriteLine("\" >"); | 251 | ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]); |
277 | ps.Write(" <Name>"); | 252 | ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]); |
278 | ps.Write(refr.Name); | 253 | ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]); |
279 | ps.WriteLine("</Name>"); | 254 | ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]); |
280 | 255 | ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]); | |
281 | if(!String.IsNullOrEmpty(refr.Path)) | 256 | ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform); |
282 | { | 257 | ps.WriteLine(" <Prefer32Bit>{0}</Prefer32Bit>",conf.Options["Prefer32Bit"]); |
283 | // Use absolute path to assembly (for determining assembly type) | 258 | ps.WriteLine(" </PropertyGroup>"); |
284 | string absolutePath = Path.Combine(project.FullPath, refr.Path); | 259 | } |
285 | if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) { | 260 | |
286 | // Assembly is an executable (exe) | 261 | //ps.WriteLine(" </Settings>"); |
287 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe")); | 262 | |
288 | } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) { | 263 | Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>(); |
289 | // Assembly is an library (dll) | 264 | List<ReferenceNode> otherReferences = new List<ReferenceNode>(); |
290 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); | 265 | |
291 | } else { | 266 | foreach (ReferenceNode refr in project.References) |
292 | string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll"); | 267 | { |
293 | kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath); | 268 | ProjectNode projectNode = FindProjectInSolution(refr.Name, solution); |
294 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); | 269 | |
295 | } | 270 | if (projectNode == null) |
296 | } | 271 | otherReferences.Add(refr); |
297 | 272 | else | |
298 | ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy); | 273 | projectReferences.Add(refr, projectNode); |
299 | ps.WriteLine(" </Reference>"); | 274 | } |
300 | } | 275 | // Assembly References |
301 | ps.WriteLine(" </ItemGroup>"); | 276 | ps.WriteLine(" <ItemGroup>"); |
302 | 277 | ||
303 | //Project References | 278 | foreach (ReferenceNode refr in otherReferences) |
304 | ps.WriteLine(" <ItemGroup>"); | 279 | { |
305 | foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences) | 280 | ps.Write(" <Reference"); |
306 | { | 281 | ps.Write(" Include=\""); |
307 | ToolInfo tool = tools[pair.Value.Language]; | 282 | ps.Write(refr.Name); |
308 | if (tools == null) | 283 | ps.WriteLine("\" >"); |
309 | throw new UnknownLanguageException(); | 284 | ps.Write(" <Name>"); |
310 | 285 | ps.Write(refr.Name); | |
311 | string path = | 286 | ps.WriteLine("</Name>"); |
312 | Helper.MakePathRelativeTo(project.FullPath, | 287 | |
313 | Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension)); | 288 | if(!String.IsNullOrEmpty(refr.Path)) |
314 | ps.WriteLine(" <ProjectReference Include=\"{0}\">", path); | 289 | { |
315 | 290 | // Use absolute path to assembly (for determining assembly type) | |
316 | // TODO: Allow reference to visual basic projects | 291 | string absolutePath = Path.Combine(project.FullPath, refr.Path); |
317 | ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name); | 292 | if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) { |
318 | ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper()); | 293 | // Assembly is an executable (exe) |
319 | ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper()); | 294 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe")); |
320 | 295 | } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) { | |
321 | //This is the Copy Local flag in VS | 296 | // Assembly is an library (dll) |
322 | ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy); | 297 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); |
323 | 298 | } else { | |
324 | ps.WriteLine(" </ProjectReference>"); | 299 | string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll"); |
325 | } | 300 | kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath); |
326 | ps.WriteLine(" </ItemGroup>"); | 301 | ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); |
327 | 302 | } | |
328 | // ps.WriteLine(" </Build>"); | 303 | } |
329 | ps.WriteLine(" <ItemGroup>"); | 304 | |
330 | 305 | ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy); | |
331 | // ps.WriteLine(" <Include>"); | 306 | ps.WriteLine(" </Reference>"); |
332 | List<string> list = new List<string>(); | 307 | } |
333 | 308 | ps.WriteLine(" </ItemGroup>"); | |
334 | foreach (string path in project.Files) | 309 | |
335 | { | 310 | //Project References |
336 | string lower = path.ToLower(); | 311 | ps.WriteLine(" <ItemGroup>"); |
337 | if (lower.EndsWith(".resx")) | 312 | foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences) |
338 | { | 313 | { |
339 | string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension); | 314 | ToolInfo tool = tools[pair.Value.Language]; |
340 | if (!list.Contains(codebehind)) | 315 | if (tools == null) |
341 | list.Add(codebehind); | 316 | throw new UnknownLanguageException(); |
342 | } | 317 | |
343 | 318 | string path = | |
344 | } | 319 | Helper.MakePathRelativeTo(project.FullPath, |
345 | 320 | Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension)); | |
346 | 321 | ps.WriteLine(" <ProjectReference Include=\"{0}\">", path); | |
347 | foreach (string filePath in project.Files) | 322 | |
348 | { | 323 | // TODO: Allow reference to visual basic projects |
324 | ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name); | ||
325 | ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper()); | ||
326 | ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper()); | ||
327 | |||
328 | //This is the Copy Local flag in VS | ||
329 | ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy); | ||
330 | |||
331 | ps.WriteLine(" </ProjectReference>"); | ||
332 | } | ||
333 | ps.WriteLine(" </ItemGroup>"); | ||
334 | |||
335 | // ps.WriteLine(" </Build>"); | ||
336 | ps.WriteLine(" <ItemGroup>"); | ||
337 | |||
338 | // ps.WriteLine(" <Include>"); | ||
339 | List<string> list = new List<string>(); | ||
340 | |||
341 | foreach (string path in project.Files) | ||
342 | { | ||
343 | string lower = path.ToLower(); | ||
344 | if (lower.EndsWith(".resx")) | ||
345 | { | ||
346 | string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension); | ||
347 | if (!list.Contains(codebehind)) | ||
348 | list.Add(codebehind); | ||
349 | } | ||
350 | |||
351 | } | ||
352 | |||
353 | |||
354 | foreach (string filePath in project.Files) | ||
355 | { | ||
349 | // Add the filePath with the destination as the key | 356 | // Add the filePath with the destination as the key |
350 | // will use it later to form the copy parameters with Include lists | 357 | // will use it later to form the copy parameters with Include lists |
351 | // for each destination | 358 | // for each destination |
352 | if (project.Files.GetBuildAction(filePath) == BuildAction.Copy) | 359 | if (project.Files.GetBuildAction(filePath) == BuildAction.Copy) |
353 | continue; | 360 | continue; |
354 | // if (file == "Properties\\Bind.Designer.cs") | 361 | // if (file == "Properties\\Bind.Designer.cs") |
355 | // { | 362 | // { |
356 | // Console.WriteLine("Wait a minute!"); | 363 | // Console.WriteLine("Wait a minute!"); |
357 | // Console.WriteLine(project.Files.GetSubType(file).ToString()); | 364 | // Console.WriteLine(project.Files.GetSubType(file).ToString()); |
358 | // } | 365 | // } |
359 | SubType subType = project.Files.GetSubType(filePath); | 366 | SubType subType = project.Files.GetSubType(filePath); |
360 | 367 | ||
361 | // Visual Studio chokes on file names if forward slash is used as a path separator | 368 | // Visual Studio chokes on file names if forward slash is used as a path separator |
362 | // instead of backslash. So we must make sure that all file paths written to the | 369 | // instead of backslash. So we must make sure that all file paths written to the |
363 | // project file use \ as a path separator. | 370 | // project file use \ as a path separator. |
364 | string file = filePath.Replace(@"/", @"\"); | 371 | string file = filePath.Replace(@"/", @"\"); |
365 | 372 | ||
366 | if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer | 373 | if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer |
367 | && subType != SubType.CodeBehind) | 374 | && subType != SubType.CodeBehind) |
368 | { | 375 | { |
369 | ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); | 376 | ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); |
370 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file)); | 377 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file)); |
371 | ps.WriteLine(" <SubType>Designer</SubType>"); | 378 | ps.WriteLine(" <SubType>Designer</SubType>"); |
372 | ps.WriteLine(" </EmbeddedResource>"); | 379 | ps.WriteLine(" </EmbeddedResource>"); |
373 | // | 380 | // |
374 | } | 381 | } |
375 | 382 | ||
376 | if (subType == SubType.Designer) | 383 | if (subType == SubType.Designer) |
377 | { | 384 | { |
378 | ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file); | 385 | ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file); |
379 | 386 | ||
380 | string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs"; | 387 | string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs"; |
381 | string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs"; | 388 | string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs"; |
382 | 389 | ||
383 | // Check for a parent .cs file with the same name as this designer file | 390 | // Check for a parent .cs file with the same name as this designer file |
384 | if (File.Exists(Helper.NormalizePath(dependent_name))) | 391 | if (File.Exists(Helper.NormalizePath(dependent_name))) |
385 | { | 392 | { |
386 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); | 393 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); |
387 | } | 394 | } |
388 | else | 395 | else |
389 | { | 396 | { |
390 | ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>"); | 397 | ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>"); |
391 | ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name)); | 398 | ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name)); |
392 | ps.WriteLine(" <SubType>" + subType + "</SubType>"); | 399 | ps.WriteLine(" <SubType>" + subType + "</SubType>"); |
393 | } | 400 | } |
394 | 401 | ||
395 | ps.WriteLine(" </EmbeddedResource>"); | 402 | ps.WriteLine(" </EmbeddedResource>"); |
396 | if (File.Exists(Helper.NormalizePath(autogen_name))) | 403 | if (File.Exists(Helper.NormalizePath(autogen_name))) |
397 | { | 404 | { |
398 | ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name); | 405 | ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name); |
399 | //ps.WriteLine(" <DesignTime>True</DesignTime>"); | 406 | //ps.WriteLine(" <DesignTime>True</DesignTime>"); |
400 | 407 | ||
401 | // If a parent .cs file exists, link this autogen file to it. Otherwise link | 408 | // If a parent .cs file exists, link this autogen file to it. Otherwise link |
402 | // to the designer file | 409 | // to the designer file |
403 | if (File.Exists(dependent_name)) | 410 | if (File.Exists(dependent_name)) |
404 | { | 411 | { |
405 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); | 412 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); |
406 | } | 413 | } |
407 | else | 414 | else |
408 | { | 415 | { |
409 | ps.WriteLine(" <AutoGen>True</AutoGen>"); | 416 | ps.WriteLine(" <AutoGen>True</AutoGen>"); |
410 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath)); | 417 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath)); |
411 | } | 418 | } |
412 | 419 | ||
413 | ps.WriteLine(" </Compile>"); | 420 | ps.WriteLine(" </Compile>"); |
414 | } | 421 | } |
415 | list.Add(autogen_name); | 422 | list.Add(autogen_name); |
416 | } | 423 | } |
417 | if (subType == SubType.Settings) | 424 | if (subType == SubType.Settings) |
418 | { | 425 | { |
419 | ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); | 426 | ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); |
420 | ps.WriteLine("Include=\"{0}\">", file); | 427 | ps.WriteLine("Include=\"{0}\">", file); |
421 | string fileName = Path.GetFileName(filePath); | 428 | string fileName = Path.GetFileName(filePath); |
422 | if (project.Files.GetBuildAction(filePath) == BuildAction.None) | 429 | if (project.Files.GetBuildAction(filePath) == BuildAction.None) |
423 | { | 430 | { |
424 | ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>"); | 431 | ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>"); |
425 | ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); | 432 | ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); |
426 | } | 433 | } |
427 | else | 434 | else |
428 | { | 435 | { |
429 | ps.WriteLine(" <SubType>Code</SubType>"); | 436 | ps.WriteLine(" <SubType>Code</SubType>"); |
430 | ps.WriteLine(" <AutoGen>True</AutoGen>"); | 437 | ps.WriteLine(" <AutoGen>True</AutoGen>"); |
431 | ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); | 438 | ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); |
432 | string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.')); | 439 | string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.')); |
433 | string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.')); | 440 | string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.')); |
434 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings")); | 441 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings")); |
435 | } | 442 | } |
436 | ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); | 443 | ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); |
437 | } | 444 | } |
438 | else if (subType != SubType.Designer) | 445 | else if (subType != SubType.Designer) |
439 | { | 446 | { |
440 | string path = Helper.NormalizePath(file); | 447 | string path = Helper.NormalizePath(file); |
441 | string path_lower = path.ToLower(); | 448 | string path_lower = path.ToLower(); |
442 | 449 | ||
443 | if (!list.Contains(filePath)) | 450 | if (!list.Contains(filePath)) |
444 | { | 451 | { |
445 | ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); | 452 | ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); |
446 | 453 | ||
447 | int startPos = 0; | 454 | int startPos = 0; |
448 | if (project.Files.GetPreservePath(filePath)) | 455 | if (project.Files.GetPreservePath(filePath)) |
449 | { | 456 | { |
450 | while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1) | 457 | while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1) |
451 | startPos++; | 458 | startPos++; |
452 | 459 | ||
453 | } | 460 | } |
454 | else | 461 | else |
455 | { | 462 | { |
456 | startPos = file.LastIndexOf(Path.GetFileName(path)); | 463 | startPos = file.LastIndexOf(Path.GetFileName(path)); |
457 | } | 464 | } |
458 | 465 | ||
459 | // be sure to write out the path with backslashes so VS recognizes | 466 | // be sure to write out the path with backslashes so VS recognizes |
460 | // the file properly. | 467 | // the file properly. |
461 | ps.WriteLine("Include=\"{0}\">", file); | 468 | ps.WriteLine("Include=\"{0}\">", file); |
462 | 469 | ||
463 | int last_period_index = file.LastIndexOf('.'); | 470 | int last_period_index = file.LastIndexOf('.'); |
464 | string short_file_name = (last_period_index >= 0) | 471 | string short_file_name = (last_period_index >= 0) |
465 | ? file.Substring(0, last_period_index) | 472 | ? file.Substring(0, last_period_index) |
466 | : file; | 473 | : file; |
467 | string extension = Path.GetExtension(path); | 474 | string extension = Path.GetExtension(path); |
468 | // make this upper case, so that when File.Exists tests for the | 475 | // make this upper case, so that when File.Exists tests for the |
469 | // existence of a designer file on a case-sensitive platform, | 476 | // existence of a designer file on a case-sensitive platform, |
470 | // it is correctly identified. | 477 | // it is correctly identified. |
471 | string designer_format = string.Format(".Designer{0}", extension); | 478 | string designer_format = string.Format(".Designer{0}", extension); |
472 | 479 | ||
473 | if (path_lower.EndsWith(designer_format.ToLowerInvariant())) | 480 | if (path_lower.EndsWith(designer_format.ToLowerInvariant())) |
474 | { | 481 | { |
475 | int designer_index = path.IndexOf(designer_format); | 482 | int designer_index = path.IndexOf(designer_format); |
476 | string file_name = path.Substring(0, designer_index); | 483 | string file_name = path.Substring(0, designer_index); |
477 | 484 | ||
478 | // There are two corrections to the next lines: | 485 | // There are two corrections to the next lines: |
479 | // 1. Fix the connection between a designer file and a form | 486 | // 1. Fix the connection between a designer file and a form |
480 | // or usercontrol that don't have an associated resx file. | 487 | // or usercontrol that don't have an associated resx file. |
481 | // 2. Connect settings files to associated designer files. | 488 | // 2. Connect settings files to associated designer files. |
482 | if (File.Exists(file_name + extension)) | 489 | if (File.Exists(file_name + extension)) |
483 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension)); | 490 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension)); |
484 | else if (File.Exists(file_name + ".resx")) | 491 | else if (File.Exists(file_name + ".resx")) |
485 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx")); | 492 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx")); |
486 | else if (File.Exists(file_name + ".settings")) | 493 | else if (File.Exists(file_name + ".settings")) |
487 | { | 494 | { |
488 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings")); | 495 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings")); |
489 | ps.WriteLine(" <AutoGen>True</AutoGen>"); | 496 | ps.WriteLine(" <AutoGen>True</AutoGen>"); |
490 | ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); | 497 | ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); |
491 | } | 498 | } |
492 | } | 499 | } |
493 | else if (subType == SubType.CodeBehind) | 500 | else if (subType == SubType.CodeBehind) |
494 | { | 501 | { |
495 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name)); | 502 | ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name)); |
496 | } | 503 | } |
497 | if (project.Files.GetIsLink(filePath)) | 504 | if (project.Files.GetIsLink(filePath)) |
498 | { | 505 | { |
499 | string alias = project.Files.GetLinkPath(filePath); | 506 | string alias = project.Files.GetLinkPath(filePath); |
500 | alias += file.Substring(startPos); | 507 | alias += file.Substring(startPos); |
501 | alias = Helper.NormalizePath(alias); | 508 | alias = Helper.NormalizePath(alias); |
502 | ps.WriteLine(" <Link>{0}</Link>", alias); | 509 | ps.WriteLine(" <Link>{0}</Link>", alias); |
503 | } | 510 | } |
504 | else if (project.Files.GetBuildAction(filePath) != BuildAction.None) | 511 | else if (project.Files.GetBuildAction(filePath) != BuildAction.None) |
505 | { | 512 | { |
506 | if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource) | 513 | if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource) |
507 | { | 514 | { |
508 | ps.WriteLine(" <SubType>{0}</SubType>", subType); | 515 | ps.WriteLine(" <SubType>{0}</SubType>", subType); |
509 | } | 516 | } |
510 | } | 517 | } |
511 | 518 | ||
512 | if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never) | 519 | if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never) |
513 | { | 520 | { |
514 | ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath)); | 521 | ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath)); |
515 | } | 522 | } |
516 | 523 | ||
517 | ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); | 524 | ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); |
518 | } | 525 | } |
519 | } | 526 | } |
520 | } | 527 | } |
521 | ps.WriteLine(" </ItemGroup>"); | 528 | ps.WriteLine(" </ItemGroup>"); |
522 | 529 | ||
523 | /* | 530 | /* |
@@ -553,420 +560,420 @@ namespace Prebuild.Core.Targets | |||
553 | ps.WriteLine(" </Target>"); | 560 | ps.WriteLine(" </Target>"); |
554 | } | 561 | } |
555 | 562 | ||
556 | ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />"); | 563 | ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />"); |
557 | ps.WriteLine(" <PropertyGroup>"); | 564 | ps.WriteLine(" <PropertyGroup>"); |
558 | ps.WriteLine(" <PreBuildEvent>"); | 565 | ps.WriteLine(" <PreBuildEvent>"); |
559 | ps.WriteLine(" </PreBuildEvent>"); | 566 | ps.WriteLine(" </PreBuildEvent>"); |
560 | ps.WriteLine(" <PostBuildEvent>"); | 567 | ps.WriteLine(" <PostBuildEvent>"); |
561 | ps.WriteLine(" </PostBuildEvent>"); | 568 | ps.WriteLine(" </PostBuildEvent>"); |
562 | ps.WriteLine(" </PropertyGroup>"); | 569 | ps.WriteLine(" </PropertyGroup>"); |
563 | ps.WriteLine("</Project>"); | 570 | ps.WriteLine("</Project>"); |
564 | } | 571 | } |
565 | #endregion | 572 | #endregion |
566 | 573 | ||
567 | #region User File | 574 | #region User File |
568 | 575 | ||
569 | ps = new StreamWriter(projectFile + ".user"); | 576 | ps = new StreamWriter(projectFile + ".user"); |
570 | using (ps) | 577 | using (ps) |
571 | { | 578 | { |
572 | // Get the first configuration from the project. | 579 | // Get the first configuration from the project. |
573 | ConfigurationNode firstConfiguration = null; | 580 | ConfigurationNode firstConfiguration = null; |
574 | 581 | ||
575 | if (project.Configurations.Count > 0) | 582 | if (project.Configurations.Count > 0) |
576 | { | 583 | { |
577 | firstConfiguration = project.Configurations[0]; | 584 | firstConfiguration = project.Configurations[0]; |
578 | } | 585 | } |
579 | 586 | ||
580 | ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">"); | 587 | ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">"); |
581 | //ps.WriteLine( "<VisualStudioProject>" ); | 588 | //ps.WriteLine( "<VisualStudioProject>" ); |
582 | //ps.WriteLine(" <{0}>", toolInfo.XMLTag); | 589 | //ps.WriteLine(" <{0}>", toolInfo.XMLTag); |
583 | //ps.WriteLine(" <Build>"); | 590 | //ps.WriteLine(" <Build>"); |
584 | ps.WriteLine(" <PropertyGroup>"); | 591 | ps.WriteLine(" <PropertyGroup>"); |
585 | //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); | 592 | //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); |
586 | 593 | ||
587 | if (firstConfiguration != null) | 594 | if (firstConfiguration != null) |
588 | { | 595 | { |
589 | ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name); | 596 | ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name); |
590 | ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform); | 597 | ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform); |
591 | } | 598 | } |
592 | 599 | ||
593 | ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project)); | 600 | ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project)); |
594 | ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion); | 601 | ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion); |
595 | ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>"); | 602 | ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>"); |
596 | ps.WriteLine(" <ProjectTrust>0</ProjectTrust>"); | 603 | ps.WriteLine(" <ProjectTrust>0</ProjectTrust>"); |
597 | ps.WriteLine(" </PropertyGroup>"); | 604 | ps.WriteLine(" </PropertyGroup>"); |
598 | foreach (ConfigurationNode conf in project.Configurations) | 605 | foreach (ConfigurationNode conf in project.Configurations) |
599 | { | 606 | { |
600 | ps.Write(" <PropertyGroup"); | 607 | ps.Write(" <PropertyGroup"); |
601 | ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform); | 608 | ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform); |
602 | ps.WriteLine(" />"); | 609 | ps.WriteLine(" />"); |
603 | } | 610 | } |
604 | ps.WriteLine("</Project>"); | 611 | ps.WriteLine("</Project>"); |
605 | } | 612 | } |
606 | #endregion | 613 | #endregion |
607 | 614 | ||
608 | kernel.CurrentWorkingDirectory.Pop(); | 615 | kernel.CurrentWorkingDirectory.Pop(); |
609 | } | 616 | } |
610 | 617 | ||
611 | private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) | 618 | private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) |
612 | { | 619 | { |
613 | kernel.Log.Write("Creating {0} solution and project files", VersionName); | 620 | kernel.Log.Write("Creating {0} solution and project files", VersionName); |
614 | 621 | ||
615 | foreach (SolutionNode child in solution.Solutions) | 622 | foreach (SolutionNode child in solution.Solutions) |
616 | { | 623 | { |
617 | kernel.Log.Write("...Creating folder: {0}", child.Name); | 624 | kernel.Log.Write("...Creating folder: {0}", child.Name); |
618 | WriteSolution(child, false); | 625 | WriteSolution(child, false); |
619 | } | 626 | } |
620 | 627 | ||
621 | foreach (ProjectNode project in solution.Projects) | 628 | foreach (ProjectNode project in solution.Projects) |
622 | { | 629 | { |
623 | kernel.Log.Write("...Creating project: {0}", project.Name); | 630 | kernel.Log.Write("...Creating project: {0}", project.Name); |
624 | WriteProject(solution, project); | 631 | WriteProject(solution, project); |
625 | } | 632 | } |
626 | 633 | ||
627 | foreach (DatabaseProjectNode project in solution.DatabaseProjects) | 634 | foreach (DatabaseProjectNode project in solution.DatabaseProjects) |
628 | { | 635 | { |
629 | kernel.Log.Write("...Creating database project: {0}", project.Name); | 636 | kernel.Log.Write("...Creating database project: {0}", project.Name); |
630 | WriteDatabaseProject(solution, project); | 637 | WriteDatabaseProject(solution, project); |
631 | } | 638 | } |
632 | 639 | ||
633 | if (writeSolutionToDisk) // only write main solution | 640 | if (writeSolutionToDisk) // only write main solution |
634 | { | 641 | { |
635 | kernel.Log.Write(""); | 642 | kernel.Log.Write(""); |
636 | string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); | 643 | string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); |
637 | 644 | ||
638 | using (StreamWriter ss = new StreamWriter(solutionFile)) | 645 | using (StreamWriter ss = new StreamWriter(solutionFile)) |
639 | { | 646 | { |
640 | kernel.CurrentWorkingDirectory.Push(); | 647 | kernel.CurrentWorkingDirectory.Push(); |
641 | Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); | 648 | Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); |
642 | 649 | ||
643 | ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); | 650 | ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); |
644 | ss.WriteLine(SolutionTag); | 651 | ss.WriteLine(SolutionTag); |
645 | 652 | ||
646 | WriteProjectDeclarations(ss, solution, solution); | 653 | WriteProjectDeclarations(ss, solution, solution); |
647 | 654 | ||
648 | ss.WriteLine("Global"); | 655 | ss.WriteLine("Global"); |
649 | 656 | ||
650 | ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); | 657 | ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); |
651 | foreach (ConfigurationNode conf in solution.Configurations) | 658 | foreach (ConfigurationNode conf in solution.Configurations) |
652 | { | 659 | { |
653 | ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform); | 660 | ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform); |
654 | } | 661 | } |
655 | ss.WriteLine("\tEndGlobalSection"); | 662 | ss.WriteLine("\tEndGlobalSection"); |
656 | 663 | ||
657 | ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); | 664 | ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); |
658 | WriteConfigurationLines(solution.Configurations, solution, ss); | 665 | WriteConfigurationLines(solution.Configurations, solution, ss); |
659 | ss.WriteLine("\tEndGlobalSection"); | 666 | ss.WriteLine("\tEndGlobalSection"); |
660 | 667 | ||
661 | if (solution.Solutions.Count > 0) | 668 | if (solution.Solutions.Count > 0) |
662 | { | 669 | { |
663 | ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution"); | 670 | ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution"); |
664 | foreach (SolutionNode embeddedSolution in solution.Solutions) | 671 | foreach (SolutionNode embeddedSolution in solution.Solutions) |
665 | { | 672 | { |
666 | WriteNestedProjectMap(ss, embeddedSolution); | 673 | WriteNestedProjectMap(ss, embeddedSolution); |
667 | } | 674 | } |
668 | ss.WriteLine("\tEndGlobalSection"); | 675 | ss.WriteLine("\tEndGlobalSection"); |
669 | } | 676 | } |
670 | 677 | ||
671 | ss.WriteLine("EndGlobal"); | 678 | ss.WriteLine("EndGlobal"); |
672 | } | 679 | } |
673 | 680 | ||
674 | kernel.CurrentWorkingDirectory.Pop(); | 681 | kernel.CurrentWorkingDirectory.Pop(); |
675 | } | 682 | } |
676 | } | 683 | } |
677 | 684 | ||
678 | private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) | 685 | private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) |
679 | { | 686 | { |
680 | foreach (SolutionNode childSolution in embeddedSolution.Solutions) | 687 | foreach (SolutionNode childSolution in embeddedSolution.Solutions) |
681 | { | 688 | { |
682 | WriteEmbeddedSolution(writer, childSolution); | 689 | WriteEmbeddedSolution(writer, childSolution); |
683 | WriteProjectDeclarations(writer, actualSolution, childSolution); | 690 | WriteProjectDeclarations(writer, actualSolution, childSolution); |
684 | } | 691 | } |
685 | 692 | ||
686 | foreach (ProjectNode project in embeddedSolution.Projects) | 693 | foreach (ProjectNode project in embeddedSolution.Projects) |
687 | { | 694 | { |
688 | WriteProject(actualSolution, writer, project); | 695 | WriteProject(actualSolution, writer, project); |
689 | } | 696 | } |
690 | 697 | ||
691 | foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) | 698 | foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) |
692 | { | 699 | { |
693 | WriteProject(actualSolution, writer, dbProject); | 700 | WriteProject(actualSolution, writer, dbProject); |
694 | } | 701 | } |
695 | 702 | ||
696 | if (actualSolution.Guid == embeddedSolution.Guid) | 703 | if (actualSolution.Guid == embeddedSolution.Guid) |
697 | { | 704 | { |
698 | WriteSolutionFiles(actualSolution, writer); | 705 | WriteSolutionFiles(actualSolution, writer); |
699 | } | 706 | } |
700 | } | 707 | } |
701 | 708 | ||
702 | private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution) | 709 | private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution) |
703 | { | 710 | { |
704 | foreach (ProjectNode project in embeddedSolution.Projects) | 711 | foreach (ProjectNode project in embeddedSolution.Projects) |
705 | { | 712 | { |
706 | WriteNestedProject(writer, embeddedSolution, project.Guid); | 713 | WriteNestedProject(writer, embeddedSolution, project.Guid); |
707 | } | 714 | } |
708 | 715 | ||
709 | foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) | 716 | foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) |
710 | { | 717 | { |
711 | WriteNestedProject(writer, embeddedSolution, dbProject.Guid); | 718 | WriteNestedProject(writer, embeddedSolution, dbProject.Guid); |
712 | } | 719 | } |
713 | 720 | ||
714 | foreach (SolutionNode child in embeddedSolution.Solutions) | 721 | foreach (SolutionNode child in embeddedSolution.Solutions) |
715 | { | 722 | { |
716 | WriteNestedProject(writer, embeddedSolution, child.Guid); | 723 | WriteNestedProject(writer, embeddedSolution, child.Guid); |
717 | WriteNestedProjectMap(writer, child); | 724 | WriteNestedProjectMap(writer, child); |
718 | } | 725 | } |
719 | } | 726 | } |
720 | 727 | ||
721 | private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid) | 728 | private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid) |
722 | { | 729 | { |
723 | WriteNestedFolder(writer, solution.Guid, projectGuid); | 730 | WriteNestedFolder(writer, solution.Guid, projectGuid); |
724 | } | 731 | } |
725 | 732 | ||
726 | private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid) | 733 | private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid) |
727 | { | 734 | { |
728 | writer.WriteLine("\t\t{0} = {1}", | 735 | writer.WriteLine("\t\t{0} = {1}", |
729 | childGuid.ToString("B").ToUpper(), | 736 | childGuid.ToString("B").ToUpper(), |
730 | parentGuid.ToString("B").ToUpper()); | 737 | parentGuid.ToString("B").ToUpper()); |
731 | } | 738 | } |
732 | 739 | ||
733 | private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss) | 740 | private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss) |
734 | { | 741 | { |
735 | foreach (ProjectNode project in solution.Projects) | 742 | foreach (ProjectNode project in solution.Projects) |
736 | { | 743 | { |
737 | foreach (ConfigurationNode conf in configurations) | 744 | foreach (ConfigurationNode conf in configurations) |
738 | { | 745 | { |
739 | ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}", | 746 | ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}", |
740 | project.Guid.ToString("B").ToUpper(), | 747 | project.Guid.ToString("B").ToUpper(), |
741 | conf.NameAndPlatform); | 748 | conf.NameAndPlatform); |
742 | 749 | ||
743 | ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}", | 750 | ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}", |
744 | project.Guid.ToString("B").ToUpper(), | 751 | project.Guid.ToString("B").ToUpper(), |
745 | conf.NameAndPlatform); | 752 | conf.NameAndPlatform); |
746 | } | 753 | } |
747 | } | 754 | } |
748 | 755 | ||
749 | foreach (SolutionNode child in solution.Solutions) | 756 | foreach (SolutionNode child in solution.Solutions) |
750 | { | 757 | { |
751 | WriteConfigurationLines(configurations, child, ss); | 758 | WriteConfigurationLines(configurations, child, ss); |
752 | } | 759 | } |
753 | } | 760 | } |
754 | 761 | ||
755 | private void WriteSolutionFiles(SolutionNode solution, TextWriter ss) | 762 | private void WriteSolutionFiles(SolutionNode solution, TextWriter ss) |
756 | { | 763 | { |
757 | if(solution.Files != null && solution.Files.Count > 0) | 764 | if(solution.Files != null && solution.Files.Count > 0) |
758 | WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); | 765 | WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); |
759 | } | 766 | } |
760 | 767 | ||
761 | private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution) | 768 | private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution) |
762 | { | 769 | { |
763 | WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files); | 770 | WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files); |
764 | } | 771 | } |
765 | 772 | ||
766 | private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project) | 773 | private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project) |
767 | { | 774 | { |
768 | WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath); | 775 | WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath); |
769 | } | 776 | } |
770 | 777 | ||
771 | private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject) | 778 | private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject) |
772 | { | 779 | { |
773 | if (solution.Files != null && solution.Files.Count > 0) | 780 | if (solution.Files != null && solution.Files.Count > 0) |
774 | WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath); | 781 | WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath); |
775 | } | 782 | } |
776 | 783 | ||
777 | const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\""; | 784 | const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\""; |
778 | const string ProjectDeclarationEndFormat = "EndProject"; | 785 | const string ProjectDeclarationEndFormat = "EndProject"; |
779 | 786 | ||
780 | private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) | 787 | private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) |
781 | { | 788 | { |
782 | if (!tools.ContainsKey(language)) | 789 | if (!tools.ContainsKey(language)) |
783 | throw new UnknownLanguageException("Unknown .NET language: " + language); | 790 | throw new UnknownLanguageException("Unknown .NET language: " + language); |
784 | 791 | ||
785 | ToolInfo toolInfo = tools[language]; | 792 | ToolInfo toolInfo = tools[language]; |
786 | 793 | ||
787 | string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath); | 794 | string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath); |
788 | 795 | ||
789 | path = Helper.MakeFilePath(path, name, toolInfo.FileExtension); | 796 | path = Helper.MakeFilePath(path, name, toolInfo.FileExtension); |
790 | 797 | ||
791 | WriteProject(ss, language, guid, name, path); | 798 | WriteProject(ss, language, guid, name, path); |
792 | } | 799 | } |
793 | 800 | ||
794 | private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location) | 801 | private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location) |
795 | { | 802 | { |
796 | WriteProject(writer, language, projectGuid, name, location, null); | 803 | WriteProject(writer, language, projectGuid, name, location, null); |
797 | } | 804 | } |
798 | 805 | ||
799 | private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) | 806 | private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) |
800 | { | 807 | { |
801 | if (!tools.ContainsKey(language)) | 808 | if (!tools.ContainsKey(language)) |
802 | throw new UnknownLanguageException("Unknown .NET language: " + language); | 809 | throw new UnknownLanguageException("Unknown .NET language: " + language); |
803 | 810 | ||
804 | ToolInfo toolInfo = tools[language]; | 811 | ToolInfo toolInfo = tools[language]; |
805 | 812 | ||
806 | writer.WriteLine(ProjectDeclarationBeginFormat, | 813 | writer.WriteLine(ProjectDeclarationBeginFormat, |
807 | toolInfo.Guid, | 814 | toolInfo.Guid, |
808 | name, | 815 | name, |
809 | location, | 816 | location, |
810 | projectGuid.ToString("B").ToUpper()); | 817 | projectGuid.ToString("B").ToUpper()); |
811 | 818 | ||
812 | if (files != null) | 819 | if (files != null) |
813 | { | 820 | { |
814 | writer.WriteLine("\tProjectSection(SolutionItems) = preProject"); | 821 | writer.WriteLine("\tProjectSection(SolutionItems) = preProject"); |
815 | 822 | ||
816 | foreach (string file in files) | 823 | foreach (string file in files) |
817 | writer.WriteLine("\t\t{0} = {0}", file); | 824 | writer.WriteLine("\t\t{0} = {0}", file); |
818 | 825 | ||
819 | writer.WriteLine("\tEndProjectSection"); | 826 | writer.WriteLine("\tEndProjectSection"); |
820 | } | 827 | } |
821 | 828 | ||
822 | writer.WriteLine(ProjectDeclarationEndFormat); | 829 | writer.WriteLine(ProjectDeclarationEndFormat); |
823 | } | 830 | } |
824 | 831 | ||
825 | private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project) | 832 | private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project) |
826 | { | 833 | { |
827 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp"); | 834 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp"); |
828 | IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); | 835 | IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); |
829 | 836 | ||
830 | kernel.CurrentWorkingDirectory.Push(); | 837 | kernel.CurrentWorkingDirectory.Push(); |
831 | 838 | ||
832 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); | 839 | Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); |
833 | 840 | ||
834 | using (ps) | 841 | using (ps) |
835 | { | 842 | { |
836 | ps.WriteLine("# Microsoft Developer Studio Project File - Database Project"); | 843 | ps.WriteLine("# Microsoft Developer Studio Project File - Database Project"); |
837 | ps.WriteLine("Begin DataProject = \"{0}\"", project.Name); | 844 | ps.WriteLine("Begin DataProject = \"{0}\"", project.Name); |
838 | ps.Indent++; | 845 | ps.Indent++; |
839 | ps.WriteLine("MSDTVersion = \"80\""); | 846 | ps.WriteLine("MSDTVersion = \"80\""); |
840 | // TODO: Use the project.Files property | 847 | // TODO: Use the project.Files property |
841 | if (ContainsSqlFiles(Path.GetDirectoryName(projectFile))) | 848 | if (ContainsSqlFiles(Path.GetDirectoryName(projectFile))) |
842 | WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile)); | 849 | WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile)); |
843 | 850 | ||
844 | ps.WriteLine("Begin DBRefFolder = \"Database References\""); | 851 | ps.WriteLine("Begin DBRefFolder = \"Database References\""); |
845 | ps.Indent++; | 852 | ps.Indent++; |
846 | foreach (DatabaseReferenceNode reference in project.References) | 853 | foreach (DatabaseReferenceNode reference in project.References) |
847 | { | 854 | { |
848 | ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name); | 855 | ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name); |
849 | ps.Indent++; | 856 | ps.Indent++; |
850 | ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString); | 857 | ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString); |
851 | ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper()); | 858 | ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper()); |
852 | //ps.WriteLine("Colorizer = 5"); | 859 | //ps.WriteLine("Colorizer = 5"); |
853 | ps.Indent--; | 860 | ps.Indent--; |
854 | ps.WriteLine("End"); | 861 | ps.WriteLine("End"); |
855 | } | 862 | } |
856 | ps.Indent--; | 863 | ps.Indent--; |
857 | ps.WriteLine("End"); | 864 | ps.WriteLine("End"); |
858 | ps.Indent--; | 865 | ps.Indent--; |
859 | ps.WriteLine("End"); | 866 | ps.WriteLine("End"); |
860 | 867 | ||
861 | ps.Flush(); | 868 | ps.Flush(); |
862 | } | 869 | } |
863 | 870 | ||
864 | kernel.CurrentWorkingDirectory.Pop(); | 871 | kernel.CurrentWorkingDirectory.Pop(); |
865 | } | 872 | } |
866 | 873 | ||
867 | private static bool ContainsSqlFiles(string folder) | 874 | private static bool ContainsSqlFiles(string folder) |
868 | { | 875 | { |
869 | if(Directory.GetFiles(folder, "*.sql").Length > 0) | 876 | if(Directory.GetFiles(folder, "*.sql").Length > 0) |
870 | return true; // if the folder contains 1 .sql file, that's good enough | 877 | return true; // if the folder contains 1 .sql file, that's good enough |
871 | 878 | ||
872 | foreach (string child in Directory.GetDirectories(folder)) | 879 | foreach (string child in Directory.GetDirectories(folder)) |
873 | { | 880 | { |
874 | if (ContainsSqlFiles(child)) | 881 | if (ContainsSqlFiles(child)) |
875 | return true; // if 1 child folder contains a .sql file, still good enough | 882 | return true; // if 1 child folder contains a .sql file, still good enough |
876 | } | 883 | } |
877 | 884 | ||
878 | return false; | 885 | return false; |
879 | } | 886 | } |
880 | 887 | ||
881 | private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) | 888 | private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) |
882 | { | 889 | { |
883 | foreach (string child in Directory.GetDirectories(folder)) | 890 | foreach (string child in Directory.GetDirectories(folder)) |
884 | { | 891 | { |
885 | if (ContainsSqlFiles(child)) | 892 | if (ContainsSqlFiles(child)) |
886 | { | 893 | { |
887 | writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child)); | 894 | writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child)); |
888 | writer.Indent++; | 895 | writer.Indent++; |
889 | WriteDatabaseFoldersAndFiles(writer, child); | 896 | WriteDatabaseFoldersAndFiles(writer, child); |
890 | writer.Indent--; | 897 | writer.Indent--; |
891 | writer.WriteLine("End"); | 898 | writer.WriteLine("End"); |
892 | } | 899 | } |
893 | } | 900 | } |
894 | foreach (string file in Directory.GetFiles(folder, "*.sql")) | 901 | foreach (string file in Directory.GetFiles(folder, "*.sql")) |
895 | { | 902 | { |
896 | writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file)); | 903 | writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file)); |
897 | } | 904 | } |
898 | } | 905 | } |
899 | 906 | ||
900 | private void CleanProject(ProjectNode project) | 907 | private void CleanProject(ProjectNode project) |
901 | { | 908 | { |
902 | kernel.Log.Write("...Cleaning project: {0}", project.Name); | 909 | kernel.Log.Write("...Cleaning project: {0}", project.Name); |
903 | 910 | ||
904 | ToolInfo toolInfo = tools[project.Language]; | 911 | ToolInfo toolInfo = tools[project.Language]; |
905 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); | 912 | string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); |
906 | string userFile = projectFile + ".user"; | 913 | string userFile = projectFile + ".user"; |
907 | 914 | ||
908 | Helper.DeleteIfExists(projectFile); | 915 | Helper.DeleteIfExists(projectFile); |
909 | Helper.DeleteIfExists(userFile); | 916 | Helper.DeleteIfExists(userFile); |
910 | } | 917 | } |
911 | 918 | ||
912 | private void CleanSolution(SolutionNode solution) | 919 | private void CleanSolution(SolutionNode solution) |
913 | { | 920 | { |
914 | kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name); | 921 | kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name); |
915 | 922 | ||
916 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); | 923 | string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); |
917 | string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); | 924 | string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); |
918 | 925 | ||
919 | Helper.DeleteIfExists(slnFile); | 926 | Helper.DeleteIfExists(slnFile); |
920 | Helper.DeleteIfExists(suoFile); | 927 | Helper.DeleteIfExists(suoFile); |
921 | 928 | ||
922 | foreach (ProjectNode project in solution.Projects) | 929 | foreach (ProjectNode project in solution.Projects) |
923 | { | 930 | { |
924 | CleanProject(project); | 931 | CleanProject(project); |
925 | } | 932 | } |
926 | 933 | ||
927 | kernel.Log.Write(""); | 934 | kernel.Log.Write(""); |
928 | } | 935 | } |
929 | 936 | ||
930 | #endregion | 937 | #endregion |
931 | 938 | ||
932 | #region ITarget Members | 939 | #region ITarget Members |
933 | 940 | ||
934 | /// <summary> | 941 | /// <summary> |
935 | /// Writes the specified kern. | 942 | /// Writes the specified kern. |
936 | /// </summary> | 943 | /// </summary> |
937 | /// <param name="kern">The kern.</param> | 944 | /// <param name="kern">The kern.</param> |
938 | public virtual void Write(Kernel kern) | 945 | public virtual void Write(Kernel kern) |
939 | { | 946 | { |
940 | if (kern == null) | 947 | if (kern == null) |
941 | { | 948 | { |
942 | throw new ArgumentNullException("kern"); | 949 | throw new ArgumentNullException("kern"); |
943 | } | 950 | } |
944 | kernel = kern; | 951 | kernel = kern; |
945 | foreach (SolutionNode sol in kernel.Solutions) | 952 | foreach (SolutionNode sol in kernel.Solutions) |
946 | { | 953 | { |
947 | WriteSolution(sol, true); | 954 | WriteSolution(sol, true); |
948 | } | 955 | } |
949 | kernel = null; | 956 | kernel = null; |
950 | } | 957 | } |
951 | 958 | ||
952 | /// <summary> | 959 | /// <summary> |
953 | /// Cleans the specified kern. | 960 | /// Cleans the specified kern. |
954 | /// </summary> | 961 | /// </summary> |
955 | /// <param name="kern">The kern.</param> | 962 | /// <param name="kern">The kern.</param> |
956 | public virtual void Clean(Kernel kern) | 963 | public virtual void Clean(Kernel kern) |
957 | { | 964 | { |
958 | if (kern == null) | 965 | if (kern == null) |
959 | { | 966 | { |
960 | throw new ArgumentNullException("kern"); | 967 | throw new ArgumentNullException("kern"); |
961 | } | 968 | } |
962 | kernel = kern; | 969 | kernel = kern; |
963 | foreach (SolutionNode sol in kernel.Solutions) | 970 | foreach (SolutionNode sol in kernel.Solutions) |
964 | { | 971 | { |
965 | CleanSolution(sol); | 972 | CleanSolution(sol); |
966 | } | 973 | } |
967 | kernel = null; | 974 | kernel = null; |
968 | } | 975 | } |
969 | 976 | ||
970 | #endregion | 977 | #endregion |
971 | } | 978 | } |
972 | } | 979 | } |
diff --git a/Prebuild/src/Core/Targets/VSVersion.cs b/Prebuild/src/Core/Targets/VSVersion.cs index a7434c6..b917878 100644 --- a/Prebuild/src/Core/Targets/VSVersion.cs +++ b/Prebuild/src/Core/Targets/VSVersion.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2008-2009 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -25,30 +25,43 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
25 | 25 | ||
26 | namespace Prebuild.Core.Targets | 26 | namespace Prebuild.Core.Targets |
27 | { | 27 | { |
28 | /// <summary> | 28 | /// <summary> |
29 | /// | 29 | /// |
30 | /// </summary> | 30 | /// </summary> |
31 | public enum VSVersion | 31 | public enum VSVersion |
32 | { | 32 | { |
33 | /// <summary> | ||
34 | /// Visual Studio 2002 | ||
35 | /// </summary> | ||
36 | VS70, | ||
37 | /// <summary> | ||
38 | /// Visual Studio 2003 | ||
39 | /// </summary> | ||
40 | VS71, | ||
41 | /// <summary> | ||
42 | /// Visual Studio 2005 | ||
43 | /// </summary> | ||
44 | VS80, | ||
45 | /// <summary> | ||
46 | /// Visual Studio 2008 | ||
47 | /// </summary> | ||
48 | VS90, | ||
49 | /// <summary> | ||
50 | /// Visual Studio 2010 | ||
51 | /// </summary> | ||
52 | VS10, | ||
53 | /// <summary> | ||
54 | /// Visual Studio 2012 | ||
55 | /// </summary> | ||
56 | VS11, | ||
57 | /// <summary> | ||
58 | /// Visual Studio 2013 | ||
59 | /// </summary> | ||
60 | VS12, | ||
33 | /// <summary> | 61 | /// <summary> |
34 | /// Visual Studio 2002 | 62 | /// Visual Studio 2015 |
35 | /// </summary> | 63 | /// </summary> |
36 | VS70, | 64 | VS15 |
37 | /// <summary> | 65 | |
38 | /// Visual Studio 2003 | 66 | } |
39 | /// </summary> | ||
40 | VS71, | ||
41 | /// <summary> | ||
42 | /// Visual Studio 2005 | ||
43 | /// </summary> | ||
44 | VS80, | ||
45 | /// <summary> | ||
46 | /// Visual Studio 2008 | ||
47 | /// </summary> | ||
48 | VS90, | ||
49 | /// <summary> | ||
50 | /// Visual Studio 2010 | ||
51 | /// </summary> | ||
52 | VS10 | ||
53 | } | ||
54 | } | 67 | } |
diff --git a/Prebuild/src/Core/Targets/XcodeTarget.cs b/Prebuild/src/Core/Targets/XcodeTarget.cs index d2c86a0..5393cec 100644 --- a/Prebuild/src/Core/Targets/XcodeTarget.cs +++ b/Prebuild/src/Core/Targets/XcodeTarget.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -36,7 +36,7 @@ using Prebuild.Core.Utilities; | |||
36 | namespace Prebuild.Core.Targets | 36 | namespace Prebuild.Core.Targets |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | [Target("xcode")] | 41 | [Target("xcode")] |
42 | public class XcodeTarget : ITarget | 42 | public class XcodeTarget : ITarget |
@@ -282,7 +282,7 @@ namespace Prebuild.Core.Targets | |||
282 | } | 282 | } |
283 | //if (project.Files.GetSubType(file).ToString() != "Code") | 283 | //if (project.Files.GetSubType(file).ToString() != "Code") |
284 | //{ | 284 | //{ |
285 | // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); | 285 | // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); |
286 | 286 | ||
287 | ss.WriteLine(" </resources>"); | 287 | ss.WriteLine(" </resources>"); |
288 | ss.WriteLine(" <sources failonempty=\"true\">"); | 288 | ss.WriteLine(" <sources failonempty=\"true\">"); |
diff --git a/Prebuild/src/Core/UnknownLanguageException.cs b/Prebuild/src/Core/UnknownLanguageException.cs index 71fc885..607b66c 100644 --- a/Prebuild/src/Core/UnknownLanguageException.cs +++ b/Prebuild/src/Core/UnknownLanguageException.cs | |||
@@ -6,12 +6,12 @@ | |||
6 | * modify it under the terms of the GNU Lesser General Public | 6 | * modify it under the terms of the GNU Lesser General Public |
7 | * License as published by the Free Software Foundation; either | 7 | * License as published by the Free Software Foundation; either |
8 | * version 2.1 of the License, or (at your option) any later version. | 8 | * version 2.1 of the License, or (at your option) any later version. |
9 | * | 9 | * |
10 | * This library is distributed in the hope that it will be useful, | 10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Lesser General Public License for more details. | 13 | * Lesser General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU Lesser General Public | 15 | * You should have received a copy of the GNU Lesser General Public |
16 | * License along with this library; if not, write to the Free Software | 16 | * License along with this library; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -20,44 +20,44 @@ | |||
20 | using System; | 20 | using System; |
21 | using System.Runtime.Serialization; | 21 | using System.Runtime.Serialization; |
22 | 22 | ||
23 | namespace Prebuild.Core | 23 | namespace Prebuild.Core |
24 | { | 24 | { |
25 | /// <summary> | 25 | /// <summary> |
26 | /// </summary> | 26 | /// </summary> |
27 | [Serializable()] | 27 | [Serializable()] |
28 | public class UnknownLanguageException : Exception | 28 | public class UnknownLanguageException : Exception |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// Basic exception. | 31 | /// Basic exception. |
32 | /// </summary> | 32 | /// </summary> |
33 | public UnknownLanguageException() | 33 | public UnknownLanguageException() |
34 | { | 34 | { |
35 | } | 35 | } |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Exception with specified string | 38 | /// Exception with specified string |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <param name="message">Exception message</param> | 40 | /// <param name="message">Exception message</param> |
41 | public UnknownLanguageException(string message): base(message) | 41 | public UnknownLanguageException(string message): base(message) |
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// | 46 | /// |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <param name="message"></param> | 48 | /// <param name="message"></param> |
49 | /// <param name="exception"></param> | 49 | /// <param name="exception"></param> |
50 | public UnknownLanguageException(string message, Exception exception) : base(message, exception) | 50 | public UnknownLanguageException(string message, Exception exception) : base(message, exception) |
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// | 55 | /// |
56 | /// </summary> | 56 | /// </summary> |
57 | /// <param name="info"></param> | 57 | /// <param name="info"></param> |
58 | /// <param name="context"></param> | 58 | /// <param name="context"></param> |
59 | protected UnknownLanguageException(SerializationInfo info, StreamingContext context) : base( info, context ) | 59 | protected UnknownLanguageException(SerializationInfo info, StreamingContext context) : base( info, context ) |
60 | { | 60 | { |
61 | } | 61 | } |
62 | } | 62 | } |
63 | } | 63 | } |
diff --git a/Prebuild/src/Core/Utilities/CommandLineCollection.cs b/Prebuild/src/Core/Utilities/CommandLineCollection.cs index 5e6face..786fa1e 100644 --- a/Prebuild/src/Core/Utilities/CommandLineCollection.cs +++ b/Prebuild/src/Core/Utilities/CommandLineCollection.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -27,126 +27,126 @@ using System.Collections; | |||
27 | using System.Collections.Generic; | 27 | using System.Collections.Generic; |
28 | 28 | ||
29 | namespace Prebuild.Core.Utilities | 29 | namespace Prebuild.Core.Utilities |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// The CommandLine class parses and interprets the command-line arguments passed to | 32 | /// The CommandLine class parses and interprets the command-line arguments passed to |
33 | /// prebuild. | 33 | /// prebuild. |
34 | /// </summary> | 34 | /// </summary> |
35 | public class CommandLineCollection : IEnumerable<KeyValuePair<string, string>> | 35 | public class CommandLineCollection : IEnumerable<KeyValuePair<string, string>> |
36 | { | 36 | { |
37 | #region Fields | 37 | #region Fields |
38 | 38 | ||
39 | // The raw OS arguments | 39 | // The raw OS arguments |
40 | private readonly string[] m_RawArgs; | 40 | private readonly string[] m_RawArgs; |
41 | 41 | ||
42 | // Command-line argument storage | 42 | // Command-line argument storage |
43 | private readonly Dictionary<string, string> m_Arguments = new Dictionary<string, string>(); | 43 | private readonly Dictionary<string, string> m_Arguments = new Dictionary<string, string>(); |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Constructors | 47 | #region Constructors |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Create a new CommandLine instance and set some internal variables. | 50 | /// Create a new CommandLine instance and set some internal variables. |
51 | /// </summary> | 51 | /// </summary> |
52 | public CommandLineCollection(string[] args) | 52 | public CommandLineCollection(string[] args) |
53 | { | 53 | { |
54 | m_RawArgs = args; | 54 | m_RawArgs = args; |
55 | 55 | ||
56 | Parse(); | 56 | Parse(); |
57 | } | 57 | } |
58 | 58 | ||
59 | #endregion | 59 | #endregion |
60 | 60 | ||
61 | #region Private Methods | 61 | #region Private Methods |
62 | 62 | ||
63 | private void Parse() | 63 | private void Parse() |
64 | { | 64 | { |
65 | if(m_RawArgs.Length < 1) | 65 | if(m_RawArgs.Length < 1) |
66 | return; | 66 | return; |
67 | 67 | ||
68 | int idx = 0; | 68 | int idx = 0; |
69 | string lastArg = null; | 69 | string lastArg = null; |
70 | 70 | ||
71 | while(idx <m_RawArgs.Length) | 71 | while(idx <m_RawArgs.Length) |
72 | { | 72 | { |
73 | string arg = m_RawArgs[idx]; | 73 | string arg = m_RawArgs[idx]; |
74 | 74 | ||
75 | if(arg.Length > 2 && arg[0] == '/') | 75 | if(arg.Length > 2 && arg[0] == '/') |
76 | { | 76 | { |
77 | arg = arg.Substring(1); | 77 | arg = arg.Substring(1); |
78 | lastArg = arg; | 78 | lastArg = arg; |
79 | m_Arguments[arg] = ""; | 79 | m_Arguments[arg] = ""; |
80 | } | 80 | } |
81 | else | 81 | else |
82 | { | 82 | { |
83 | if(lastArg != null) | 83 | if(lastArg != null) |
84 | { | 84 | { |
85 | m_Arguments[lastArg] = arg; | 85 | m_Arguments[lastArg] = arg; |
86 | lastArg = null; | 86 | lastArg = null; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | idx++; | 90 | idx++; |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
94 | #endregion | 94 | #endregion |
95 | 95 | ||
96 | #region Public Methods | 96 | #region Public Methods |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Wases the passed. | 99 | /// Wases the passed. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="arg">The arg.</param> | 101 | /// <param name="arg">The arg.</param> |
102 | /// <returns></returns> | 102 | /// <returns></returns> |
103 | public bool WasPassed(string arg) | 103 | public bool WasPassed(string arg) |
104 | { | 104 | { |
105 | return (m_Arguments.ContainsKey(arg)); | 105 | return (m_Arguments.ContainsKey(arg)); |
106 | } | 106 | } |
107 | 107 | ||
108 | #endregion | 108 | #endregion |
109 | 109 | ||
110 | #region Properties | 110 | #region Properties |
111 | 111 | ||
112 | /// <summary> | 112 | /// <summary> |
113 | /// Gets the parameter associated with the command line option | 113 | /// Gets the parameter associated with the command line option |
114 | /// </summary> | 114 | /// </summary> |
115 | /// <remarks>Returns null if option was not specified, | 115 | /// <remarks>Returns null if option was not specified, |
116 | /// null string if no parameter was specified, and the value if a parameter was specified</remarks> | 116 | /// null string if no parameter was specified, and the value if a parameter was specified</remarks> |
117 | public string this[string index] | 117 | public string this[string index] |
118 | { | 118 | { |
119 | get | 119 | get |
120 | { | 120 | { |
121 | if(m_Arguments.ContainsKey(index)) | 121 | if(m_Arguments.ContainsKey(index)) |
122 | { | 122 | { |
123 | return (m_Arguments[index]); | 123 | return (m_Arguments[index]); |
124 | } | 124 | } |
125 | return null; | 125 | return null; |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | #endregion | 129 | #endregion |
130 | 130 | ||
131 | #region IEnumerable Members | 131 | #region IEnumerable Members |
132 | 132 | ||
133 | /// <summary> | 133 | /// <summary> |
134 | /// Returns an enumerator that can iterate through a collection. | 134 | /// Returns an enumerator that can iterate through a collection. |
135 | /// </summary> | 135 | /// </summary> |
136 | /// <returns> | 136 | /// <returns> |
137 | /// An <see cref="T:System.Collections.IDictionaryEnumerator"/> | 137 | /// An <see cref="T:System.Collections.IDictionaryEnumerator"/> |
138 | /// that can be used to iterate through the collection. | 138 | /// that can be used to iterate through the collection. |
139 | /// </returns> | 139 | /// </returns> |
140 | public IEnumerator<KeyValuePair<string, string>> GetEnumerator() | 140 | public IEnumerator<KeyValuePair<string, string>> GetEnumerator() |
141 | { | 141 | { |
142 | return m_Arguments.GetEnumerator(); | 142 | return m_Arguments.GetEnumerator(); |
143 | } | 143 | } |
144 | 144 | ||
145 | IEnumerator IEnumerable.GetEnumerator() | 145 | IEnumerator IEnumerable.GetEnumerator() |
146 | { | 146 | { |
147 | return GetEnumerator(); | 147 | return GetEnumerator(); |
148 | } | 148 | } |
149 | 149 | ||
150 | #endregion | 150 | #endregion |
151 | } | 151 | } |
152 | } | 152 | } |
diff --git a/Prebuild/src/Core/Utilities/CurrentDirectory.cs b/Prebuild/src/Core/Utilities/CurrentDirectory.cs index d743d83..9624c35 100644 --- a/Prebuild/src/Core/Utilities/CurrentDirectory.cs +++ b/Prebuild/src/Core/Utilities/CurrentDirectory.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -28,41 +28,41 @@ using System.Collections.Generic; | |||
28 | 28 | ||
29 | namespace Prebuild.Core.Utilities | 29 | namespace Prebuild.Core.Utilities |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | public class CurrentDirectory | 34 | public class CurrentDirectory |
35 | { | 35 | { |
36 | #region Fields | 36 | #region Fields |
37 | 37 | ||
38 | private readonly Stack<string> m_Stack = new Stack<string>(); | 38 | private readonly Stack<string> m_Stack = new Stack<string>(); |
39 | 39 | ||
40 | #endregion | 40 | #endregion |
41 | 41 | ||
42 | #region Public Methods | 42 | #region Public Methods |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Pushes this instance. | 45 | /// Pushes this instance. |
46 | /// </summary> | 46 | /// </summary> |
47 | public void Push() | 47 | public void Push() |
48 | { | 48 | { |
49 | m_Stack.Push(Environment.CurrentDirectory); | 49 | m_Stack.Push(Environment.CurrentDirectory); |
50 | } | 50 | } |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Pops this instance. | 53 | /// Pops this instance. |
54 | /// </summary> | 54 | /// </summary> |
55 | public void Pop() | 55 | public void Pop() |
56 | { | 56 | { |
57 | if(m_Stack.Count < 1) | 57 | if(m_Stack.Count < 1) |
58 | { | 58 | { |
59 | return; | 59 | return; |
60 | } | 60 | } |
61 | |||
62 | string cwd = m_Stack.Pop(); | ||
63 | Helper.SetCurrentDir(cwd); | ||
64 | } | ||
61 | 65 | ||
62 | string cwd = m_Stack.Pop(); | 66 | #endregion |
63 | Helper.SetCurrentDir(cwd); | 67 | } |
64 | } | ||
65 | |||
66 | #endregion | ||
67 | } | ||
68 | } | 68 | } |
diff --git a/Prebuild/src/Core/Utilities/Helper.cs b/Prebuild/src/Core/Utilities/Helper.cs index a440e58..8533340 100644 --- a/Prebuild/src/Core/Utilities/Helper.cs +++ b/Prebuild/src/Core/Utilities/Helper.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -35,541 +35,541 @@ using Prebuild.Core.Nodes; | |||
35 | 35 | ||
36 | namespace Prebuild.Core.Utilities | 36 | namespace Prebuild.Core.Utilities |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | public class Helper | 41 | public class Helper |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | static bool checkForOSVariables; | 45 | static bool checkForOSVariables; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// | 48 | /// |
49 | /// </summary> | 49 | /// </summary> |
50 | public static bool CheckForOSVariables | 50 | public static bool CheckForOSVariables |
51 | { | 51 | { |
52 | get | 52 | get |
53 | { | 53 | { |
54 | return checkForOSVariables; | 54 | return checkForOSVariables; |
55 | } | 55 | } |
56 | set | 56 | set |
57 | { | 57 | { |
58 | checkForOSVariables = value; | 58 | checkForOSVariables = value; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | #endregion | 62 | #endregion |
63 | 63 | ||
64 | #region Public Methods | 64 | #region Public Methods |
65 | 65 | ||
66 | #region String Parsing | 66 | #region String Parsing |
67 | 67 | ||
68 | public delegate string StringLookup(string key); | 68 | public delegate string StringLookup(string key); |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Gets a collection of StringLocationPair objects that represent the matches | 71 | /// Gets a collection of StringLocationPair objects that represent the matches |
72 | /// </summary> | 72 | /// </summary> |
73 | /// <param name="target">The target.</param> | 73 | /// <param name="target">The target.</param> |
74 | /// <param name="beforeGroup">The before group.</param> | 74 | /// <param name="beforeGroup">The before group.</param> |
75 | /// <param name="afterGroup">The after group.</param> | 75 | /// <param name="afterGroup">The after group.</param> |
76 | /// <param name="includeDelimitersInSubstrings">if set to <c>true</c> [include delimiters in substrings].</param> | 76 | /// <param name="includeDelimitersInSubstrings">if set to <c>true</c> [include delimiters in substrings].</param> |
77 | /// <returns></returns> | 77 | /// <returns></returns> |
78 | public static StringCollection FindGroups(string target, string beforeGroup, string afterGroup, bool includeDelimitersInSubstrings) | 78 | public static StringCollection FindGroups(string target, string beforeGroup, string afterGroup, bool includeDelimitersInSubstrings) |
79 | { | 79 | { |
80 | if( beforeGroup == null ) | 80 | if( beforeGroup == null ) |
81 | { | 81 | { |
82 | throw new ArgumentNullException("beforeGroup"); | 82 | throw new ArgumentNullException("beforeGroup"); |
83 | } | 83 | } |
84 | if( afterGroup == null ) | 84 | if( afterGroup == null ) |
85 | { | 85 | { |
86 | throw new ArgumentNullException("afterGroup"); | 86 | throw new ArgumentNullException("afterGroup"); |
87 | } | 87 | } |
88 | StringCollection results = new StringCollection(); | 88 | StringCollection results = new StringCollection(); |
89 | if(target == null || target.Length == 0) | 89 | if(target == null || target.Length == 0) |
90 | { | 90 | { |
91 | return results; | 91 | return results; |
92 | } | 92 | } |
93 | 93 | ||
94 | int beforeMod = 0; | 94 | int beforeMod = 0; |
95 | int afterMod = 0; | 95 | int afterMod = 0; |
96 | if(includeDelimitersInSubstrings) | 96 | if(includeDelimitersInSubstrings) |
97 | { | 97 | { |
98 | //be sure to not exlude the delims | 98 | //be sure to not exlude the delims |
99 | beforeMod = beforeGroup.Length; | 99 | beforeMod = beforeGroup.Length; |
100 | afterMod = afterGroup.Length; | 100 | afterMod = afterGroup.Length; |
101 | } | 101 | } |
102 | int startIndex = 0; | 102 | int startIndex = 0; |
103 | while((startIndex = target.IndexOf(beforeGroup,startIndex)) != -1) { | 103 | while((startIndex = target.IndexOf(beforeGroup,startIndex)) != -1) { |
104 | int endIndex = target.IndexOf(afterGroup,startIndex);//the index of the char after it | 104 | int endIndex = target.IndexOf(afterGroup,startIndex);//the index of the char after it |
105 | if(endIndex == -1) | 105 | if(endIndex == -1) |
106 | { | 106 | { |
107 | break; | 107 | break; |
108 | } | 108 | } |
109 | int length = endIndex - startIndex - beforeGroup.Length;//move to the first char in the string | 109 | int length = endIndex - startIndex - beforeGroup.Length;//move to the first char in the string |
110 | string substring = substring = target.Substring(startIndex + beforeGroup.Length - beforeMod, | 110 | string substring = target.Substring(startIndex + beforeGroup.Length - beforeMod, |
111 | length - afterMod); | 111 | length - afterMod); |
112 | 112 | ||
113 | results.Add(substring); | 113 | results.Add(substring); |
114 | //results.Add(new StringLocationPair(substring,startIndex)); | 114 | //results.Add(new StringLocationPair(substring,startIndex)); |
115 | startIndex = endIndex + 1; | 115 | startIndex = endIndex + 1; |
116 | //the Interpolate*() methods will not work if expressions are expandded inside expression due to an optimization | 116 | //the Interpolate*() methods will not work if expressions are expandded inside expression due to an optimization |
117 | //so start after endIndex | 117 | //so start after endIndex |
118 | 118 | ||
119 | } | 119 | } |
120 | return results; | 120 | return results; |
121 | } | 121 | } |
122 | 122 | ||
123 | /// <summary> | 123 | /// <summary> |
124 | /// Replaces the groups. | 124 | /// Replaces the groups. |
125 | /// </summary> | 125 | /// </summary> |
126 | /// <param name="target">The target.</param> | 126 | /// <param name="target">The target.</param> |
127 | /// <param name="beforeGroup">The before group.</param> | 127 | /// <param name="beforeGroup">The before group.</param> |
128 | /// <param name="afterGroup">The after group.</param> | 128 | /// <param name="afterGroup">The after group.</param> |
129 | /// <param name="lookup">The lookup.</param> | 129 | /// <param name="lookup">The lookup.</param> |
130 | /// <returns></returns> | 130 | /// <returns></returns> |
131 | public static string ReplaceGroups(string target, string beforeGroup, string afterGroup, StringLookup lookup) { | 131 | public static string ReplaceGroups(string target, string beforeGroup, string afterGroup, StringLookup lookup) { |
132 | if( target == null ) | 132 | if( target == null ) |
133 | { | 133 | { |
134 | throw new ArgumentNullException("target"); | 134 | throw new ArgumentNullException("target"); |
135 | } | 135 | } |
136 | //int targetLength = target.Length; | 136 | //int targetLength = target.Length; |
137 | StringCollection strings = FindGroups(target,beforeGroup,afterGroup,false); | 137 | StringCollection strings = FindGroups(target,beforeGroup,afterGroup,false); |
138 | if( lookup == null ) | 138 | if( lookup == null ) |
139 | { | 139 | { |
140 | throw new ArgumentNullException("lookup"); | 140 | throw new ArgumentNullException("lookup"); |
141 | } | 141 | } |
142 | foreach(string substring in strings) | 142 | foreach(string substring in strings) |
143 | { | 143 | { |
144 | target = target.Replace(beforeGroup + substring + afterGroup, lookup(substring) ); | 144 | target = target.Replace(beforeGroup + substring + afterGroup, lookup(substring) ); |
145 | } | 145 | } |
146 | return target; | 146 | return target; |
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// Replaces ${var} statements in a string with the corresonding values as detirmined by the lookup delegate | 150 | /// Replaces ${var} statements in a string with the corresonding values as detirmined by the lookup delegate |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <param name="target">The target.</param> | 152 | /// <param name="target">The target.</param> |
153 | /// <param name="lookup">The lookup.</param> | 153 | /// <param name="lookup">The lookup.</param> |
154 | /// <returns></returns> | 154 | /// <returns></returns> |
155 | public static string InterpolateForVariables(string target, StringLookup lookup) | 155 | public static string InterpolateForVariables(string target, StringLookup lookup) |
156 | { | 156 | { |
157 | return ReplaceGroups(target, "${" , "}" , lookup); | 157 | return ReplaceGroups(target, "${" , "}" , lookup); |
158 | } | 158 | } |
159 | 159 | ||
160 | /// <summary> | 160 | /// <summary> |
161 | /// Replaces ${var} statements in a string with the corresonding environment variable with name var | 161 | /// Replaces ${var} statements in a string with the corresonding environment variable with name var |
162 | /// </summary> | 162 | /// </summary> |
163 | /// <param name="target"></param> | 163 | /// <param name="target"></param> |
164 | /// <returns></returns> | 164 | /// <returns></returns> |
165 | public static string InterpolateForEnvironmentVariables(string target) | 165 | public static string InterpolateForEnvironmentVariables(string target) |
166 | { | 166 | { |
167 | return InterpolateForVariables(target, new StringLookup(Environment.GetEnvironmentVariable)); | 167 | return InterpolateForVariables(target, new StringLookup(Environment.GetEnvironmentVariable)); |
168 | } | 168 | } |
169 | 169 | ||
170 | #endregion | 170 | #endregion |
171 | 171 | ||
172 | /// <summary> | 172 | /// <summary> |
173 | /// Translates the value. | 173 | /// Translates the value. |
174 | /// </summary> | 174 | /// </summary> |
175 | /// <param name="translateType">Type of the translate.</param> | 175 | /// <param name="translateType">Type of the translate.</param> |
176 | /// <param name="translationItem">The translation item.</param> | 176 | /// <param name="translationItem">The translation item.</param> |
177 | /// <returns></returns> | 177 | /// <returns></returns> |
178 | public static object TranslateValue(Type translateType, string translationItem) | 178 | public static object TranslateValue(Type translateType, string translationItem) |
179 | { | 179 | { |
180 | if(translationItem == null) | 180 | if(translationItem == null) |
181 | { | 181 | { |
182 | return null; | 182 | return null; |
183 | } | 183 | } |
184 | 184 | ||
185 | try | 185 | try |
186 | { | 186 | { |
187 | string lowerVal = translationItem.ToLower(); | 187 | string lowerVal = translationItem.ToLower(); |
188 | if(translateType == typeof(bool)) | 188 | if(translateType == typeof(bool)) |
189 | { | 189 | { |
190 | return (lowerVal == "true" || lowerVal == "1" || lowerVal == "y" || lowerVal == "yes" || lowerVal == "on"); | 190 | return (lowerVal == "true" || lowerVal == "1" || lowerVal == "y" || lowerVal == "yes" || lowerVal == "on"); |
191 | } | 191 | } |
192 | else if(translateType == typeof(int)) | 192 | else if(translateType == typeof(int)) |
193 | { | 193 | { |
194 | return (Int32.Parse(translationItem)); | 194 | return (Int32.Parse(translationItem)); |
195 | } | 195 | } |
196 | else | 196 | else |
197 | { | 197 | { |
198 | return translationItem; | 198 | return translationItem; |
199 | } | 199 | } |
200 | } | 200 | } |
201 | catch(FormatException) | 201 | catch(FormatException) |
202 | { | 202 | { |
203 | return null; | 203 | return null; |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | /// <summary> | 207 | /// <summary> |
208 | /// Deletes if exists. | 208 | /// Deletes if exists. |
209 | /// </summary> | 209 | /// </summary> |
210 | /// <param name="file">The file.</param> | 210 | /// <param name="file">The file.</param> |
211 | /// <returns></returns> | 211 | /// <returns></returns> |
212 | public static bool DeleteIfExists(string file) | 212 | public static bool DeleteIfExists(string file) |
213 | { | 213 | { |
214 | string resFile = null; | 214 | string resFile = null; |
215 | try | 215 | try |
216 | { | 216 | { |
217 | resFile = ResolvePath(file); | 217 | resFile = ResolvePath(file); |
218 | } | 218 | } |
219 | catch(ArgumentException) | 219 | catch(ArgumentException) |
220 | { | 220 | { |
221 | return false; | 221 | return false; |
222 | } | 222 | } |
223 | 223 | ||
224 | if(!File.Exists(resFile)) | 224 | if(!File.Exists(resFile)) |
225 | { | 225 | { |
226 | return false; | 226 | return false; |
227 | } | 227 | } |
228 | 228 | ||
229 | File.Delete(resFile); | 229 | File.Delete(resFile); |
230 | return true; | 230 | return true; |
231 | } | 231 | } |
232 | 232 | ||
233 | static readonly char seperator = Path.DirectorySeparatorChar; | 233 | static readonly char seperator = Path.DirectorySeparatorChar; |
234 | 234 | ||
235 | // This little gem was taken from the NeL source, thanks guys! | 235 | // This little gem was taken from the NeL source, thanks guys! |
236 | /// <summary> | 236 | /// <summary> |
237 | /// Makes a relative path | 237 | /// Makes a relative path |
238 | /// </summary> | 238 | /// </summary> |
239 | /// <param name="startPath">Path to start from</param> | 239 | /// <param name="startPath">Path to start from</param> |
240 | /// <param name="endPath">Path to end at</param> | 240 | /// <param name="endPath">Path to end at</param> |
241 | /// <returns>Path that will get from startPath to endPath</returns> | 241 | /// <returns>Path that will get from startPath to endPath</returns> |
242 | public static string MakePathRelativeTo(string startPath, string endPath) | 242 | public static string MakePathRelativeTo(string startPath, string endPath) |
243 | { | 243 | { |
244 | string tmp = NormalizePath(startPath, seperator); | 244 | string tmp = NormalizePath(startPath, seperator); |
245 | string src = NormalizePath(endPath, seperator); | 245 | string src = NormalizePath(endPath, seperator); |
246 | string prefix = ""; | 246 | string prefix = ""; |
247 | 247 | ||
248 | while(true) | 248 | while(true) |
249 | { | 249 | { |
250 | if((String.Compare(tmp, 0, src, 0, tmp.Length) == 0)) | 250 | if((String.Compare(tmp, 0, src, 0, tmp.Length) == 0)) |
251 | { | 251 | { |
252 | string ret; | 252 | string ret; |
253 | int size = tmp.Length; | 253 | int size = tmp.Length; |
254 | if(size == src.Length) | 254 | if(size == src.Length) |
255 | { | 255 | { |
256 | return "./"; | 256 | return "./"; |
257 | } | 257 | } |
258 | if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator) | 258 | if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator) |
259 | { | 259 | { |
260 | } | 260 | } |
261 | else | 261 | else |
262 | { | 262 | { |
263 | ret = prefix + endPath.Substring(size, endPath.Length - size); | 263 | ret = prefix + endPath.Substring(size, endPath.Length - size); |
264 | ret = ret.Trim(); | 264 | ret = ret.Trim(); |
265 | if(ret[0] == seperator) | 265 | if(ret[0] == seperator) |
266 | { | 266 | { |
267 | ret = "." + ret; | 267 | ret = "." + ret; |
268 | } | 268 | } |
269 | 269 | ||
270 | return NormalizePath(ret); | 270 | return NormalizePath(ret); |
271 | } | 271 | } |
272 | |||
273 | } | ||
272 | 274 | ||
273 | } | 275 | if(tmp.Length < 2) |
274 | 276 | { | |
275 | if(tmp.Length < 2) | 277 | break; |
276 | { | 278 | } |
277 | break; | ||
278 | } | ||
279 | 279 | ||
280 | int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2); | 280 | int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2); |
281 | int prevPos = tmp.IndexOf(seperator); | 281 | int prevPos = tmp.IndexOf(seperator); |
282 | 282 | ||
283 | if((lastPos == prevPos) || (lastPos == -1)) | 283 | if((lastPos == prevPos) || (lastPos == -1)) |
284 | { | 284 | { |
285 | break; | 285 | break; |
286 | } | 286 | } |
287 | 287 | ||
288 | tmp = tmp.Substring(0, lastPos + 1); | 288 | tmp = tmp.Substring(0, lastPos + 1); |
289 | prefix += ".." + seperator.ToString(); | 289 | prefix += ".." + seperator.ToString(); |
290 | } | 290 | } |
291 | 291 | ||
292 | return endPath; | 292 | return endPath; |
293 | } | 293 | } |
294 | 294 | ||
295 | /// <summary> | 295 | /// <summary> |
296 | /// Resolves the path. | 296 | /// Resolves the path. |
297 | /// </summary> | 297 | /// </summary> |
298 | /// <param name="path">The path.</param> | 298 | /// <param name="path">The path.</param> |
299 | /// <returns></returns> | 299 | /// <returns></returns> |
300 | public static string ResolvePath(string path) | 300 | public static string ResolvePath(string path) |
301 | { | 301 | { |
302 | string tmpPath = NormalizePath(path); | 302 | string tmpPath = NormalizePath(path); |
303 | if(tmpPath.Length < 1) | 303 | if(tmpPath.Length < 1) |
304 | { | 304 | { |
305 | tmpPath = "."; | 305 | tmpPath = "."; |
306 | } | 306 | } |
307 | 307 | ||
308 | tmpPath = Path.GetFullPath(tmpPath); | 308 | tmpPath = Path.GetFullPath(tmpPath); |
309 | if(!File.Exists(tmpPath) && !Directory.Exists(tmpPath)) | 309 | if(!File.Exists(tmpPath) && !Directory.Exists(tmpPath)) |
310 | { | 310 | { |
311 | throw new ArgumentException("Path could not be resolved: " + tmpPath); | 311 | throw new ArgumentException("Path could not be resolved: " + tmpPath); |
312 | } | 312 | } |
313 | 313 | ||
314 | return tmpPath; | 314 | return tmpPath; |
315 | } | 315 | } |
316 | 316 | ||
317 | /// <summary> | 317 | /// <summary> |
318 | /// Normalizes the path. | 318 | /// Normalizes the path. |
319 | /// </summary> | 319 | /// </summary> |
320 | /// <param name="path">The path.</param> | 320 | /// <param name="path">The path.</param> |
321 | /// <param name="separatorCharacter">The separator character.</param> | 321 | /// <param name="separatorCharacter">The separator character.</param> |
322 | /// <returns></returns> | 322 | /// <returns></returns> |
323 | public static string NormalizePath(string path, char separatorCharacter) | 323 | public static string NormalizePath(string path, char separatorCharacter) |
324 | { | 324 | { |
325 | if(path == null || path == "" || path.Length < 1) | 325 | if(path == null || path == "" || path.Length < 1) |
326 | { | 326 | { |
327 | return ""; | 327 | return ""; |
328 | } | 328 | } |
329 | 329 | ||
330 | string tmpPath = path.Replace('\\', '/'); | 330 | string tmpPath = path.Replace('\\', '/'); |
331 | tmpPath = tmpPath.Replace('/', separatorCharacter); | 331 | tmpPath = tmpPath.Replace('/', separatorCharacter); |
332 | return tmpPath; | 332 | return tmpPath; |
333 | } | 333 | } |
334 | 334 | ||
335 | /// <summary> | 335 | /// <summary> |
336 | /// Normalizes the path. | 336 | /// Normalizes the path. |
337 | /// </summary> | 337 | /// </summary> |
338 | /// <param name="path">The path.</param> | 338 | /// <param name="path">The path.</param> |
339 | /// <returns></returns> | 339 | /// <returns></returns> |
340 | public static string NormalizePath(string path) | 340 | public static string NormalizePath(string path) |
341 | { | 341 | { |
342 | return NormalizePath(path, Path.DirectorySeparatorChar); | 342 | return NormalizePath(path, Path.DirectorySeparatorChar); |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Ends the path. | 346 | /// Ends the path. |
347 | /// </summary> | 347 | /// </summary> |
348 | /// <param name="path">The path.</param> | 348 | /// <param name="path">The path.</param> |
349 | /// <param name="separatorCharacter">The separator character.</param> | 349 | /// <param name="separatorCharacter">The separator character.</param> |
350 | /// <returns></returns> | 350 | /// <returns></returns> |
351 | public static string EndPath(string path, char separatorCharacter) | 351 | public static string EndPath(string path, char separatorCharacter) |
352 | { | 352 | { |
353 | if(path == null || path == "" || path.Length < 1) | 353 | if(path == null || path == "" || path.Length < 1) |
354 | { | 354 | { |
355 | return ""; | 355 | return ""; |
356 | } | 356 | } |
357 | 357 | ||
358 | if(!path.EndsWith(separatorCharacter.ToString())) | 358 | if(!path.EndsWith(separatorCharacter.ToString())) |
359 | { | 359 | { |
360 | return (path + separatorCharacter); | 360 | return (path + separatorCharacter); |
361 | } | 361 | } |
362 | 362 | ||
363 | return path; | 363 | return path; |
364 | } | 364 | } |
365 | 365 | ||
366 | /// <summary> | 366 | /// <summary> |
367 | /// Ends the path. | 367 | /// Ends the path. |
368 | /// </summary> | 368 | /// </summary> |
369 | /// <param name="path">The path.</param> | 369 | /// <param name="path">The path.</param> |
370 | /// <returns></returns> | 370 | /// <returns></returns> |
371 | public static string EndPath(string path) | 371 | public static string EndPath(string path) |
372 | { | 372 | { |
373 | return EndPath(path, Path.DirectorySeparatorChar); | 373 | return EndPath(path, Path.DirectorySeparatorChar); |
374 | } | 374 | } |
375 | 375 | ||
376 | /// <summary> | 376 | /// <summary> |
377 | /// Makes the file path. | 377 | /// Makes the file path. |
378 | /// </summary> | 378 | /// </summary> |
379 | /// <param name="path">The path.</param> | 379 | /// <param name="path">The path.</param> |
380 | /// <param name="name">The name.</param> | 380 | /// <param name="name">The name.</param> |
381 | /// <param name="ext">The ext.</param> | 381 | /// <param name="ext">The ext.</param> |
382 | /// <returns></returns> | 382 | /// <returns></returns> |
383 | public static string MakeFilePath(string path, string name, string ext) | 383 | public static string MakeFilePath(string path, string name, string ext) |
384 | { | 384 | { |
385 | string ret = EndPath(NormalizePath(path)); | 385 | string ret = EndPath(NormalizePath(path)); |
386 | 386 | ||
387 | if( name == null ) | 387 | if( name == null ) |
388 | { | 388 | { |
389 | throw new ArgumentNullException("name"); | 389 | throw new ArgumentNullException("name"); |
390 | } | 390 | } |
391 | 391 | ||
392 | ret += name; | 392 | ret += name; |
393 | if(!name.EndsWith("." + ext)) | 393 | if(!name.EndsWith("." + ext)) |
394 | { | 394 | { |
395 | ret += "." + ext; | 395 | ret += "." + ext; |
396 | } | 396 | } |
397 | 397 | ||
398 | //foreach(char c in Path.GetInvalidPathChars()) | 398 | //foreach(char c in Path.GetInvalidPathChars()) |
399 | //{ | 399 | //{ |
400 | // ret = ret.Replace(c, '_'); | 400 | // ret = ret.Replace(c, '_'); |
401 | //} | 401 | //} |
402 | 402 | ||
403 | return ret; | 403 | return ret; |
404 | } | 404 | } |
405 | 405 | ||
406 | /// <summary> | 406 | /// <summary> |
407 | /// Makes the file path. | 407 | /// Makes the file path. |
408 | /// </summary> | 408 | /// </summary> |
409 | /// <param name="path">The path.</param> | 409 | /// <param name="path">The path.</param> |
410 | /// <param name="name">The name.</param> | 410 | /// <param name="name">The name.</param> |
411 | /// <returns></returns> | 411 | /// <returns></returns> |
412 | public static string MakeFilePath(string path, string name) | 412 | public static string MakeFilePath(string path, string name) |
413 | { | 413 | { |
414 | string ret = EndPath(NormalizePath(path)); | 414 | string ret = EndPath(NormalizePath(path)); |
415 | 415 | ||
416 | if( name == null ) | 416 | if( name == null ) |
417 | { | 417 | { |
418 | throw new ArgumentNullException("name"); | 418 | throw new ArgumentNullException("name"); |
419 | } | 419 | } |
420 | 420 | ||
421 | ret += name; | 421 | ret += name; |
422 | 422 | ||
423 | //foreach (char c in Path.GetInvalidPathChars()) | 423 | //foreach (char c in Path.GetInvalidPathChars()) |
424 | //{ | 424 | //{ |
425 | // ret = ret.Replace(c, '_'); | 425 | // ret = ret.Replace(c, '_'); |
426 | //} | 426 | //} |
427 | 427 | ||
428 | return ret; | 428 | return ret; |
429 | } | 429 | } |
430 | 430 | ||
431 | /// <summary> | 431 | /// <summary> |
432 | /// | 432 | /// |
433 | /// </summary> | 433 | /// </summary> |
434 | /// <param name="path"></param> | 434 | /// <param name="path"></param> |
435 | /// <returns></returns> | 435 | /// <returns></returns> |
436 | public static string MakeReferencePath(string path) | 436 | public static string MakeReferencePath(string path) |
437 | { | 437 | { |
438 | string ret = EndPath(NormalizePath(path)); | 438 | string ret = EndPath(NormalizePath(path)); |
439 | 439 | ||
440 | //foreach (char c in Path.GetInvalidPathChars()) | 440 | //foreach (char c in Path.GetInvalidPathChars()) |
441 | //{ | 441 | //{ |
442 | // ret = ret.Replace(c, '_'); | 442 | // ret = ret.Replace(c, '_'); |
443 | //} | 443 | //} |
444 | 444 | ||
445 | return ret; | 445 | return ret; |
446 | } | 446 | } |
447 | 447 | ||
448 | /// <summary> | 448 | /// <summary> |
449 | /// Sets the current dir. | 449 | /// Sets the current dir. |
450 | /// </summary> | 450 | /// </summary> |
451 | /// <param name="path">The path.</param> | 451 | /// <param name="path">The path.</param> |
452 | public static void SetCurrentDir(string path) | 452 | public static void SetCurrentDir(string path) |
453 | { | 453 | { |
454 | if( path == null ) | 454 | if( path == null ) |
455 | { | 455 | { |
456 | throw new ArgumentNullException("path"); | 456 | throw new ArgumentNullException("path"); |
457 | } | 457 | } |
458 | if(path.Length < 1) | 458 | if(path.Length < 1) |
459 | { | 459 | { |
460 | return; | 460 | return; |
461 | } | 461 | } |
462 | 462 | ||
463 | Environment.CurrentDirectory = path; | 463 | Environment.CurrentDirectory = path; |
464 | } | 464 | } |
465 | 465 | ||
466 | /// <summary> | 466 | /// <summary> |
467 | /// Checks the type. | 467 | /// Checks the type. |
468 | /// </summary> | 468 | /// </summary> |
469 | /// <param name="typeToCheck">The type to check.</param> | 469 | /// <param name="typeToCheck">The type to check.</param> |
470 | /// <param name="attr">The attr.</param> | 470 | /// <param name="attr">The attr.</param> |
471 | /// <param name="inter">The inter.</param> | 471 | /// <param name="inter">The inter.</param> |
472 | /// <returns></returns> | 472 | /// <returns></returns> |
473 | public static object CheckType(Type typeToCheck, Type attr, Type inter) | 473 | public static object CheckType(Type typeToCheck, Type attr, Type inter) |
474 | { | 474 | { |
475 | if(typeToCheck == null || attr == null) | 475 | if(typeToCheck == null || attr == null) |
476 | { | 476 | { |
477 | return null; | 477 | return null; |
478 | } | 478 | } |
479 | 479 | ||
480 | object[] attrs = typeToCheck.GetCustomAttributes(attr, false); | 480 | object[] attrs = typeToCheck.GetCustomAttributes(attr, false); |
481 | if(attrs == null || attrs.Length < 1) | 481 | if(attrs == null || attrs.Length < 1) |
482 | { | 482 | { |
483 | return null; | 483 | return null; |
484 | } | 484 | } |
485 | if( inter == null ) | 485 | if( inter == null ) |
486 | { | 486 | { |
487 | throw new ArgumentNullException("inter"); | 487 | throw new ArgumentNullException("inter"); |
488 | } | 488 | } |
489 | 489 | ||
490 | if(typeToCheck.GetInterface(inter.FullName) == null) | 490 | if(typeToCheck.GetInterface(inter.FullName) == null) |
491 | { | 491 | { |
492 | return null; | 492 | return null; |
493 | } | 493 | } |
494 | 494 | ||
495 | return attrs[0]; | 495 | return attrs[0]; |
496 | } | 496 | } |
497 | 497 | ||
498 | /// <summary> | 498 | /// <summary> |
499 | /// Attributes the value. | 499 | /// Attributes the value. |
500 | /// </summary> | 500 | /// </summary> |
501 | /// <param name="node">The node.</param> | 501 | /// <param name="node">The node.</param> |
502 | /// <param name="attr">The attr.</param> | 502 | /// <param name="attr">The attr.</param> |
503 | /// <param name="def">The def.</param> | 503 | /// <param name="def">The def.</param> |
504 | /// <returns></returns> | 504 | /// <returns></returns> |
505 | public static string AttributeValue(XmlNode node, string attr, string def) | 505 | public static string AttributeValue(XmlNode node, string attr, string def) |
506 | { | 506 | { |
507 | if( node == null ) | 507 | if( node == null ) |
508 | { | 508 | { |
509 | throw new ArgumentNullException("node"); | 509 | throw new ArgumentNullException("node"); |
510 | } | 510 | } |
511 | if(node.Attributes[attr] == null) | 511 | if(node.Attributes[attr] == null) |
512 | { | 512 | { |
513 | return def; | 513 | return def; |
514 | } | 514 | } |
515 | string val = node.Attributes[attr].Value; | 515 | string val = node.Attributes[attr].Value; |
516 | if(!CheckForOSVariables) | 516 | if(!CheckForOSVariables) |
517 | { | 517 | { |
518 | return val; | 518 | return val; |
519 | } | 519 | } |
520 | 520 | ||
521 | return InterpolateForEnvironmentVariables(val); | 521 | return InterpolateForEnvironmentVariables(val); |
522 | } | 522 | } |
523 | 523 | ||
524 | /// <summary> | 524 | /// <summary> |
525 | /// Parses the boolean. | 525 | /// Parses the boolean. |
526 | /// </summary> | 526 | /// </summary> |
527 | /// <param name="node">The node.</param> | 527 | /// <param name="node">The node.</param> |
528 | /// <param name="attr">The attr.</param> | 528 | /// <param name="attr">The attr.</param> |
529 | /// <param name="defaultValue">if set to <c>true</c> [default value].</param> | 529 | /// <param name="defaultValue">if set to <c>true</c> [default value].</param> |
530 | /// <returns></returns> | 530 | /// <returns></returns> |
531 | public static bool ParseBoolean(XmlNode node, string attr, bool defaultValue) | 531 | public static bool ParseBoolean(XmlNode node, string attr, bool defaultValue) |
532 | { | 532 | { |
533 | if( node == null ) | 533 | if( node == null ) |
534 | { | 534 | { |
535 | throw new ArgumentNullException("node"); | 535 | throw new ArgumentNullException("node"); |
536 | } | 536 | } |
537 | if(node.Attributes[attr] == null) | 537 | if(node.Attributes[attr] == null) |
538 | { | 538 | { |
539 | return defaultValue; | 539 | return defaultValue; |
540 | } | 540 | } |
541 | return bool.Parse(node.Attributes[attr].Value); | 541 | return bool.Parse(node.Attributes[attr].Value); |
542 | } | 542 | } |
543 | 543 | ||
544 | /// <summary> | 544 | /// <summary> |
545 | /// Enums the attribute value. | 545 | /// Enums the attribute value. |
546 | /// </summary> | 546 | /// </summary> |
547 | /// <param name="node">The node.</param> | 547 | /// <param name="node">The node.</param> |
548 | /// <param name="attr">The attr.</param> | 548 | /// <param name="attr">The attr.</param> |
549 | /// <param name="enumType">Type of the enum.</param> | 549 | /// <param name="enumType">Type of the enum.</param> |
550 | /// <param name="def">The def.</param> | 550 | /// <param name="def">The def.</param> |
551 | /// <returns></returns> | 551 | /// <returns></returns> |
552 | public static object EnumAttributeValue(XmlNode node, string attr, Type enumType, object def) | 552 | public static object EnumAttributeValue(XmlNode node, string attr, Type enumType, object def) |
553 | { | 553 | { |
554 | if( def == null ) | 554 | if( def == null ) |
555 | { | 555 | { |
556 | throw new ArgumentNullException("def"); | 556 | throw new ArgumentNullException("def"); |
557 | } | 557 | } |
558 | string val = AttributeValue(node, attr, def.ToString()); | 558 | string val = AttributeValue(node, attr, def.ToString()); |
559 | return Enum.Parse(enumType, val, true); | 559 | return Enum.Parse(enumType, val, true); |
560 | } | 560 | } |
561 | 561 | ||
562 | /// <summary> | 562 | /// <summary> |
563 | /// | 563 | /// |
564 | /// </summary> | 564 | /// </summary> |
565 | /// <param name="assemblyName"></param> | 565 | /// <param name="assemblyName"></param> |
566 | /// <param name="projectType"></param> | 566 | /// <param name="projectType"></param> |
567 | /// <returns></returns> | 567 | /// <returns></returns> |
568 | public static string AssemblyFullName(string assemblyName, ProjectType projectType) | 568 | public static string AssemblyFullName(string assemblyName, ProjectType projectType) |
569 | { | 569 | { |
570 | return assemblyName + (projectType == ProjectType.Library ? ".dll" : ".exe"); | 570 | return assemblyName + (projectType == ProjectType.Library ? ".dll" : ".exe"); |
571 | } | 571 | } |
572 | 572 | ||
573 | #endregion | 573 | #endregion |
574 | } | 574 | } |
575 | } | 575 | } |
diff --git a/Prebuild/src/Core/Utilities/Log.cs b/Prebuild/src/Core/Utilities/Log.cs index cd95633..4df3def 100644 --- a/Prebuild/src/Core/Utilities/Log.cs +++ b/Prebuild/src/Core/Utilities/Log.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -28,74 +28,74 @@ using System.IO; | |||
28 | 28 | ||
29 | namespace Prebuild.Core.Utilities | 29 | namespace Prebuild.Core.Utilities |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | public enum LogType | 34 | public enum LogType |
35 | { | 35 | { |
36 | /// <summary> | 36 | /// <summary> |
37 | /// | 37 | /// |
38 | /// </summary> | 38 | /// </summary> |
39 | None, | 39 | None, |
40 | /// <summary> | 40 | /// <summary> |
41 | /// | 41 | /// |
42 | /// </summary> | 42 | /// </summary> |
43 | Info, | 43 | Info, |
44 | /// <summary> | 44 | /// <summary> |
45 | /// | 45 | /// |
46 | /// </summary> | 46 | /// </summary> |
47 | Warning, | 47 | Warning, |
48 | /// <summary> | 48 | /// <summary> |
49 | /// | 49 | /// |
50 | /// </summary> | 50 | /// </summary> |
51 | Error | 51 | Error |
52 | } | 52 | } |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// | 55 | /// |
56 | /// </summary> | 56 | /// </summary> |
57 | [Flags] | 57 | [Flags] |
58 | public enum LogTargets | 58 | public enum LogTargets |
59 | { | 59 | { |
60 | /// <summary> | 60 | /// <summary> |
61 | /// | 61 | /// |
62 | /// </summary> | 62 | /// </summary> |
63 | None = 0, | 63 | None = 0, |
64 | /// <summary> | 64 | /// <summary> |
65 | /// | 65 | /// |
66 | /// </summary> | 66 | /// </summary> |
67 | Null = 1, | 67 | Null = 1, |
68 | /// <summary> | 68 | /// <summary> |
69 | /// | 69 | /// |
70 | /// </summary> | 70 | /// </summary> |
71 | File = 2, | 71 | File = 2, |
72 | /// <summary> | 72 | /// <summary> |
73 | /// | 73 | /// |
74 | /// </summary> | 74 | /// </summary> |
75 | Console = 4 | 75 | Console = 4 |
76 | } | 76 | } |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Summary description for Log. | 79 | /// Summary description for Log. |
80 | /// </summary> | 80 | /// </summary> |
81 | public class Log : IDisposable | 81 | public class Log : IDisposable |
82 | { | 82 | { |
83 | #region Fields | 83 | #region Fields |
84 | 84 | ||
85 | private TextWriter m_Writer; | 85 | private TextWriter m_Writer; |
86 | private LogTargets m_Target = LogTargets.Null; | 86 | private LogTargets m_Target = LogTargets.Null; |
87 | bool disposed; | 87 | bool disposed; |
88 | 88 | ||
89 | #endregion | 89 | #endregion |
90 | 90 | ||
91 | #region Constructors | 91 | #region Constructors |
92 | 92 | ||
93 | /// <summary> | 93 | /// <summary> |
94 | /// Initializes a new instance of the <see cref="Log"/> class. | 94 | /// Initializes a new instance of the <see cref="Log"/> class. |
95 | /// </summary> | 95 | /// </summary> |
96 | /// <param name="target">The target.</param> | 96 | /// <param name="target">The target.</param> |
97 | /// <param name="fileName">Name of the file.</param> | 97 | /// <param name="fileName">Name of the file.</param> |
98 | public Log(LogTargets target, string fileName) | 98 | public Log(LogTargets target, string fileName) |
99 | { | 99 | { |
100 | m_Target = target; | 100 | m_Target = target; |
101 | 101 | ||
@@ -111,166 +111,166 @@ namespace Prebuild.Core.Utilities | |||
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | #endregion | 114 | #endregion |
115 | 115 | ||
116 | #region Public Methods | 116 | #region Public Methods |
117 | 117 | ||
118 | /// <summary> | 118 | /// <summary> |
119 | /// Writes this instance. | 119 | /// Writes this instance. |
120 | /// </summary> | 120 | /// </summary> |
121 | public void Write() | 121 | public void Write() |
122 | { | 122 | { |
123 | Write(string.Empty); | 123 | Write(string.Empty); |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Writes the specified MSG. | 127 | /// Writes the specified MSG. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <param name="msg">The MSG.</param> | 129 | /// <param name="msg">The MSG.</param> |
130 | public void Write(string msg) | 130 | public void Write(string msg) |
131 | { | 131 | { |
132 | if((m_Target & LogTargets.Null) != 0) | 132 | if((m_Target & LogTargets.Null) != 0) |
133 | { | 133 | { |
134 | return; | 134 | return; |
135 | } | 135 | } |
136 | 136 | ||
137 | if((m_Target & LogTargets.Console) != 0) | 137 | if((m_Target & LogTargets.Console) != 0) |
138 | { | 138 | { |
139 | Console.WriteLine(msg); | 139 | Console.WriteLine(msg); |
140 | } | 140 | } |
141 | if((m_Target & LogTargets.File) != 0 && m_Writer != null) | 141 | if((m_Target & LogTargets.File) != 0 && m_Writer != null) |
142 | { | 142 | { |
143 | m_Writer.WriteLine(msg); | 143 | m_Writer.WriteLine(msg); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Writes the specified format. | 148 | /// Writes the specified format. |
149 | /// </summary> | 149 | /// </summary> |
150 | /// <param name="format">The format.</param> | 150 | /// <param name="format">The format.</param> |
151 | /// <param name="args">The args.</param> | 151 | /// <param name="args">The args.</param> |
152 | public void Write(string format, params object[] args) | 152 | public void Write(string format, params object[] args) |
153 | { | 153 | { |
154 | Write(string.Format(format,args)); | 154 | Write(string.Format(format,args)); |
155 | } | 155 | } |
156 | 156 | ||
157 | /// <summary> | 157 | /// <summary> |
158 | /// Writes the specified type. | 158 | /// Writes the specified type. |
159 | /// </summary> | 159 | /// </summary> |
160 | /// <param name="type">The type.</param> | 160 | /// <param name="type">The type.</param> |
161 | /// <param name="format">The format.</param> | 161 | /// <param name="format">The format.</param> |
162 | /// <param name="args">The args.</param> | 162 | /// <param name="args">The args.</param> |
163 | public void Write(LogType type, string format, params object[] args) | 163 | public void Write(LogType type, string format, params object[] args) |
164 | { | 164 | { |
165 | if((m_Target & LogTargets.Null) != 0) | 165 | if((m_Target & LogTargets.Null) != 0) |
166 | { | 166 | { |
167 | return; | 167 | return; |
168 | } | 168 | } |
169 | 169 | ||
170 | string str = ""; | 170 | string str = ""; |
171 | switch(type) | 171 | switch(type) |
172 | { | 172 | { |
173 | case LogType.Info: | 173 | case LogType.Info: |
174 | str = "[I] "; | 174 | str = "[I] "; |
175 | break; | 175 | break; |
176 | case LogType.Warning: | 176 | case LogType.Warning: |
177 | str = "[!] "; | 177 | str = "[!] "; |
178 | break; | 178 | break; |
179 | case LogType.Error: | 179 | case LogType.Error: |
180 | str = "[X] "; | 180 | str = "[X] "; |
181 | break; | 181 | break; |
182 | } | 182 | } |
183 | 183 | ||
184 | Write(str + format,args); | 184 | Write(str + format,args); |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// Writes the exception. | 188 | /// Writes the exception. |
189 | /// </summary> | 189 | /// </summary> |
190 | /// <param name="type">The type.</param> | 190 | /// <param name="type">The type.</param> |
191 | /// <param name="ex">The ex.</param> | 191 | /// <param name="ex">The ex.</param> |
192 | public void WriteException(LogType type, Exception ex) | 192 | public void WriteException(LogType type, Exception ex) |
193 | { | 193 | { |
194 | if(ex != null) | 194 | if(ex != null) |
195 | { | 195 | { |
196 | Write(type, ex.Message); | 196 | Write(type, ex.Message); |
197 | //#if DEBUG | 197 | //#if DEBUG |
198 | m_Writer.WriteLine("Exception @{0} stack trace [[", ex.TargetSite.Name); | 198 | m_Writer.WriteLine("Exception @{0} stack trace [[", ex.TargetSite.Name); |
199 | m_Writer.WriteLine(ex.StackTrace); | 199 | m_Writer.WriteLine(ex.StackTrace); |
200 | m_Writer.WriteLine("]]"); | 200 | m_Writer.WriteLine("]]"); |
201 | //#endif | 201 | //#endif |
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
205 | /// <summary> | 205 | /// <summary> |
206 | /// Flushes this instance. | 206 | /// Flushes this instance. |
207 | /// </summary> | 207 | /// </summary> |
208 | public void Flush() | 208 | public void Flush() |
209 | { | 209 | { |
210 | if(m_Writer != null) | 210 | if(m_Writer != null) |
211 | { | 211 | { |
212 | m_Writer.Flush(); | 212 | m_Writer.Flush(); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | #endregion | 216 | #endregion |
217 | 217 | ||
218 | #region IDisposable Members | 218 | #region IDisposable Members |
219 | |||
220 | /// <summary> | ||
221 | /// Performs application-defined tasks associated with freeing, releasing, or | ||
222 | /// resetting unmanaged resources. | ||
223 | /// </summary> | ||
224 | public void Dispose() | ||
225 | { | ||
226 | Dispose(true); | ||
227 | GC.SuppressFinalize(this); | ||
228 | } | ||
229 | 219 | ||
230 | /// <summary> | 220 | /// <summary> |
231 | /// Dispose objects | 221 | /// Performs application-defined tasks associated with freeing, releasing, or |
232 | /// </summary> | 222 | /// resetting unmanaged resources. |
233 | /// <param name="disposing"> | 223 | /// </summary> |
234 | /// If true, it will dispose close the handle | 224 | public void Dispose() |
235 | /// </param> | 225 | { |
236 | /// <remarks> | 226 | Dispose(true); |
237 | /// Will dispose managed and unmanaged resources. | 227 | GC.SuppressFinalize(this); |
238 | /// </remarks> | 228 | } |
239 | protected virtual void Dispose(bool disposing) | ||
240 | { | ||
241 | if (!this.disposed) | ||
242 | { | ||
243 | if (disposing) | ||
244 | { | ||
245 | if (m_Writer != null) | ||
246 | { | ||
247 | m_Writer.Close(); | ||
248 | m_Writer = null; | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | this.disposed = true; | ||
253 | } | ||
254 | 229 | ||
255 | /// <summary> | 230 | /// <summary> |
256 | /// | 231 | /// Dispose objects |
257 | /// </summary> | 232 | /// </summary> |
258 | ~Log() | 233 | /// <param name="disposing"> |
259 | { | 234 | /// If true, it will dispose close the handle |
260 | this.Dispose(false); | 235 | /// </param> |
261 | } | 236 | /// <remarks> |
237 | /// Will dispose managed and unmanaged resources. | ||
238 | /// </remarks> | ||
239 | protected virtual void Dispose(bool disposing) | ||
240 | { | ||
241 | if (!this.disposed) | ||
242 | { | ||
243 | if (disposing) | ||
244 | { | ||
245 | if (m_Writer != null) | ||
246 | { | ||
247 | m_Writer.Close(); | ||
248 | m_Writer = null; | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | this.disposed = true; | ||
253 | } | ||
262 | 254 | ||
263 | /// <summary> | 255 | /// <summary> |
264 | /// Closes and destroys this object | 256 | /// |
265 | /// </summary> | 257 | /// </summary> |
266 | /// <remarks> | 258 | ~Log() |
267 | /// Same as Dispose(true) | 259 | { |
268 | /// </remarks> | 260 | this.Dispose(false); |
269 | public void Close() | 261 | } |
270 | { | 262 | |
271 | Dispose(); | 263 | /// <summary> |
272 | } | 264 | /// Closes and destroys this object |
265 | /// </summary> | ||
266 | /// <remarks> | ||
267 | /// Same as Dispose(true) | ||
268 | /// </remarks> | ||
269 | public void Close() | ||
270 | { | ||
271 | Dispose(); | ||
272 | } | ||
273 | 273 | ||
274 | #endregion | 274 | #endregion |
275 | } | 275 | } |
276 | } | 276 | } |
diff --git a/Prebuild/src/Core/WarningException.cs b/Prebuild/src/Core/WarningException.cs index 721f43d..b7c3668 100644 --- a/Prebuild/src/Core/WarningException.cs +++ b/Prebuild/src/Core/WarningException.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -28,57 +28,57 @@ using System.Runtime.Serialization; | |||
28 | 28 | ||
29 | namespace Prebuild.Core | 29 | namespace Prebuild.Core |
30 | { | 30 | { |
31 | /// <summary> | 31 | /// <summary> |
32 | /// | 32 | /// |
33 | /// </summary> | 33 | /// </summary> |
34 | [Serializable] | 34 | [Serializable] |
35 | public class WarningException : Exception | 35 | public class WarningException : Exception |
36 | { | 36 | { |
37 | #region Constructors | 37 | #region Constructors |
38 | 38 | ||
39 | /// <summary> | 39 | /// <summary> |
40 | /// | 40 | /// |
41 | /// </summary> | 41 | /// </summary> |
42 | public WarningException() | 42 | public WarningException() |
43 | { | 43 | { |
44 | } | 44 | } |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// | 47 | /// |
48 | /// </summary> | 48 | /// </summary> |
49 | /// <param name="format"></param> | 49 | /// <param name="format"></param> |
50 | /// <param name="args"></param> | 50 | /// <param name="args"></param> |
51 | public WarningException(string format, params object[] args) | 51 | public WarningException(string format, params object[] args) |
52 | : base(String.Format(format, args)) | 52 | : base(String.Format(format, args)) |
53 | { | 53 | { |
54 | } | 54 | } |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Exception with specified string | 57 | /// Exception with specified string |
58 | /// </summary> | 58 | /// </summary> |
59 | /// <param name="message">Exception message</param> | 59 | /// <param name="message">Exception message</param> |
60 | public WarningException(string message): base(message) | 60 | public WarningException(string message): base(message) |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// | 65 | /// |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <param name="message"></param> | 67 | /// <param name="message"></param> |
68 | /// <param name="exception"></param> | 68 | /// <param name="exception"></param> |
69 | public WarningException(string message, Exception exception) : base(message, exception) | 69 | public WarningException(string message, Exception exception) : base(message, exception) |
70 | { | 70 | { |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// | 74 | /// |
75 | /// </summary> | 75 | /// </summary> |
76 | /// <param name="info"></param> | 76 | /// <param name="info"></param> |
77 | /// <param name="context"></param> | 77 | /// <param name="context"></param> |
78 | protected WarningException(SerializationInfo info, StreamingContext context) : base( info, context ) | 78 | protected WarningException(SerializationInfo info, StreamingContext context) : base( info, context ) |
79 | { | 79 | { |
80 | } | 80 | } |
81 | 81 | ||
82 | #endregion | 82 | #endregion |
83 | } | 83 | } |
84 | } | 84 | } |
diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs index 996dea0..35a5dfa 100644 --- a/Prebuild/src/Prebuild.cs +++ b/Prebuild/src/Prebuild.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -42,50 +42,50 @@ using System.EnterpriseServices.Internal; | |||
42 | using Prebuild.Core; | 42 | using Prebuild.Core; |
43 | using Prebuild.Core.Utilities; | 43 | using Prebuild.Core.Utilities; |
44 | 44 | ||
45 | namespace Prebuild | 45 | namespace Prebuild |
46 | { | 46 | { |
47 | /// <summary> | 47 | /// <summary> |
48 | /// | 48 | /// |
49 | /// </summary> | 49 | /// </summary> |
50 | class Prebuild | 50 | class Prebuild |
51 | { | 51 | { |
52 | #region Main | 52 | #region Main |
53 | 53 | ||
54 | [STAThread] | 54 | [STAThread] |
55 | static void Main(string[] args) | 55 | static void Main(string[] args) |
56 | { | 56 | { |
57 | Kernel kernel = null; | 57 | Kernel kernel = null; |
58 | try | 58 | try |
59 | { | 59 | { |
60 | kernel = Kernel.Instance; | 60 | kernel = Kernel.Instance; |
61 | kernel.Initialize(LogTargets.File | LogTargets.Console, args); | 61 | kernel.Initialize(LogTargets.File | LogTargets.Console, args); |
62 | bool exit = false; | 62 | bool exit = false; |
63 | 63 | ||
64 | if(kernel.CommandLine.WasPassed("usage")) | 64 | if(kernel.CommandLine.WasPassed("usage")) |
65 | { | 65 | { |
66 | exit = true; | 66 | exit = true; |
67 | OutputUsage(); | 67 | OutputUsage(); |
68 | } | 68 | } |
69 | if(kernel.CommandLine.WasPassed("showtargets")) | 69 | if(kernel.CommandLine.WasPassed("showtargets")) |
70 | { | 70 | { |
71 | exit = true; | 71 | exit = true; |
72 | OutputTargets(kernel); | 72 | OutputTargets(kernel); |
73 | } | 73 | } |
74 | if(kernel.CommandLine.WasPassed("install")) | 74 | if(kernel.CommandLine.WasPassed("install")) |
75 | { | 75 | { |
76 | exit = true; | 76 | exit = true; |
77 | InstallAssembly(kernel); | 77 | InstallAssembly(kernel); |
78 | } | 78 | } |
79 | if(kernel.CommandLine.WasPassed("remove")) | 79 | if(kernel.CommandLine.WasPassed("remove")) |
80 | { | 80 | { |
81 | exit = true; | 81 | exit = true; |
82 | RemoveAssembly(kernel); | 82 | RemoveAssembly(kernel); |
83 | } | 83 | } |
84 | 84 | ||
85 | if(!exit) | 85 | if(!exit) |
86 | { | 86 | { |
87 | kernel.Process(); | 87 | kernel.Process(); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | #if !DEBUG | 90 | #if !DEBUG |
91 | catch (Exception ex) | 91 | catch (Exception ex) |
@@ -96,70 +96,70 @@ namespace Prebuild | |||
96 | #endif | 96 | #endif |
97 | finally | 97 | finally |
98 | { | 98 | { |
99 | if(kernel != null && kernel.PauseAfterFinish) | 99 | if(kernel != null && kernel.PauseAfterFinish) |
100 | { | 100 | { |
101 | Console.WriteLine("\nPress enter to continue..."); | 101 | Console.WriteLine("\nPress enter to continue..."); |
102 | Console.ReadLine(); | 102 | Console.ReadLine(); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | #endregion | 107 | #endregion |
108 | 108 | ||
109 | #region Private Methods | 109 | #region Private Methods |
110 | 110 | ||
111 | private static void InstallAssembly(Kernel kernel) | 111 | private static void InstallAssembly(Kernel kernel) |
112 | { | 112 | { |
113 | Publish publish = new Publish(); | 113 | Publish publish = new Publish(); |
114 | string file = kernel.CommandLine["install"]; | 114 | string file = kernel.CommandLine["install"]; |
115 | //Console.WriteLine(".."+file+".."); | 115 | //Console.WriteLine(".."+file+".."); |
116 | publish.GacInstall(file); | 116 | publish.GacInstall(file); |
117 | } | 117 | } |
118 | 118 | ||
119 | private static void RemoveAssembly(Kernel kernel) | 119 | private static void RemoveAssembly(Kernel kernel) |
120 | { | 120 | { |
121 | Publish publish = new Publish(); | 121 | Publish publish = new Publish(); |
122 | string file = kernel.CommandLine["remove"]; | 122 | string file = kernel.CommandLine["remove"]; |
123 | publish.GacRemove(file); | 123 | publish.GacRemove(file); |
124 | } | 124 | } |
125 | 125 | ||
126 | private static void OutputUsage() | 126 | private static void OutputUsage() |
127 | { | 127 | { |
128 | Console.WriteLine("Usage: prebuild /target <target> [options]"); | 128 | Console.WriteLine("Usage: prebuild /target <target> [options]"); |
129 | Console.WriteLine("Available command-line switches:"); | 129 | Console.WriteLine("Available command-line switches:"); |
130 | Console.WriteLine(); | 130 | Console.WriteLine(); |
131 | Console.WriteLine("/target Target for Prebuild"); | 131 | Console.WriteLine("/target Target for Prebuild"); |
132 | Console.WriteLine("/clean Clean the build files for the given target"); | 132 | Console.WriteLine("/clean Clean the build files for the given target"); |
133 | Console.WriteLine("/file XML file to process"); | 133 | Console.WriteLine("/file XML file to process"); |
134 | Console.WriteLine("/log Log file to write to"); | 134 | Console.WriteLine("/log Log file to write to"); |
135 | Console.WriteLine("/ppo Pre-process the file, but perform no other processing"); | 135 | Console.WriteLine("/ppo Pre-process the file, but perform no other processing"); |
136 | Console.WriteLine("/pause Pauses the application after execution to view the output"); | 136 | Console.WriteLine("/pause Pauses the application after execution to view the output"); |
137 | Console.WriteLine("/yes Default to yes to any questions asked"); | 137 | Console.WriteLine("/yes Default to yes to any questions asked"); |
138 | Console.WriteLine("/install Install assembly into the GAC"); | 138 | Console.WriteLine("/install Install assembly into the GAC"); |
139 | Console.WriteLine("/remove Remove assembly from the GAC"); | 139 | Console.WriteLine("/remove Remove assembly from the GAC"); |
140 | Console.WriteLine(); | 140 | Console.WriteLine(); |
141 | Console.WriteLine("See 'prebuild /showtargets for a list of available targets"); | 141 | Console.WriteLine("See 'prebuild /showtargets for a list of available targets"); |
142 | Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information"); | 142 | Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information"); |
143 | Console.WriteLine(); | 143 | Console.WriteLine(); |
144 | } | 144 | } |
145 | 145 | ||
146 | private static void OutputTargets(Kernel kern) | 146 | private static void OutputTargets(Kernel kern) |
147 | { | 147 | { |
148 | Console.WriteLine("Targets available in Prebuild:"); | 148 | Console.WriteLine("Targets available in Prebuild:"); |
149 | Console.WriteLine(""); | 149 | Console.WriteLine(""); |
150 | if(kern.Targets.Keys.Count > 0) | 150 | if(kern.Targets.Keys.Count > 0) |
151 | { | 151 | { |
152 | string[] targs = new string[kern.Targets.Keys.Count]; | 152 | string[] targs = new string[kern.Targets.Keys.Count]; |
153 | kern.Targets.Keys.CopyTo(targs, 0); | 153 | kern.Targets.Keys.CopyTo(targs, 0); |
154 | Array.Sort(targs); | 154 | Array.Sort(targs); |
155 | foreach(string target in targs) | 155 | foreach(string target in targs) |
156 | { | 156 | { |
157 | Console.WriteLine(target); | 157 | Console.WriteLine(target); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | Console.WriteLine(""); | 160 | Console.WriteLine(""); |
161 | } | 161 | } |
162 | 162 | ||
163 | #endregion | 163 | #endregion |
164 | } | 164 | } |
165 | } | 165 | } |
diff --git a/Prebuild/src/Properties/AssemblyInfo.cs b/Prebuild/src/Properties/AssemblyInfo.cs index f9d90bb..079d6a5 100644 --- a/Prebuild/src/Properties/AssemblyInfo.cs +++ b/Prebuild/src/Properties/AssemblyInfo.cs | |||
@@ -52,7 +52,7 @@ using System.Resources; | |||
52 | [assembly: CLSCompliant(true)] | 52 | [assembly: CLSCompliant(true)] |
53 | 53 | ||
54 | // | 54 | // |
55 | // General Information about an assembly is controlled through the following | 55 | // General Information about an assembly is controlled through the following |
56 | // set of attributes. Change these attribute values to modify the information | 56 | // set of attributes. Change these attribute values to modify the information |
57 | // associated with an assembly. | 57 | // associated with an assembly. |
58 | // | 58 | // |
@@ -61,50 +61,52 @@ using System.Resources; | |||
61 | [assembly: AssemblyConfiguration(".NET CLR")] | 61 | [assembly: AssemblyConfiguration(".NET CLR")] |
62 | [assembly: AssemblyCompany("The Prebuild Project")] | 62 | [assembly: AssemblyCompany("The Prebuild Project")] |
63 | [assembly: AssemblyProduct("")] | 63 | [assembly: AssemblyProduct("")] |
64 | [assembly: AssemblyCopyright("Copyright 2004-2013 " + | 64 | [assembly: AssemblyCopyright("Copyright 2004-2015 " + |
65 | "Matthew Holmes, " + | 65 | "Matthew Holmes, " + |
66 | "Dan Moorehead, " + | 66 | "Dan Moorehead, " + |
67 | "C.J. Adams-Collier, " + | 67 | "C.J. Adams-Collier, " + |
68 | "Rob Loach, " + | 68 | "Rob Loach, " + |
69 | "David Hudson," + | 69 | "David Hudson," + |
70 | "John Hurliman")] | 70 | "John Hurliman" + |
71 | "WhiteCore Development" + | ||
72 | "OpenSimulator developers")] | ||
71 | [assembly: AssemblyTrademark("")] | 73 | [assembly: AssemblyTrademark("")] |
72 | [assembly: AssemblyCulture("")] | 74 | [assembly: AssemblyCulture("")] |
73 | [assembly: NeutralResourcesLanguageAttribute("en-US")] | 75 | [assembly: NeutralResourcesLanguageAttribute("en-US")] |
74 | [assembly: AssemblyVersion("2.0.6.*")] | 76 | [assembly: AssemblyVersion("2.0.7.*")] |
75 | 77 | ||
76 | // | 78 | // |
77 | // Version information for an assembly consists of the following four values: | 79 | // Version information for an assembly consists of the following four values: |
78 | // | 80 | // |
79 | // Major Version | 81 | // Major Version |
80 | // Minor Version | 82 | // Minor Version |
81 | // Build Number | 83 | // Build Number |
82 | // Revision | 84 | // Revision |
83 | // | 85 | // |
84 | // You can specify all the values or you can default the Revision and Build Numbers | 86 | // You can specify all the values or you can default the Revision and Build Numbers |
85 | // by using the '*' as shown below: | 87 | // by using the '*' as shown below: |
86 | 88 | ||
87 | // | 89 | // |
88 | // In order to sign your assembly you must specify a key to use. Refer to the | 90 | // In order to sign your assembly you must specify a key to use. Refer to the |
89 | // Microsoft .NET Framework documentation for more information on assembly signing. | 91 | // Microsoft .NET Framework documentation for more information on assembly signing. |
90 | // | 92 | // |
91 | // Use the attributes below to control which key is used for signing. | 93 | // Use the attributes below to control which key is used for signing. |
92 | // | 94 | // |
93 | // Notes: | 95 | // Notes: |
94 | // (*) If no key is specified, the assembly is not signed. | 96 | // (*) If no key is specified, the assembly is not signed. |
95 | // (*) KeyName refers to a key that has been installed in the Crypto Service | 97 | // (*) KeyName refers to a key that has been installed in the Crypto Service |
96 | // Provider (CSP) on your machine. KeyFile refers to a file which contains | 98 | // Provider (CSP) on your machine. KeyFile refers to a file which contains |
97 | // a key. | 99 | // a key. |
98 | // (*) If the KeyFile and the KeyName values are both specified, the | 100 | // (*) If the KeyFile and the KeyName values are both specified, the |
99 | // following processing occurs: | 101 | // following processing occurs: |
100 | // (1) If the KeyName can be found in the CSP, that key is used. | 102 | // (1) If the KeyName can be found in the CSP, that key is used. |
101 | // (2) If the KeyName does not exist and the KeyFile does exist, the key | 103 | // (2) If the KeyName does not exist and the KeyFile does exist, the key |
102 | // in the KeyFile is installed into the CSP and used. | 104 | // in the KeyFile is installed into the CSP and used. |
103 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. | 105 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. |
104 | // When specifying the KeyFile, the location of the KeyFile should be | 106 | // When specifying the KeyFile, the location of the KeyFile should be |
105 | // relative to the project output directory which is | 107 | // relative to the project output directory which is |
106 | // %Project Directory%\obj\<configuration>. For example, if your KeyFile is | 108 | // %Project Directory%\obj\<configuration>. For example, if your KeyFile is |
107 | // located in the project directory, you would specify the AssemblyKeyFile | 109 | // located in the project directory, you would specify the AssemblyKeyFile |
108 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] | 110 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] |
109 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework | 111 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework |
110 | // documentation for more information on this. | 112 | // documentation for more information on this. |
diff --git a/Prebuild/src/data/prebuild-1.10.xsd b/Prebuild/src/data/prebuild-1.10.xsd index eee07a8..ddfa2c5 100644 --- a/Prebuild/src/data/prebuild-1.10.xsd +++ b/Prebuild/src/data/prebuild-1.10.xsd | |||
@@ -186,8 +186,9 @@ | |||
186 | <xs:complexType> | 186 | <xs:complexType> |
187 | <xs:all> | 187 | <xs:all> |
188 | <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" /> | 188 | <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" /> |
189 | <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" /> | 189 | <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" /> |
190 | <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" /> | 190 | <xs:element name="Prefer32Bit" type="xs:boolean" minOccurs="0" /> |
191 | <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" /> | ||
191 | <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" /> | 192 | <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" /> |
192 | <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" /> | 193 | <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" /> |
193 | <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" /> | 194 | <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" /> |
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index 5db99ef..f6e3dae 100755 --- a/bin/HttpServer_OpenSim.dll +++ b/bin/HttpServer_OpenSim.dll | |||
Binary files differ | |||
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb index 25b6760..35b15cd 100644 --- a/bin/HttpServer_OpenSim.pdb +++ b/bin/HttpServer_OpenSim.pdb | |||
Binary files differ | |||
diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml deleted file mode 100644 index 7b6912e..0000000 --- a/bin/HttpServer_OpenSim.xml +++ /dev/null | |||
@@ -1,5574 +0,0 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <doc> | ||
3 | <assembly> | ||
4 | <name>HttpServer_OpenSim</name> | ||
5 | </assembly> | ||
6 | <members> | ||
7 | <member name="T:HttpServer.Authentication.AuthenticationHandler"> | ||
8 | <summary> | ||
9 | Delegate used to let authentication modules authenticate the user name and password. | ||
10 | </summary> | ||
11 | <param name="realm">Realm that the user want to authenticate in</param> | ||
12 | <param name="userName">User name specified by client</param> | ||
13 | <param name="token">Can either be user password or implementation specific token.</param> | ||
14 | <param name="login">object that will be stored in a session variable called <see cref="F:HttpServer.Authentication.AuthenticationModule.AuthenticationTag"/> if authentication was successful.</param> | ||
15 | <exception cref="T:HttpServer.Exceptions.ForbiddenException">throw forbidden exception if too many attempts have been made.</exception> | ||
16 | <remarks> | ||
17 | <para> | ||
18 | Use <see cref="P:HttpServer.Authentication.DigestAuthentication.TokenIsHA1"/> to specify that the token is a HA1 token. (MD5 generated | ||
19 | string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); | ||
20 | </para> | ||
21 | </remarks> | ||
22 | </member> | ||
23 | <member name="T:HttpServer.Authentication.AuthenticationRequiredHandler"> | ||
24 | <summary> | ||
25 | Let's you decide on a system level if authentication is required. | ||
26 | </summary> | ||
27 | <param name="request">HTTP request from client</param> | ||
28 | <returns>true if user should be authenticated.</returns> | ||
29 | <remarks>throw <see cref="T:HttpServer.Exceptions.ForbiddenException"/> if no more attempts are allowed.</remarks> | ||
30 | <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> | ||
31 | </member> | ||
32 | <member name="T:HttpServer.Authentication.AuthenticationModule"> | ||
33 | <summary> | ||
34 | Authentication modules are used to implement different | ||
35 | kind of HTTP authentication. | ||
36 | </summary> | ||
37 | </member> | ||
38 | <member name="M:HttpServer.Authentication.AuthenticationModule.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> | ||
39 | <summary> | ||
40 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthenticationModule"/> class. | ||
41 | </summary> | ||
42 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
43 | <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> | ||
44 | </member> | ||
45 | <member name="M:HttpServer.Authentication.AuthenticationModule.#ctor(HttpServer.Authentication.AuthenticationHandler)"> | ||
46 | <summary> | ||
47 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthenticationModule"/> class. | ||
48 | </summary> | ||
49 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
50 | </member> | ||
51 | <member name="P:HttpServer.Authentication.AuthenticationModule.Name"> | ||
52 | <summary> | ||
53 | name used in HTTP request. | ||
54 | </summary> | ||
55 | </member> | ||
56 | <member name="F:HttpServer.Authentication.AuthenticationModule.AuthenticationTag"> | ||
57 | <summary> | ||
58 | Tag used for authentication. | ||
59 | </summary> | ||
60 | </member> | ||
61 | <member name="M:HttpServer.Authentication.AuthenticationModule.CreateResponse(System.String,System.Object[])"> | ||
62 | <summary> | ||
63 | Create a response that can be sent in the WWW-Authenticate header. | ||
64 | </summary> | ||
65 | <param name="realm">Realm that the user should authenticate in</param> | ||
66 | <param name="options">Array with optional options.</param> | ||
67 | <returns>A correct authentication request.</returns> | ||
68 | <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> | ||
69 | </member> | ||
70 | <member name="M:HttpServer.Authentication.AuthenticationModule.Authenticate(System.String,System.String,System.String,System.Object[])"> | ||
71 | <summary> | ||
72 | An authentication response have been received from the web browser. | ||
73 | Check if it's correct | ||
74 | </summary> | ||
75 | <param name="authenticationHeader">Contents from the Authorization header</param> | ||
76 | <param name="realm">Realm that should be authenticated</param> | ||
77 | <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> | ||
78 | <param name="options">options to specific implementations</param> | ||
79 | <returns>Authentication object that is stored for the request. A user class or something like that.</returns> | ||
80 | <exception cref="T:System.ArgumentException">if <paramref name="authenticationHeader"/> is invalid</exception> | ||
81 | <exception cref="T:System.ArgumentNullException">If any of the parameters is empty or null.</exception> | ||
82 | </member> | ||
83 | <member name="M:HttpServer.Authentication.AuthenticationModule.CheckAuthentication(System.String,System.String,System.String@,System.Object@)"> | ||
84 | <summary> | ||
85 | Used to invoke the authentication delegate that is used to lookup the user name/realm. | ||
86 | </summary> | ||
87 | <param name="realm">Realm (domain) that user want to authenticate in</param> | ||
88 | <param name="userName">User name</param> | ||
89 | <param name="password">Password used for validation. Some implementations got password in clear text, they are then sent to client.</param> | ||
90 | <param name="login">object that will be stored in the request to help you identify the user if authentication was successful.</param> | ||
91 | <returns>true if authentication was successful</returns> | ||
92 | </member> | ||
93 | <member name="M:HttpServer.Authentication.AuthenticationModule.AuthenticationRequired(HttpServer.IHttpRequest)"> | ||
94 | <summary> | ||
95 | Determines if authentication is required. | ||
96 | </summary> | ||
97 | <param name="request">HTTP request from browser</param> | ||
98 | <returns>true if user should be authenticated.</returns> | ||
99 | <remarks>throw <see cref="T:HttpServer.Exceptions.ForbiddenException"/> from your delegate if no more attempts are allowed.</remarks> | ||
100 | <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> | ||
101 | </member> | ||
102 | <member name="T:HttpServer.Authentication.BasicAuthentication"> | ||
103 | <summary> | ||
104 | The "basic" authentication scheme is based on the model that the | ||
105 | client must authenticate itself with a user-ID and a password for | ||
106 | each realm. The realm value should be considered an opaque string | ||
107 | which can only be compared for equality with other realms on that | ||
108 | server. The server will service the request only if it can validate | ||
109 | the user-ID and password for the protection space of the Request-URI. | ||
110 | There are no optional authentication parameters. | ||
111 | </summary> | ||
112 | </member> | ||
113 | <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> | ||
114 | <summary> | ||
115 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. | ||
116 | </summary> | ||
117 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
118 | <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> | ||
119 | </member> | ||
120 | <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> | ||
121 | <summary> | ||
122 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. | ||
123 | </summary> | ||
124 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
125 | </member> | ||
126 | <member name="M:HttpServer.Authentication.BasicAuthentication.CreateResponse(System.String,System.Object[])"> | ||
127 | <summary> | ||
128 | Create a response that can be sent in the WWW-Authenticate header. | ||
129 | </summary> | ||
130 | <param name="realm">Realm that the user should authenticate in</param> | ||
131 | <param name="options">Not used in basic auth</param> | ||
132 | <returns>A correct auth request.</returns> | ||
133 | </member> | ||
134 | <member name="M:HttpServer.Authentication.BasicAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> | ||
135 | <summary> | ||
136 | An authentication response have been received from the web browser. | ||
137 | Check if it's correct | ||
138 | </summary> | ||
139 | <param name="authenticationHeader">Contents from the Authorization header</param> | ||
140 | <param name="realm">Realm that should be authenticated</param> | ||
141 | <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> | ||
142 | <param name="options">Not used in basic auth</param> | ||
143 | <returns>Authentication object that is stored for the request. A user class or something like that.</returns> | ||
144 | <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> | ||
145 | <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> | ||
146 | </member> | ||
147 | <member name="P:HttpServer.Authentication.BasicAuthentication.Name"> | ||
148 | <summary> | ||
149 | name used in http request. | ||
150 | </summary> | ||
151 | </member> | ||
152 | <member name="T:HttpServer.Authentication.DigestAuthentication"> | ||
153 | <summary> | ||
154 | Implements HTTP Digest authentication. It's more secure than Basic auth since password is | ||
155 | encrypted with a "key" from the server. | ||
156 | </summary> | ||
157 | <remarks> | ||
158 | Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. | ||
159 | </remarks> | ||
160 | </member> | ||
161 | <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> | ||
162 | <summary> | ||
163 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. | ||
164 | </summary> | ||
165 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
166 | <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> | ||
167 | </member> | ||
168 | <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> | ||
169 | <summary> | ||
170 | Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. | ||
171 | </summary> | ||
172 | <param name="authenticator">Delegate used to provide information used during authentication.</param> | ||
173 | </member> | ||
174 | <member name="F:HttpServer.Authentication.DigestAuthentication.DisableNonceCheck"> | ||
175 | <summary> | ||
176 | Used by test classes to be able to use hardcoded values | ||
177 | </summary> | ||
178 | </member> | ||
179 | <member name="P:HttpServer.Authentication.DigestAuthentication.Name"> | ||
180 | <summary> | ||
181 | name used in http request. | ||
182 | </summary> | ||
183 | </member> | ||
184 | <member name="M:HttpServer.Authentication.DigestAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> | ||
185 | <summary> | ||
186 | An authentication response have been received from the web browser. | ||
187 | Check if it's correct | ||
188 | </summary> | ||
189 | <param name="authenticationHeader">Contents from the Authorization header</param> | ||
190 | <param name="realm">Realm that should be authenticated</param> | ||
191 | <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> | ||
192 | <param name="options">First option: true if username/password is correct but not cnonce</param> | ||
193 | <returns> | ||
194 | Authentication object that is stored for the request. A user class or something like that. | ||
195 | </returns> | ||
196 | <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> | ||
197 | <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> | ||
198 | </member> | ||
199 | <member name="P:HttpServer.Authentication.DigestAuthentication.TokenIsHA1"> | ||
200 | <summary> | ||
201 | Gets or sets whether the token supplied in <see cref="T:HttpServer.Authentication.AuthenticationHandler"/> is a | ||
202 | HA1 generated string. | ||
203 | </summary> | ||
204 | </member> | ||
205 | <member name="M:HttpServer.Authentication.DigestAuthentication.Encrypt(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)"> | ||
206 | <summary> | ||
207 | Encrypts parameters into a Digest string | ||
208 | </summary> | ||
209 | <param name="realm">Realm that the user want to log into.</param> | ||
210 | <param name="userName">User logging in</param> | ||
211 | <param name="password">Users password.</param> | ||
212 | <param name="method">HTTP method.</param> | ||
213 | <param name="uri">Uri/domain that generated the login prompt.</param> | ||
214 | <param name="qop">Quality of Protection.</param> | ||
215 | <param name="nonce">"Number used ONCE"</param> | ||
216 | <param name="nc">Hexadecimal request counter.</param> | ||
217 | <param name="cnonce">"Client Number used ONCE"</param> | ||
218 | <returns>Digest encrypted string</returns> | ||
219 | </member> | ||
220 | <member name="M:HttpServer.Authentication.DigestAuthentication.Encrypt(System.String,System.String,System.String,System.String,System.String,System.String)"> | ||
221 | <summary> | ||
222 | |||
223 | </summary> | ||
224 | <param name="ha1">Md5 hex encoded "userName:realm:password", without the quotes.</param> | ||
225 | <param name="ha2">Md5 hex encoded "method:uri", without the quotes</param> | ||
226 | <param name="qop">Quality of Protection</param> | ||
227 | <param name="nonce">"Number used ONCE"</param> | ||
228 | <param name="nc">Hexadecimal request counter.</param> | ||
229 | <param name="cnonce">Client number used once</param> | ||
230 | <returns></returns> | ||
231 | </member> | ||
232 | <member name="M:HttpServer.Authentication.DigestAuthentication.CreateResponse(System.String,System.Object[])"> | ||
233 | <summary> | ||
234 | Create a response that can be sent in the WWW-Authenticate header. | ||
235 | </summary> | ||
236 | <param name="realm">Realm that the user should authenticate in</param> | ||
237 | <param name="options">First options specifies if true if username/password is correct but not cnonce.</param> | ||
238 | <returns>A correct auth request.</returns> | ||
239 | <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> | ||
240 | </member> | ||
241 | <member name="M:HttpServer.Authentication.DigestAuthentication.Decode(System.String,System.Text.Encoding)"> | ||
242 | <summary> | ||
243 | Decodes authorization header value | ||
244 | </summary> | ||
245 | <param name="buffer">header value</param> | ||
246 | <param name="encoding">Encoding that the buffer is in</param> | ||
247 | <returns>All headers and their values if successful; otherwise null</returns> | ||
248 | <example> | ||
249 | NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); | ||
250 | </example> | ||
251 | <remarks>Can handle lots of whitespaces and new lines without failing.</remarks> | ||
252 | </member> | ||
253 | <member name="M:HttpServer.Authentication.DigestAuthentication.GetCurrentNonce"> | ||
254 | <summary> | ||
255 | Gets the current nonce. | ||
256 | </summary> | ||
257 | <returns></returns> | ||
258 | </member> | ||
259 | <member name="M:HttpServer.Authentication.DigestAuthentication.GetMD5HashBinHex2(System.String)"> | ||
260 | <summary> | ||
261 | Gets the Md5 hash bin hex2. | ||
262 | </summary> | ||
263 | <param name="toBeHashed">To be hashed.</param> | ||
264 | <returns></returns> | ||
265 | </member> | ||
266 | <member name="M:HttpServer.Authentication.DigestAuthentication.IsValidNonce(System.String)"> | ||
267 | <summary> | ||
268 | determines if the nonce is valid or has expired. | ||
269 | </summary> | ||
270 | <param name="nonce">nonce value (check wikipedia for info)</param> | ||
271 | <returns>true if the nonce has not expired.</returns> | ||
272 | </member> | ||
273 | <member name="T:HttpServer.Check"> | ||
274 | <summary> | ||
275 | Small design by contract implementation. | ||
276 | </summary> | ||
277 | </member> | ||
278 | <member name="M:HttpServer.Check.NotEmpty(System.String,System.String)"> | ||
279 | <summary> | ||
280 | Check whether a parameter is empty. | ||
281 | </summary> | ||
282 | <param name="value">Parameter value</param> | ||
283 | <param name="parameterOrErrorMessage">Parameter name, or error description.</param> | ||
284 | <exception cref="T:System.ArgumentException">value is empty.</exception> | ||
285 | </member> | ||
286 | <member name="M:HttpServer.Check.Require(System.Object,System.String)"> | ||
287 | <summary> | ||
288 | Checks whether a parameter is null. | ||
289 | </summary> | ||
290 | <param name="value">Parameter value</param> | ||
291 | <param name="parameterOrErrorMessage">Parameter name, or error description.</param> | ||
292 | <exception cref="T:System.ArgumentNullException">value is null.</exception> | ||
293 | </member> | ||
294 | <member name="M:HttpServer.Check.Min(System.Int32,System.Object,System.String)"> | ||
295 | <summary> | ||
296 | Checks whether a parameter is null. | ||
297 | </summary> | ||
298 | <param name="minValue"></param> | ||
299 | <param name="value">Parameter value</param> | ||
300 | <param name="parameterOrErrorMessage">Parameter name, or error description.</param> | ||
301 | <exception cref="T:System.ArgumentException">value is null.</exception> | ||
302 | </member> | ||
303 | <member name="T:HttpServer.ClientAcceptedEventArgs"> | ||
304 | <summary> | ||
305 | Invoked when a client have been accepted by the <see cref="T:HttpServer.HttpListener"/> | ||
306 | </summary> | ||
307 | <remarks> | ||
308 | Can be used to revoke incoming connections | ||
309 | </remarks> | ||
310 | </member> | ||
311 | <member name="M:HttpServer.ClientAcceptedEventArgs.#ctor(System.Net.Sockets.Socket)"> | ||
312 | <summary> | ||
313 | Initializes a new instance of the <see cref="T:HttpServer.ClientAcceptedEventArgs"/> class. | ||
314 | </summary> | ||
315 | <param name="socket">The socket.</param> | ||
316 | </member> | ||
317 | <member name="P:HttpServer.ClientAcceptedEventArgs.Socket"> | ||
318 | <summary> | ||
319 | Accepted socket. | ||
320 | </summary> | ||
321 | </member> | ||
322 | <member name="P:HttpServer.ClientAcceptedEventArgs.Revoked"> | ||
323 | <summary> | ||
324 | Client should be revoked. | ||
325 | </summary> | ||
326 | </member> | ||
327 | <member name="M:HttpServer.ClientAcceptedEventArgs.Revoke"> | ||
328 | <summary> | ||
329 | Client may not be handled. | ||
330 | </summary> | ||
331 | </member> | ||
332 | <member name="M:HttpServer.ComponentProvider.AddInstance``1(System.Object)"> | ||
333 | <summary> | ||
334 | Add a component instance | ||
335 | </summary> | ||
336 | <typeparam name="T">Interface type</typeparam> | ||
337 | <param name="instance">Instance to add</param> | ||
338 | </member> | ||
339 | <member name="M:HttpServer.ComponentProvider.Get``1"> | ||
340 | <summary> | ||
341 | Get a component. | ||
342 | </summary> | ||
343 | <typeparam name="T">Interface type</typeparam> | ||
344 | <returns>Component if registered, otherwise null.</returns> | ||
345 | <remarks> | ||
346 | Component will get created if needed. | ||
347 | </remarks> | ||
348 | </member> | ||
349 | <member name="M:HttpServer.ComponentProvider.Create(HttpServer.ComponentProvider.TypeInformation)"> | ||
350 | <exception cref="T:System.InvalidOperationException">If instance cannot be created.</exception> | ||
351 | </member> | ||
352 | <member name="M:HttpServer.ComponentProvider.Contains(System.Type)"> | ||
353 | <summary> | ||
354 | Checks if the specified component interface have been added. | ||
355 | </summary> | ||
356 | <param name="interfaceType"></param> | ||
357 | <returns>true if found; otherwise false.</returns> | ||
358 | </member> | ||
359 | <member name="M:HttpServer.ComponentProvider.Add``2"> | ||
360 | <summary> | ||
361 | Add a component. | ||
362 | </summary> | ||
363 | <typeparam name="InterfaceType">Type being requested.</typeparam> | ||
364 | <typeparam name="InstanceType">Type being created.</typeparam> | ||
365 | <exception cref="T:System.InvalidOperationException">Type have already been mapped.</exception> | ||
366 | </member> | ||
367 | <member name="T:HttpServer.ContentType"> | ||
368 | <summary> | ||
369 | Lists content type mime types. | ||
370 | </summary> | ||
371 | </member> | ||
372 | <member name="F:HttpServer.ContentType.Text"> | ||
373 | <summary> | ||
374 | text/plain | ||
375 | </summary> | ||
376 | </member> | ||
377 | <member name="F:HttpServer.ContentType.Html"> | ||
378 | <summary> | ||
379 | text/haml | ||
380 | </summary> | ||
381 | </member> | ||
382 | <member name="F:HttpServer.ContentType.Javascript"> | ||
383 | <summary> | ||
384 | content type for javascript documents = application/javascript | ||
385 | </summary> | ||
386 | <remarks> | ||
387 | <para> | ||
388 | RFC 4329 states that text/javascript have been superseeded by | ||
389 | application/javascript. You might still want to check browser versions | ||
390 | since older ones do not support application/javascript. | ||
391 | </para> | ||
392 | <para>Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/</para> | ||
393 | </remarks> | ||
394 | </member> | ||
395 | <member name="F:HttpServer.ContentType.Xml"> | ||
396 | <summary> | ||
397 | text/xml | ||
398 | </summary> | ||
399 | </member> | ||
400 | <member name="T:HttpServer.ContentTypes"> | ||
401 | <summary> | ||
402 | A list of content types | ||
403 | </summary> | ||
404 | </member> | ||
405 | <member name="M:HttpServer.ContentTypes.#ctor(System.String)"> | ||
406 | <summary> | ||
407 | |||
408 | </summary> | ||
409 | <param name="types">Semicolon separated content types.</param> | ||
410 | </member> | ||
411 | <member name="P:HttpServer.ContentTypes.First"> | ||
412 | <summary> | ||
413 | Get this first content type. | ||
414 | </summary> | ||
415 | </member> | ||
416 | <member name="P:HttpServer.ContentTypes.Item(System.String)"> | ||
417 | <summary> | ||
418 | Fetch a content type | ||
419 | </summary> | ||
420 | <param name="type">Part of type ("xml" would return "application/xml")</param> | ||
421 | <returns></returns> | ||
422 | <remarks>All content types are in lower case.</remarks> | ||
423 | </member> | ||
424 | <member name="M:HttpServer.ContentTypes.GetEnumerator"> | ||
425 | <summary> | ||
426 | Returns an enumerator that iterates through a collection. | ||
427 | </summary> | ||
428 | <returns> | ||
429 | An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection. | ||
430 | </returns> | ||
431 | </member> | ||
432 | <member name="M:HttpServer.ContentTypes.Contains(System.String)"> | ||
433 | <summary> | ||
434 | Searches for the specified type | ||
435 | </summary> | ||
436 | <param name="type">Can also be a part of a type (searching for "xml" would return true for "application/xml").</param> | ||
437 | <returns>true if type was found.</returns> | ||
438 | </member> | ||
439 | <member name="T:HttpServer.ContextTimeoutManager"> | ||
440 | <summary> | ||
441 | Timeout Manager. Checks for dead clients. Clients with open connections that are not doing anything. Closes sessions opened with keepalive. | ||
442 | </summary> | ||
443 | </member> | ||
444 | <member name="T:HttpServer.ContextTimeoutManager.MonitorType"> | ||
445 | <summary> | ||
446 | Use a Thread or a Timer to monitor the ugly | ||
447 | </summary> | ||
448 | </member> | ||
449 | <member name="M:HttpServer.ContextTimeoutManager.ProcessContextTimeouts"> | ||
450 | <summary> | ||
451 | Causes the watcher to immediately check the connections. | ||
452 | </summary> | ||
453 | </member> | ||
454 | <member name="M:HttpServer.ContextTimeoutManager.EnvironmentTickCount"> | ||
455 | <summary> | ||
456 | Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
457 | and negative every 24.9 days. This trims down TickCount so it doesn't wrap | ||
458 | for the callers. | ||
459 | This trims it to a 12 day interval so don't let your frame time get too long. | ||
460 | </summary> | ||
461 | <returns></returns> | ||
462 | </member> | ||
463 | <member name="M:HttpServer.ContextTimeoutManager.EnvironmentTickCountSubtract(System.Int32,System.Int32)"> | ||
464 | <summary> | ||
465 | Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
466 | and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
467 | 'EnvironmentTickCount()') and accounts for any wrapping. | ||
468 | </summary> | ||
469 | <param name="newValue"></param> | ||
470 | <param name="prevValue"></param> | ||
471 | <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
472 | </member> | ||
473 | <member name="M:HttpServer.ContextTimeoutManager.EnvironmentTickCountAdd(System.Int32,System.Int32)"> | ||
474 | <summary> | ||
475 | Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
476 | and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
477 | 'EnvironmentTickCount()') and accounts for any wrapping. | ||
478 | </summary> | ||
479 | <param name="newValue"></param> | ||
480 | <param name="prevValue"></param> | ||
481 | <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
482 | </member> | ||
483 | <member name="M:HttpServer.ContextTimeoutManager.EnvironmentTickCountSubtract(System.Int32)"> | ||
484 | <summary> | ||
485 | Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
486 | and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
487 | 'EnvironmentTickCount()') and accounts for any wrapping. | ||
488 | </summary> | ||
489 | <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
490 | </member> | ||
491 | <member name="T:HttpServer.ExceptionHandler"> | ||
492 | <summary> | ||
493 | We dont want to let the server to die due to exceptions thrown in worker threads. | ||
494 | therefore we use this delegate to give you a change to handle uncaught exceptions. | ||
495 | </summary> | ||
496 | <param name="source">Class that the exception was thrown in.</param> | ||
497 | <param name="exception">Exception</param> | ||
498 | <remarks> | ||
499 | Server will throw a InternalServerException in release version if you dont | ||
500 | handle this delegate. | ||
501 | </remarks> | ||
502 | </member> | ||
503 | <member name="T:HttpServer.Exceptions.BadRequestException"> | ||
504 | <summary> | ||
505 | The request could not be understood by the server due to malformed syntax. | ||
506 | The client SHOULD NOT repeat the request without modifications. | ||
507 | |||
508 | Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php | ||
509 | </summary> | ||
510 | </member> | ||
511 | <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String)"> | ||
512 | <summary> | ||
513 | Create a new bad request exception. | ||
514 | </summary> | ||
515 | <param name="errMsg">reason to why the request was bad.</param> | ||
516 | </member> | ||
517 | <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String,System.Exception)"> | ||
518 | <summary> | ||
519 | Create a new bad request exception. | ||
520 | </summary> | ||
521 | <param name="errMsg">reason to why the request was bad.</param> | ||
522 | <param name="inner">inner exception</param> | ||
523 | </member> | ||
524 | <member name="T:HttpServer.Exceptions.ForbiddenException"> | ||
525 | <summary> | ||
526 | The server understood the request, but is refusing to fulfill it. | ||
527 | Authorization will not help and the request SHOULD NOT be repeated. | ||
528 | If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, | ||
529 | it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information | ||
530 | available to the client, the status code 404 (Not Found) can be used instead. | ||
531 | |||
532 | Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php | ||
533 | </summary> | ||
534 | </member> | ||
535 | <member name="M:HttpServer.Exceptions.ForbiddenException.#ctor(System.String)"> | ||
536 | <summary> | ||
537 | Initializes a new instance of the <see cref="T:HttpServer.Exceptions.ForbiddenException"/> class. | ||
538 | </summary> | ||
539 | <param name="errorMsg">error message</param> | ||
540 | </member> | ||
541 | <member name="T:HttpServer.Exceptions.HttpException"> | ||
542 | <summary> | ||
543 | All HTTP based exceptions will derive this class. | ||
544 | </summary> | ||
545 | </member> | ||
546 | <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String)"> | ||
547 | <summary> | ||
548 | Create a new HttpException | ||
549 | </summary> | ||
550 | <param name="code">http status code (sent in the response)</param> | ||
551 | <param name="message">error description</param> | ||
552 | </member> | ||
553 | <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String,System.Exception)"> | ||
554 | <summary> | ||
555 | Create a new HttpException | ||
556 | </summary> | ||
557 | <param name="code">http status code (sent in the response)</param> | ||
558 | <param name="message">error description</param> | ||
559 | <param name="inner">inner exception</param> | ||
560 | </member> | ||
561 | <member name="P:HttpServer.Exceptions.HttpException.HttpStatusCode"> | ||
562 | <summary> | ||
563 | status code to use in the response. | ||
564 | </summary> | ||
565 | </member> | ||
566 | <member name="T:HttpServer.Exceptions.InternalServerException"> | ||
567 | <summary> | ||
568 | The server encountered an unexpected condition which prevented it from fulfilling the request. | ||
569 | </summary> | ||
570 | </member> | ||
571 | <member name="M:HttpServer.Exceptions.InternalServerException.#ctor"> | ||
572 | <summary> | ||
573 | Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. | ||
574 | </summary> | ||
575 | </member> | ||
576 | <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String)"> | ||
577 | <summary> | ||
578 | Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. | ||
579 | </summary> | ||
580 | <param name="message">error message.</param> | ||
581 | </member> | ||
582 | <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String,System.Exception)"> | ||
583 | <summary> | ||
584 | Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. | ||
585 | </summary> | ||
586 | <param name="message">error message.</param> | ||
587 | <param name="inner">inner exception.</param> | ||
588 | </member> | ||
589 | <member name="T:HttpServer.Exceptions.NotFoundException"> | ||
590 | <summary> | ||
591 | The requested resource was not found in the web server. | ||
592 | </summary> | ||
593 | </member> | ||
594 | <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String,System.Exception)"> | ||
595 | <summary> | ||
596 | Create a new exception | ||
597 | </summary> | ||
598 | <param name="message">message describing the error</param> | ||
599 | <param name="inner">inner exception</param> | ||
600 | </member> | ||
601 | <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String)"> | ||
602 | <summary> | ||
603 | Create a new exception | ||
604 | </summary> | ||
605 | <param name="message">message describing the error</param> | ||
606 | </member> | ||
607 | <member name="T:HttpServer.Exceptions.UnauthorizedException"> | ||
608 | <summary> | ||
609 | The request requires user authentication. The response MUST include a | ||
610 | WWW-Authenticate header field (section 14.47) containing a challenge | ||
611 | applicable to the requested resource. | ||
612 | |||
613 | The client MAY repeat the request with a suitable Authorization header | ||
614 | field (section 14.8). If the request already included Authorization | ||
615 | credentials, then the 401 response indicates that authorization has been | ||
616 | refused for those credentials. If the 401 response contains the same challenge | ||
617 | as the prior response, and the user agent has already attempted authentication | ||
618 | at least once, then the user SHOULD be presented the entity that was given in the response, | ||
619 | since that entity might include relevant diagnostic information. | ||
620 | |||
621 | HTTP access authentication is explained in rfc2617: | ||
622 | http://www.ietf.org/rfc/rfc2617.txt | ||
623 | |||
624 | (description is taken from | ||
625 | http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) | ||
626 | </summary> | ||
627 | </member> | ||
628 | <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor"> | ||
629 | <summary> | ||
630 | Create a new unauhtorized exception. | ||
631 | </summary> | ||
632 | <seealso cref="T:HttpServer.Exceptions.UnauthorizedException"/> | ||
633 | </member> | ||
634 | <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String,System.Exception)"> | ||
635 | <summary> | ||
636 | Create a new unauhtorized exception. | ||
637 | </summary> | ||
638 | <param name="message">reason to why the request was unauthorized.</param> | ||
639 | <param name="inner">inner exception</param> | ||
640 | </member> | ||
641 | <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String)"> | ||
642 | <summary> | ||
643 | Create a new unauhtorized exception. | ||
644 | </summary> | ||
645 | <param name="message">reason to why the request was unauthorized.</param> | ||
646 | </member> | ||
647 | <member name="T:HttpServer.FormDecoders.FormDecoderProvider"> | ||
648 | <summary> | ||
649 | This provider is used to let us implement any type of form decoding we want without | ||
650 | having to rewrite anything else in the server. | ||
651 | </summary> | ||
652 | </member> | ||
653 | <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Decode(System.String,System.IO.Stream,System.Text.Encoding)"> | ||
654 | <summary> | ||
655 | |||
656 | </summary> | ||
657 | <param name="contentType">Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959</param> | ||
658 | <param name="stream">Stream containing form data.</param> | ||
659 | <param name="encoding">Encoding used when decoding the stream</param> | ||
660 | <returns><see cref="F:HttpServer.HttpInput.Empty"/> if no parser was found.</returns> | ||
661 | <exception cref="T:System.ArgumentException">If stream is null or not readable.</exception> | ||
662 | <exception cref="T:System.IO.InvalidDataException">If stream contents cannot be decoded properly.</exception> | ||
663 | </member> | ||
664 | <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Add(HttpServer.FormDecoders.IFormDecoder)"> | ||
665 | <summary> | ||
666 | Add a decoder. | ||
667 | </summary> | ||
668 | <param name="decoder"></param> | ||
669 | <exception cref="T:System.ArgumentNullException"></exception> | ||
670 | </member> | ||
671 | <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Count"> | ||
672 | <summary> | ||
673 | Number of added decoders. | ||
674 | </summary> | ||
675 | </member> | ||
676 | <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Decoders"> | ||
677 | <summary> | ||
678 | Use with care. | ||
679 | </summary> | ||
680 | </member> | ||
681 | <member name="P:HttpServer.FormDecoders.FormDecoderProvider.DefaultDecoder"> | ||
682 | <summary> | ||
683 | Decoder used for unknown content types. | ||
684 | </summary> | ||
685 | </member> | ||
686 | <member name="T:HttpServer.FormDecoders.HttpMultipart.Element"> | ||
687 | <summary>Represents a field in a multipart form</summary> | ||
688 | </member> | ||
689 | <member name="M:HttpServer.FormDecoders.HttpMultipart.ReadLine"> | ||
690 | <summary> | ||
691 | |||
692 | </summary> | ||
693 | <returns></returns> | ||
694 | <exception cref="T:System.ArgumentOutOfRangeException"></exception> | ||
695 | <exception cref="T:System.ObjectDisposedException"></exception> | ||
696 | </member> | ||
697 | <member name="T:HttpServer.FormDecoders.IFormDecoder"> | ||
698 | <summary> | ||
699 | Interface for form content decoders. | ||
700 | </summary> | ||
701 | </member> | ||
702 | <member name="M:HttpServer.FormDecoders.IFormDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> | ||
703 | <summary> | ||
704 | |||
705 | </summary> | ||
706 | <param name="stream">Stream containing the content</param> | ||
707 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> | ||
708 | <param name="encoding">Stream enconding</param> | ||
709 | <returns>A http form, or null if content could not be parsed.</returns> | ||
710 | <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> | ||
711 | </member> | ||
712 | <member name="M:HttpServer.FormDecoders.IFormDecoder.CanParse(System.String)"> | ||
713 | <summary> | ||
714 | Checks if the decoder can handle the mime type | ||
715 | </summary> | ||
716 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> | ||
717 | <returns>True if the decoder can parse the specified content type</returns> | ||
718 | </member> | ||
719 | <member name="T:HttpServer.FormDecoders.MultipartDecoder"> | ||
720 | <summary> | ||
721 | |||
722 | </summary> | ||
723 | <remarks> | ||
724 | http://www.faqs.org/rfcs/rfc1867.html | ||
725 | </remarks> | ||
726 | </member> | ||
727 | <member name="F:HttpServer.FormDecoders.MultipartDecoder.MimeType"> | ||
728 | <summary> | ||
729 | multipart/form-data | ||
730 | </summary> | ||
731 | </member> | ||
732 | <member name="F:HttpServer.FormDecoders.MultipartDecoder.FormData"> | ||
733 | <summary> | ||
734 | form-data | ||
735 | </summary> | ||
736 | </member> | ||
737 | <member name="M:HttpServer.FormDecoders.MultipartDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> | ||
738 | <summary> | ||
739 | |||
740 | </summary> | ||
741 | <param name="stream">Stream containing the content</param> | ||
742 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> | ||
743 | <param name="encoding">Stream enconding</param> | ||
744 | <returns>A http form, or null if content could not be parsed.</returns> | ||
745 | <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> | ||
746 | <exception cref="T:System.ArgumentNullException">If any parameter is null</exception> | ||
747 | </member> | ||
748 | <member name="M:HttpServer.FormDecoders.MultipartDecoder.CanParse(System.String)"> | ||
749 | <summary> | ||
750 | Checks if the decoder can handle the mime type | ||
751 | </summary> | ||
752 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> | ||
753 | <returns>True if the decoder can parse the specified content type</returns> | ||
754 | </member> | ||
755 | <member name="T:HttpServer.FormDecoders.UrlDecoder"> | ||
756 | <summary> | ||
757 | Can handle application/x-www-form-urlencoded | ||
758 | </summary> | ||
759 | </member> | ||
760 | <member name="M:HttpServer.FormDecoders.UrlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> | ||
761 | <summary> | ||
762 | </summary> | ||
763 | <param name="stream">Stream containing the content</param> | ||
764 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> | ||
765 | <param name="encoding">Stream encoding</param> | ||
766 | <returns> | ||
767 | A HTTP form, or null if content could not be parsed. | ||
768 | </returns> | ||
769 | <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> | ||
770 | </member> | ||
771 | <member name="M:HttpServer.FormDecoders.UrlDecoder.CanParse(System.String)"> | ||
772 | <summary> | ||
773 | Checks if the decoder can handle the mime type | ||
774 | </summary> | ||
775 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> | ||
776 | <returns>True if the decoder can parse the specified content type</returns> | ||
777 | </member> | ||
778 | <member name="T:HttpServer.FormDecoders.XmlDecoder"> | ||
779 | <summary> | ||
780 | This decoder converts XML documents to form items. | ||
781 | Each element becomes a subitem in the form, and each attribute becomes an item. | ||
782 | </summary> | ||
783 | <example> | ||
784 | // xml: <hello id="1">something<world id="2">data</world></hello> | ||
785 | // result: | ||
786 | // form["hello"].Value = "something" | ||
787 | // form["hello"]["id"].Value = 1 | ||
788 | // form["hello"]["world]["id"].Value = 1 | ||
789 | // form["hello"]["world"].Value = "data" | ||
790 | </example> | ||
791 | <remarks> | ||
792 | The original xml document is stored in form["__xml__"].Value. | ||
793 | </remarks> | ||
794 | </member> | ||
795 | <member name="M:HttpServer.FormDecoders.XmlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> | ||
796 | <summary> | ||
797 | |||
798 | </summary> | ||
799 | <param name="stream">Stream containing the content</param> | ||
800 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> | ||
801 | <param name="encoding">Stream encoding</param> | ||
802 | Note: contentType and encoding are not used? | ||
803 | <returns>A http form, or null if content could not be parsed.</returns> | ||
804 | <exception cref="T:System.IO.InvalidDataException"></exception> | ||
805 | </member> | ||
806 | <member name="M:HttpServer.FormDecoders.XmlDecoder.TraverseNode(HttpServer.IHttpInput,System.Xml.XmlNode)"> | ||
807 | <summary> | ||
808 | Recursive function that will go through an xml element and store it's content | ||
809 | to the form item. | ||
810 | </summary> | ||
811 | <param name="item">(parent) Item in form that content should be added to.</param> | ||
812 | <param name="node">Node that should be parsed.</param> | ||
813 | </member> | ||
814 | <member name="M:HttpServer.FormDecoders.XmlDecoder.CanParse(System.String)"> | ||
815 | <summary> | ||
816 | Checks if the decoder can handle the mime type | ||
817 | </summary> | ||
818 | <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> | ||
819 | <returns>True if the decoder can parse the specified content type</returns> | ||
820 | </member> | ||
821 | <member name="T:HttpServer.Helpers.FormHelper"> | ||
822 | <summary> | ||
823 | Helpers making it easier to work with forms. | ||
824 | </summary> | ||
825 | <seealso cref="T:HttpServer.Helpers.ObjectForm"/> | ||
826 | </member> | ||
827 | <member name="F:HttpServer.Helpers.FormHelper.JSImplementation"> | ||
828 | <summary> | ||
829 | Used to let the website use different JavaScript libraries. | ||
830 | Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> | ||
831 | </summary> | ||
832 | </member> | ||
833 | <member name="M:HttpServer.Helpers.FormHelper.Start(System.String,System.String,System.Boolean,System.String[])"> | ||
834 | <summary> | ||
835 | Create a <form> tag. | ||
836 | </summary> | ||
837 | <param name="id">name of form</param> | ||
838 | <param name="action">action to invoke on submit</param> | ||
839 | <param name="isAjax">form should be posted as Ajax</param> | ||
840 | <returns>HTML code</returns> | ||
841 | <example> | ||
842 | <code> | ||
843 | // without options | ||
844 | WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); | ||
845 | |||
846 | // with options | ||
847 | WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); | ||
848 | </code> | ||
849 | </example> | ||
850 | <param name="options">HTML attributes or JavaScript options.</param> | ||
851 | <remarks>Method will ALWAYS be POST.</remarks> | ||
852 | <exception cref="T:System.ArgumentException">options must consist of name, value, name, value</exception> | ||
853 | </member> | ||
854 | <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
855 | <summary> | ||
856 | Creates a select list with the values in a collection. | ||
857 | </summary> | ||
858 | <param name="name">Name of the SELECT-tag</param> | ||
859 | <param name="collection">collection used to generate options.</param> | ||
860 | <param name="getIdTitle">delegate used to return id and title from objects.</param> | ||
861 | <param name="selectedValue">value that should be marked as selected.</param> | ||
862 | <param name="firstEmpty">First row should contain an empty value.</param> | ||
863 | <returns>string containing a SELECT-tag.</returns> | ||
864 | <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> | ||
865 | </member> | ||
866 | <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
867 | <summary> | ||
868 | Creates a select list with the values in a collection. | ||
869 | </summary> | ||
870 | <param name="name">Name of the SELECT-tag</param> | ||
871 | <param name="id">Id of the SELECT-tag</param> | ||
872 | <param name="collection">collection used to generate options.</param> | ||
873 | <param name="getIdTitle">delegate used to return id and title from objects.</param> | ||
874 | <param name="selectedValue">value that should be marked as selected.</param> | ||
875 | <param name="firstEmpty">First row should contain an empty value.</param> | ||
876 | <returns>string containing a SELECT-tag.</returns> | ||
877 | <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> | ||
878 | <example> | ||
879 | <code> | ||
880 | // Class that is going to be used in a SELECT-tag. | ||
881 | public class User | ||
882 | { | ||
883 | private readonly string _realName; | ||
884 | private readonly int _id; | ||
885 | public User(int id, string realName) | ||
886 | { | ||
887 | _id = id; | ||
888 | _realName = realName; | ||
889 | } | ||
890 | public string RealName | ||
891 | { | ||
892 | get { return _realName; } | ||
893 | } | ||
894 | |||
895 | public int Id | ||
896 | { | ||
897 | get { return _id; } | ||
898 | } | ||
899 | } | ||
900 | |||
901 | // Using an inline delegate to generate the select list | ||
902 | public void UserInlineDelegate() | ||
903 | { | ||
904 | List<User> items = new List<User>(); | ||
905 | items.Add(new User(1, "adam")); | ||
906 | items.Add(new User(2, "bertial")); | ||
907 | items.Add(new User(3, "david")); | ||
908 | string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) | ||
909 | { | ||
910 | User user = (User)o; | ||
911 | id = user.Id; | ||
912 | value = user.RealName; | ||
913 | }, 2, true); | ||
914 | } | ||
915 | |||
916 | // Using an method as delegate to generate the select list. | ||
917 | public void UseExternalDelegate() | ||
918 | { | ||
919 | List<User> items = new List<User>(); | ||
920 | items.Add(new User(1, "adam")); | ||
921 | items.Add(new User(2, "bertial")); | ||
922 | items.Add(new User(3, "david")); | ||
923 | string htmlSelect = Select("users", "users", items, UserOptions, 1, true); | ||
924 | } | ||
925 | |||
926 | // delegate returning id and title | ||
927 | public static void UserOptions(object o, out object id, out object title) | ||
928 | { | ||
929 | User user = (User)o; | ||
930 | id = user.Id; | ||
931 | value = user.RealName; | ||
932 | } | ||
933 | </code> | ||
934 | </example> | ||
935 | <exception cref="T:System.ArgumentNullException"><c>name</c>, <c>id</c>, <c>collection</c> or <c>getIdTitle</c> is null.</exception> | ||
936 | </member> | ||
937 | <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean,System.String[])"> | ||
938 | <summary> | ||
939 | Creates a select list with the values in a collection. | ||
940 | </summary> | ||
941 | <param name="name">Name of the SELECT-tag</param> | ||
942 | <param name="id">Id of the SELECT-tag</param> | ||
943 | <param name="collection">collection used to generate options.</param> | ||
944 | <param name="getIdTitle">delegate used to return id and title from objects.</param> | ||
945 | <param name="selectedValue">value that should be marked as selected.</param> | ||
946 | <param name="firstEmpty">First row should contain an empty value.</param> | ||
947 | <param name="htmlAttributes">name, value collection of extra HTML attributes.</param> | ||
948 | <returns>string containing a SELECT-tag.</returns> | ||
949 | <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> | ||
950 | <exception cref="T:System.ArgumentNullException"><c>name</c>, <c>id</c>, <c>collection</c> or <c>getIdTitle</c> is null.</exception> | ||
951 | <exception cref="T:System.ArgumentException">Invalid HTML attribute list.</exception> | ||
952 | </member> | ||
953 | <member name="M:HttpServer.Helpers.FormHelper.Options(System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
954 | <summary> | ||
955 | Generate a list of HTML options | ||
956 | </summary> | ||
957 | <param name="collection">collection used to generate options.</param> | ||
958 | <param name="getIdTitle">delegate used to return id and title from objects.</param> | ||
959 | <param name="selectedValue">value that should be marked as selected.</param> | ||
960 | <param name="firstEmpty">First row should contain an empty value.</param> | ||
961 | <returns></returns> | ||
962 | <exception cref="T:System.ArgumentNullException"><c>collection</c> or <c>getIdTitle</c> is null.</exception> | ||
963 | </member> | ||
964 | <member name="M:HttpServer.Helpers.FormHelper.Options(System.Text.StringBuilder,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
965 | <exception cref="T:System.ArgumentNullException"><c>sb</c> is null.</exception> | ||
966 | </member> | ||
967 | <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.Object,System.Object,System.String[])"> | ||
968 | <summary> | ||
969 | Creates a check box. | ||
970 | </summary> | ||
971 | <param name="name">element name</param> | ||
972 | <param name="value">element value</param> | ||
973 | <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the | ||
974 | type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if | ||
975 | the box is checked or not. </param> | ||
976 | <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> | ||
977 | <returns>a generated radio button</returns> | ||
978 | </member> | ||
979 | <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.Object,System.String[])"> | ||
980 | <summary> | ||
981 | Creates a check box. | ||
982 | </summary> | ||
983 | <param name="name">element name</param> | ||
984 | <param name="id">element id</param> | ||
985 | <param name="value">element value</param> | ||
986 | <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the | ||
987 | type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if | ||
988 | the box is checked or not. </param> | ||
989 | <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> | ||
990 | <returns>a generated radio button</returns> | ||
991 | <remarks> | ||
992 | value in your business object. (check box will be selected if it matches the element value) | ||
993 | </remarks> | ||
994 | </member> | ||
995 | <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.String[])"> | ||
996 | <summary> | ||
997 | Creates a check box. | ||
998 | </summary> | ||
999 | <param name="name">element name</param> | ||
1000 | <param name="id">element id</param> | ||
1001 | <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the | ||
1002 | type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if | ||
1003 | the box is checked or not. </param> | ||
1004 | <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> | ||
1005 | <returns>a generated radio button</returns> | ||
1006 | <remarks>will set value to "1".</remarks> | ||
1007 | </member> | ||
1008 | <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.Object,System.Object,System.String[])"> | ||
1009 | <summary> | ||
1010 | Creates a RadioButton. | ||
1011 | </summary> | ||
1012 | <param name="name">element name</param> | ||
1013 | <param name="value">element value</param> | ||
1014 | <param name="isSelected">determines if the radio button is selected or not. This is done differently depending on the | ||
1015 | type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if | ||
1016 | the box is checked or not. </param> | ||
1017 | <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> | ||
1018 | <returns>a generated radio button</returns> | ||
1019 | </member> | ||
1020 | <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.String,System.Object,System.Object,System.String[])"> | ||
1021 | <summary> | ||
1022 | Creates a RadioButton. | ||
1023 | </summary> | ||
1024 | <param name="name">element name</param> | ||
1025 | <param name="id">element id</param> | ||
1026 | <param name="value">element value</param> | ||
1027 | <param name="isSelected">determines if the radio button is selected or not. This is done differently depending on the | ||
1028 | type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if | ||
1029 | the box is checked or not. </param> | ||
1030 | <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> | ||
1031 | <returns>a generated radio button</returns> | ||
1032 | </member> | ||
1033 | <member name="M:HttpServer.Helpers.FormHelper.End"> | ||
1034 | <summary> | ||
1035 | form close tag | ||
1036 | </summary> | ||
1037 | <returns></returns> | ||
1038 | </member> | ||
1039 | <member name="T:HttpServer.Helpers.GetIdTitle"> | ||
1040 | <summary> | ||
1041 | Delegate used by <see cref="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"/> to populate select options. | ||
1042 | </summary> | ||
1043 | <param name="obj">current object (for instance a User).</param> | ||
1044 | <param name="id">Text that should be displayed in the value part of a <optiongt;-tag.</param> | ||
1045 | <param name="title">Text shown in the select list.</param> | ||
1046 | <example> | ||
1047 | // Class that is going to be used in a SELECT-tag. | ||
1048 | public class User | ||
1049 | { | ||
1050 | private readonly string _realName; | ||
1051 | private readonly int _id; | ||
1052 | public User(int id, string realName) | ||
1053 | { | ||
1054 | _id = id; | ||
1055 | _realName = realName; | ||
1056 | } | ||
1057 | public string RealName | ||
1058 | { | ||
1059 | get { return _realName; } | ||
1060 | } | ||
1061 | |||
1062 | public int Id | ||
1063 | { | ||
1064 | get { return _id; } | ||
1065 | } | ||
1066 | } | ||
1067 | |||
1068 | // Using an inline delegate to generate the select list | ||
1069 | public void UserInlineDelegate() | ||
1070 | { | ||
1071 | List<User> items = new List<User>(); | ||
1072 | items.Add(new User(1, "adam")); | ||
1073 | items.Add(new User(2, "bertial")); | ||
1074 | items.Add(new User(3, "david")); | ||
1075 | string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) | ||
1076 | { | ||
1077 | User user = (User)o; | ||
1078 | id = user.Id; | ||
1079 | value = user.RealName; | ||
1080 | }, 2, true); | ||
1081 | } | ||
1082 | |||
1083 | // Using an method as delegate to generate the select list. | ||
1084 | public void UseExternalDelegate() | ||
1085 | { | ||
1086 | List<User> items = new List<User>(); | ||
1087 | items.Add(new User(1, "adam")); | ||
1088 | items.Add(new User(2, "bertial")); | ||
1089 | items.Add(new User(3, "david")); | ||
1090 | string htmlSelect = Select("users", "users", items, UserOptions, 1, true); | ||
1091 | } | ||
1092 | |||
1093 | // delegate returning id and title | ||
1094 | public static void UserOptions(object o, out object id, out object title) | ||
1095 | { | ||
1096 | User user = (User)o; | ||
1097 | id = user.Id; | ||
1098 | value = user.RealName; | ||
1099 | } /// </example> | ||
1100 | </member> | ||
1101 | <member name="T:HttpServer.Helpers.Implementations.PrototypeImp"> | ||
1102 | <summary> | ||
1103 | PrototypeJS implementation of the javascript functions. | ||
1104 | </summary> | ||
1105 | </member> | ||
1106 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxRequest(System.String,System.String[])"> | ||
1107 | <summary> | ||
1108 | Requests a url through ajax | ||
1109 | </summary> | ||
1110 | <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> | ||
1111 | <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> | ||
1112 | <returns>a link tag</returns> | ||
1113 | <remarks>onclick attribute is used by this method.</remarks> | ||
1114 | <example> | ||
1115 | <code> | ||
1116 | // plain text | ||
1117 | JSHelper.AjaxRequest("'/user/show/1'"); | ||
1118 | |||
1119 | // ajax request using this.href | ||
1120 | string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; | ||
1121 | </code> | ||
1122 | </example> | ||
1123 | </member> | ||
1124 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.Contains(System.Collections.Generic.IEnumerable{System.String},System.String)"> | ||
1125 | <summary> | ||
1126 | Determins if a list of strings contains a specific value | ||
1127 | </summary> | ||
1128 | <param name="options">options to check in</param> | ||
1129 | <param name="value">value to find</param> | ||
1130 | <returns>true if value was found</returns> | ||
1131 | <remarks>case insensitive</remarks> | ||
1132 | </member> | ||
1133 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxUpdater(System.String,System.String,System.String[])"> | ||
1134 | <summary> | ||
1135 | Ajax requests that updates an element with | ||
1136 | the fetched content | ||
1137 | </summary> | ||
1138 | <param name="url">URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> | ||
1139 | <param name="targetId">element to update</param> | ||
1140 | <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> | ||
1141 | <returns>A link tag.</returns> | ||
1142 | <example> | ||
1143 | <code> | ||
1144 | JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); | ||
1145 | </code> | ||
1146 | </example> | ||
1147 | </member> | ||
1148 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])"> | ||
1149 | <summary> | ||
1150 | A link that pop ups a Dialog (overlay div) | ||
1151 | </summary> | ||
1152 | <param name="url">URL to contents of dialog</param> | ||
1153 | <param name="title">link title</param> | ||
1154 | <param name="htmlAttributes">name, value, name, value</param> | ||
1155 | <returns> | ||
1156 | A "a"-tag that popups a dialog when clicked | ||
1157 | </returns> | ||
1158 | <remarks><para>Requires Control.Modal found here: http://livepipe.net/projects/control_modal/</para> | ||
1159 | And the following JavaScript (load it in application.js): | ||
1160 | <code> | ||
1161 | Event.observe(window, 'load', | ||
1162 | function() { | ||
1163 | document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); | ||
1164 | } | ||
1165 | ); | ||
1166 | </code> | ||
1167 | </remarks> | ||
1168 | <example> | ||
1169 | WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); | ||
1170 | </example> | ||
1171 | </member> | ||
1172 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CreateDialog(System.String,System.String,System.String[])"> | ||
1173 | <summary> | ||
1174 | create a modal dialog (usually using DIVs) | ||
1175 | </summary> | ||
1176 | <param name="url">url to fetch</param> | ||
1177 | <param name="title">dialog title</param> | ||
1178 | <param name="options">javascript/html attributes. javascript options ends with colon ':'.</param> | ||
1179 | <returns></returns> | ||
1180 | </member> | ||
1181 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CloseDialog"> | ||
1182 | <summary> | ||
1183 | Close a javascript dialog window/div. | ||
1184 | </summary> | ||
1185 | <returns>javascript for closing a dialog.</returns> | ||
1186 | <see cref="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])" /> | ||
1187 | </member> | ||
1188 | <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxFormOnSubmit(System.String[])"> | ||
1189 | <summary> | ||
1190 | javascript action that should be added to the "onsubmit" event in the form tag. | ||
1191 | </summary> | ||
1192 | <param name="options">remember to encapsulate strings in ''</param> | ||
1193 | <returns></returns> | ||
1194 | <remarks>All javascript option names should end with colon.</remarks> | ||
1195 | <example> | ||
1196 | <code> | ||
1197 | JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); | ||
1198 | </code> | ||
1199 | </example> | ||
1200 | </member> | ||
1201 | <member name="T:HttpServer.Helpers.JSHelper"> | ||
1202 | <summary> | ||
1203 | Will contain helper functions for javascript. | ||
1204 | </summary> | ||
1205 | </member> | ||
1206 | <member name="M:HttpServer.Helpers.JSHelper.AjaxRequest(System.String,System.String[])"> | ||
1207 | <summary> | ||
1208 | Requests a url through ajax | ||
1209 | </summary> | ||
1210 | <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> | ||
1211 | <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> | ||
1212 | <returns>a link tag</returns> | ||
1213 | <remarks>onclick attribute is used by this method.</remarks> | ||
1214 | <example> | ||
1215 | <code> | ||
1216 | // plain text | ||
1217 | JSHelper.AjaxRequest("'/user/show/1'"); | ||
1218 | |||
1219 | // ajax request using this.href | ||
1220 | string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; | ||
1221 | </code> | ||
1222 | </example> | ||
1223 | </member> | ||
1224 | <member name="M:HttpServer.Helpers.JSHelper.AjaxUpdater(System.String,System.String,System.String[])"> | ||
1225 | <summary> | ||
1226 | Ajax requests that updates an element with | ||
1227 | the fetched content | ||
1228 | </summary> | ||
1229 | <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> | ||
1230 | <param name="targetId">element to update</param> | ||
1231 | <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> | ||
1232 | <returns>A link tag.</returns> | ||
1233 | <example> | ||
1234 | <code> | ||
1235 | JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); | ||
1236 | </code> | ||
1237 | </example> | ||
1238 | </member> | ||
1239 | <member name="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])"> | ||
1240 | <summary> | ||
1241 | Opens contents in a dialog window. | ||
1242 | </summary> | ||
1243 | <param name="url">url to contents of dialog</param> | ||
1244 | <param name="title">link title</param> | ||
1245 | <param name="options">name, value, name, value, all parameter names should end with colon.</param> | ||
1246 | </member> | ||
1247 | <member name="M:HttpServer.Helpers.JSHelper.CloseDialog"> | ||
1248 | <summary> | ||
1249 | Close a javascript dialog window/div. | ||
1250 | </summary> | ||
1251 | <returns>javascript for closing a dialog.</returns> | ||
1252 | <see cref="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])" /> | ||
1253 | </member> | ||
1254 | <member name="T:HttpServer.Helpers.ObjectForm"> | ||
1255 | <summary> | ||
1256 | The object form class takes an object and creates form items for it. | ||
1257 | </summary> | ||
1258 | </member> | ||
1259 | <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object,System.String)"> | ||
1260 | <summary> | ||
1261 | Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. | ||
1262 | </summary> | ||
1263 | <param name="method"></param> | ||
1264 | <param name="name">form name *and* id.</param> | ||
1265 | <param name="action">action to do when form is posted.</param> | ||
1266 | <param name="obj"></param> | ||
1267 | </member> | ||
1268 | <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object)"> | ||
1269 | <summary> | ||
1270 | Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. | ||
1271 | </summary> | ||
1272 | <param name="name">form name *and* id.</param> | ||
1273 | <param name="action">action to do when form is posted.</param> | ||
1274 | <param name="obj">object to get values from</param> | ||
1275 | </member> | ||
1276 | <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.Object)"> | ||
1277 | <summary> | ||
1278 | Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. | ||
1279 | </summary> | ||
1280 | <param name="action">form action.</param> | ||
1281 | <param name="obj">object to get values from.</param> | ||
1282 | </member> | ||
1283 | <member name="M:HttpServer.Helpers.ObjectForm.Begin"> | ||
1284 | <summary> | ||
1285 | write out the FORM-tag. | ||
1286 | </summary> | ||
1287 | <returns>generated html code</returns> | ||
1288 | </member> | ||
1289 | <member name="M:HttpServer.Helpers.ObjectForm.Begin(System.Boolean)"> | ||
1290 | <summary> | ||
1291 | Writeout the form tag | ||
1292 | </summary> | ||
1293 | <param name="isAjax">form should be posted through ajax.</param> | ||
1294 | <returns>generated html code</returns> | ||
1295 | </member> | ||
1296 | <member name="M:HttpServer.Helpers.ObjectForm.Tb(System.String,System.Object[])"> | ||
1297 | <summary> | ||
1298 | Generates a text box. | ||
1299 | </summary> | ||
1300 | <param name="propertyName"></param> | ||
1301 | <param name="options"></param> | ||
1302 | <returns>generated html code</returns> | ||
1303 | </member> | ||
1304 | <member name="M:HttpServer.Helpers.ObjectForm.Pb(System.String,System.Object[])"> | ||
1305 | <summary> | ||
1306 | password box | ||
1307 | </summary> | ||
1308 | <param name="propertyName"></param> | ||
1309 | <param name="options"></param> | ||
1310 | <returns>generated html code</returns> | ||
1311 | </member> | ||
1312 | <member name="M:HttpServer.Helpers.ObjectForm.Hidden(System.String,System.Object[])"> | ||
1313 | <summary> | ||
1314 | Hiddens the specified property name. | ||
1315 | </summary> | ||
1316 | <param name="propertyName">Name of the property.</param> | ||
1317 | <param name="options">The options.</param> | ||
1318 | <returns>generated html code</returns> | ||
1319 | </member> | ||
1320 | <member name="M:HttpServer.Helpers.ObjectForm.Label(System.String,System.String)"> | ||
1321 | <summary> | ||
1322 | Labels the specified property name. | ||
1323 | </summary> | ||
1324 | <param name="propertyName">property in object.</param> | ||
1325 | <param name="label">caption</param> | ||
1326 | <returns>generated html code</returns> | ||
1327 | </member> | ||
1328 | <member name="M:HttpServer.Helpers.ObjectForm.Cb(System.String,System.String,System.Object[])"> | ||
1329 | <summary> | ||
1330 | Generate a checkbox | ||
1331 | </summary> | ||
1332 | <param name="propertyName">property in object</param> | ||
1333 | <param name="value">checkbox value</param> | ||
1334 | <param name="options">additional html attributes.</param> | ||
1335 | <returns>generated html code</returns> | ||
1336 | </member> | ||
1337 | <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.String,System.String,System.Object[])"> | ||
1338 | <summary> | ||
1339 | Write a html select tag | ||
1340 | </summary> | ||
1341 | <param name="propertyName">object property.</param> | ||
1342 | <param name="idColumn">id column</param> | ||
1343 | <param name="titleColumn">The title column.</param> | ||
1344 | <param name="options">The options.</param> | ||
1345 | <returns></returns> | ||
1346 | </member> | ||
1347 | <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.Collections.IEnumerable,System.String,System.String,System.Object[])"> | ||
1348 | <summary> | ||
1349 | Selects the specified property name. | ||
1350 | </summary> | ||
1351 | <param name="propertyName">Name of the property.</param> | ||
1352 | <param name="items">The items.</param> | ||
1353 | <param name="idColumn">The id column.</param> | ||
1354 | <param name="titleColumn">The title column.</param> | ||
1355 | <param name="options">The options.</param> | ||
1356 | <returns></returns> | ||
1357 | </member> | ||
1358 | <member name="M:HttpServer.Helpers.ObjectForm.Submit(System.String)"> | ||
1359 | <summary> | ||
1360 | Write a submit tag. | ||
1361 | </summary> | ||
1362 | <param name="value">button caption</param> | ||
1363 | <returns>html submit tag</returns> | ||
1364 | </member> | ||
1365 | <member name="M:HttpServer.Helpers.ObjectForm.End"> | ||
1366 | <summary> | ||
1367 | html end form tag | ||
1368 | </summary> | ||
1369 | <returns>html</returns> | ||
1370 | </member> | ||
1371 | <member name="T:HttpServer.Helpers.ResourceInfo"> | ||
1372 | <summary> | ||
1373 | Container to bind resource names to assemblies | ||
1374 | </summary> | ||
1375 | </member> | ||
1376 | <member name="M:HttpServer.Helpers.ResourceInfo.#ctor(System.String,System.String,System.Reflection.Assembly)"> | ||
1377 | <summary> | ||
1378 | Instantiates an instance of <see cref="T:HttpServer.Helpers.ResourceInfo"/> | ||
1379 | </summary> | ||
1380 | <param name="uri">The dot seperated uri the resource maps to</param> | ||
1381 | <param name="resourceName">The full resource name</param> | ||
1382 | <param name="assembly">The assembly the resource exists in</param> | ||
1383 | </member> | ||
1384 | <member name="P:HttpServer.Helpers.ResourceInfo.Assembly"> | ||
1385 | <summary> | ||
1386 | Retrieves the assembly the resource resides in | ||
1387 | </summary> | ||
1388 | </member> | ||
1389 | <member name="P:HttpServer.Helpers.ResourceInfo.Uri"> | ||
1390 | <summary> | ||
1391 | Retrieves the full name/path of the assembly | ||
1392 | </summary> | ||
1393 | </member> | ||
1394 | <member name="P:HttpServer.Helpers.ResourceInfo.Extension"> | ||
1395 | <summary> | ||
1396 | Retrieves the extension of the resource | ||
1397 | </summary> | ||
1398 | </member> | ||
1399 | <member name="P:HttpServer.Helpers.ResourceInfo.ExtensionLessUri"> | ||
1400 | <summary>Returns the Uri without extension</summary> | ||
1401 | </member> | ||
1402 | <member name="P:HttpServer.Helpers.ResourceInfo.ResourceName"> | ||
1403 | <summary>Retrieves the full path name to the resource file</summary> | ||
1404 | </member> | ||
1405 | <member name="M:HttpServer.Helpers.ResourceInfo.GetStream"> | ||
1406 | <summary> | ||
1407 | Retrieves a stream to the resource | ||
1408 | </summary> | ||
1409 | <returns>Null if the resource couldn't be located somehow</returns> | ||
1410 | </member> | ||
1411 | <member name="T:HttpServer.Helpers.ResourceManager"> | ||
1412 | <summary>Class to handle loading of resource files</summary> | ||
1413 | </member> | ||
1414 | <member name="M:HttpServer.Helpers.ResourceManager.#ctor"> | ||
1415 | <summary> | ||
1416 | Initializes a new instance of the <see cref="T:HttpServer.Helpers.ResourceManager"/> class. | ||
1417 | </summary> | ||
1418 | </member> | ||
1419 | <member name="M:HttpServer.Helpers.ResourceManager.#ctor(HttpServer.ILogWriter)"> | ||
1420 | <summary> | ||
1421 | Initializes a new instance of the <see cref="T:HttpServer.Helpers.ResourceManager"/> class. | ||
1422 | </summary> | ||
1423 | <param name="writer">logger.</param> | ||
1424 | </member> | ||
1425 | <member name="M:HttpServer.Helpers.ResourceManager.LoadResources(System.String,System.Reflection.Assembly,System.String)"> | ||
1426 | <summary> | ||
1427 | Loads resources from a namespace in the given assembly to an URI | ||
1428 | </summary> | ||
1429 | <param name="toUri">The URI to map the resources to</param> | ||
1430 | <param name="fromAssembly">The assembly in which the resources reside</param> | ||
1431 | <param name="fromNamespace">The namespace from which to load the resources</param> | ||
1432 | <usage> | ||
1433 | <code> | ||
1434 | resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); | ||
1435 | </code> | ||
1436 | Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ | ||
1437 | </usage> | ||
1438 | <returns>The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded</returns> | ||
1439 | <exception cref="T:System.InvalidOperationException">If a resource has already been mapped to an uri</exception> | ||
1440 | </member> | ||
1441 | <member name="M:HttpServer.Helpers.ResourceManager.GetResourceStream(System.String)"> | ||
1442 | <summary> | ||
1443 | Retrieves a stream for the specified resource path if loaded otherwise null | ||
1444 | </summary> | ||
1445 | <param name="path">Path to the resource to retrieve a stream for</param> | ||
1446 | <returns>A stream or null if the resource couldn't be found</returns> | ||
1447 | </member> | ||
1448 | <member name="M:HttpServer.Helpers.ResourceManager.GetFiles(System.String)"> | ||
1449 | <summary> | ||
1450 | Fetch all files from the resource that matches the specified arguments. | ||
1451 | </summary> | ||
1452 | <param name="path">The path to the resource to extract</param> | ||
1453 | <returns> | ||
1454 | a list of files if found; or an empty array if no files are found. | ||
1455 | </returns> | ||
1456 | <exception cref="T:System.ArgumentException">Search path must end with an asterisk for finding arbitrary files</exception> | ||
1457 | </member> | ||
1458 | <member name="M:HttpServer.Helpers.ResourceManager.GetFiles(System.String,System.String)"> | ||
1459 | <summary> | ||
1460 | Fetch all files from the resource that matches the specified arguments. | ||
1461 | </summary> | ||
1462 | <param name="path">Where the file should reside.</param> | ||
1463 | <param name="filename">Files to check</param> | ||
1464 | <returns> | ||
1465 | a list of files if found; or an empty array if no files are found. | ||
1466 | </returns> | ||
1467 | </member> | ||
1468 | <member name="M:HttpServer.Helpers.ResourceManager.ContainsResource(System.String)"> | ||
1469 | <summary> | ||
1470 | Returns whether or not the loader has an instance of the file requested | ||
1471 | </summary> | ||
1472 | <param name="filename">The name of the template/file</param> | ||
1473 | <returns>True if the loader can provide the file</returns> | ||
1474 | </member> | ||
1475 | <member name="T:HttpServer.Helpers.WebHelper"> | ||
1476 | <summary> | ||
1477 | Webhelper provides helpers for common tasks in HTML. | ||
1478 | </summary> | ||
1479 | </member> | ||
1480 | <member name="F:HttpServer.Helpers.WebHelper.JSImplementation"> | ||
1481 | <summary> | ||
1482 | Used to let the website use different javascript libraries. | ||
1483 | Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> | ||
1484 | </summary> | ||
1485 | </member> | ||
1486 | <member name="M:HttpServer.Helpers.WebHelper.AjaxRequest(System.String,System.String,System.String[])"> | ||
1487 | <summary> | ||
1488 | Creates a link that invokes through ajax. | ||
1489 | </summary> | ||
1490 | <param name="url">url to fetch</param> | ||
1491 | <param name="title">link title</param> | ||
1492 | <param name="options"> | ||
1493 | optional options in format "key, value, key, value". | ||
1494 | Javascript options starts with ':'. | ||
1495 | </param> | ||
1496 | <returns>a link tag</returns> | ||
1497 | <example> | ||
1498 | WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); | ||
1499 | </example> | ||
1500 | </member> | ||
1501 | <member name="M:HttpServer.Helpers.WebHelper.AjaxUpdater(System.String,System.String,System.String,System.String[])"> | ||
1502 | <summary> | ||
1503 | Builds a link that updates an element with the fetched ajax content. | ||
1504 | </summary> | ||
1505 | <param name="url">Url to fetch content from</param> | ||
1506 | <param name="title">link title</param> | ||
1507 | <param name="targetId">html element to update with the results of the ajax request.</param> | ||
1508 | <param name="options">optional options in format "key, value, key, value"</param> | ||
1509 | <returns>A link tag.</returns> | ||
1510 | </member> | ||
1511 | <member name="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"> | ||
1512 | <summary> | ||
1513 | A link that pop ups a Dialog (overlay div) | ||
1514 | </summary> | ||
1515 | <param name="url">url to contents of dialog</param> | ||
1516 | <param name="title">link title</param> | ||
1517 | <param name="htmlAttributes">name/value of html attributes.</param> | ||
1518 | <returns>A "a"-tag that popups a dialog when clicked</returns> | ||
1519 | <example> | ||
1520 | WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); | ||
1521 | </example> | ||
1522 | </member> | ||
1523 | <member name="M:HttpServer.Helpers.WebHelper.CreateDialog(System.String,System.String,System.String[])"> | ||
1524 | <summary> | ||
1525 | Create/Open a dialog box using ajax | ||
1526 | </summary> | ||
1527 | <param name="url"></param> | ||
1528 | <param name="title"></param> | ||
1529 | <param name="parameters"></param> | ||
1530 | <returns></returns> | ||
1531 | </member> | ||
1532 | <member name="M:HttpServer.Helpers.WebHelper.CloseDialog"> | ||
1533 | <summary> | ||
1534 | Close a javascript dialog window/div. | ||
1535 | </summary> | ||
1536 | <returns>javascript for closing a dialog.</returns> | ||
1537 | <see cref="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"/> | ||
1538 | </member> | ||
1539 | <member name="M:HttpServer.Helpers.WebHelper.FormStart(System.String,System.String,System.Boolean)"> | ||
1540 | <summary> | ||
1541 | Create a <form> tag. | ||
1542 | </summary> | ||
1543 | <param name="name">name of form</param> | ||
1544 | <param name="action">action to invoke on submit</param> | ||
1545 | <param name="isAjax">form should be posted as ajax</param> | ||
1546 | <returns>html code</returns> | ||
1547 | <example> | ||
1548 | WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); | ||
1549 | </example> | ||
1550 | </member> | ||
1551 | <member name="M:HttpServer.Helpers.WebHelper.Link(System.String,System.String,System.String[])"> | ||
1552 | <summary> | ||
1553 | Create a link tag. | ||
1554 | </summary> | ||
1555 | <param name="url">url to go to</param> | ||
1556 | <param name="title">link title (text that is displayed)</param> | ||
1557 | <param name="htmlAttributes">html attributes, name, value, name, value</param> | ||
1558 | <returns>html code</returns> | ||
1559 | <example> | ||
1560 | WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); | ||
1561 | </example> | ||
1562 | </member> | ||
1563 | <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[])"> | ||
1564 | <summary> | ||
1565 | Build a link | ||
1566 | </summary> | ||
1567 | <param name="url">url to go to.</param> | ||
1568 | <param name="title">title of link (displayed text)</param> | ||
1569 | <param name="htmlAttributes">extra html attributes.</param> | ||
1570 | <returns>a complete link</returns> | ||
1571 | </member> | ||
1572 | <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[],System.String[])"> | ||
1573 | <summary> | ||
1574 | Build a link | ||
1575 | </summary> | ||
1576 | <param name="url">url to go to.</param> | ||
1577 | <param name="title">title of link (displayed text)</param> | ||
1578 | <param name="htmlAttributes">extra html attributes.</param> | ||
1579 | <returns>a complete link</returns> | ||
1580 | <param name="options">more options</param> | ||
1581 | </member> | ||
1582 | <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
1583 | <summary> | ||
1584 | Obsolete | ||
1585 | </summary> | ||
1586 | <param name="name">Obsolete</param> | ||
1587 | <param name="collection">Obsolete</param> | ||
1588 | <param name="getIdTitle">Obsolete</param> | ||
1589 | <param name="selectedValue">Obsolete</param> | ||
1590 | <param name="firstEmpty">Obsolete</param> | ||
1591 | <returns>Obsolete</returns> | ||
1592 | </member> | ||
1593 | <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> | ||
1594 | <summary> | ||
1595 | Obsolete | ||
1596 | </summary> | ||
1597 | <param name="name">Obsolete</param> | ||
1598 | <param name="id">Obsolete</param> | ||
1599 | <param name="collection">Obsolete</param> | ||
1600 | <param name="getIdTitle">Obsolete</param> | ||
1601 | <param name="selectedValue">Obsolete</param> | ||
1602 | <param name="firstEmpty">Obsolete</param> | ||
1603 | <returns>Obsolete</returns> | ||
1604 | </member> | ||
1605 | <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Generic.IEnumerable{System.Object},System.String)"> | ||
1606 | <summary> | ||
1607 | Render errors into a UL with class "errors" | ||
1608 | </summary> | ||
1609 | <param name="className">class used by UL-tag.</param> | ||
1610 | <param name="theList">items to list</param> | ||
1611 | <returns>an unordered html list.</returns> | ||
1612 | </member> | ||
1613 | <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Specialized.NameValueCollection,System.String)"> | ||
1614 | <summary> | ||
1615 | Render errors into a UL with class "errors" | ||
1616 | </summary> | ||
1617 | <param name="className">class used by UL-tag.</param> | ||
1618 | <param name="theList">items to list</param> | ||
1619 | <returns>an unordered html list.</returns> | ||
1620 | </member> | ||
1621 | <member name="M:HttpServer.Helpers.WebHelper.Errors(System.Collections.Specialized.NameValueCollection)"> | ||
1622 | <summary> | ||
1623 | Render errors into a UL with class "errors" | ||
1624 | </summary> | ||
1625 | <param name="errors"></param> | ||
1626 | <returns></returns> | ||
1627 | </member> | ||
1628 | <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[],System.String[])"> | ||
1629 | <summary> | ||
1630 | Generates a list with html attributes. | ||
1631 | </summary> | ||
1632 | <param name="sb">StringBuilder that the options should be added to.</param> | ||
1633 | <param name="firstOptions">attributes set by user.</param> | ||
1634 | <param name="secondOptions">attributes set by any of the helper classes.</param> | ||
1635 | </member> | ||
1636 | <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[])"> | ||
1637 | <summary> | ||
1638 | Generates a list with html attributes. | ||
1639 | </summary> | ||
1640 | <param name="sb">StringBuilder that the options should be added to.</param> | ||
1641 | <param name="options"></param> | ||
1642 | </member> | ||
1643 | <member name="T:HttpServer.Helpers.JavascriptHelperImplementation"> | ||
1644 | <summary> | ||
1645 | Purpose of this class is to create a javascript toolkit independent javascript helper. | ||
1646 | </summary> | ||
1647 | </member> | ||
1648 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.GenerateOptions(System.Text.StringBuilder,System.String[],System.Boolean)"> | ||
1649 | <summary> | ||
1650 | Generates a list with JS options. | ||
1651 | </summary> | ||
1652 | <param name="sb">StringBuilder that the options should be added to.</param> | ||
1653 | <param name="options">the javascript options. name, value pairs. each string value should be escaped by YOU!</param> | ||
1654 | <param name="startWithComma">true if we should start with a comma.</param> | ||
1655 | </member> | ||
1656 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.RemoveJavascriptOptions(System.String[])"> | ||
1657 | <summary> | ||
1658 | Removes any javascript parameters from an array of parameters | ||
1659 | </summary> | ||
1660 | <param name="options">The array of parameters to remove javascript params from</param> | ||
1661 | <returns>An array of html parameters</returns> | ||
1662 | </member> | ||
1663 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxFormOnSubmit(System.String[])"> | ||
1664 | <summary> | ||
1665 | javascript action that should be added to the "onsubmit" event in the form tag. | ||
1666 | </summary> | ||
1667 | <returns></returns> | ||
1668 | <remarks>All javascript option names should end with colon.</remarks> | ||
1669 | <example> | ||
1670 | <code> | ||
1671 | JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); | ||
1672 | </code> | ||
1673 | </example> | ||
1674 | </member> | ||
1675 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxRequest(System.String,System.String[])"> | ||
1676 | <summary> | ||
1677 | Requests a url through ajax | ||
1678 | </summary> | ||
1679 | <param name="url">url to fetch</param> | ||
1680 | <param name="options">optional options in format "key, value, key, value", used in JS request object.</param> | ||
1681 | <returns>a link tag</returns> | ||
1682 | <remarks>All javascript option names should end with colon.</remarks> | ||
1683 | <example> | ||
1684 | <code> | ||
1685 | JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); | ||
1686 | </code> | ||
1687 | </example> | ||
1688 | </member> | ||
1689 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxUpdater(System.String,System.String,System.String[])"> | ||
1690 | <summary> | ||
1691 | Ajax requests that updates an element with | ||
1692 | the fetched content | ||
1693 | </summary> | ||
1694 | <param name="url">Url to fetch content from</param> | ||
1695 | <param name="targetId">element to update</param> | ||
1696 | <param name="options">optional options in format "key, value, key, value", used in JS updater object.</param> | ||
1697 | <returns>A link tag.</returns> | ||
1698 | <remarks>All javascript option names should end with colon.</remarks> | ||
1699 | <example> | ||
1700 | <code> | ||
1701 | JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); | ||
1702 | </code> | ||
1703 | </example> | ||
1704 | </member> | ||
1705 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"> | ||
1706 | <summary> | ||
1707 | A link that pop ups a Dialog (overlay div) | ||
1708 | </summary> | ||
1709 | <param name="url">url to contents of dialog</param> | ||
1710 | <param name="title">link title</param> | ||
1711 | <returns>A "a"-tag that popups a dialog when clicked</returns> | ||
1712 | <param name="htmlAttributes">name/value of html attributes</param> | ||
1713 | <example> | ||
1714 | WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); | ||
1715 | </example> | ||
1716 | </member> | ||
1717 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CloseDialog"> | ||
1718 | <summary> | ||
1719 | Close a javascript dialog window/div. | ||
1720 | </summary> | ||
1721 | <returns>javascript for closing a dialog.</returns> | ||
1722 | <see cref="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"/> | ||
1723 | </member> | ||
1724 | <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CreateDialog(System.String,System.String,System.String[])"> | ||
1725 | <summary> | ||
1726 | Creates a new modal dialog window | ||
1727 | </summary> | ||
1728 | <param name="url">url to open in window.</param> | ||
1729 | <param name="title">window title (may not be supported by all js implementations)</param> | ||
1730 | <param name="options"></param> | ||
1731 | <returns></returns> | ||
1732 | </member> | ||
1733 | <member name="T:HttpServer.Helpers.XmlHelper"> | ||
1734 | <summary> | ||
1735 | Helpers to make XML handling easier | ||
1736 | </summary> | ||
1737 | </member> | ||
1738 | <member name="M:HttpServer.Helpers.XmlHelper.Serialize(System.Object)"> | ||
1739 | <summary> | ||
1740 | Serializes object to XML. | ||
1741 | </summary> | ||
1742 | <param name="value">object to serialize.</param> | ||
1743 | <returns>XML</returns> | ||
1744 | <remarks> | ||
1745 | Removes name spaces and adds indentation | ||
1746 | </remarks> | ||
1747 | </member> | ||
1748 | <member name="M:HttpServer.Helpers.XmlHelper.Deserialize``1(System.String)"> | ||
1749 | <summary> | ||
1750 | Create an object from a XML string | ||
1751 | </summary> | ||
1752 | <typeparam name="T">Type of object</typeparam> | ||
1753 | <param name="xml">XML string</param> | ||
1754 | <returns>object</returns> | ||
1755 | </member> | ||
1756 | <member name="T:HttpServer.HttpClientContext"> | ||
1757 | <summary> | ||
1758 | Contains a connection to a browser/client. | ||
1759 | </summary> | ||
1760 | <remarks> | ||
1761 | Remember to <see cref="M:HttpServer.HttpClientContext.Start"/> after you have hooked the <see cref="E:HttpServer.HttpClientContext.RequestReceived"/> event. | ||
1762 | </remarks> | ||
1763 | TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? | ||
1764 | </member> | ||
1765 | <member name="E:HttpServer.HttpClientContext.Cleaned"> | ||
1766 | <summary> | ||
1767 | This context have been cleaned, which means that it can be reused. | ||
1768 | </summary> | ||
1769 | </member> | ||
1770 | <member name="E:HttpServer.HttpClientContext.Started"> | ||
1771 | <summary> | ||
1772 | Context have been started (a new client have connected) | ||
1773 | </summary> | ||
1774 | </member> | ||
1775 | <member name="M:HttpServer.HttpClientContext.#ctor(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,HttpServer.IRequestParserFactory,System.Int32,System.Net.Sockets.Socket)"> | ||
1776 | <summary> | ||
1777 | Initializes a new instance of the <see cref="T:HttpServer.HttpClientContext"/> class. | ||
1778 | </summary> | ||
1779 | <param name="secured">true if the connection is secured (SSL/TLS)</param> | ||
1780 | <param name="remoteEndPoint">client that connected.</param> | ||
1781 | <param name="stream">Stream used for communication</param> | ||
1782 | <param name="parserFactory">Used to create a <see cref="T:HttpServer.IHttpRequestParser"/>.</param> | ||
1783 | <param name="bufferSize">Size of buffer to use when reading data. Must be at least 4096 bytes.</param> | ||
1784 | <exception cref="T:System.Net.Sockets.SocketException">If <see cref="M:System.Net.Sockets.Socket.BeginReceive(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)"/> fails</exception> | ||
1785 | <exception cref="T:System.ArgumentException">Stream must be writable and readable.</exception> | ||
1786 | </member> | ||
1787 | <member name="M:HttpServer.HttpClientContext.OnBodyBytesReceived(System.Object,HttpServer.Parser.BodyEventArgs)"> | ||
1788 | <summary> | ||
1789 | Process incoming body bytes. | ||
1790 | </summary> | ||
1791 | <param name="sender"><see cref="T:HttpServer.IHttpRequestParser"/></param> | ||
1792 | <param name="e">Bytes</param> | ||
1793 | </member> | ||
1794 | <member name="M:HttpServer.HttpClientContext.OnHeaderReceived(System.Object,HttpServer.Parser.HeaderEventArgs)"> | ||
1795 | <summary> | ||
1796 | |||
1797 | </summary> | ||
1798 | <param name="sender"></param> | ||
1799 | <param name="e"></param> | ||
1800 | </member> | ||
1801 | <member name="P:HttpServer.HttpClientContext.CurrentRequest"> | ||
1802 | <summary> | ||
1803 | Overload to specify own type. | ||
1804 | </summary> | ||
1805 | <remarks> | ||
1806 | Must be specified before the context is being used. | ||
1807 | </remarks> | ||
1808 | </member> | ||
1809 | <member name="M:HttpServer.HttpClientContext.Start"> | ||
1810 | <summary> | ||
1811 | Start reading content. | ||
1812 | </summary> | ||
1813 | <remarks> | ||
1814 | Make sure to call base.Start() if you override this method. | ||
1815 | </remarks> | ||
1816 | </member> | ||
1817 | <member name="M:HttpServer.HttpClientContext.Cleanup"> | ||
1818 | <summary> | ||
1819 | Clean up context. | ||
1820 | </summary> | ||
1821 | <remarks> | ||
1822 | Make sure to call base.Cleanup() if you override the method. | ||
1823 | </remarks> | ||
1824 | </member> | ||
1825 | <member name="P:HttpServer.HttpClientContext.Secured"> | ||
1826 | <summary> | ||
1827 | Using SSL or other encryption method. | ||
1828 | </summary> | ||
1829 | </member> | ||
1830 | <member name="P:HttpServer.HttpClientContext.IsSecured"> | ||
1831 | <summary> | ||
1832 | Using SSL or other encryption method. | ||
1833 | </summary> | ||
1834 | </member> | ||
1835 | <member name="P:HttpServer.HttpClientContext.LogWriter"> | ||
1836 | <summary> | ||
1837 | Specify which logger to use. | ||
1838 | </summary> | ||
1839 | </member> | ||
1840 | <member name="P:HttpServer.HttpClientContext.Stream"> | ||
1841 | <summary> | ||
1842 | Gets or sets the network stream. | ||
1843 | </summary> | ||
1844 | </member> | ||
1845 | <member name="P:HttpServer.HttpClientContext.RemoteAddress"> | ||
1846 | <summary> | ||
1847 | Gets or sets IP address that the client connected from. | ||
1848 | </summary> | ||
1849 | </member> | ||
1850 | <member name="P:HttpServer.HttpClientContext.RemotePort"> | ||
1851 | <summary> | ||
1852 | Gets or sets port that the client connected from. | ||
1853 | </summary> | ||
1854 | </member> | ||
1855 | <member name="M:HttpServer.HttpClientContext.Disconnect(System.Net.Sockets.SocketError)"> | ||
1856 | <summary> | ||
1857 | Disconnect from client | ||
1858 | </summary> | ||
1859 | <param name="error">error to report in the <see cref="E:HttpServer.HttpClientContext.Disconnected"/> event.</param> | ||
1860 | </member> | ||
1861 | <member name="M:HttpServer.HttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String,System.String)"> | ||
1862 | <summary> | ||
1863 | Send a response. | ||
1864 | </summary> | ||
1865 | <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> | ||
1866 | <param name="statusCode">HTTP status code</param> | ||
1867 | <param name="reason">reason for the status code.</param> | ||
1868 | <param name="body">HTML body contents, can be null or empty.</param> | ||
1869 | <param name="contentType">A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty</param> | ||
1870 | <exception cref="T:System.ArgumentException">If <paramref name="httpVersion"/> is invalid.</exception> | ||
1871 | </member> | ||
1872 | <member name="M:HttpServer.HttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String)"> | ||
1873 | <summary> | ||
1874 | Send a response. | ||
1875 | </summary> | ||
1876 | <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> | ||
1877 | <param name="statusCode">HTTP status code</param> | ||
1878 | <param name="reason">reason for the status code.</param> | ||
1879 | </member> | ||
1880 | <member name="M:HttpServer.HttpClientContext.Respond(System.String)"> | ||
1881 | <summary> | ||
1882 | Send a response. | ||
1883 | </summary> | ||
1884 | <exception cref="T:System.ArgumentNullException"></exception> | ||
1885 | </member> | ||
1886 | <member name="M:HttpServer.HttpClientContext.Send(System.Byte[])"> | ||
1887 | <summary> | ||
1888 | send a whole buffer | ||
1889 | </summary> | ||
1890 | <param name="buffer">buffer to send</param> | ||
1891 | <exception cref="T:System.ArgumentNullException"></exception> | ||
1892 | </member> | ||
1893 | <member name="M:HttpServer.HttpClientContext.Send(System.Byte[],System.Int32,System.Int32)"> | ||
1894 | <summary> | ||
1895 | Send data using the stream | ||
1896 | </summary> | ||
1897 | <param name="buffer">Contains data to send</param> | ||
1898 | <param name="offset">Start position in buffer</param> | ||
1899 | <param name="size">number of bytes to send</param> | ||
1900 | <exception cref="T:System.ArgumentNullException"></exception> | ||
1901 | <exception cref="T:System.ArgumentOutOfRangeException"></exception> | ||
1902 | </member> | ||
1903 | <member name="E:HttpServer.HttpClientContext.Disconnected"> | ||
1904 | <summary> | ||
1905 | The context have been disconnected. | ||
1906 | </summary> | ||
1907 | <remarks> | ||
1908 | Event can be used to clean up a context, or to reuse it. | ||
1909 | </remarks> | ||
1910 | </member> | ||
1911 | <member name="E:HttpServer.HttpClientContext.RequestReceived"> | ||
1912 | <summary> | ||
1913 | A request have been received in the context. | ||
1914 | </summary> | ||
1915 | </member> | ||
1916 | <member name="T:HttpServer.HttpContextFactory"> | ||
1917 | <summary> | ||
1918 | Used to create and reuse contexts. | ||
1919 | </summary> | ||
1920 | </member> | ||
1921 | <member name="M:HttpServer.HttpContextFactory.#ctor(HttpServer.ILogWriter,System.Int32,HttpServer.IRequestParserFactory)"> | ||
1922 | <summary> | ||
1923 | Initializes a new instance of the <see cref="T:HttpServer.HttpContextFactory"/> class. | ||
1924 | </summary> | ||
1925 | <param name="writer">The writer.</param> | ||
1926 | <param name="bufferSize">Amount of bytes to read from the incoming socket stream.</param> | ||
1927 | <param name="factory">Used to create a request parser.</param> | ||
1928 | </member> | ||
1929 | <member name="P:HttpServer.HttpContextFactory.UseTraceLogs"> | ||
1930 | <summary> | ||
1931 | True if detailed trace logs should be written. | ||
1932 | </summary> | ||
1933 | </member> | ||
1934 | <member name="M:HttpServer.HttpContextFactory.CreateContext(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,System.Net.Sockets.Socket)"> | ||
1935 | <summary> | ||
1936 | Create a new context. | ||
1937 | </summary> | ||
1938 | <param name="isSecured">true if socket is running HTTPS.</param> | ||
1939 | <param name="endPoint">Client that connected</param> | ||
1940 | <param name="stream">Network/SSL stream.</param> | ||
1941 | <returns>A context.</returns> | ||
1942 | </member> | ||
1943 | <member name="M:HttpServer.HttpContextFactory.CreateNewContext(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,System.Net.Sockets.Socket)"> | ||
1944 | <summary> | ||
1945 | Create a new context. | ||
1946 | </summary> | ||
1947 | <param name="isSecured">true if HTTPS is used.</param> | ||
1948 | <param name="endPoint">Remote client</param> | ||
1949 | <param name="stream">Network stream, <see cref="T:HttpServer.HttpClientContext"/> uses <see cref="T:HttpServer.ReusableSocketNetworkStream"/>.</param> | ||
1950 | <returns>A new context (always).</returns> | ||
1951 | </member> | ||
1952 | <member name="M:HttpServer.HttpContextFactory.CreateSecureContext(System.Net.Sockets.Socket,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> | ||
1953 | <summary> | ||
1954 | Create a secure <see cref="T:HttpServer.IHttpClientContext"/>. | ||
1955 | </summary> | ||
1956 | <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> | ||
1957 | <param name="certificate">HTTPS certificate to use.</param> | ||
1958 | <param name="protocol">Kind of HTTPS protocol. Usually TLS or SSL.</param> | ||
1959 | <returns> | ||
1960 | A created <see cref="T:HttpServer.IHttpClientContext"/>. | ||
1961 | </returns> | ||
1962 | </member> | ||
1963 | <member name="E:HttpServer.HttpContextFactory.RequestReceived"> | ||
1964 | <summary> | ||
1965 | A request have been received from one of the contexts. | ||
1966 | </summary> | ||
1967 | </member> | ||
1968 | <member name="M:HttpServer.HttpContextFactory.CreateContext(System.Net.Sockets.Socket)"> | ||
1969 | <summary> | ||
1970 | Creates a <see cref="T:HttpServer.IHttpClientContext"/> that handles a connected client. | ||
1971 | </summary> | ||
1972 | <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> | ||
1973 | <returns> | ||
1974 | A creates <see cref="T:HttpServer.IHttpClientContext"/>. | ||
1975 | </returns> | ||
1976 | </member> | ||
1977 | <member name="M:HttpServer.HttpContextFactory.Shutdown"> | ||
1978 | <summary> | ||
1979 | Server is shutting down so shut down the factory | ||
1980 | </summary> | ||
1981 | </member> | ||
1982 | <member name="T:HttpServer.ReusableSocketNetworkStream"> | ||
1983 | <summary> | ||
1984 | Custom network stream to mark sockets as reusable when disposing the stream. | ||
1985 | </summary> | ||
1986 | </member> | ||
1987 | <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket)"> | ||
1988 | <summary> | ||
1989 | Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" />. | ||
1990 | </summary> | ||
1991 | <param name="socket"> | ||
1992 | The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. | ||
1993 | </param> | ||
1994 | <exception cref="T:System.ArgumentNullException"> | ||
1995 | The <paramref name="socket" /> parameter is null. | ||
1996 | </exception> | ||
1997 | <exception cref="T:System.IO.IOException"> | ||
1998 | The <paramref name="socket" /> parameter is not connected. | ||
1999 | -or- | ||
2000 | The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. | ||
2001 | -or- | ||
2002 | The <paramref name="socket" /> parameter is in a nonblocking state. | ||
2003 | </exception> | ||
2004 | </member> | ||
2005 | <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.Boolean)"> | ||
2006 | <summary> | ||
2007 | Initializes a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified <see cref="T:System.Net.Sockets.Socket" /> ownership. | ||
2008 | </summary> | ||
2009 | <param name="socket"> | ||
2010 | The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. | ||
2011 | </param> | ||
2012 | <param name="ownsSocket"> | ||
2013 | Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. | ||
2014 | </param> | ||
2015 | <exception cref="T:System.ArgumentNullException"> | ||
2016 | The <paramref name="socket" /> parameter is null. | ||
2017 | </exception> | ||
2018 | <exception cref="T:System.IO.IOException"> | ||
2019 | The <paramref name="socket" /> parameter is not connected. | ||
2020 | -or- | ||
2021 | the value of the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. | ||
2022 | -or- | ||
2023 | the <paramref name="socket" /> parameter is in a nonblocking state. | ||
2024 | </exception> | ||
2025 | </member> | ||
2026 | <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.IO.FileAccess)"> | ||
2027 | <summary> | ||
2028 | Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights. | ||
2029 | </summary> | ||
2030 | <param name="socket"> | ||
2031 | The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. | ||
2032 | </param> | ||
2033 | <param name="access"> | ||
2034 | A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specify the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. | ||
2035 | </param> | ||
2036 | <exception cref="T:System.ArgumentNullException"> | ||
2037 | The <paramref name="socket" /> parameter is null. | ||
2038 | </exception> | ||
2039 | <exception cref="T:System.IO.IOException"> | ||
2040 | The <paramref name="socket" /> parameter is not connected. | ||
2041 | -or- | ||
2042 | the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. | ||
2043 | -or- | ||
2044 | the <paramref name="socket" /> parameter is in a nonblocking state. | ||
2045 | </exception> | ||
2046 | </member> | ||
2047 | <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.IO.FileAccess,System.Boolean)"> | ||
2048 | <summary> | ||
2049 | Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights and the specified <see cref="T:System.Net.Sockets.Socket" /> ownership. | ||
2050 | </summary> | ||
2051 | <param name="socket"> | ||
2052 | The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. | ||
2053 | </param> | ||
2054 | <param name="access"> | ||
2055 | A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specifies the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. | ||
2056 | </param> | ||
2057 | <param name="ownsSocket"> | ||
2058 | Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. | ||
2059 | </param> | ||
2060 | <exception cref="T:System.ArgumentNullException"> | ||
2061 | The <paramref name="socket" /> parameter is null. | ||
2062 | </exception> | ||
2063 | <exception cref="T:System.IO.IOException"> | ||
2064 | The <paramref name="socket" /> parameter is not connected. | ||
2065 | -or- | ||
2066 | The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. | ||
2067 | -or- | ||
2068 | The <paramref name="socket" /> parameter is in a nonblocking state. | ||
2069 | </exception> | ||
2070 | </member> | ||
2071 | <member name="M:HttpServer.ReusableSocketNetworkStream.Close"> | ||
2072 | <summary> | ||
2073 | Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. | ||
2074 | </summary> | ||
2075 | </member> | ||
2076 | <member name="M:HttpServer.ReusableSocketNetworkStream.Dispose(System.Boolean)"> | ||
2077 | <summary> | ||
2078 | Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.NetworkStream"/> and optionally releases the managed resources. | ||
2079 | </summary> | ||
2080 | <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> | ||
2081 | </member> | ||
2082 | <member name="T:HttpServer.IHttpContextFactory"> | ||
2083 | <summary> | ||
2084 | Used to create <see cref="T:HttpServer.IHttpClientContext"/>es. | ||
2085 | </summary> | ||
2086 | </member> | ||
2087 | <member name="M:HttpServer.IHttpContextFactory.CreateContext(System.Net.Sockets.Socket)"> | ||
2088 | <summary> | ||
2089 | Creates a <see cref="T:HttpServer.IHttpClientContext"/> that handles a connected client. | ||
2090 | </summary> | ||
2091 | <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> | ||
2092 | <returns>A creates <see cref="T:HttpServer.IHttpClientContext"/>.</returns> | ||
2093 | </member> | ||
2094 | <member name="M:HttpServer.IHttpContextFactory.CreateSecureContext(System.Net.Sockets.Socket,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> | ||
2095 | <summary> | ||
2096 | Create a secure <see cref="T:HttpServer.IHttpClientContext"/>. | ||
2097 | </summary> | ||
2098 | <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> | ||
2099 | <param name="certificate">HTTPS certificate to use.</param> | ||
2100 | <param name="protocol">Kind of HTTPS protocol. Usually TLS or SSL.</param> | ||
2101 | <returns>A created <see cref="T:HttpServer.IHttpClientContext"/>.</returns> | ||
2102 | </member> | ||
2103 | <member name="E:HttpServer.IHttpContextFactory.RequestReceived"> | ||
2104 | <summary> | ||
2105 | A request have been received from one of the contexts. | ||
2106 | </summary> | ||
2107 | </member> | ||
2108 | <member name="M:HttpServer.IHttpContextFactory.Shutdown"> | ||
2109 | <summary> | ||
2110 | Server is shutting down so shut down the factory | ||
2111 | </summary> | ||
2112 | </member> | ||
2113 | <member name="T:HttpServer.HttpFile"> | ||
2114 | <summary> | ||
2115 | Container class for posted files | ||
2116 | </summary> | ||
2117 | </member> | ||
2118 | <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"> | ||
2119 | <summary> | ||
2120 | Creates a container for a posted file | ||
2121 | </summary> | ||
2122 | <param name="name">The identifier of the post field</param> | ||
2123 | <param name="filename">The file path</param> | ||
2124 | <param name="contentType">The content type of the file</param> | ||
2125 | <param name="uploadFilename">The name of the file uploaded</param> | ||
2126 | <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> | ||
2127 | </member> | ||
2128 | <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String)"> | ||
2129 | <summary> | ||
2130 | Creates a container for a posted file <see cref="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"/> | ||
2131 | </summary> | ||
2132 | <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> | ||
2133 | </member> | ||
2134 | <member name="M:HttpServer.HttpFile.Finalize"> | ||
2135 | <summary>Destructor disposing the file</summary> | ||
2136 | </member> | ||
2137 | <member name="P:HttpServer.HttpFile.Name"> | ||
2138 | <summary> | ||
2139 | The name/id of the file | ||
2140 | </summary> | ||
2141 | </member> | ||
2142 | <member name="P:HttpServer.HttpFile.Filename"> | ||
2143 | <summary> | ||
2144 | The full file path | ||
2145 | </summary> | ||
2146 | </member> | ||
2147 | <member name="P:HttpServer.HttpFile.UploadFilename"> | ||
2148 | <summary> | ||
2149 | The name of the uploaded file | ||
2150 | </summary> | ||
2151 | </member> | ||
2152 | <member name="P:HttpServer.HttpFile.ContentType"> | ||
2153 | <summary> | ||
2154 | The type of file | ||
2155 | </summary> | ||
2156 | </member> | ||
2157 | <member name="M:HttpServer.HttpFile.Dispose(System.Boolean)"> | ||
2158 | <summary> | ||
2159 | Deletes the temporary file | ||
2160 | </summary> | ||
2161 | <param name="disposing">True if manual dispose</param> | ||
2162 | </member> | ||
2163 | <member name="M:HttpServer.HttpFile.Dispose"> | ||
2164 | <summary> | ||
2165 | Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization | ||
2166 | </summary> | ||
2167 | </member> | ||
2168 | <member name="T:HttpServer.HttpForm"> | ||
2169 | <summary>Container for posted form data</summary> | ||
2170 | </member> | ||
2171 | <member name="F:HttpServer.HttpForm.EmptyForm"> | ||
2172 | <summary>Instance to help mark a non-initialized form</summary> | ||
2173 | </member> | ||
2174 | <member name="M:HttpServer.HttpForm.#ctor"> | ||
2175 | <summary>Initializes a form container with the specified name</summary> | ||
2176 | </member> | ||
2177 | <member name="M:HttpServer.HttpForm.#ctor(HttpServer.HttpInput)"> | ||
2178 | <summary> | ||
2179 | Makes a deep copy of the input | ||
2180 | </summary> | ||
2181 | <param name="input">The input to copy</param> | ||
2182 | </member> | ||
2183 | <member name="M:HttpServer.HttpForm.AddFile(HttpServer.HttpFile)"> | ||
2184 | <summary> | ||
2185 | Adds a file to the collection of posted files | ||
2186 | </summary> | ||
2187 | <param name="file">The file to add</param> | ||
2188 | <exception cref="T:System.ArgumentException">If the file is already added</exception> | ||
2189 | <exception cref="T:System.ArgumentNullException">If file is null</exception> | ||
2190 | <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> | ||
2191 | </member> | ||
2192 | <member name="M:HttpServer.HttpForm.ContainsFile(System.String)"> | ||
2193 | <summary> | ||
2194 | Checks if the form contains a specified file | ||
2195 | </summary> | ||
2196 | <param name="name">Field name of the file parameter</param> | ||
2197 | <returns>True if the file exists</returns> | ||
2198 | <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> | ||
2199 | </member> | ||
2200 | <member name="M:HttpServer.HttpForm.GetFile(System.String)"> | ||
2201 | <summary> | ||
2202 | Retrieves a file held by by the form | ||
2203 | </summary> | ||
2204 | <param name="name">The identifier of the file</param> | ||
2205 | <returns>The requested file or null if the file was not found</returns> | ||
2206 | <exception cref="T:System.ArgumentNullException">If name is null or empty</exception> | ||
2207 | <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> | ||
2208 | </member> | ||
2209 | <member name="P:HttpServer.HttpForm.Files"> | ||
2210 | <summary> | ||
2211 | Retrieves the number of files added to the <see cref="T:HttpServer.HttpForm"/> | ||
2212 | </summary> | ||
2213 | <returns>0 if no files are added</returns> | ||
2214 | </member> | ||
2215 | <member name="M:HttpServer.HttpForm.Clear"> | ||
2216 | <summary>Disposes all held HttpFile's and resets values</summary> | ||
2217 | </member> | ||
2218 | <member name="T:HttpServer.HttpHelper"> | ||
2219 | <summary> | ||
2220 | Generic helper functions for HTTP | ||
2221 | </summary> | ||
2222 | </member> | ||
2223 | <member name="F:HttpServer.HttpHelper.HTTP10"> | ||
2224 | <summary> | ||
2225 | Version string for HTTP v1.0 | ||
2226 | </summary> | ||
2227 | </member> | ||
2228 | <member name="F:HttpServer.HttpHelper.HTTP11"> | ||
2229 | <summary> | ||
2230 | Version string for HTTP v1.1 | ||
2231 | </summary> | ||
2232 | </member> | ||
2233 | <member name="F:HttpServer.HttpHelper.EmptyUri"> | ||
2234 | <summary> | ||
2235 | An empty URI | ||
2236 | </summary> | ||
2237 | </member> | ||
2238 | <member name="M:HttpServer.HttpHelper.ParseQueryString(System.String)"> | ||
2239 | <summary> | ||
2240 | Parses a query string. | ||
2241 | </summary> | ||
2242 | <param name="queryString">Query string (URI encoded)</param> | ||
2243 | <returns>A <see cref="T:HttpServer.HttpInput"/> object if successful; otherwise <see cref="F:HttpServer.HttpInput.Empty"/></returns> | ||
2244 | <exception cref="T:System.ArgumentNullException"><c>queryString</c> is null.</exception> | ||
2245 | <exception cref="T:System.FormatException">If string cannot be parsed.</exception> | ||
2246 | </member> | ||
2247 | <member name="T:HttpServer.HttpInput"> | ||
2248 | <summary> | ||
2249 | Contains some kind of input from the browser/client. | ||
2250 | can be QueryString, form data or any other request body content. | ||
2251 | </summary> | ||
2252 | </member> | ||
2253 | <member name="F:HttpServer.HttpInput.Empty"> | ||
2254 | <summary> Representation of a non-initialized class instance </summary> | ||
2255 | </member> | ||
2256 | <member name="F:HttpServer.HttpInput._ignoreChanges"> | ||
2257 | <summary> Variable telling the class that it is non-initialized <see cref="F:HttpServer.HttpInput.Empty"/> </summary> | ||
2258 | </member> | ||
2259 | <member name="M:HttpServer.HttpInput.#ctor(System.String)"> | ||
2260 | <summary> | ||
2261 | Initializes a new instance of the <see cref="T:HttpServer.HttpInput"/> class. | ||
2262 | </summary> | ||
2263 | <param name="name">form name.</param> | ||
2264 | </member> | ||
2265 | <member name="M:HttpServer.HttpInput.#ctor(System.String,System.Boolean)"> | ||
2266 | <summary> | ||
2267 | Initializes a new instance of the <see cref="T:HttpServer.HttpInput"/> class. | ||
2268 | </summary> | ||
2269 | <param name="name">form name.</param> | ||
2270 | <param name="ignoreChanges">if set to <c>true</c> all changes will be ignored. </param> | ||
2271 | <remarks>this constructor should only be used by Empty</remarks> | ||
2272 | </member> | ||
2273 | <member name="M:HttpServer.HttpInput.#ctor(HttpServer.HttpInput)"> | ||
2274 | <summary>Creates a deep copy of the HttpInput class</summary> | ||
2275 | <param name="input">The object to copy</param> | ||
2276 | <remarks>The function makes a deep copy of quite a lot which can be slow</remarks> | ||
2277 | </member> | ||
2278 | <member name="P:HttpServer.HttpInput.Name"> | ||
2279 | <summary> | ||
2280 | Form name as lower case | ||
2281 | </summary> | ||
2282 | </member> | ||
2283 | <member name="M:HttpServer.HttpInput.Add(System.String,System.String)"> | ||
2284 | <summary> | ||
2285 | Add a new element. Form array elements are parsed | ||
2286 | and added in a correct hierarchy. | ||
2287 | </summary> | ||
2288 | <param name="name">Name is converted to lower case.</param> | ||
2289 | <param name="value"></param> | ||
2290 | <exception cref="T:System.ArgumentNullException"><c>name</c> is null.</exception> | ||
2291 | <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> | ||
2292 | </member> | ||
2293 | <member name="P:HttpServer.HttpInput.Item(System.String)"> | ||
2294 | <summary> | ||
2295 | Get a form item. | ||
2296 | </summary> | ||
2297 | <param name="name"></param> | ||
2298 | <returns>Returns <see cref="F:HttpServer.HttpInputItem.Empty"/> if item was not found.</returns> | ||
2299 | </member> | ||
2300 | <member name="M:HttpServer.HttpInput.Contains(System.String)"> | ||
2301 | <summary> | ||
2302 | Returns true if the class contains a <see cref="T:HttpServer.HttpInput"/> with the corresponding name. | ||
2303 | </summary> | ||
2304 | <param name="name">The field/query string name</param> | ||
2305 | <returns>True if the value exists</returns> | ||
2306 | </member> | ||
2307 | <member name="M:HttpServer.HttpInput.ParseItem(System.String,System.String)"> | ||
2308 | <summary> | ||
2309 | Parses an item and returns it. | ||
2310 | This function is primarily used to parse array items as in user[name]. | ||
2311 | </summary> | ||
2312 | <param name="name"></param> | ||
2313 | <param name="value"></param> | ||
2314 | <returns></returns> | ||
2315 | </member> | ||
2316 | <member name="M:HttpServer.HttpInput.ToString"> | ||
2317 | <summary> Outputs the instance representing all its values joined together </summary> | ||
2318 | <returns></returns> | ||
2319 | </member> | ||
2320 | <member name="M:HttpServer.HttpInput.ToString(System.Boolean)"> | ||
2321 | <summary>Returns all items as an unescaped query string.</summary> | ||
2322 | <returns></returns> | ||
2323 | </member> | ||
2324 | <member name="M:HttpServer.HttpInput.ExtractOne(System.String)"> | ||
2325 | <summary> | ||
2326 | Extracts one parameter from an array | ||
2327 | </summary> | ||
2328 | <param name="value">Containing the string array</param> | ||
2329 | <returns>All but the first value</returns> | ||
2330 | <example> | ||
2331 | string test1 = ExtractOne("system[user][extension][id]"); | ||
2332 | string test2 = ExtractOne(test1); | ||
2333 | string test3 = ExtractOne(test2); | ||
2334 | // test1 = user[extension][id] | ||
2335 | // test2 = extension[id] | ||
2336 | // test3 = id | ||
2337 | </example> | ||
2338 | </member> | ||
2339 | <member name="M:HttpServer.HttpInput.Clear"> | ||
2340 | <summary>Resets all data contained by class</summary> | ||
2341 | </member> | ||
2342 | <member name="M:HttpServer.HttpInput.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> | ||
2343 | <summary> | ||
2344 | Returns an enumerator that iterates through the collection. | ||
2345 | </summary> | ||
2346 | |||
2347 | <returns> | ||
2348 | A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. | ||
2349 | </returns> | ||
2350 | <filterpriority>1</filterpriority> | ||
2351 | </member> | ||
2352 | <member name="M:HttpServer.HttpInput.GetEnumerator"> | ||
2353 | <summary> | ||
2354 | Returns an enumerator that iterates through a collection. | ||
2355 | </summary> | ||
2356 | |||
2357 | <returns> | ||
2358 | An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. | ||
2359 | </returns> | ||
2360 | <filterpriority>2</filterpriority> | ||
2361 | </member> | ||
2362 | <member name="T:HttpServer.IHttpInput"> | ||
2363 | <summary> | ||
2364 | Base class for request data containers | ||
2365 | </summary> | ||
2366 | </member> | ||
2367 | <member name="M:HttpServer.IHttpInput.Add(System.String,System.String)"> | ||
2368 | <summary> | ||
2369 | Adds a parameter mapped to the presented name | ||
2370 | </summary> | ||
2371 | <param name="name">The name to map the parameter to</param> | ||
2372 | <param name="value">The parameter value</param> | ||
2373 | </member> | ||
2374 | <member name="P:HttpServer.IHttpInput.Item(System.String)"> | ||
2375 | <summary> | ||
2376 | Returns a request parameter | ||
2377 | </summary> | ||
2378 | <param name="name">The name associated with the parameter</param> | ||
2379 | <returns></returns> | ||
2380 | </member> | ||
2381 | <member name="M:HttpServer.IHttpInput.Contains(System.String)"> | ||
2382 | <summary> | ||
2383 | Returns true if the container contains the requested parameter | ||
2384 | </summary> | ||
2385 | <param name="name">Parameter id</param> | ||
2386 | <returns>True if parameter exists</returns> | ||
2387 | </member> | ||
2388 | <member name="T:HttpServer.HttpInputItem"> | ||
2389 | <summary> | ||
2390 | represents a HTTP input item. Each item can have multiple sub items, a sub item | ||
2391 | is made in a HTML form by using square brackets | ||
2392 | </summary> | ||
2393 | <example> | ||
2394 | // <input type="text" name="user[FirstName]" value="jonas" /> becomes: | ||
2395 | Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value); | ||
2396 | </example> | ||
2397 | <remarks> | ||
2398 | All names in a form SHOULD be in lowercase. | ||
2399 | </remarks> | ||
2400 | </member> | ||
2401 | <member name="F:HttpServer.HttpInputItem.Empty"> | ||
2402 | <summary> Representation of a non-initialized <see cref="T:HttpServer.HttpInputItem"/>.</summary> | ||
2403 | </member> | ||
2404 | <member name="M:HttpServer.HttpInputItem.#ctor(System.String,System.String)"> | ||
2405 | <summary> | ||
2406 | Initializes an input item setting its name/identifier and value | ||
2407 | </summary> | ||
2408 | <param name="name">Parameter name/id</param> | ||
2409 | <param name="value">Parameter value</param> | ||
2410 | </member> | ||
2411 | <member name="M:HttpServer.HttpInputItem.#ctor(HttpServer.HttpInputItem)"> | ||
2412 | <summary>Creates a deep copy of the item specified</summary> | ||
2413 | <param name="item">The item to copy</param> | ||
2414 | <remarks>The function makes a deep copy of quite a lot which can be slow</remarks> | ||
2415 | </member> | ||
2416 | <member name="P:HttpServer.HttpInputItem.Count"> | ||
2417 | <summary> | ||
2418 | Number of values | ||
2419 | </summary> | ||
2420 | </member> | ||
2421 | <member name="P:HttpServer.HttpInputItem.Item(System.String)"> | ||
2422 | <summary> | ||
2423 | Get a sub item | ||
2424 | </summary> | ||
2425 | <param name="name">name in lower case.</param> | ||
2426 | <returns><see cref="F:HttpServer.HttpInputItem.Empty"/> if no item was found.</returns> | ||
2427 | </member> | ||
2428 | <member name="P:HttpServer.HttpInputItem.Name"> | ||
2429 | <summary> | ||
2430 | Name of item (in lower case). | ||
2431 | </summary> | ||
2432 | </member> | ||
2433 | <member name="P:HttpServer.HttpInputItem.Value"> | ||
2434 | <summary> | ||
2435 | Returns the first value, or null if no value exist. | ||
2436 | </summary> | ||
2437 | </member> | ||
2438 | <member name="P:HttpServer.HttpInputItem.LastValue"> | ||
2439 | <summary> | ||
2440 | Returns the last value, or null if no value exist. | ||
2441 | </summary> | ||
2442 | </member> | ||
2443 | <member name="P:HttpServer.HttpInputItem.Values"> | ||
2444 | <summary> | ||
2445 | Returns the list with values. | ||
2446 | </summary> | ||
2447 | </member> | ||
2448 | <member name="M:HttpServer.HttpInputItem.Add(System.String)"> | ||
2449 | <summary> | ||
2450 | Add another value to this item | ||
2451 | </summary> | ||
2452 | <param name="value">Value to add.</param> | ||
2453 | <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> | ||
2454 | </member> | ||
2455 | <member name="M:HttpServer.HttpInputItem.Contains(System.String)"> | ||
2456 | <summary> | ||
2457 | checks if a sub-item exists (and has a value). | ||
2458 | </summary> | ||
2459 | <param name="name">name in lower case</param> | ||
2460 | <returns>true if the sub-item exists and has a value; otherwise false.</returns> | ||
2461 | </member> | ||
2462 | <member name="M:HttpServer.HttpInputItem.ToString"> | ||
2463 | <summary> Returns a formatted representation of the instance with the values of all contained parameters </summary> | ||
2464 | </member> | ||
2465 | <member name="M:HttpServer.HttpInputItem.ToString(System.String,System.Boolean)"> | ||
2466 | <summary> | ||
2467 | Outputs the string in a formatted manner | ||
2468 | </summary> | ||
2469 | <param name="prefix">A prefix to append, used internally</param> | ||
2470 | <param name="asQuerySting">produce a query string</param> | ||
2471 | </member> | ||
2472 | <member name="P:HttpServer.HttpInputItem.HttpServer#IHttpInput#Item(System.String)"> | ||
2473 | <summary> | ||
2474 | |||
2475 | </summary> | ||
2476 | <param name="name">name in lower case</param> | ||
2477 | <returns></returns> | ||
2478 | </member> | ||
2479 | <member name="M:HttpServer.HttpInputItem.Add(System.String,System.String)"> | ||
2480 | <summary> | ||
2481 | Add a sub item. | ||
2482 | </summary> | ||
2483 | <param name="name">Can contain array formatting, the item is then parsed and added in multiple levels</param> | ||
2484 | <param name="value">Value to add.</param> | ||
2485 | <exception cref="T:System.ArgumentNullException">Argument is null.</exception> | ||
2486 | <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> | ||
2487 | </member> | ||
2488 | <member name="M:HttpServer.HttpInputItem.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> | ||
2489 | <summary> | ||
2490 | Returns an enumerator that iterates through the collection. | ||
2491 | </summary> | ||
2492 | |||
2493 | <returns> | ||
2494 | A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. | ||
2495 | </returns> | ||
2496 | <filterpriority>1</filterpriority> | ||
2497 | </member> | ||
2498 | <member name="M:HttpServer.HttpInputItem.GetEnumerator"> | ||
2499 | <summary> | ||
2500 | Returns an enumerator that iterates through a collection. | ||
2501 | </summary> | ||
2502 | |||
2503 | <returns> | ||
2504 | An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. | ||
2505 | </returns> | ||
2506 | <filterpriority>2</filterpriority> | ||
2507 | </member> | ||
2508 | <member name="M:HttpServer.HttpInputItem.ToString(System.String)"> | ||
2509 | <summary> | ||
2510 | Outputs the string in a formatted manner | ||
2511 | </summary> | ||
2512 | <param name="prefix">A prefix to append, used internally</param> | ||
2513 | <returns></returns> | ||
2514 | </member> | ||
2515 | <member name="T:HttpServer.HttpListener"> | ||
2516 | <summary> | ||
2517 | New implementation of the HTTP listener. | ||
2518 | </summary> | ||
2519 | <remarks> | ||
2520 | Use the <c>Create</c> methods to create a default listener. | ||
2521 | </remarks> | ||
2522 | </member> | ||
2523 | <member name="E:HttpServer.HttpListener.Accepted"> | ||
2524 | <summary> | ||
2525 | A client have been accepted, but not handled, by the listener. | ||
2526 | </summary> | ||
2527 | </member> | ||
2528 | <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory)"> | ||
2529 | <summary> | ||
2530 | Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. | ||
2531 | </summary> | ||
2532 | <param name="address">IP Address to accept connections on</param> | ||
2533 | <param name="port">TCP Port to listen on, default HTTP port is 80.</param> | ||
2534 | <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> | ||
2535 | <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> | ||
2536 | <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> | ||
2537 | </member> | ||
2538 | <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate)"> | ||
2539 | <summary> | ||
2540 | Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. | ||
2541 | </summary> | ||
2542 | <param name="address">The address.</param> | ||
2543 | <param name="port">The port.</param> | ||
2544 | <param name="factory">The factory.</param> | ||
2545 | <param name="certificate">The certificate.</param> | ||
2546 | </member> | ||
2547 | <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> | ||
2548 | <summary> | ||
2549 | Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. | ||
2550 | </summary> | ||
2551 | <param name="address">The address.</param> | ||
2552 | <param name="port">The port.</param> | ||
2553 | <param name="factory">The factory.</param> | ||
2554 | <param name="certificate">The certificate.</param> | ||
2555 | <param name="protocol">The protocol.</param> | ||
2556 | </member> | ||
2557 | <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32)"> | ||
2558 | <summary> | ||
2559 | Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. | ||
2560 | </summary> | ||
2561 | <param name="address">Address that the listener should accept connections on.</param> | ||
2562 | <param name="port">Port that listener should accept connections on.</param> | ||
2563 | <returns>Created HTTP listener.</returns> | ||
2564 | </member> | ||
2565 | <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> | ||
2566 | <summary> | ||
2567 | Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. | ||
2568 | </summary> | ||
2569 | <param name="address">Address that the listener should accept connections on.</param> | ||
2570 | <param name="port">Port that listener should accept connections on.</param> | ||
2571 | <param name="certificate">Certificate to use</param> | ||
2572 | <returns>Created HTTP listener.</returns> | ||
2573 | </member> | ||
2574 | <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> | ||
2575 | <summary> | ||
2576 | Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. | ||
2577 | </summary> | ||
2578 | <param name="address">Address that the listener should accept connections on.</param> | ||
2579 | <param name="port">Port that listener should accept connections on.</param> | ||
2580 | <param name="certificate">Certificate to use</param> | ||
2581 | <param name="protocol">which HTTPS protocol to use, default is TLS.</param> | ||
2582 | <returns>Created HTTP listener.</returns> | ||
2583 | </member> | ||
2584 | <member name="M:HttpServer.HttpListener.OnAcceptingSocket(System.Net.Sockets.Socket)"> | ||
2585 | <summary> | ||
2586 | Can be used to create filtering of new connections. | ||
2587 | </summary> | ||
2588 | <param name="socket">Accepted socket</param> | ||
2589 | <returns> | ||
2590 | true if connection can be accepted; otherwise false. | ||
2591 | </returns> | ||
2592 | </member> | ||
2593 | <member name="T:HttpServer.HttpListenerBase"> | ||
2594 | <summary> | ||
2595 | Contains a listener that doesn't do anything with the connections. | ||
2596 | </summary> | ||
2597 | </member> | ||
2598 | <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory)"> | ||
2599 | <summary> | ||
2600 | Listen for regular HTTP connections | ||
2601 | </summary> | ||
2602 | <param name="address">IP Address to accept connections on</param> | ||
2603 | <param name="port">TCP Port to listen on, default HTTP port is 80.</param> | ||
2604 | <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> | ||
2605 | <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> | ||
2606 | <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> | ||
2607 | </member> | ||
2608 | <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate)"> | ||
2609 | <summary> | ||
2610 | Initializes a new instance of the <see cref="T:HttpServer.HttpListenerBase"/> class. | ||
2611 | </summary> | ||
2612 | <param name="address">IP Address to accept connections on</param> | ||
2613 | <param name="port">TCP Port to listen on, default HTTPS port is 443</param> | ||
2614 | <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> | ||
2615 | <param name="certificate">Certificate to use</param> | ||
2616 | </member> | ||
2617 | <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> | ||
2618 | <summary> | ||
2619 | Initializes a new instance of the <see cref="T:HttpServer.HttpListenerBase"/> class. | ||
2620 | </summary> | ||
2621 | <param name="address">IP Address to accept connections on</param> | ||
2622 | <param name="port">TCP Port to listen on, default HTTPS port is 443</param> | ||
2623 | <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> | ||
2624 | <param name="certificate">Certificate to use</param> | ||
2625 | <param name="protocol">which HTTPS protocol to use, default is TLS.</param> | ||
2626 | </member> | ||
2627 | <member name="P:HttpServer.HttpListenerBase.LogWriter"> | ||
2628 | <summary> | ||
2629 | Gives you a change to receive log entries for all internals of the HTTP library. | ||
2630 | </summary> | ||
2631 | <remarks> | ||
2632 | You may not switch log writer after starting the listener. | ||
2633 | </remarks> | ||
2634 | </member> | ||
2635 | <member name="P:HttpServer.HttpListenerBase.UseTraceLogs"> | ||
2636 | <summary> | ||
2637 | True if we should turn on trace logs. | ||
2638 | </summary> | ||
2639 | </member> | ||
2640 | <member name="M:HttpServer.HttpListenerBase.OnAccept(System.IAsyncResult)"> | ||
2641 | <exception cref="T:System.Exception"><c>Exception</c>.</exception> | ||
2642 | </member> | ||
2643 | <member name="M:HttpServer.HttpListenerBase.RetryBeginAccept"> | ||
2644 | <summary> | ||
2645 | Will try to accept connections one more time. | ||
2646 | </summary> | ||
2647 | <exception cref="T:System.Exception">If any exceptions is thrown.</exception> | ||
2648 | </member> | ||
2649 | <member name="M:HttpServer.HttpListenerBase.OnAcceptingSocket(System.Net.Sockets.Socket)"> | ||
2650 | <summary> | ||
2651 | Can be used to create filtering of new connections. | ||
2652 | </summary> | ||
2653 | <param name="socket">Accepted socket</param> | ||
2654 | <returns>true if connection can be accepted; otherwise false.</returns> | ||
2655 | </member> | ||
2656 | <member name="M:HttpServer.HttpListenerBase.Start(System.Int32)"> | ||
2657 | <summary> | ||
2658 | Start listen for new connections | ||
2659 | </summary> | ||
2660 | <param name="backlog">Number of connections that can stand in a queue to be accepted.</param> | ||
2661 | <exception cref="T:System.InvalidOperationException">Listener have already been started.</exception> | ||
2662 | </member> | ||
2663 | <member name="M:HttpServer.HttpListenerBase.Stop"> | ||
2664 | <summary> | ||
2665 | Stop the listener | ||
2666 | </summary> | ||
2667 | <exception cref="T:System.Net.Sockets.SocketException"></exception> | ||
2668 | </member> | ||
2669 | <member name="E:HttpServer.HttpListenerBase.ExceptionThrown"> | ||
2670 | <summary> | ||
2671 | Catch exceptions not handled by the listener. | ||
2672 | </summary> | ||
2673 | <remarks> | ||
2674 | Exceptions will be thrown during debug mode if this event is not used, | ||
2675 | exceptions will be printed to console and suppressed during release mode. | ||
2676 | </remarks> | ||
2677 | </member> | ||
2678 | <member name="E:HttpServer.HttpListenerBase.RequestReceived"> | ||
2679 | <summary> | ||
2680 | A request have been received from a <see cref="T:HttpServer.IHttpClientContext"/>. | ||
2681 | </summary> | ||
2682 | </member> | ||
2683 | <member name="T:HttpServer.HttpModules.FileModule"> | ||
2684 | <summary> | ||
2685 | The purpose of this module is to serve files. | ||
2686 | </summary> | ||
2687 | </member> | ||
2688 | <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String,System.Boolean)"> | ||
2689 | <summary> | ||
2690 | Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. | ||
2691 | </summary> | ||
2692 | <param name="baseUri">Uri to serve, for instance "/files/"</param> | ||
2693 | <param name="basePath">Path on hard drive where we should start looking for files</param> | ||
2694 | <param name="useLastModifiedHeader">If true a Last-Modifed header will be sent upon requests urging web browser to cache files</param> | ||
2695 | </member> | ||
2696 | <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String)"> | ||
2697 | <summary> | ||
2698 | Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. | ||
2699 | </summary> | ||
2700 | <param name="baseUri">Uri to serve, for instance "/files/"</param> | ||
2701 | <param name="basePath">Path on hard drive where we should start looking for files</param> | ||
2702 | </member> | ||
2703 | <member name="P:HttpServer.HttpModules.FileModule.MimeTypes"> | ||
2704 | <summary> | ||
2705 | List with all mime-type that are allowed. | ||
2706 | </summary> | ||
2707 | <remarks>All other mime types will result in a Forbidden http status code.</remarks> | ||
2708 | </member> | ||
2709 | <member name="P:HttpServer.HttpModules.FileModule.ForbiddenChars"> | ||
2710 | <summary> | ||
2711 | characters that may not exist in a path. | ||
2712 | </summary> | ||
2713 | <example> | ||
2714 | fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; | ||
2715 | </example> | ||
2716 | </member> | ||
2717 | <member name="M:HttpServer.HttpModules.FileModule.AddDefaultMimeTypes"> | ||
2718 | <summary> | ||
2719 | Mimtypes that this class can handle per default | ||
2720 | </summary> | ||
2721 | </member> | ||
2722 | <member name="M:HttpServer.HttpModules.FileModule.CanHandle(System.Uri)"> | ||
2723 | <summary> | ||
2724 | Determines if the request should be handled by this module. | ||
2725 | Invoked by the <see cref="T:HttpServer.HttpServer"/> | ||
2726 | </summary> | ||
2727 | <param name="uri"></param> | ||
2728 | <returns>true if this module should handle it.</returns> | ||
2729 | </member> | ||
2730 | <member name="M:HttpServer.HttpModules.FileModule.GetPath(System.Uri)"> | ||
2731 | <exception cref="T:HttpServer.Exceptions.BadRequestException">Illegal path</exception> | ||
2732 | </member> | ||
2733 | <member name="M:HttpServer.HttpModules.FileModule.Contains(System.String,System.Collections.Generic.IEnumerable{System.String})"> | ||
2734 | <summary> | ||
2735 | check if source contains any of the chars. | ||
2736 | </summary> | ||
2737 | <param name="source"></param> | ||
2738 | <param name="chars"></param> | ||
2739 | <returns></returns> | ||
2740 | </member> | ||
2741 | <member name="M:HttpServer.HttpModules.FileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
2742 | <summary> | ||
2743 | Method that process the Uri. | ||
2744 | </summary> | ||
2745 | <param name="request">Information sent by the browser about the request</param> | ||
2746 | <param name="response">Information that is being sent back to the client.</param> | ||
2747 | <param name="session">Session used to </param> | ||
2748 | <exception cref="T:HttpServer.Exceptions.InternalServerException">Failed to find file extension</exception> | ||
2749 | <exception cref="T:HttpServer.Exceptions.ForbiddenException">File type is forbidden.</exception> | ||
2750 | </member> | ||
2751 | <member name="M:HttpServer.HttpModules.FileModule.GetFileExtension(System.String)"> | ||
2752 | <summary> | ||
2753 | return a file extension from an absolute Uri path (or plain filename) | ||
2754 | </summary> | ||
2755 | <param name="uri"></param> | ||
2756 | <returns></returns> | ||
2757 | </member> | ||
2758 | <member name="T:HttpServer.HttpModules.HttpModule"> | ||
2759 | <summary> | ||
2760 | A HttpModule can be used to serve Uri's. The module itself | ||
2761 | decides if it should serve a Uri or not. In this way, you can | ||
2762 | get a very flexible http application since you can let multiple modules | ||
2763 | serve almost similar urls. | ||
2764 | </summary> | ||
2765 | <remarks> | ||
2766 | Throw <see cref="T:HttpServer.Exceptions.UnauthorizedException"/> if you are using a <see cref="T:HttpServer.Authentication.AuthenticationModule"/> and want to prompt for user name/password. | ||
2767 | </remarks> | ||
2768 | </member> | ||
2769 | <member name="M:HttpServer.HttpModules.HttpModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
2770 | <summary> | ||
2771 | Method that process the url | ||
2772 | </summary> | ||
2773 | <param name="request">Information sent by the browser about the request</param> | ||
2774 | <param name="response">Information that is being sent back to the client.</param> | ||
2775 | <param name="session">Session used to </param> | ||
2776 | <returns>true if this module handled the request.</returns> | ||
2777 | </member> | ||
2778 | <member name="M:HttpServer.HttpModules.HttpModule.SetLogWriter(HttpServer.ILogWriter)"> | ||
2779 | <summary> | ||
2780 | Set the log writer to use. | ||
2781 | </summary> | ||
2782 | <param name="writer">logwriter to use.</param> | ||
2783 | </member> | ||
2784 | <member name="M:HttpServer.HttpModules.HttpModule.Write(HttpServer.LogPrio,System.String)"> | ||
2785 | <summary> | ||
2786 | Log something. | ||
2787 | </summary> | ||
2788 | <param name="prio">importance of log message</param> | ||
2789 | <param name="message">message</param> | ||
2790 | </member> | ||
2791 | <member name="P:HttpServer.HttpModules.HttpModule.AllowSecondaryProcessing"> | ||
2792 | <summary> | ||
2793 | If true specifies that the module doesn't consume the processing of a request so that subsequent modules | ||
2794 | can continue processing afterwards. Default is false. | ||
2795 | </summary> | ||
2796 | </member> | ||
2797 | <member name="T:HttpServer.HttpModules.HttpModuleExceptionEventArgs"> | ||
2798 | <summary> | ||
2799 | Used to inform http server that | ||
2800 | </summary> | ||
2801 | </member> | ||
2802 | <member name="M:HttpServer.HttpModules.HttpModuleExceptionEventArgs.#ctor(System.Exception)"> | ||
2803 | <summary> | ||
2804 | Eventarguments used when an exception is thrown by a module | ||
2805 | </summary> | ||
2806 | <param name="e">the exception</param> | ||
2807 | </member> | ||
2808 | <member name="P:HttpServer.HttpModules.HttpModuleExceptionEventArgs.Exception"> | ||
2809 | <summary> | ||
2810 | Exception thrown in a module | ||
2811 | </summary> | ||
2812 | </member> | ||
2813 | <member name="T:HttpServer.HttpModules.ResourceFileModule"> | ||
2814 | <summary> | ||
2815 | Serves files that are stored in embedded resources. | ||
2816 | </summary> | ||
2817 | </member> | ||
2818 | <member name="M:HttpServer.HttpModules.ResourceFileModule.#ctor"> | ||
2819 | <summary> | ||
2820 | Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ResourceFileModule"/> class. | ||
2821 | Runs <see cref="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"/> to make sure the basic mime types are available, they can be cleared later | ||
2822 | through the use of <see cref="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"/> if desired. | ||
2823 | </summary> | ||
2824 | </member> | ||
2825 | <member name="M:HttpServer.HttpModules.ResourceFileModule.#ctor(HttpServer.ILogWriter)"> | ||
2826 | <summary> | ||
2827 | Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ResourceFileModule"/> class. | ||
2828 | Runs <see cref="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"/> to make sure the basic mime types are available, they can be cleared later | ||
2829 | through the use of <see cref="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"/> if desired. | ||
2830 | </summary> | ||
2831 | <param name="logWriter">The log writer to use when logging events</param> | ||
2832 | </member> | ||
2833 | <member name="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"> | ||
2834 | <summary> | ||
2835 | List with all mime-type that are allowed. | ||
2836 | </summary> | ||
2837 | <remarks>All other mime types will result in a Forbidden http status code.</remarks> | ||
2838 | </member> | ||
2839 | <member name="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"> | ||
2840 | <summary> | ||
2841 | Mimtypes that this class can handle per default | ||
2842 | </summary> | ||
2843 | </member> | ||
2844 | <member name="M:HttpServer.HttpModules.ResourceFileModule.AddResources(System.String,System.Reflection.Assembly,System.String)"> | ||
2845 | <summary> | ||
2846 | Loads resources from a namespace in the given assembly to an uri | ||
2847 | </summary> | ||
2848 | <param name="toUri">The uri to map the resources to</param> | ||
2849 | <param name="fromAssembly">The assembly in which the resources reside</param> | ||
2850 | <param name="fromNamespace">The namespace from which to load the resources</param> | ||
2851 | <usage> | ||
2852 | resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); | ||
2853 | |||
2854 | will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css | ||
2855 | </usage> | ||
2856 | <returns>The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded</returns> | ||
2857 | </member> | ||
2858 | <member name="M:HttpServer.HttpModules.ResourceFileModule.CanHandle(HttpServer.IHttpRequest)"> | ||
2859 | <summary> | ||
2860 | Returns true if the module can handle the request | ||
2861 | </summary> | ||
2862 | </member> | ||
2863 | <member name="M:HttpServer.HttpModules.ResourceFileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
2864 | <summary> | ||
2865 | Method that process the url | ||
2866 | </summary> | ||
2867 | <param name="request">Information sent by the browser about the request</param> | ||
2868 | <param name="response">Information that is being sent back to the client.</param> | ||
2869 | <param name="session">Session used to </param> | ||
2870 | <returns>true if this module handled the request.</returns> | ||
2871 | </member> | ||
2872 | <member name="T:HttpServer.HttpModules.ReverseProxyModule"> | ||
2873 | <summary> | ||
2874 | A reverse proxy are used to act as a bridge between local (protected/hidden) websites | ||
2875 | and public clients. | ||
2876 | |||
2877 | A typical usage is to allow web servers on non standard ports to still be available | ||
2878 | to the public clients, or allow web servers on private ips to be available. | ||
2879 | </summary> | ||
2880 | </member> | ||
2881 | <member name="M:HttpServer.HttpModules.ReverseProxyModule.#ctor(System.String,System.String)"> | ||
2882 | <summary> | ||
2883 | |||
2884 | </summary> | ||
2885 | <param name="source">Base url requested from browser</param> | ||
2886 | <param name="destination">Base url on private web server</param> | ||
2887 | <example> | ||
2888 | // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas | ||
2889 | _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); | ||
2890 | </example> | ||
2891 | </member> | ||
2892 | <member name="M:HttpServer.HttpModules.ReverseProxyModule.CanHandle(System.Uri)"> | ||
2893 | <summary> | ||
2894 | Method that determines if an url should be handled or not by the module | ||
2895 | </summary> | ||
2896 | <param name="uri">Url requested by the client.</param> | ||
2897 | <returns>true if module should handle the url.</returns> | ||
2898 | </member> | ||
2899 | <member name="M:HttpServer.HttpModules.ReverseProxyModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
2900 | <summary> | ||
2901 | Method that process the url | ||
2902 | </summary> | ||
2903 | <param name="request">Information sent by the browser about the request</param> | ||
2904 | <param name="response">Information that is being sent back to the client.</param> | ||
2905 | <param name="session">Session used to </param> | ||
2906 | </member> | ||
2907 | <member name="T:HttpServer.HttpModules.WebSiteModule"> | ||
2908 | <summary> | ||
2909 | The website module let's you handle multiple websites in the same server. | ||
2910 | It uses the "Host" header to check which site you want. | ||
2911 | </summary> | ||
2912 | <remarks>It's recommended that you do not | ||
2913 | add any other modules to HttpServer if you are using the website module. Instead, | ||
2914 | add all wanted modules to each website.</remarks> | ||
2915 | </member> | ||
2916 | <member name="M:HttpServer.HttpModules.WebSiteModule.#ctor(System.String,System.String)"> | ||
2917 | <summary> | ||
2918 | |||
2919 | </summary> | ||
2920 | <param name="host">domain name that should be handled.</param> | ||
2921 | <param name="name"></param> | ||
2922 | </member> | ||
2923 | <member name="P:HttpServer.HttpModules.WebSiteModule.SiteName"> | ||
2924 | <summary> | ||
2925 | Name of site. | ||
2926 | </summary> | ||
2927 | </member> | ||
2928 | <member name="M:HttpServer.HttpModules.WebSiteModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
2929 | <summary> | ||
2930 | Method that process the url | ||
2931 | </summary> | ||
2932 | <param name="request">Information sent by the browser about the request</param> | ||
2933 | <param name="response">Information that is being sent back to the client.</param> | ||
2934 | <param name="session">Session used to </param> | ||
2935 | </member> | ||
2936 | <member name="T:HttpServer.HttpParam"> | ||
2937 | <summary> | ||
2938 | Returns item either from a form or a query string (checks them in that order) | ||
2939 | </summary> | ||
2940 | </member> | ||
2941 | <member name="F:HttpServer.HttpParam.Empty"> | ||
2942 | <summary> Representation of a non-initialized HttpParam </summary> | ||
2943 | </member> | ||
2944 | <member name="M:HttpServer.HttpParam.#ctor(HttpServer.IHttpInput,HttpServer.IHttpInput)"> | ||
2945 | <summary>Initialises the class to hold a value either from a post request or a querystring request</summary> | ||
2946 | </member> | ||
2947 | <member name="M:HttpServer.HttpParam.Add(System.String,System.String)"> | ||
2948 | <summary> | ||
2949 | The add method is not availible for HttpParam | ||
2950 | since HttpParam checks both Request.Form and Request.QueryString | ||
2951 | </summary> | ||
2952 | <param name="name">name identifying the value</param> | ||
2953 | <param name="value">value to add</param> | ||
2954 | <exception cref="T:System.NotImplementedException"></exception> | ||
2955 | </member> | ||
2956 | <member name="M:HttpServer.HttpParam.Contains(System.String)"> | ||
2957 | <summary> | ||
2958 | Checks whether the form or querystring has the specified value | ||
2959 | </summary> | ||
2960 | <param name="name">Name, case sensitive</param> | ||
2961 | <returns>true if found; otherwise false.</returns> | ||
2962 | </member> | ||
2963 | <member name="P:HttpServer.HttpParam.Item(System.String)"> | ||
2964 | <summary> | ||
2965 | Fetch an item from the form or querystring (in that order). | ||
2966 | </summary> | ||
2967 | <param name="name"></param> | ||
2968 | <returns>Item if found; otherwise HttpInputItem.EmptyLanguageNode</returns> | ||
2969 | </member> | ||
2970 | <member name="M:HttpServer.HttpParam.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> | ||
2971 | <summary> | ||
2972 | Returns an enumerator that iterates through the collection. | ||
2973 | </summary> | ||
2974 | |||
2975 | <returns> | ||
2976 | A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. | ||
2977 | </returns> | ||
2978 | <filterpriority>1</filterpriority> | ||
2979 | </member> | ||
2980 | <member name="M:HttpServer.HttpParam.GetEnumerator"> | ||
2981 | <summary> | ||
2982 | Returns an enumerator that iterates through a collection. | ||
2983 | </summary> | ||
2984 | |||
2985 | <returns> | ||
2986 | An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. | ||
2987 | </returns> | ||
2988 | <filterpriority>2</filterpriority> | ||
2989 | </member> | ||
2990 | <member name="T:HttpServer.HttpRequest"> | ||
2991 | <summary> | ||
2992 | Contains server side HTTP request information. | ||
2993 | </summary> | ||
2994 | </member> | ||
2995 | <member name="F:HttpServer.HttpRequest.UriSplitters"> | ||
2996 | <summary> | ||
2997 | Chars used to split an URL path into multiple parts. | ||
2998 | </summary> | ||
2999 | </member> | ||
3000 | <member name="P:HttpServer.HttpRequest.Secure"> | ||
3001 | <summary> | ||
3002 | Gets or sets a value indicating whether this <see cref="T:HttpServer.HttpRequest"/> is secure. | ||
3003 | </summary> | ||
3004 | </member> | ||
3005 | <member name="P:HttpServer.HttpRequest.UriPath"> | ||
3006 | <summary> | ||
3007 | Path and query (will be merged with the host header) and put in Uri | ||
3008 | </summary> | ||
3009 | <see cref="P:HttpServer.HttpRequest.Uri"/> | ||
3010 | </member> | ||
3011 | <member name="M:HttpServer.HttpRequest.AssignForm(HttpServer.HttpForm)"> | ||
3012 | <summary> | ||
3013 | Assign a form. | ||
3014 | </summary> | ||
3015 | <param name="form"></param> | ||
3016 | </member> | ||
3017 | <member name="P:HttpServer.HttpRequest.BodyIsComplete"> | ||
3018 | <summary> | ||
3019 | Gets whether the body is complete. | ||
3020 | </summary> | ||
3021 | </member> | ||
3022 | <member name="P:HttpServer.HttpRequest.AcceptTypes"> | ||
3023 | <summary> | ||
3024 | Gets kind of types accepted by the client. | ||
3025 | </summary> | ||
3026 | </member> | ||
3027 | <member name="P:HttpServer.HttpRequest.Body"> | ||
3028 | <summary> | ||
3029 | Gets or sets body stream. | ||
3030 | </summary> | ||
3031 | </member> | ||
3032 | <member name="P:HttpServer.HttpRequest.Connection"> | ||
3033 | <summary> | ||
3034 | Gets or sets kind of connection used for the session. | ||
3035 | </summary> | ||
3036 | </member> | ||
3037 | <member name="P:HttpServer.HttpRequest.ContentLength"> | ||
3038 | <summary> | ||
3039 | Gets or sets number of bytes in the body. | ||
3040 | </summary> | ||
3041 | </member> | ||
3042 | <member name="P:HttpServer.HttpRequest.Headers"> | ||
3043 | <summary> | ||
3044 | Gets headers sent by the client. | ||
3045 | </summary> | ||
3046 | </member> | ||
3047 | <member name="P:HttpServer.HttpRequest.HttpVersion"> | ||
3048 | <summary> | ||
3049 | Gets or sets version of HTTP protocol that's used. | ||
3050 | </summary> | ||
3051 | <remarks> | ||
3052 | Probably <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/>. | ||
3053 | </remarks> | ||
3054 | <seealso cref="T:HttpServer.HttpHelper"/> | ||
3055 | </member> | ||
3056 | <member name="P:HttpServer.HttpRequest.Method"> | ||
3057 | <summary> | ||
3058 | Gets or sets requested method. | ||
3059 | </summary> | ||
3060 | <value></value> | ||
3061 | <remarks> | ||
3062 | Will always be in upper case. | ||
3063 | </remarks> | ||
3064 | <see cref="!:HttpServer.Method"/> | ||
3065 | </member> | ||
3066 | <member name="P:HttpServer.HttpRequest.QueryString"> | ||
3067 | <summary> | ||
3068 | Gets variables sent in the query string | ||
3069 | </summary> | ||
3070 | </member> | ||
3071 | <member name="P:HttpServer.HttpRequest.Uri"> | ||
3072 | <summary> | ||
3073 | Gets or sets requested URI. | ||
3074 | </summary> | ||
3075 | </member> | ||
3076 | <member name="P:HttpServer.HttpRequest.UriParts"> | ||
3077 | <summary> | ||
3078 | Uri absolute path splitted into parts. | ||
3079 | </summary> | ||
3080 | <example> | ||
3081 | // uri is: http://gauffin.com/code/tiny/ | ||
3082 | Console.WriteLine(request.UriParts[0]); // result: code | ||
3083 | Console.WriteLine(request.UriParts[1]); // result: tiny | ||
3084 | </example> | ||
3085 | <remarks> | ||
3086 | If you're using controllers than the first part is controller name, | ||
3087 | the second part is method name and the third part is Id property. | ||
3088 | </remarks> | ||
3089 | <seealso cref="P:HttpServer.HttpRequest.Uri"/> | ||
3090 | </member> | ||
3091 | <member name="P:HttpServer.HttpRequest.Param"> | ||
3092 | <summary> | ||
3093 | Gets parameter from <see cref="P:HttpServer.HttpRequest.QueryString"/> or <see cref="P:HttpServer.HttpRequest.Form"/>. | ||
3094 | </summary> | ||
3095 | </member> | ||
3096 | <member name="P:HttpServer.HttpRequest.Form"> | ||
3097 | <summary> | ||
3098 | Gets form parameters. | ||
3099 | </summary> | ||
3100 | </member> | ||
3101 | <member name="P:HttpServer.HttpRequest.IsAjax"> | ||
3102 | <summary> | ||
3103 | Gets whether the request was made by Ajax (Asynchronous JavaScript) | ||
3104 | </summary> | ||
3105 | </member> | ||
3106 | <member name="P:HttpServer.HttpRequest.Cookies"> | ||
3107 | <summary> | ||
3108 | Gets cookies that was sent with the request. | ||
3109 | </summary> | ||
3110 | </member> | ||
3111 | <member name="M:HttpServer.HttpRequest.Clone"> | ||
3112 | <summary> | ||
3113 | Creates a new object that is a copy of the current instance. | ||
3114 | </summary> | ||
3115 | |||
3116 | <returns> | ||
3117 | A new object that is a copy of this instance. | ||
3118 | </returns> | ||
3119 | <filterpriority>2</filterpriority> | ||
3120 | </member> | ||
3121 | <member name="M:HttpServer.HttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> | ||
3122 | <summary> | ||
3123 | Decode body into a form. | ||
3124 | </summary> | ||
3125 | <param name="providers">A list with form decoders.</param> | ||
3126 | <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> | ||
3127 | <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> | ||
3128 | </member> | ||
3129 | <member name="M:HttpServer.HttpRequest.SetCookies(HttpServer.RequestCookies)"> | ||
3130 | <summary> | ||
3131 | Cookies | ||
3132 | </summary> | ||
3133 | <param name="cookies">the cookies</param> | ||
3134 | </member> | ||
3135 | <member name="M:HttpServer.HttpRequest.CreateResponse(HttpServer.IHttpClientContext)"> | ||
3136 | <summary> | ||
3137 | Create a response object. | ||
3138 | </summary> | ||
3139 | <returns>A new <see cref="T:HttpServer.IHttpResponse"/>.</returns> | ||
3140 | </member> | ||
3141 | <member name="M:HttpServer.HttpRequest.AddHeader(System.String,System.String)"> | ||
3142 | <summary> | ||
3143 | Called during parsing of a <see cref="T:HttpServer.IHttpRequest"/>. | ||
3144 | </summary> | ||
3145 | <param name="name">Name of the header, should not be URL encoded</param> | ||
3146 | <param name="value">Value of the header, should not be URL encoded</param> | ||
3147 | <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> | ||
3148 | </member> | ||
3149 | <member name="M:HttpServer.HttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> | ||
3150 | <summary> | ||
3151 | Add bytes to the body | ||
3152 | </summary> | ||
3153 | <param name="bytes">buffer to read bytes from</param> | ||
3154 | <param name="offset">where to start read</param> | ||
3155 | <param name="length">number of bytes to read</param> | ||
3156 | <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> | ||
3157 | <exception cref="T:System.InvalidOperationException">If body is not writable</exception> | ||
3158 | <exception cref="T:System.ArgumentNullException"><c>bytes</c> is null.</exception> | ||
3159 | <exception cref="T:System.ArgumentOutOfRangeException"><c>offset</c> is out of range.</exception> | ||
3160 | </member> | ||
3161 | <member name="M:HttpServer.HttpRequest.Clear"> | ||
3162 | <summary> | ||
3163 | Clear everything in the request | ||
3164 | </summary> | ||
3165 | </member> | ||
3166 | <member name="T:HttpServer.HttpResponse"> | ||
3167 | <summary> | ||
3168 | Response that is sent back to the web browser / client. | ||
3169 | </summary> | ||
3170 | <remarks> | ||
3171 | <para> | ||
3172 | A response can be sent if different ways. The easiest one is | ||
3173 | to just fill the Body stream with content, everything else | ||
3174 | will then be taken care of by the framework. The default content-type | ||
3175 | is text/html, you should change it if you send anything else. | ||
3176 | </para><para> | ||
3177 | The second and slightly more complex way is to send the response | ||
3178 | as parts. Start with sending the header using the SendHeaders method and | ||
3179 | then you can send the body using SendBody method, but do not forget | ||
3180 | to set <see cref="P:HttpServer.HttpResponse.ContentType"/> and <see cref="P:HttpServer.HttpResponse.ContentLength"/> before doing so. | ||
3181 | </para> | ||
3182 | </remarks> | ||
3183 | <example> | ||
3184 | <code> | ||
3185 | // Example using response body. | ||
3186 | class MyModule : HttpModule | ||
3187 | { | ||
3188 | public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) | ||
3189 | { | ||
3190 | StreamWriter writer = new StreamWriter(response.Body); | ||
3191 | writer.WriteLine("Hello dear World!"); | ||
3192 | writer.Flush(); | ||
3193 | |||
3194 | // return true to tell webserver that we've handled the url | ||
3195 | return true; | ||
3196 | } | ||
3197 | } | ||
3198 | </code> | ||
3199 | </example> | ||
3200 | todo: add two examples, using SendHeaders/SendBody and just the Body stream. | ||
3201 | </member> | ||
3202 | <member name="M:HttpServer.HttpResponse.#ctor(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> | ||
3203 | <summary> | ||
3204 | Initializes a new instance of the <see cref="T:HttpServer.IHttpResponse"/> class. | ||
3205 | </summary> | ||
3206 | <param name="context">Client that send the <see cref="T:HttpServer.IHttpRequest"/>.</param> | ||
3207 | <param name="request">Contains information of what the client want to receive.</param> | ||
3208 | <exception cref="T:System.ArgumentException"><see cref="P:HttpServer.IHttpRequest.HttpVersion"/> cannot be empty.</exception> | ||
3209 | </member> | ||
3210 | <member name="M:HttpServer.HttpResponse.#ctor(HttpServer.IHttpClientContext,System.String,HttpServer.ConnectionType)"> | ||
3211 | <summary> | ||
3212 | Initializes a new instance of the <see cref="T:HttpServer.IHttpResponse"/> class. | ||
3213 | </summary> | ||
3214 | <param name="context">Client that send the <see cref="T:HttpServer.IHttpRequest"/>.</param> | ||
3215 | <param name="httpVersion">Version of HTTP protocol that the client uses.</param> | ||
3216 | <param name="connectionType">Type of HTTP connection used.</param> | ||
3217 | </member> | ||
3218 | <member name="P:HttpServer.HttpResponse.Body"> | ||
3219 | <summary> | ||
3220 | The body stream is used to cache the body contents | ||
3221 | before sending everything to the client. It's the simplest | ||
3222 | way to serve documents. | ||
3223 | </summary> | ||
3224 | </member> | ||
3225 | <member name="P:HttpServer.HttpResponse.Chunked"> | ||
3226 | <summary> | ||
3227 | The chunked encoding modifies the body of a message in order to | ||
3228 | transfer it as a series of chunks, each with its own size indicator, | ||
3229 | followed by an OPTIONAL trailer containing entity-header fields. This | ||
3230 | allows dynamically produced content to be transferred along with the | ||
3231 | information necessary for the recipient to verify that it has | ||
3232 | received the full message. | ||
3233 | </summary> | ||
3234 | </member> | ||
3235 | <member name="P:HttpServer.HttpResponse.ProtocolVersion"> | ||
3236 | <summary> | ||
3237 | Defines the version of the HTTP Response for applications where it's required | ||
3238 | for this to be forced. | ||
3239 | </summary> | ||
3240 | </member> | ||
3241 | <member name="P:HttpServer.HttpResponse.Connection"> | ||
3242 | <summary> | ||
3243 | Kind of connection | ||
3244 | </summary> | ||
3245 | </member> | ||
3246 | <member name="P:HttpServer.HttpResponse.Encoding"> | ||
3247 | <summary> | ||
3248 | Encoding to use when sending stuff to the client. | ||
3249 | </summary> | ||
3250 | <remarks>Default is UTF8</remarks> | ||
3251 | </member> | ||
3252 | <member name="P:HttpServer.HttpResponse.KeepAlive"> | ||
3253 | <summary> | ||
3254 | Number of seconds to keep connection alive | ||
3255 | </summary> | ||
3256 | <remarks>Only used if Connection property is set to <see cref="F:HttpServer.ConnectionType.KeepAlive"/>.</remarks> | ||
3257 | </member> | ||
3258 | <member name="P:HttpServer.HttpResponse.Status"> | ||
3259 | <summary> | ||
3260 | Status code that is sent to the client. | ||
3261 | </summary> | ||
3262 | <remarks>Default is <see cref="F:System.Net.HttpStatusCode.OK"/></remarks> | ||
3263 | </member> | ||
3264 | <member name="P:HttpServer.HttpResponse.Reason"> | ||
3265 | <summary> | ||
3266 | Information about why a specific status code was used. | ||
3267 | </summary> | ||
3268 | </member> | ||
3269 | <member name="P:HttpServer.HttpResponse.ContentLength"> | ||
3270 | <summary> | ||
3271 | Size of the body. MUST be specified before sending the header, | ||
3272 | unless property Chunked is set to true. | ||
3273 | </summary> | ||
3274 | </member> | ||
3275 | <member name="P:HttpServer.HttpResponse.ContentType"> | ||
3276 | <summary> | ||
3277 | Kind of content in the body | ||
3278 | </summary> | ||
3279 | <remarks>Default type is "text/html"</remarks> | ||
3280 | </member> | ||
3281 | <member name="P:HttpServer.HttpResponse.HeadersSent"> | ||
3282 | <summary> | ||
3283 | Headers have been sent to the client- | ||
3284 | </summary> | ||
3285 | <remarks>You can not send any additional headers if they have already been sent.</remarks> | ||
3286 | </member> | ||
3287 | <member name="P:HttpServer.HttpResponse.Sent"> | ||
3288 | <summary> | ||
3289 | The whole response have been sent. | ||
3290 | </summary> | ||
3291 | </member> | ||
3292 | <member name="P:HttpServer.HttpResponse.Cookies"> | ||
3293 | <summary> | ||
3294 | Cookies that should be created/changed. | ||
3295 | </summary> | ||
3296 | </member> | ||
3297 | <member name="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"> | ||
3298 | <summary> | ||
3299 | Add another header to the document. | ||
3300 | </summary> | ||
3301 | <param name="name">Name of the header, case sensitive, use lower cases.</param> | ||
3302 | <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> | ||
3303 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
3304 | <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> | ||
3305 | <remarks>Adding any header will override the default ones and those specified by properties.</remarks> | ||
3306 | </member> | ||
3307 | <member name="M:HttpServer.HttpResponse.Send"> | ||
3308 | <summary> | ||
3309 | Send headers and body to the browser. | ||
3310 | </summary> | ||
3311 | <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> | ||
3312 | </member> | ||
3313 | <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> | ||
3314 | <summary> | ||
3315 | Make sure that you have specified <see cref="P:HttpServer.HttpResponse.ContentLength"/> and sent the headers first. | ||
3316 | </summary> | ||
3317 | <param name="buffer"></param> | ||
3318 | <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> | ||
3319 | <see cref="M:HttpServer.HttpResponse.SendHeaders"/> | ||
3320 | <param name="offset">offset of first byte to send</param> | ||
3321 | <param name="count">number of bytes to send.</param> | ||
3322 | <seealso cref="M:HttpServer.HttpResponse.Send"/> | ||
3323 | <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> | ||
3324 | <remarks>This method can be used if you want to send body contents without caching them first. This | ||
3325 | is recommended for larger files to keep the memory usage low.</remarks> | ||
3326 | </member> | ||
3327 | <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[])"> | ||
3328 | <summary> | ||
3329 | Make sure that you have specified <see cref="P:HttpServer.HttpResponse.ContentLength"/> and sent the headers first. | ||
3330 | </summary> | ||
3331 | <param name="buffer"></param> | ||
3332 | <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> | ||
3333 | <see cref="M:HttpServer.HttpResponse.SendHeaders"/> | ||
3334 | <seealso cref="M:HttpServer.HttpResponse.Send"/> | ||
3335 | <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> | ||
3336 | <remarks>This method can be used if you want to send body contents without caching them first. This | ||
3337 | is recommended for larger files to keep the memory usage low.</remarks> | ||
3338 | </member> | ||
3339 | <member name="M:HttpServer.HttpResponse.SendHeaders"> | ||
3340 | <summary> | ||
3341 | Send headers to the client. | ||
3342 | </summary> | ||
3343 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
3344 | <seealso cref="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"/> | ||
3345 | <seealso cref="M:HttpServer.HttpResponse.Send"/> | ||
3346 | <seealso cref="M:HttpServer.HttpResponse.SendBody(System.Byte[])"/> | ||
3347 | </member> | ||
3348 | <member name="M:HttpServer.HttpResponse.Redirect(System.Uri)"> | ||
3349 | <summary> | ||
3350 | Redirect client to somewhere else using the 302 status code. | ||
3351 | </summary> | ||
3352 | <param name="uri">Destination of the redirect</param> | ||
3353 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
3354 | <remarks>You can not do anything more with the request when a redirect have been done. This should be your last | ||
3355 | action.</remarks> | ||
3356 | </member> | ||
3357 | <member name="M:HttpServer.HttpResponse.Redirect(System.String)"> | ||
3358 | <summary> | ||
3359 | redirect to somewhere | ||
3360 | </summary> | ||
3361 | <param name="url">where the redirect should go</param> | ||
3362 | <remarks> | ||
3363 | No body are allowed when doing redirects. | ||
3364 | </remarks> | ||
3365 | </member> | ||
3366 | <member name="T:HttpServer.RealmHandler"> | ||
3367 | <summary> | ||
3368 | Delegate used to find a realm/domain. | ||
3369 | </summary> | ||
3370 | <param name="domain"></param> | ||
3371 | <returns></returns> | ||
3372 | <remarks> | ||
3373 | Realms are used during HTTP Authentication | ||
3374 | </remarks> | ||
3375 | <seealso cref="T:HttpServer.Authentication.AuthenticationModule"/> | ||
3376 | <seealso cref="T:HttpServer.Authentication.AuthenticationHandler"/> | ||
3377 | </member> | ||
3378 | <member name="T:HttpServer.HttpServer"> | ||
3379 | <summary> | ||
3380 | A complete HTTP server, you need to add a module to it to be able to handle incoming requests. | ||
3381 | </summary> | ||
3382 | <example> | ||
3383 | <code> | ||
3384 | // this small example will add two web site modules, thus handling | ||
3385 | // two different sites. In reality you should add Controller modules or something | ||
3386 | // two the website modules to be able to handle different requests. | ||
3387 | HttpServer server = new HttpServer(); | ||
3388 | server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); | ||
3389 | server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); | ||
3390 | |||
3391 | // start regular http | ||
3392 | server.Start(IPAddress.Any, 80); | ||
3393 | |||
3394 | // start https | ||
3395 | server.Start(IPAddress.Any, 443, myCertificate); | ||
3396 | </code> | ||
3397 | </example> | ||
3398 | <seealso cref="T:HttpServer.HttpModules.HttpModule"/> | ||
3399 | <seealso cref="T:HttpServer.HttpModules.FileModule"/> | ||
3400 | <seealso cref="T:HttpServer.HttpListener"/> | ||
3401 | </member> | ||
3402 | <member name="P:HttpServer.HttpServer.Current"> | ||
3403 | <summary> | ||
3404 | Server that is handling the current request. | ||
3405 | </summary> | ||
3406 | <remarks> | ||
3407 | Will be set as soon as a request arrives to the <see cref="T:HttpServer.HttpServer"/> object. | ||
3408 | </remarks> | ||
3409 | </member> | ||
3410 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.IComponentProvider)"> | ||
3411 | <summary> | ||
3412 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3413 | </summary> | ||
3414 | <param name="provider">Used to get all components used in the server..</param> | ||
3415 | </member> | ||
3416 | <member name="M:HttpServer.HttpServer.#ctor"> | ||
3417 | <summary> | ||
3418 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3419 | </summary> | ||
3420 | </member> | ||
3421 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider)"> | ||
3422 | <summary> | ||
3423 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3424 | </summary> | ||
3425 | <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> | ||
3426 | <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> | ||
3427 | <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> | ||
3428 | </member> | ||
3429 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.Sessions.IHttpSessionStore)"> | ||
3430 | <summary> | ||
3431 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3432 | </summary> | ||
3433 | <param name="sessionStore">A session store is used to save and retrieve sessions</param> | ||
3434 | <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> | ||
3435 | </member> | ||
3436 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.ILogWriter)"> | ||
3437 | <summary> | ||
3438 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3439 | </summary> | ||
3440 | <param name="logWriter">The log writer.</param> | ||
3441 | <seealso cref="P:HttpServer.HttpServer.LogWriter"/> | ||
3442 | </member> | ||
3443 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.ILogWriter)"> | ||
3444 | <summary> | ||
3445 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3446 | </summary> | ||
3447 | <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> | ||
3448 | <param name="logWriter">The log writer.</param> | ||
3449 | <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> | ||
3450 | <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> | ||
3451 | <seealso cref="P:HttpServer.HttpServer.LogWriter"/> | ||
3452 | </member> | ||
3453 | <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.Sessions.IHttpSessionStore,HttpServer.ILogWriter)"> | ||
3454 | <summary> | ||
3455 | Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. | ||
3456 | </summary> | ||
3457 | <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> | ||
3458 | <param name="sessionStore">A session store is used to save and retrieve sessions</param> | ||
3459 | <param name="logWriter">The log writer.</param> | ||
3460 | <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> | ||
3461 | <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> | ||
3462 | <seealso cref="P:HttpServer.HttpServer.LogWriter"/> | ||
3463 | <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> | ||
3464 | </member> | ||
3465 | <member name="P:HttpServer.HttpServer.AuthenticationModules"> | ||
3466 | <summary> | ||
3467 | Modules used for authentication. The module that is is added first is used as | ||
3468 | the default authentication module. | ||
3469 | </summary> | ||
3470 | <remarks>Use the corresponding property | ||
3471 | in the <see cref="T:HttpServer.HttpModules.WebSiteModule"/> if you are using multiple websites.</remarks> | ||
3472 | </member> | ||
3473 | <member name="P:HttpServer.HttpServer.FormDecoderProviders"> | ||
3474 | <summary> | ||
3475 | Form decoder providers are used to decode request body (which normally contains form data). | ||
3476 | </summary> | ||
3477 | </member> | ||
3478 | <member name="P:HttpServer.HttpServer.ServerName"> | ||
3479 | <summary> | ||
3480 | Server name sent in HTTP responses. | ||
3481 | </summary> | ||
3482 | <remarks> | ||
3483 | Do NOT include version in name, since it makes it | ||
3484 | easier for hackers. | ||
3485 | </remarks> | ||
3486 | </member> | ||
3487 | <member name="P:HttpServer.HttpServer.SessionCookieName"> | ||
3488 | <summary> | ||
3489 | Name of cookie where session id is stored. | ||
3490 | </summary> | ||
3491 | </member> | ||
3492 | <member name="P:HttpServer.HttpServer.LogWriter"> | ||
3493 | <summary> | ||
3494 | Specified where logging should go. | ||
3495 | </summary> | ||
3496 | <seealso cref="T:HttpServer.NullLogWriter"/> | ||
3497 | <seealso cref="T:HttpServer.ConsoleLogWriter"/> | ||
3498 | <seealso cref="P:HttpServer.HttpServer.LogWriter"/> | ||
3499 | </member> | ||
3500 | <member name="P:HttpServer.HttpServer.BackLog"> | ||
3501 | <summary> | ||
3502 | Number of connections that can wait to be accepted by the server. | ||
3503 | </summary> | ||
3504 | <remarks>Default is 10.</remarks> | ||
3505 | </member> | ||
3506 | <member name="P:HttpServer.HttpServer.MaxRequestCount"> | ||
3507 | <summary> | ||
3508 | Gets or sets maximum number of allowed simultaneous requests. | ||
3509 | </summary> | ||
3510 | <remarks> | ||
3511 | <para> | ||
3512 | This property is useful in busy systems. The HTTP server | ||
3513 | will start queuing new requests if this limit is hit, instead | ||
3514 | of trying to process all incoming requests directly. | ||
3515 | </para> | ||
3516 | <para> | ||
3517 | The default number if allowed simultaneous requests are 10. | ||
3518 | </para> | ||
3519 | </remarks> | ||
3520 | </member> | ||
3521 | <member name="P:HttpServer.HttpServer.MaxQueueSize"> | ||
3522 | <summary> | ||
3523 | Gets or sets maximum number of requests queuing to be handled. | ||
3524 | </summary> | ||
3525 | <remarks> | ||
3526 | <para> | ||
3527 | The WebServer will start turning requests away if response code | ||
3528 | <see cref="F:System.Net.HttpStatusCode.ServiceUnavailable"/> to indicate that the server | ||
3529 | is too busy to be able to handle the request. | ||
3530 | </para> | ||
3531 | </remarks> | ||
3532 | </member> | ||
3533 | <member name="M:HttpServer.HttpServer.Add(HttpServer.Rules.IRule)"> | ||
3534 | <summary> | ||
3535 | Adds the specified rule. | ||
3536 | </summary> | ||
3537 | <param name="rule">The rule.</param> | ||
3538 | </member> | ||
3539 | <member name="M:HttpServer.HttpServer.Add(HttpServer.HttpModules.HttpModule)"> | ||
3540 | <summary> | ||
3541 | Add a <see cref="T:HttpServer.HttpModules.HttpModule"/> to the server. | ||
3542 | </summary> | ||
3543 | <param name="module">mode to add</param> | ||
3544 | </member> | ||
3545 | <member name="M:HttpServer.HttpServer.DecodeBody(HttpServer.IHttpRequest)"> | ||
3546 | <summary> | ||
3547 | Decodes the request body. | ||
3548 | </summary> | ||
3549 | <param name="request">The request.</param> | ||
3550 | <exception cref="T:HttpServer.Exceptions.InternalServerException">Failed to decode form data.</exception> | ||
3551 | </member> | ||
3552 | <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,System.Net.HttpStatusCode,System.String)"> | ||
3553 | <summary> | ||
3554 | Generate a HTTP error page (that will be added to the response body). | ||
3555 | response status code is also set. | ||
3556 | </summary> | ||
3557 | <param name="response">Response that the page will be generated in.</param> | ||
3558 | <param name="error"><see cref="T:System.Net.HttpStatusCode"/>.</param> | ||
3559 | <param name="body">response body contents.</param> | ||
3560 | </member> | ||
3561 | <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,HttpServer.Exceptions.HttpException)"> | ||
3562 | <summary> | ||
3563 | Generate a HTTP error page (that will be added to the response body). | ||
3564 | response status code is also set. | ||
3565 | </summary> | ||
3566 | <param name="response">Response that the page will be generated in.</param> | ||
3567 | <param name="err">exception.</param> | ||
3568 | </member> | ||
3569 | <member name="M:HttpServer.HttpServer.GetRealm(HttpServer.IHttpRequest)"> | ||
3570 | <summary> | ||
3571 | Realms are used by the <see cref="T:HttpServer.Authentication.AuthenticationModule"/>s. | ||
3572 | </summary> | ||
3573 | <param name="request">HTTP request</param> | ||
3574 | <returns>domain/realm.</returns> | ||
3575 | </member> | ||
3576 | <member name="M:HttpServer.HttpServer.HandleRequest(HttpServer.IHttpClientContext,HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
3577 | <summary> | ||
3578 | Process an incoming request. | ||
3579 | </summary> | ||
3580 | <param name="context">connection to client</param> | ||
3581 | <param name="request">request information</param> | ||
3582 | <param name="response">response that should be filled</param> | ||
3583 | <param name="session">session information</param> | ||
3584 | </member> | ||
3585 | <member name="M:HttpServer.HttpServer.OnClientDisconnected(HttpServer.IHttpClientContext,System.Net.Sockets.SocketError)"> | ||
3586 | <summary> | ||
3587 | Can be overloaded to implement stuff when a client have been connected. | ||
3588 | </summary> | ||
3589 | <remarks> | ||
3590 | Default implementation does nothing. | ||
3591 | </remarks> | ||
3592 | <param name="client">client that disconnected</param> | ||
3593 | <param name="error">disconnect reason</param> | ||
3594 | </member> | ||
3595 | <member name="M:HttpServer.HttpServer.ProcessAuthentication(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> | ||
3596 | <summary> | ||
3597 | Handle authentication | ||
3598 | </summary> | ||
3599 | <param name="request"></param> | ||
3600 | <param name="response"></param> | ||
3601 | <param name="session"></param> | ||
3602 | <returns>true if request can be handled; false if not.</returns> | ||
3603 | <exception cref="T:HttpServer.Exceptions.BadRequestException">Invalid authorization header</exception> | ||
3604 | </member> | ||
3605 | <member name="M:HttpServer.HttpServer.RequestAuthentication(HttpServer.Authentication.AuthenticationModule,HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> | ||
3606 | <summary> | ||
3607 | Will request authentication. | ||
3608 | </summary> | ||
3609 | <remarks> | ||
3610 | Sends respond to client, nothing else can be done with the response after this. | ||
3611 | </remarks> | ||
3612 | <param name="mod"></param> | ||
3613 | <param name="request"></param> | ||
3614 | <param name="response"></param> | ||
3615 | </member> | ||
3616 | <member name="M:HttpServer.HttpServer.OnRequest(System.Object,HttpServer.RequestEventArgs)"> | ||
3617 | <summary> | ||
3618 | Received from a <see cref="T:HttpServer.IHttpClientContext"/> when a request have been parsed successfully. | ||
3619 | </summary> | ||
3620 | <param name="source"><see cref="T:HttpServer.IHttpClientContext"/> that received the request.</param> | ||
3621 | <param name="args">The request.</param> | ||
3622 | </member> | ||
3623 | <member name="M:HttpServer.HttpServer.ProcessRequestWrapper(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> | ||
3624 | <summary> | ||
3625 | To be able to track request count. | ||
3626 | </summary> | ||
3627 | <param name="context"></param> | ||
3628 | <param name="request"></param> | ||
3629 | </member> | ||
3630 | <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32)"> | ||
3631 | <summary> | ||
3632 | Start the web server using regular HTTP. | ||
3633 | </summary> | ||
3634 | <param name="address">IP Address to listen on, use <c>IpAddress.Any </c>to accept connections on all IP addresses/network cards.</param> | ||
3635 | <param name="port">Port to listen on. 80 can be a good idea =)</param> | ||
3636 | <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> | ||
3637 | <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> | ||
3638 | </member> | ||
3639 | <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> | ||
3640 | <summary> | ||
3641 | Accept secure connections. | ||
3642 | </summary> | ||
3643 | <param name="address">IP Address to listen on, use <see cref="F:System.Net.IPAddress.Any"/> to accept connections on all IP Addresses / network cards.</param> | ||
3644 | <param name="port">Port to listen on. 80 can be a good idea =)</param> | ||
3645 | <param name="certificate">Certificate to use</param> | ||
3646 | <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> | ||
3647 | <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> | ||
3648 | </member> | ||
3649 | <member name="M:HttpServer.HttpServer.Stop"> | ||
3650 | <summary> | ||
3651 | shut down the server and listeners | ||
3652 | </summary> | ||
3653 | </member> | ||
3654 | <member name="M:HttpServer.HttpServer.WriteLog(HttpServer.LogPrio,System.String)"> | ||
3655 | <summary> | ||
3656 | write an entry to the log file | ||
3657 | </summary> | ||
3658 | <param name="prio">importance of the message</param> | ||
3659 | <param name="message">log message</param> | ||
3660 | </member> | ||
3661 | <member name="M:HttpServer.HttpServer.WriteLog(System.Object,HttpServer.LogPrio,System.String)"> | ||
3662 | <summary> | ||
3663 | write an entry to the log file | ||
3664 | </summary> | ||
3665 | <param name="source">object that wrote the message</param> | ||
3666 | <param name="prio">importance of the message</param> | ||
3667 | <param name="message">log message</param> | ||
3668 | </member> | ||
3669 | <member name="E:HttpServer.HttpServer.RealmWanted"> | ||
3670 | <summary> | ||
3671 | Realms are used during HTTP authentication. | ||
3672 | Default realm is same as server name. | ||
3673 | </summary> | ||
3674 | </member> | ||
3675 | <member name="E:HttpServer.HttpServer.ExceptionThrown"> | ||
3676 | <summary> | ||
3677 | Let's to receive unhandled exceptions from the threads. | ||
3678 | </summary> | ||
3679 | <remarks> | ||
3680 | Exceptions will be thrown during debug mode if this event is not used, | ||
3681 | exceptions will be printed to console and suppressed during release mode. | ||
3682 | </remarks> | ||
3683 | </member> | ||
3684 | <member name="T:HttpServer.IComponentProvider"> | ||
3685 | <summary> | ||
3686 | Inversion of control interface. | ||
3687 | </summary> | ||
3688 | </member> | ||
3689 | <member name="M:HttpServer.IComponentProvider.AddInstance``1(System.Object)"> | ||
3690 | <summary> | ||
3691 | Add a component instance | ||
3692 | </summary> | ||
3693 | <typeparam name="T">Interface type</typeparam> | ||
3694 | <param name="instance">Instance to add</param> | ||
3695 | </member> | ||
3696 | <member name="M:HttpServer.IComponentProvider.Get``1"> | ||
3697 | <summary> | ||
3698 | Get a component. | ||
3699 | </summary> | ||
3700 | <typeparam name="T">Interface type</typeparam> | ||
3701 | <returns>Component if registered, otherwise null.</returns> | ||
3702 | <remarks> | ||
3703 | Component will get created if needed. | ||
3704 | </remarks> | ||
3705 | </member> | ||
3706 | <member name="M:HttpServer.IComponentProvider.Contains(System.Type)"> | ||
3707 | <summary> | ||
3708 | Checks if the specified component interface have been added. | ||
3709 | </summary> | ||
3710 | <param name="interfaceType"></param> | ||
3711 | <returns>true if found; otherwise false.</returns> | ||
3712 | </member> | ||
3713 | <member name="M:HttpServer.IComponentProvider.Add``2"> | ||
3714 | <summary> | ||
3715 | Add a component. | ||
3716 | </summary> | ||
3717 | <typeparam name="InterfaceType">Type being requested.</typeparam> | ||
3718 | <typeparam name="InstanceType">Type being created.</typeparam> | ||
3719 | </member> | ||
3720 | <member name="T:HttpServer.IHttpClientContext"> | ||
3721 | <summary> | ||
3722 | Contains a connection to a browser/client. | ||
3723 | </summary> | ||
3724 | </member> | ||
3725 | <member name="P:HttpServer.IHttpClientContext.Secured"> | ||
3726 | <summary> | ||
3727 | Using SSL or other encryption method. | ||
3728 | </summary> | ||
3729 | </member> | ||
3730 | <member name="P:HttpServer.IHttpClientContext.IsSecured"> | ||
3731 | <summary> | ||
3732 | Using SSL or other encryption method. | ||
3733 | </summary> | ||
3734 | </member> | ||
3735 | <member name="M:HttpServer.IHttpClientContext.Disconnect(System.Net.Sockets.SocketError)"> | ||
3736 | <summary> | ||
3737 | Disconnect from client | ||
3738 | </summary> | ||
3739 | <param name="error">error to report in the <see cref="E:HttpServer.IHttpClientContext.Disconnected"/> event.</param> | ||
3740 | </member> | ||
3741 | <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String,System.String)"> | ||
3742 | <summary> | ||
3743 | Send a response. | ||
3744 | </summary> | ||
3745 | <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> | ||
3746 | <param name="statusCode">HTTP status code</param> | ||
3747 | <param name="reason">reason for the status code.</param> | ||
3748 | <param name="body">HTML body contents, can be null or empty.</param> | ||
3749 | <param name="contentType">A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty</param> | ||
3750 | <exception cref="T:System.ArgumentException">If <paramref name="httpVersion"/> is invalid.</exception> | ||
3751 | </member> | ||
3752 | <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String)"> | ||
3753 | <summary> | ||
3754 | Send a response. | ||
3755 | </summary> | ||
3756 | <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> | ||
3757 | <param name="statusCode">HTTP status code</param> | ||
3758 | <param name="reason">reason for the status code.</param> | ||
3759 | </member> | ||
3760 | <member name="M:HttpServer.IHttpClientContext.Respond(System.String)"> | ||
3761 | <summary> | ||
3762 | Send a response. | ||
3763 | </summary> | ||
3764 | <exception cref="T:System.ArgumentNullException"></exception> | ||
3765 | </member> | ||
3766 | <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[])"> | ||
3767 | <summary> | ||
3768 | send a whole buffer | ||
3769 | </summary> | ||
3770 | <param name="buffer">buffer to send</param> | ||
3771 | <exception cref="T:System.ArgumentNullException"></exception> | ||
3772 | </member> | ||
3773 | <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[],System.Int32,System.Int32)"> | ||
3774 | <summary> | ||
3775 | Send data using the stream | ||
3776 | </summary> | ||
3777 | <param name="buffer">Contains data to send</param> | ||
3778 | <param name="offset">Start position in buffer</param> | ||
3779 | <param name="size">number of bytes to send</param> | ||
3780 | <exception cref="T:System.ArgumentNullException"></exception> | ||
3781 | <exception cref="T:System.ArgumentOutOfRangeException"></exception> | ||
3782 | </member> | ||
3783 | <member name="M:HttpServer.IHttpClientContext.Close"> | ||
3784 | <summary> | ||
3785 | Closes the streams and disposes of the unmanaged resources | ||
3786 | </summary> | ||
3787 | </member> | ||
3788 | <member name="E:HttpServer.IHttpClientContext.Disconnected"> | ||
3789 | <summary> | ||
3790 | The context have been disconnected. | ||
3791 | </summary> | ||
3792 | <remarks> | ||
3793 | Event can be used to clean up a context, or to reuse it. | ||
3794 | </remarks> | ||
3795 | </member> | ||
3796 | <member name="E:HttpServer.IHttpClientContext.RequestReceived"> | ||
3797 | <summary> | ||
3798 | A request have been received in the context. | ||
3799 | </summary> | ||
3800 | </member> | ||
3801 | <member name="T:HttpServer.DisconnectedEventArgs"> | ||
3802 | <summary> | ||
3803 | A <see cref="T:HttpServer.IHttpClientContext"/> have been disconnected. | ||
3804 | </summary> | ||
3805 | </member> | ||
3806 | <member name="P:HttpServer.DisconnectedEventArgs.Error"> | ||
3807 | <summary> | ||
3808 | Gets reason to why client disconnected. | ||
3809 | </summary> | ||
3810 | </member> | ||
3811 | <member name="M:HttpServer.DisconnectedEventArgs.#ctor(System.Net.Sockets.SocketError)"> | ||
3812 | <summary> | ||
3813 | Initializes a new instance of the <see cref="T:HttpServer.DisconnectedEventArgs"/> class. | ||
3814 | </summary> | ||
3815 | <param name="error">Reason to disconnection.</param> | ||
3816 | </member> | ||
3817 | <member name="T:HttpServer.RequestEventArgs"> | ||
3818 | <summary> | ||
3819 | |||
3820 | </summary> | ||
3821 | </member> | ||
3822 | <member name="P:HttpServer.RequestEventArgs.Request"> | ||
3823 | <summary> | ||
3824 | Gets received request. | ||
3825 | </summary> | ||
3826 | </member> | ||
3827 | <member name="M:HttpServer.RequestEventArgs.#ctor(HttpServer.IHttpRequest)"> | ||
3828 | <summary> | ||
3829 | Initializes a new instance of the <see cref="T:HttpServer.RequestEventArgs"/> class. | ||
3830 | </summary> | ||
3831 | <param name="request">The request.</param> | ||
3832 | </member> | ||
3833 | <member name="T:HttpServer.IHttpContextHandler"> | ||
3834 | <summary> | ||
3835 | Class that receives Requests from a <see cref="T:HttpServer.IHttpClientContext"/>. | ||
3836 | </summary> | ||
3837 | </member> | ||
3838 | <member name="M:HttpServer.IHttpContextHandler.ClientDisconnected(HttpServer.IHttpClientContext,System.Net.Sockets.SocketError)"> | ||
3839 | <summary> | ||
3840 | Client have been disconnected. | ||
3841 | </summary> | ||
3842 | <param name="client">Client that was disconnected.</param> | ||
3843 | <param name="error">Reason</param> | ||
3844 | <see cref="T:HttpServer.IHttpClientContext"/> | ||
3845 | </member> | ||
3846 | <member name="M:HttpServer.IHttpContextHandler.RequestReceived(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> | ||
3847 | <summary> | ||
3848 | Invoked when a client context have received a new HTTP request | ||
3849 | </summary> | ||
3850 | <param name="client">Client that received the request.</param> | ||
3851 | <param name="request">Request that was received.</param> | ||
3852 | <see cref="T:HttpServer.IHttpClientContext"/> | ||
3853 | </member> | ||
3854 | <member name="T:HttpServer.IHttpRequest"> | ||
3855 | <summary> | ||
3856 | Contains server side HTTP request information. | ||
3857 | </summary> | ||
3858 | </member> | ||
3859 | <member name="P:HttpServer.IHttpRequest.AcceptTypes"> | ||
3860 | <summary> | ||
3861 | Gets kind of types accepted by the client. | ||
3862 | </summary> | ||
3863 | </member> | ||
3864 | <member name="P:HttpServer.IHttpRequest.Body"> | ||
3865 | <summary> | ||
3866 | Gets or sets body stream. | ||
3867 | </summary> | ||
3868 | </member> | ||
3869 | <member name="P:HttpServer.IHttpRequest.BodyIsComplete"> | ||
3870 | <summary> | ||
3871 | Gets whether the body is complete. | ||
3872 | </summary> | ||
3873 | </member> | ||
3874 | <member name="P:HttpServer.IHttpRequest.Connection"> | ||
3875 | <summary> | ||
3876 | Gets or sets kind of connection used for the session. | ||
3877 | </summary> | ||
3878 | </member> | ||
3879 | <member name="P:HttpServer.IHttpRequest.ContentLength"> | ||
3880 | <summary> | ||
3881 | Gets or sets number of bytes in the body. | ||
3882 | </summary> | ||
3883 | </member> | ||
3884 | <member name="P:HttpServer.IHttpRequest.Cookies"> | ||
3885 | <summary> | ||
3886 | Gets cookies that was sent with the request. | ||
3887 | </summary> | ||
3888 | </member> | ||
3889 | <member name="P:HttpServer.IHttpRequest.Form"> | ||
3890 | <summary> | ||
3891 | Gets form parameters. | ||
3892 | </summary> | ||
3893 | </member> | ||
3894 | <member name="P:HttpServer.IHttpRequest.Headers"> | ||
3895 | <summary> | ||
3896 | Gets headers sent by the client. | ||
3897 | </summary> | ||
3898 | </member> | ||
3899 | <member name="P:HttpServer.IHttpRequest.HttpVersion"> | ||
3900 | <summary> | ||
3901 | Gets or sets version of HTTP protocol that's used. | ||
3902 | </summary> | ||
3903 | <remarks> | ||
3904 | Probably <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/>. | ||
3905 | </remarks> | ||
3906 | <seealso cref="T:HttpServer.HttpHelper"/> | ||
3907 | </member> | ||
3908 | <member name="P:HttpServer.IHttpRequest.IsAjax"> | ||
3909 | <summary> | ||
3910 | Gets whether the request was made by Ajax (Asynchronous JavaScript) | ||
3911 | </summary> | ||
3912 | </member> | ||
3913 | <member name="P:HttpServer.IHttpRequest.Method"> | ||
3914 | <summary> | ||
3915 | Gets or sets requested method. | ||
3916 | </summary> | ||
3917 | <remarks> | ||
3918 | Will always be in upper case. | ||
3919 | </remarks> | ||
3920 | <see cref="P:HttpServer.IHttpRequest.Method"/> | ||
3921 | </member> | ||
3922 | <member name="P:HttpServer.IHttpRequest.Param"> | ||
3923 | <summary> | ||
3924 | Gets parameter from <see cref="P:HttpServer.IHttpRequest.QueryString"/> or <see cref="P:HttpServer.IHttpRequest.Form"/>. | ||
3925 | </summary> | ||
3926 | </member> | ||
3927 | <member name="P:HttpServer.IHttpRequest.QueryString"> | ||
3928 | <summary> | ||
3929 | Gets variables sent in the query string | ||
3930 | </summary> | ||
3931 | </member> | ||
3932 | <member name="P:HttpServer.IHttpRequest.Uri"> | ||
3933 | <summary> | ||
3934 | Gets or sets requested URI. | ||
3935 | </summary> | ||
3936 | </member> | ||
3937 | <member name="P:HttpServer.IHttpRequest.UriParts"> | ||
3938 | <summary> | ||
3939 | Gets URI absolute path divided into parts. | ||
3940 | </summary> | ||
3941 | <example> | ||
3942 | // URI is: http://gauffin.com/code/tiny/ | ||
3943 | Console.WriteLine(request.UriParts[0]); // result: code | ||
3944 | Console.WriteLine(request.UriParts[1]); // result: tiny | ||
3945 | </example> | ||
3946 | <remarks> | ||
3947 | If you're using controllers than the first part is controller name, | ||
3948 | the second part is method name and the third part is Id property. | ||
3949 | </remarks> | ||
3950 | <seealso cref="P:HttpServer.IHttpRequest.Uri"/> | ||
3951 | </member> | ||
3952 | <member name="P:HttpServer.IHttpRequest.UriPath"> | ||
3953 | <summary> | ||
3954 | Gets or sets path and query. | ||
3955 | </summary> | ||
3956 | <see cref="P:HttpServer.IHttpRequest.Uri"/> | ||
3957 | <remarks> | ||
3958 | Are only used during request parsing. Cannot be set after "Host" header have been | ||
3959 | added. | ||
3960 | </remarks> | ||
3961 | </member> | ||
3962 | <member name="M:HttpServer.IHttpRequest.AddHeader(System.String,System.String)"> | ||
3963 | <summary> | ||
3964 | Called during parsing of a <see cref="T:HttpServer.IHttpRequest"/>. | ||
3965 | </summary> | ||
3966 | <param name="name">Name of the header, should not be URL encoded</param> | ||
3967 | <param name="value">Value of the header, should not be URL encoded</param> | ||
3968 | <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> | ||
3969 | </member> | ||
3970 | <member name="M:HttpServer.IHttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> | ||
3971 | <summary> | ||
3972 | Add bytes to the body | ||
3973 | </summary> | ||
3974 | <param name="bytes">buffer to read bytes from</param> | ||
3975 | <param name="offset">where to start read</param> | ||
3976 | <param name="length">number of bytes to read</param> | ||
3977 | <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> | ||
3978 | <exception cref="T:System.InvalidOperationException">If body is not writable</exception> | ||
3979 | <exception cref="T:System.ArgumentNullException"><c>bytes</c> is null.</exception> | ||
3980 | <exception cref="T:System.ArgumentOutOfRangeException"><c>offset</c> is out of range.</exception> | ||
3981 | </member> | ||
3982 | <member name="M:HttpServer.IHttpRequest.Clear"> | ||
3983 | <summary> | ||
3984 | Clear everything in the request | ||
3985 | </summary> | ||
3986 | </member> | ||
3987 | <member name="M:HttpServer.IHttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> | ||
3988 | <summary> | ||
3989 | Decode body into a form. | ||
3990 | </summary> | ||
3991 | <param name="providers">A list with form decoders.</param> | ||
3992 | <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> | ||
3993 | <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> | ||
3994 | </member> | ||
3995 | <member name="M:HttpServer.IHttpRequest.SetCookies(HttpServer.RequestCookies)"> | ||
3996 | <summary> | ||
3997 | Sets the cookies. | ||
3998 | </summary> | ||
3999 | <param name="cookies">The cookies.</param> | ||
4000 | </member> | ||
4001 | <member name="M:HttpServer.IHttpRequest.CreateResponse(HttpServer.IHttpClientContext)"> | ||
4002 | <summary> | ||
4003 | Create a response object. | ||
4004 | </summary> | ||
4005 | <param name="context">Context for the connected client.</param> | ||
4006 | <returns>A new <see cref="T:HttpServer.IHttpResponse"/>.</returns> | ||
4007 | </member> | ||
4008 | <member name="T:HttpServer.IHttpRequestParser"> | ||
4009 | <summary> | ||
4010 | Event driven parser used to parse incoming HTTP requests. | ||
4011 | </summary> | ||
4012 | <remarks> | ||
4013 | The parser supports partial messages and keeps the states between | ||
4014 | each parsed buffer. It's therefore important that the parser gets | ||
4015 | <see cref="M:HttpServer.IHttpRequestParser.Clear"/>ed if a client disconnects. | ||
4016 | </remarks> | ||
4017 | </member> | ||
4018 | <member name="P:HttpServer.IHttpRequestParser.CurrentState"> | ||
4019 | <summary> | ||
4020 | Current state in parser. | ||
4021 | </summary> | ||
4022 | </member> | ||
4023 | <member name="M:HttpServer.IHttpRequestParser.Parse(System.Byte[],System.Int32,System.Int32)"> | ||
4024 | <summary> | ||
4025 | Parse partial or complete message. | ||
4026 | </summary> | ||
4027 | <param name="buffer">buffer containing incoming bytes</param> | ||
4028 | <param name="offset">where in buffer that parsing should start</param> | ||
4029 | <param name="count">number of bytes to parse</param> | ||
4030 | <returns>Unparsed bytes left in buffer.</returns> | ||
4031 | <exception cref="T:HttpServer.Exceptions.BadRequestException"><c>BadRequestException</c>.</exception> | ||
4032 | </member> | ||
4033 | <member name="E:HttpServer.IHttpRequestParser.RequestCompleted"> | ||
4034 | <summary> | ||
4035 | A request have been successfully parsed. | ||
4036 | </summary> | ||
4037 | </member> | ||
4038 | <member name="E:HttpServer.IHttpRequestParser.BodyBytesReceived"> | ||
4039 | <summary> | ||
4040 | More body bytes have been received. | ||
4041 | </summary> | ||
4042 | </member> | ||
4043 | <member name="E:HttpServer.IHttpRequestParser.RequestLineReceived"> | ||
4044 | <summary> | ||
4045 | Request line have been received. | ||
4046 | </summary> | ||
4047 | </member> | ||
4048 | <member name="E:HttpServer.IHttpRequestParser.HeaderReceived"> | ||
4049 | <summary> | ||
4050 | A header have been received. | ||
4051 | </summary> | ||
4052 | </member> | ||
4053 | <member name="M:HttpServer.IHttpRequestParser.Clear"> | ||
4054 | <summary> | ||
4055 | Clear parser state. | ||
4056 | </summary> | ||
4057 | </member> | ||
4058 | <member name="P:HttpServer.IHttpRequestParser.LogWriter"> | ||
4059 | <summary> | ||
4060 | Gets or sets the log writer. | ||
4061 | </summary> | ||
4062 | </member> | ||
4063 | <member name="T:HttpServer.RequestParserState"> | ||
4064 | <summary> | ||
4065 | Current state in the parsing. | ||
4066 | </summary> | ||
4067 | </member> | ||
4068 | <member name="F:HttpServer.RequestParserState.FirstLine"> | ||
4069 | <summary> | ||
4070 | Should parse the request line | ||
4071 | </summary> | ||
4072 | </member> | ||
4073 | <member name="F:HttpServer.RequestParserState.HeaderName"> | ||
4074 | <summary> | ||
4075 | Searching for a complete header name | ||
4076 | </summary> | ||
4077 | </member> | ||
4078 | <member name="F:HttpServer.RequestParserState.AfterName"> | ||
4079 | <summary> | ||
4080 | Searching for colon after header name (ignoring white spaces) | ||
4081 | </summary> | ||
4082 | </member> | ||
4083 | <member name="F:HttpServer.RequestParserState.Between"> | ||
4084 | <summary> | ||
4085 | Searching for start of header value (ignoring white spaces) | ||
4086 | </summary> | ||
4087 | </member> | ||
4088 | <member name="F:HttpServer.RequestParserState.HeaderValue"> | ||
4089 | <summary> | ||
4090 | Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) | ||
4091 | </summary> | ||
4092 | </member> | ||
4093 | <member name="F:HttpServer.RequestParserState.Body"> | ||
4094 | <summary> | ||
4095 | Adding bytes to body | ||
4096 | </summary> | ||
4097 | </member> | ||
4098 | <member name="T:HttpServer.IHttpResponse"> | ||
4099 | <summary> | ||
4100 | Response that is sent back to the web browser / client. | ||
4101 | |||
4102 | A response can be sent if different ways. The easiest one is | ||
4103 | to just fill the Body stream with content, everything else | ||
4104 | will then be taken care of by the framework. The default content-type | ||
4105 | is text/html, you should change it if you send anything else. | ||
4106 | |||
4107 | The second and slighty more complex way is to send the response | ||
4108 | as parts. Start with sending the header using the SendHeaders method and | ||
4109 | then you can send the body using SendBody method, but do not forget | ||
4110 | to set ContentType and ContentLength before doing so. | ||
4111 | </summary> | ||
4112 | <example> | ||
4113 | public void MyHandler(IHttpRequest request, IHttpResponse response) | ||
4114 | { | ||
4115 | |||
4116 | } | ||
4117 | </example> | ||
4118 | </member> | ||
4119 | <member name="P:HttpServer.IHttpResponse.Body"> | ||
4120 | <summary> | ||
4121 | The body stream is used to cache the body contents | ||
4122 | before sending everything to the client. It's the simplest | ||
4123 | way to serve documents. | ||
4124 | </summary> | ||
4125 | </member> | ||
4126 | <member name="P:HttpServer.IHttpResponse.ProtocolVersion"> | ||
4127 | <summary> | ||
4128 | Defines the version of the HTTP Response for applications where it's required | ||
4129 | for this to be forced. | ||
4130 | </summary> | ||
4131 | </member> | ||
4132 | <member name="P:HttpServer.IHttpResponse.Chunked"> | ||
4133 | <summary> | ||
4134 | The chunked encoding modifies the body of a message in order to | ||
4135 | transfer it as a series of chunks, each with its own size indicator, | ||
4136 | followed by an OPTIONAL trailer containing entity-header fields. This | ||
4137 | allows dynamically produced content to be transferred along with the | ||
4138 | information necessary for the recipient to verify that it has | ||
4139 | received the full message. | ||
4140 | </summary> | ||
4141 | </member> | ||
4142 | <member name="P:HttpServer.IHttpResponse.Connection"> | ||
4143 | <summary> | ||
4144 | Kind of connection | ||
4145 | </summary> | ||
4146 | </member> | ||
4147 | <member name="P:HttpServer.IHttpResponse.Encoding"> | ||
4148 | <summary> | ||
4149 | Encoding to use when sending stuff to the client. | ||
4150 | </summary> | ||
4151 | <remarks>Default is UTF8</remarks> | ||
4152 | </member> | ||
4153 | <member name="P:HttpServer.IHttpResponse.KeepAlive"> | ||
4154 | <summary> | ||
4155 | Number of seconds to keep connection alive | ||
4156 | </summary> | ||
4157 | <remarks>Only used if Connection property is set to ConnectionType.KeepAlive</remarks> | ||
4158 | </member> | ||
4159 | <member name="P:HttpServer.IHttpResponse.Status"> | ||
4160 | <summary> | ||
4161 | Status code that is sent to the client. | ||
4162 | </summary> | ||
4163 | <remarks>Default is HttpStatusCode.Ok</remarks> | ||
4164 | </member> | ||
4165 | <member name="P:HttpServer.IHttpResponse.Reason"> | ||
4166 | <summary> | ||
4167 | Information about why a specific status code was used. | ||
4168 | </summary> | ||
4169 | </member> | ||
4170 | <member name="P:HttpServer.IHttpResponse.ContentLength"> | ||
4171 | <summary> | ||
4172 | Size of the body. MUST be specified before sending the header, | ||
4173 | unless property Chunked is set to true. | ||
4174 | </summary> | ||
4175 | </member> | ||
4176 | <member name="P:HttpServer.IHttpResponse.ContentType"> | ||
4177 | <summary> | ||
4178 | Kind of content in the body | ||
4179 | </summary> | ||
4180 | <remarks>Default is text/html</remarks> | ||
4181 | </member> | ||
4182 | <member name="P:HttpServer.IHttpResponse.HeadersSent"> | ||
4183 | <summary> | ||
4184 | Headers have been sent to the client- | ||
4185 | </summary> | ||
4186 | <remarks>You can not send any additional headers if they have already been sent.</remarks> | ||
4187 | </member> | ||
4188 | <member name="P:HttpServer.IHttpResponse.Sent"> | ||
4189 | <summary> | ||
4190 | The whole response have been sent. | ||
4191 | </summary> | ||
4192 | </member> | ||
4193 | <member name="P:HttpServer.IHttpResponse.Cookies"> | ||
4194 | <summary> | ||
4195 | Cookies that should be created/changed. | ||
4196 | </summary> | ||
4197 | </member> | ||
4198 | <member name="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"> | ||
4199 | <summary> | ||
4200 | Add another header to the document. | ||
4201 | </summary> | ||
4202 | <param name="name">Name of the header, case sensitive, use lower cases.</param> | ||
4203 | <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> | ||
4204 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
4205 | <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> | ||
4206 | <remarks>Adding any header will override the default ones and those specified by properties.</remarks> | ||
4207 | </member> | ||
4208 | <member name="M:HttpServer.IHttpResponse.Send"> | ||
4209 | <summary> | ||
4210 | Send headers and body to the browser. | ||
4211 | </summary> | ||
4212 | <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> | ||
4213 | </member> | ||
4214 | <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> | ||
4215 | <summary> | ||
4216 | Make sure that you have specified ContentLength and sent the headers first. | ||
4217 | </summary> | ||
4218 | <param name="buffer"></param> | ||
4219 | <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> | ||
4220 | <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> | ||
4221 | <param name="offset">offest of first byte to send</param> | ||
4222 | <param name="count">number of bytes to send.</param> | ||
4223 | <seealso cref="M:HttpServer.IHttpResponse.Send"/> | ||
4224 | <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> | ||
4225 | <remarks>This method can be used if you want to send body contents without caching them first. This | ||
4226 | is recommended for larger files to keep the memory usage low.</remarks> | ||
4227 | </member> | ||
4228 | <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"> | ||
4229 | <summary> | ||
4230 | Make sure that you have specified ContentLength and sent the headers first. | ||
4231 | </summary> | ||
4232 | <param name="buffer"></param> | ||
4233 | <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> | ||
4234 | <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> | ||
4235 | <seealso cref="M:HttpServer.IHttpResponse.Send"/> | ||
4236 | <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> | ||
4237 | <remarks>This method can be used if you want to send body contents without caching them first. This | ||
4238 | is recommended for larger files to keep the memory usage low.</remarks> | ||
4239 | </member> | ||
4240 | <member name="M:HttpServer.IHttpResponse.SendHeaders"> | ||
4241 | <summary> | ||
4242 | Send headers to the client. | ||
4243 | </summary> | ||
4244 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
4245 | <seealso cref="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"/> | ||
4246 | <seealso cref="M:HttpServer.IHttpResponse.Send"/> | ||
4247 | <seealso cref="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"/> | ||
4248 | </member> | ||
4249 | <member name="M:HttpServer.IHttpResponse.Redirect(System.Uri)"> | ||
4250 | <summary> | ||
4251 | Redirect client to somewhere else using the 302 status code. | ||
4252 | </summary> | ||
4253 | <param name="uri">Destination of the redirect</param> | ||
4254 | <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> | ||
4255 | <remarks>You can not do anything more with the request when a redirect have been done. This should be your last | ||
4256 | action.</remarks> | ||
4257 | </member> | ||
4258 | <member name="M:HttpServer.IHttpResponse.Redirect(System.String)"> | ||
4259 | <summary> | ||
4260 | redirect to somewhere | ||
4261 | </summary> | ||
4262 | <param name="url">where the redirect should go</param> | ||
4263 | <remarks> | ||
4264 | No body are allowed when doing redirects. | ||
4265 | </remarks> | ||
4266 | </member> | ||
4267 | <member name="T:HttpServer.ConnectionType"> | ||
4268 | <summary> | ||
4269 | Type of HTTP connection | ||
4270 | </summary> | ||
4271 | </member> | ||
4272 | <member name="F:HttpServer.ConnectionType.Close"> | ||
4273 | <summary> | ||
4274 | Connection is closed after each request-response | ||
4275 | </summary> | ||
4276 | </member> | ||
4277 | <member name="F:HttpServer.ConnectionType.KeepAlive"> | ||
4278 | <summary> | ||
4279 | Connection is kept alive for X seconds (unless another request have been made) | ||
4280 | </summary> | ||
4281 | </member> | ||
4282 | <member name="T:HttpServer.LogPrio"> | ||
4283 | <summary> | ||
4284 | Priority for log entries | ||
4285 | </summary> | ||
4286 | <seealso cref="T:HttpServer.ILogWriter"/> | ||
4287 | </member> | ||
4288 | <member name="F:HttpServer.LogPrio.Trace"> | ||
4289 | <summary> | ||
4290 | Very detailed logs to be able to follow the flow of the program. | ||
4291 | </summary> | ||
4292 | </member> | ||
4293 | <member name="F:HttpServer.LogPrio.Debug"> | ||
4294 | <summary> | ||
4295 | Logs to help debug errors in the application | ||
4296 | </summary> | ||
4297 | </member> | ||
4298 | <member name="F:HttpServer.LogPrio.Info"> | ||
4299 | <summary> | ||
4300 | Information to be able to keep track of state changes etc. | ||
4301 | </summary> | ||
4302 | </member> | ||
4303 | <member name="F:HttpServer.LogPrio.Warning"> | ||
4304 | <summary> | ||
4305 | Something did not go as we expected, but it's no problem. | ||
4306 | </summary> | ||
4307 | </member> | ||
4308 | <member name="F:HttpServer.LogPrio.Error"> | ||
4309 | <summary> | ||
4310 | Something that should not fail failed, but we can still keep | ||
4311 | on going. | ||
4312 | </summary> | ||
4313 | </member> | ||
4314 | <member name="F:HttpServer.LogPrio.Fatal"> | ||
4315 | <summary> | ||
4316 | Something failed, and we cannot handle it properly. | ||
4317 | </summary> | ||
4318 | </member> | ||
4319 | <member name="T:HttpServer.ILogWriter"> | ||
4320 | <summary> | ||
4321 | Interface used to write to log files. | ||
4322 | </summary> | ||
4323 | </member> | ||
4324 | <member name="M:HttpServer.ILogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> | ||
4325 | <summary> | ||
4326 | Write an entry to the log file. | ||
4327 | </summary> | ||
4328 | <param name="source">object that is writing to the log</param> | ||
4329 | <param name="priority">importance of the log message</param> | ||
4330 | <param name="message">the message</param> | ||
4331 | </member> | ||
4332 | <member name="T:HttpServer.ConsoleLogWriter"> | ||
4333 | <summary> | ||
4334 | This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) | ||
4335 | </summary> | ||
4336 | <seealso cref="T:HttpServer.ILogWriter"/> | ||
4337 | </member> | ||
4338 | <member name="F:HttpServer.ConsoleLogWriter.Instance"> | ||
4339 | <summary> | ||
4340 | The actual instance of this class. | ||
4341 | </summary> | ||
4342 | </member> | ||
4343 | <member name="M:HttpServer.ConsoleLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> | ||
4344 | <summary> | ||
4345 | Logwriters the specified source. | ||
4346 | </summary> | ||
4347 | <param name="source">object that wrote the logentry.</param> | ||
4348 | <param name="prio">Importance of the log message</param> | ||
4349 | <param name="message">The message.</param> | ||
4350 | </member> | ||
4351 | <member name="M:HttpServer.ConsoleLogWriter.GetColor(HttpServer.LogPrio)"> | ||
4352 | <summary> | ||
4353 | Get color for the specified logprio | ||
4354 | </summary> | ||
4355 | <param name="prio">prio for the log entry</param> | ||
4356 | <returns>A <see cref="T:System.ConsoleColor"/> for the prio</returns> | ||
4357 | </member> | ||
4358 | <member name="T:HttpServer.NullLogWriter"> | ||
4359 | <summary> | ||
4360 | Default log writer, writes everything to null (nowhere). | ||
4361 | </summary> | ||
4362 | <seealso cref="T:HttpServer.ILogWriter"/> | ||
4363 | </member> | ||
4364 | <member name="F:HttpServer.NullLogWriter.Instance"> | ||
4365 | <summary> | ||
4366 | The logging instance. | ||
4367 | </summary> | ||
4368 | </member> | ||
4369 | <member name="M:HttpServer.NullLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> | ||
4370 | <summary> | ||
4371 | Writes everything to null | ||
4372 | </summary> | ||
4373 | <param name="source">object that wrote the log entry.</param> | ||
4374 | <param name="prio">Importance of the log message</param> | ||
4375 | <param name="message">The message.</param> | ||
4376 | </member> | ||
4377 | <member name="T:HttpServer.LocklessQueue`1"> | ||
4378 | <summary> | ||
4379 | A thread-safe lockless queue that supports multiple readers and | ||
4380 | multiple writers | ||
4381 | </summary> | ||
4382 | </member> | ||
4383 | <member name="T:HttpServer.LocklessQueue`1.SingleLinkNode"> | ||
4384 | <summary> | ||
4385 | Provides a node container for data in a singly linked list | ||
4386 | </summary> | ||
4387 | </member> | ||
4388 | <member name="F:HttpServer.LocklessQueue`1.SingleLinkNode.Next"> | ||
4389 | <summary>Pointer to the next node in list</summary> | ||
4390 | </member> | ||
4391 | <member name="F:HttpServer.LocklessQueue`1.SingleLinkNode.Item"> | ||
4392 | <summary>The data contained by the node</summary> | ||
4393 | </member> | ||
4394 | <member name="M:HttpServer.LocklessQueue`1.SingleLinkNode.#ctor"> | ||
4395 | <summary> | ||
4396 | Constructor | ||
4397 | </summary> | ||
4398 | </member> | ||
4399 | <member name="M:HttpServer.LocklessQueue`1.SingleLinkNode.#ctor(`0)"> | ||
4400 | <summary> | ||
4401 | Constructor | ||
4402 | </summary> | ||
4403 | </member> | ||
4404 | <member name="F:HttpServer.LocklessQueue`1.head"> | ||
4405 | <summary>Queue head</summary> | ||
4406 | </member> | ||
4407 | <member name="F:HttpServer.LocklessQueue`1.tail"> | ||
4408 | <summary>Queue tail</summary> | ||
4409 | </member> | ||
4410 | <member name="F:HttpServer.LocklessQueue`1.count"> | ||
4411 | <summary>Queue item count</summary> | ||
4412 | </member> | ||
4413 | <member name="P:HttpServer.LocklessQueue`1.Count"> | ||
4414 | <summary>Gets the current number of items in the queue. Since this | ||
4415 | is a lockless collection this value should be treated as a close | ||
4416 | estimate</summary> | ||
4417 | </member> | ||
4418 | <member name="M:HttpServer.LocklessQueue`1.#ctor"> | ||
4419 | <summary> | ||
4420 | Constructor | ||
4421 | </summary> | ||
4422 | </member> | ||
4423 | <member name="M:HttpServer.LocklessQueue`1.Enqueue(`0)"> | ||
4424 | <summary> | ||
4425 | Enqueue an item | ||
4426 | </summary> | ||
4427 | <param name="item">Item to enqeue</param> | ||
4428 | </member> | ||
4429 | <member name="M:HttpServer.LocklessQueue`1.TryDequeue(`0@)"> | ||
4430 | <summary> | ||
4431 | Try to dequeue an item | ||
4432 | </summary> | ||
4433 | <param name="item">Dequeued item if the dequeue was successful</param> | ||
4434 | <returns>True if an item was successfully deqeued, otherwise false</returns> | ||
4435 | </member> | ||
4436 | <member name="T:HttpServer.Method"> | ||
4437 | <summary> | ||
4438 | Contains all HTTP Methods (according to the HTTP 1.1 specification) | ||
4439 | <para> | ||
4440 | See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html | ||
4441 | </para> | ||
4442 | </summary> | ||
4443 | </member> | ||
4444 | <member name="F:HttpServer.Method.Delete"> | ||
4445 | <summary> | ||
4446 | The DELETE method requests that the origin server delete the resource identified by the Request-URI. | ||
4447 | </summary> | ||
4448 | <remarks> | ||
4449 | <para> | ||
4450 | This method MAY be overridden by human intervention (or other means) on the origin server. | ||
4451 | The client cannot be guaranteed that the operation has been carried out, even if the status code | ||
4452 | returned from the origin server indicates that the action has been completed successfully. | ||
4453 | </para> | ||
4454 | <para> | ||
4455 | However, the server SHOULD NOT indicate success unless, at the time the response is given, | ||
4456 | it intends to delete the resource or move it to an inaccessible location. | ||
4457 | </para> | ||
4458 | <para> | ||
4459 | A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, | ||
4460 | 202 (Accepted) if the action has not yet been enacted, | ||
4461 | or 204 (No Content) if the action has been enacted but the response does not include an entity. | ||
4462 | </para> | ||
4463 | <para> | ||
4464 | If the request passes through a cache and the Request-URI identifies one or more currently cached entities, | ||
4465 | those entries SHOULD be treated as stale. Responses to this method are not cacheable. | ||
4466 | </para> | ||
4467 | </remarks> | ||
4468 | </member> | ||
4469 | <member name="F:HttpServer.Method.Get"> | ||
4470 | <summary> | ||
4471 | The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. | ||
4472 | </summary> | ||
4473 | <remarks> | ||
4474 | <para> | ||
4475 | If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the | ||
4476 | entity in the response and not the source text of the process, unless that text happens to be the output of the process. | ||
4477 | </para> | ||
4478 | <para> | ||
4479 | The semantics of the GET method change to a "conditional GET" if the request message includes an | ||
4480 | If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. | ||
4481 | A conditional GET method requests that the entity be transferred only under the circumstances described | ||
4482 | by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network | ||
4483 | usage by allowing cached entities to be refreshed without requiring multiple requests or transferring | ||
4484 | data already held by the client. | ||
4485 | </para> | ||
4486 | </remarks> | ||
4487 | </member> | ||
4488 | <member name="F:HttpServer.Method.Header"> | ||
4489 | <summary> | ||
4490 | The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. | ||
4491 | </summary> | ||
4492 | <remarks> | ||
4493 | The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the | ||
4494 | information sent in response to a GET request. This method can be used for obtaining meta information about | ||
4495 | the entity implied by the request without transferring the entity-body itself. | ||
4496 | |||
4497 | This method is often used for testing hypertext links for validity, accessibility, and recent modification. | ||
4498 | </remarks> | ||
4499 | </member> | ||
4500 | <member name="F:HttpServer.Method.Options"> | ||
4501 | <summary> | ||
4502 | <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> | ||
4503 | </summary> | ||
4504 | <remarks> | ||
4505 | <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> | ||
4506 | </remarks> | ||
4507 | </member> | ||
4508 | <member name="F:HttpServer.Method.Post"> | ||
4509 | <summary> | ||
4510 | The POST method is used to request that the origin server accept the entity enclosed | ||
4511 | in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. | ||
4512 | </summary> | ||
4513 | <remarks> | ||
4514 | POST is designed to allow a uniform method to cover the following functions: | ||
4515 | <list type="bullet"> | ||
4516 | <item> | ||
4517 | Annotation of existing resources; | ||
4518 | </item><item> | ||
4519 | Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; | ||
4520 | </item><item> | ||
4521 | Providing a block of data, such as the result of submitting a form, to a data-handling process; | ||
4522 | </item><item> | ||
4523 | Extending a database through an append operation. | ||
4524 | </item> | ||
4525 | </list> | ||
4526 | <para> | ||
4527 | If a resource has been created on the origin server, the response SHOULD be 201 (Created) and | ||
4528 | contain an entity which describes the status of the request and refers to the new resource, and a | ||
4529 | Location header (see section 14.30). | ||
4530 | </para> | ||
4531 | <para> | ||
4532 | The action performed by the POST method might not result in a resource that can be identified by a URI. | ||
4533 | In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on | ||
4534 | whether or not the response includes an entity that describes the result. | ||
4535 | </para><para> | ||
4536 | Responses to this method are not cacheable, unless the response includes appropriate Cache-Control | ||
4537 | or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent | ||
4538 | to retrieve a cacheable resource. | ||
4539 | </para> | ||
4540 | </remarks> | ||
4541 | </member> | ||
4542 | <member name="F:HttpServer.Method.Put"> | ||
4543 | <summary> | ||
4544 | The PUT method requests that the enclosed entity be stored under the supplied Request-URI. | ||
4545 | </summary> | ||
4546 | <remarks> | ||
4547 | <list type="bullet"> | ||
4548 | <item> | ||
4549 | If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a | ||
4550 | modified version of the one residing on the origin server. | ||
4551 | </item><item> | ||
4552 | If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new | ||
4553 | resource by the requesting user agent, the origin server can create the resource with that URI. | ||
4554 | </item><item> | ||
4555 | If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. | ||
4556 | </item><item> | ||
4557 | If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to | ||
4558 | indicate successful completion of the request. | ||
4559 | </item><item> | ||
4560 | If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be | ||
4561 | given that reflects the nature of the problem. | ||
4562 | </item> | ||
4563 | </list> | ||
4564 | <para> | ||
4565 | The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not | ||
4566 | understand or implement and MUST return a 501 (Not Implemented) response in such cases. | ||
4567 | </para> | ||
4568 | </remarks> | ||
4569 | </member> | ||
4570 | <member name="F:HttpServer.Method.Trace"> | ||
4571 | <summary> | ||
4572 | The TRACE method is used to invoke a remote, application-layer loop- back of the request message. | ||
4573 | </summary> | ||
4574 | </member> | ||
4575 | <member name="T:HttpServer.Methods"> | ||
4576 | <summary> | ||
4577 | Contains all HTTP Methods (according to the HTTP 1.1 specification) | ||
4578 | <para> | ||
4579 | See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html | ||
4580 | </para> | ||
4581 | </summary> | ||
4582 | </member> | ||
4583 | <member name="F:HttpServer.Methods.Delete"> | ||
4584 | <summary> | ||
4585 | The DELETE method requests that the origin server delete the resource identified by the Request-URI. | ||
4586 | </summary> | ||
4587 | <remarks> | ||
4588 | <para> | ||
4589 | This method MAY be overridden by human intervention (or other means) on the origin server. | ||
4590 | The client cannot be guaranteed that the operation has been carried out, even if the status code | ||
4591 | returned from the origin server indicates that the action has been completed successfully. | ||
4592 | </para> | ||
4593 | <para> | ||
4594 | However, the server SHOULD NOT indicate success unless, at the time the response is given, | ||
4595 | it intends to delete the resource or move it to an inaccessible location. | ||
4596 | </para> | ||
4597 | <para> | ||
4598 | A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, | ||
4599 | 202 (Accepted) if the action has not yet been enacted, | ||
4600 | or 204 (No Content) if the action has been enacted but the response does not include an entity. | ||
4601 | </para> | ||
4602 | <para> | ||
4603 | If the request passes through a cache and the Request-URI identifies one or more currently cached entities, | ||
4604 | those entries SHOULD be treated as stale. Responses to this method are not cacheable. | ||
4605 | </para> | ||
4606 | </remarks> | ||
4607 | </member> | ||
4608 | <member name="F:HttpServer.Methods.Get"> | ||
4609 | <summary> | ||
4610 | The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. | ||
4611 | </summary> | ||
4612 | <remarks> | ||
4613 | <para> | ||
4614 | If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the | ||
4615 | entity in the response and not the source text of the process, unless that text happens to be the output of the process. | ||
4616 | </para> | ||
4617 | <para> | ||
4618 | The semantics of the GET method change to a "conditional GET" if the request message includes an | ||
4619 | If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. | ||
4620 | A conditional GET method requests that the entity be transferred only under the circumstances described | ||
4621 | by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network | ||
4622 | usage by allowing cached entities to be refreshed without requiring multiple requests or transferring | ||
4623 | data already held by the client. | ||
4624 | </para> | ||
4625 | </remarks> | ||
4626 | </member> | ||
4627 | <member name="F:HttpServer.Methods.Header"> | ||
4628 | <summary> | ||
4629 | The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. | ||
4630 | </summary> | ||
4631 | <remarks> | ||
4632 | The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the | ||
4633 | information sent in response to a GET request. This method can be used for obtaining meta information about | ||
4634 | the entity implied by the request without transferring the entity-body itself. | ||
4635 | |||
4636 | This method is often used for testing hypertext links for validity, accessibility, and recent modification. | ||
4637 | </remarks> | ||
4638 | </member> | ||
4639 | <member name="F:HttpServer.Methods.Options"> | ||
4640 | <summary> | ||
4641 | <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> | ||
4642 | </summary> | ||
4643 | <remarks> | ||
4644 | <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> | ||
4645 | </remarks> | ||
4646 | </member> | ||
4647 | <member name="F:HttpServer.Methods.Post"> | ||
4648 | <summary> | ||
4649 | The POST method is used to request that the origin server accept the entity enclosed | ||
4650 | in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. | ||
4651 | </summary> | ||
4652 | <remarks> | ||
4653 | POST is designed to allow a uniform method to cover the following functions: | ||
4654 | <list type="bullet"> | ||
4655 | <item> | ||
4656 | Annotation of existing resources; | ||
4657 | </item><item> | ||
4658 | Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; | ||
4659 | </item><item> | ||
4660 | Providing a block of data, such as the result of submitting a form, to a data-handling process; | ||
4661 | </item><item> | ||
4662 | Extending a database through an append operation. | ||
4663 | </item> | ||
4664 | </list> | ||
4665 | <para> | ||
4666 | If a resource has been created on the origin server, the response SHOULD be 201 (Created) and | ||
4667 | contain an entity which describes the status of the request and refers to the new resource, and a | ||
4668 | Location header (see section 14.30). | ||
4669 | </para> | ||
4670 | <para> | ||
4671 | The action performed by the POST method might not result in a resource that can be identified by a URI. | ||
4672 | In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on | ||
4673 | whether or not the response includes an entity that describes the result. | ||
4674 | </para><para> | ||
4675 | Responses to this method are not cacheable, unless the response includes appropriate Cache-Control | ||
4676 | or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent | ||
4677 | to retrieve a cacheable resource. | ||
4678 | </para> | ||
4679 | </remarks> | ||
4680 | </member> | ||
4681 | <member name="F:HttpServer.Methods.Put"> | ||
4682 | <summary> | ||
4683 | The PUT method requests that the enclosed entity be stored under the supplied Request-URI. | ||
4684 | </summary> | ||
4685 | <remarks> | ||
4686 | <list type="bullet"> | ||
4687 | <item> | ||
4688 | If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a | ||
4689 | modified version of the one residing on the origin server. | ||
4690 | </item><item> | ||
4691 | If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new | ||
4692 | resource by the requesting user agent, the origin server can create the resource with that URI. | ||
4693 | </item><item> | ||
4694 | If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. | ||
4695 | </item><item> | ||
4696 | If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to | ||
4697 | indicate successful completion of the request. | ||
4698 | </item><item> | ||
4699 | If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be | ||
4700 | given that reflects the nature of the problem. | ||
4701 | </item> | ||
4702 | </list> | ||
4703 | <para> | ||
4704 | The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not | ||
4705 | understand or implement and MUST return a 501 (Not Implemented) response in such cases. | ||
4706 | </para> | ||
4707 | </remarks> | ||
4708 | </member> | ||
4709 | <member name="F:HttpServer.Methods.Trace"> | ||
4710 | <summary> | ||
4711 | The TRACE method is used to invoke a remote, application-layer loop- back of the request message. | ||
4712 | </summary> | ||
4713 | </member> | ||
4714 | <member name="T:HttpServer.Parser.BodyEventArgs"> | ||
4715 | <summary> | ||
4716 | Arguments used when more body bytes have come. | ||
4717 | </summary> | ||
4718 | </member> | ||
4719 | <member name="M:HttpServer.Parser.BodyEventArgs.#ctor(System.Byte[],System.Int32,System.Int32)"> | ||
4720 | <summary> | ||
4721 | Initializes a new instance of the <see cref="T:HttpServer.Parser.BodyEventArgs"/> class. | ||
4722 | </summary> | ||
4723 | <param name="buffer">buffer that contains the received bytes.</param> | ||
4724 | <param name="offset">offset in buffer where to start processing.</param> | ||
4725 | <param name="count">number of bytes from <paramref name="offset"/> that should be parsed.</param> | ||
4726 | </member> | ||
4727 | <member name="M:HttpServer.Parser.BodyEventArgs.#ctor"> | ||
4728 | <summary> | ||
4729 | Initializes a new instance of the <see cref="T:HttpServer.Parser.BodyEventArgs"/> class. | ||
4730 | </summary> | ||
4731 | </member> | ||
4732 | <member name="P:HttpServer.Parser.BodyEventArgs.Buffer"> | ||
4733 | <summary> | ||
4734 | Gets or sets buffer that contains the received bytes. | ||
4735 | </summary> | ||
4736 | </member> | ||
4737 | <member name="P:HttpServer.Parser.BodyEventArgs.Count"> | ||
4738 | <summary> | ||
4739 | Gets or sets number of bytes from <see cref="P:HttpServer.Parser.BodyEventArgs.Offset"/> that should be parsed. | ||
4740 | </summary> | ||
4741 | </member> | ||
4742 | <member name="P:HttpServer.Parser.BodyEventArgs.Offset"> | ||
4743 | <summary> | ||
4744 | Gets or sets offset in buffer where to start processing. | ||
4745 | </summary> | ||
4746 | </member> | ||
4747 | <member name="T:HttpServer.Parser.HeaderEventArgs"> | ||
4748 | <summary> | ||
4749 | Event arguments used when a new header have been parsed. | ||
4750 | </summary> | ||
4751 | </member> | ||
4752 | <member name="M:HttpServer.Parser.HeaderEventArgs.#ctor(System.String,System.String)"> | ||
4753 | <summary> | ||
4754 | Initializes a new instance of the <see cref="T:HttpServer.Parser.HeaderEventArgs"/> class. | ||
4755 | </summary> | ||
4756 | <param name="name">Name of header.</param> | ||
4757 | <param name="value">Header value.</param> | ||
4758 | </member> | ||
4759 | <member name="M:HttpServer.Parser.HeaderEventArgs.#ctor"> | ||
4760 | <summary> | ||
4761 | Initializes a new instance of the <see cref="T:HttpServer.Parser.HeaderEventArgs"/> class. | ||
4762 | </summary> | ||
4763 | </member> | ||
4764 | <member name="P:HttpServer.Parser.HeaderEventArgs.Name"> | ||
4765 | <summary> | ||
4766 | Gets or sets header name. | ||
4767 | </summary> | ||
4768 | </member> | ||
4769 | <member name="P:HttpServer.Parser.HeaderEventArgs.Value"> | ||
4770 | <summary> | ||
4771 | Gets or sets header value. | ||
4772 | </summary> | ||
4773 | </member> | ||
4774 | <member name="T:HttpServer.Parser.HttpRequestParser"> | ||
4775 | <summary> | ||
4776 | Parses a HTTP request directly from a stream | ||
4777 | </summary> | ||
4778 | </member> | ||
4779 | <member name="M:HttpServer.Parser.HttpRequestParser.#ctor(HttpServer.ILogWriter)"> | ||
4780 | <summary> | ||
4781 | Create a new request parser | ||
4782 | </summary> | ||
4783 | <param name="logWriter">delegate receiving log entries.</param> | ||
4784 | </member> | ||
4785 | <member name="M:HttpServer.Parser.HttpRequestParser.AddToBody(System.Byte[],System.Int32,System.Int32)"> | ||
4786 | <summary> | ||
4787 | Add a number of bytes to the body | ||
4788 | </summary> | ||
4789 | <param name="buffer">buffer containing more body bytes.</param> | ||
4790 | <param name="offset">starting offset in buffer</param> | ||
4791 | <param name="count">number of bytes, from offset, to read.</param> | ||
4792 | <returns>offset to continue from.</returns> | ||
4793 | </member> | ||
4794 | <member name="M:HttpServer.Parser.HttpRequestParser.Clear"> | ||
4795 | <summary> | ||
4796 | Remove all state information for the request. | ||
4797 | </summary> | ||
4798 | </member> | ||
4799 | <member name="P:HttpServer.Parser.HttpRequestParser.LogWriter"> | ||
4800 | <summary> | ||
4801 | Gets or sets the log writer. | ||
4802 | </summary> | ||
4803 | </member> | ||
4804 | <member name="M:HttpServer.Parser.HttpRequestParser.OnFirstLine(System.String)"> | ||
4805 | <summary> | ||
4806 | Parse request line | ||
4807 | </summary> | ||
4808 | <param name="value"></param> | ||
4809 | <exception cref="T:HttpServer.Exceptions.BadRequestException">If line is incorrect</exception> | ||
4810 | <remarks>Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF"</remarks> | ||
4811 | </member> | ||
4812 | <member name="M:HttpServer.Parser.HttpRequestParser.OnHeader(System.String,System.String)"> | ||
4813 | <summary> | ||
4814 | We've parsed a new header. | ||
4815 | </summary> | ||
4816 | <param name="name">Name in lower case</param> | ||
4817 | <param name="value">Value, unmodified.</param> | ||
4818 | <exception cref="T:HttpServer.Exceptions.BadRequestException">If content length cannot be parsed.</exception> | ||
4819 | </member> | ||
4820 | <member name="P:HttpServer.Parser.HttpRequestParser.CurrentState"> | ||
4821 | <summary> | ||
4822 | Current state in parser. | ||
4823 | </summary> | ||
4824 | </member> | ||
4825 | <member name="M:HttpServer.Parser.HttpRequestParser.Parse(System.Byte[],System.Int32,System.Int32)"> | ||
4826 | <summary> | ||
4827 | Parse a message | ||
4828 | </summary> | ||
4829 | <param name="buffer">bytes to parse.</param> | ||
4830 | <param name="offset">where in buffer that parsing should start</param> | ||
4831 | <param name="count">number of bytes to parse, starting on <paramref name="offset"/>.</param> | ||
4832 | <returns>offset (where to start parsing next).</returns> | ||
4833 | <exception cref="T:HttpServer.Exceptions.BadRequestException"><c>BadRequestException</c>.</exception> | ||
4834 | </member> | ||
4835 | <member name="E:HttpServer.Parser.HttpRequestParser.RequestCompleted"> | ||
4836 | <summary> | ||
4837 | A request have been successfully parsed. | ||
4838 | </summary> | ||
4839 | </member> | ||
4840 | <member name="E:HttpServer.Parser.HttpRequestParser.BodyBytesReceived"> | ||
4841 | <summary> | ||
4842 | More body bytes have been received. | ||
4843 | </summary> | ||
4844 | </member> | ||
4845 | <member name="E:HttpServer.Parser.HttpRequestParser.RequestLineReceived"> | ||
4846 | <summary> | ||
4847 | Request line have been received. | ||
4848 | </summary> | ||
4849 | </member> | ||
4850 | <member name="E:HttpServer.Parser.HttpRequestParser.HeaderReceived"> | ||
4851 | <summary> | ||
4852 | A header have been received. | ||
4853 | </summary> | ||
4854 | </member> | ||
4855 | <member name="T:HttpServer.Parser.RequestLineEventArgs"> | ||
4856 | <summary> | ||
4857 | Used when the request line have been successfully parsed. | ||
4858 | </summary> | ||
4859 | </member> | ||
4860 | <member name="M:HttpServer.Parser.RequestLineEventArgs.#ctor(System.String,System.String,System.String)"> | ||
4861 | <summary> | ||
4862 | Initializes a new instance of the <see cref="T:HttpServer.Parser.RequestLineEventArgs"/> class. | ||
4863 | </summary> | ||
4864 | <param name="httpMethod">The HTTP method.</param> | ||
4865 | <param name="uriPath">The URI path.</param> | ||
4866 | <param name="httpVersion">The HTTP version.</param> | ||
4867 | </member> | ||
4868 | <member name="M:HttpServer.Parser.RequestLineEventArgs.#ctor"> | ||
4869 | <summary> | ||
4870 | Initializes a new instance of the <see cref="T:HttpServer.Parser.RequestLineEventArgs"/> class. | ||
4871 | </summary> | ||
4872 | </member> | ||
4873 | <member name="P:HttpServer.Parser.RequestLineEventArgs.HttpMethod"> | ||
4874 | <summary> | ||
4875 | Gets or sets http method. | ||
4876 | </summary> | ||
4877 | <remarks> | ||
4878 | Should be one of the methods declared in <see cref="T:HttpServer.Method"/>. | ||
4879 | </remarks> | ||
4880 | </member> | ||
4881 | <member name="P:HttpServer.Parser.RequestLineEventArgs.HttpVersion"> | ||
4882 | <summary> | ||
4883 | Gets or sets the version of the HTTP protocol that the client want to use. | ||
4884 | </summary> | ||
4885 | </member> | ||
4886 | <member name="P:HttpServer.Parser.RequestLineEventArgs.UriPath"> | ||
4887 | <summary> | ||
4888 | Gets or sets requested URI path. | ||
4889 | </summary> | ||
4890 | </member> | ||
4891 | <member name="T:HttpServer.RequestParserFactory"> | ||
4892 | <summary> | ||
4893 | Creates request parsers when needed. | ||
4894 | </summary> | ||
4895 | </member> | ||
4896 | <member name="M:HttpServer.RequestParserFactory.CreateParser(HttpServer.ILogWriter)"> | ||
4897 | <summary> | ||
4898 | Create a new request parser. | ||
4899 | </summary> | ||
4900 | <param name="logWriter">Used when logging should be enabled.</param> | ||
4901 | <returns>A new request parser.</returns> | ||
4902 | </member> | ||
4903 | <member name="T:HttpServer.IRequestParserFactory"> | ||
4904 | <summary> | ||
4905 | Creates request parsers when needed. | ||
4906 | </summary> | ||
4907 | </member> | ||
4908 | <member name="M:HttpServer.IRequestParserFactory.CreateParser(HttpServer.ILogWriter)"> | ||
4909 | <summary> | ||
4910 | Create a new request parser. | ||
4911 | </summary> | ||
4912 | <param name="logWriter">Used when logging should be enabled.</param> | ||
4913 | <returns>A new request parser.</returns> | ||
4914 | </member> | ||
4915 | <member name="T:HttpServer.RequestCookie"> | ||
4916 | <summary> | ||
4917 | cookie sent by the client/browser | ||
4918 | </summary> | ||
4919 | <seealso cref="T:HttpServer.ResponseCookie"/> | ||
4920 | </member> | ||
4921 | <member name="M:HttpServer.RequestCookie.#ctor(System.String,System.String)"> | ||
4922 | <summary> | ||
4923 | Constructor. | ||
4924 | </summary> | ||
4925 | <param name="id">cookie identifier</param> | ||
4926 | <param name="content">cookie content</param> | ||
4927 | <exception cref="T:System.ArgumentNullException">id or content is null</exception> | ||
4928 | <exception cref="T:System.ArgumentException">id is empty</exception> | ||
4929 | </member> | ||
4930 | <member name="M:HttpServer.RequestCookie.ToString"> | ||
4931 | <summary> | ||
4932 | Gets the cookie HTML representation. | ||
4933 | </summary> | ||
4934 | <returns>cookie string</returns> | ||
4935 | </member> | ||
4936 | <member name="P:HttpServer.RequestCookie.Name"> | ||
4937 | <summary> | ||
4938 | Gets the cookie identifier. | ||
4939 | </summary> | ||
4940 | </member> | ||
4941 | <member name="P:HttpServer.RequestCookie.Value"> | ||
4942 | <summary> | ||
4943 | Cookie value. Set to null to remove cookie. | ||
4944 | </summary> | ||
4945 | </member> | ||
4946 | <member name="T:HttpServer.RequestCookies"> | ||
4947 | <summary> | ||
4948 | This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). | ||
4949 | The framework might switch class in the future and we dont want to have to replace all instances | ||
4950 | </summary> | ||
4951 | </member> | ||
4952 | <member name="M:HttpServer.RequestCookies.#ctor(System.String)"> | ||
4953 | <summary> | ||
4954 | Let's copy all the cookies. | ||
4955 | </summary> | ||
4956 | <param name="cookies">value from cookie header.</param> | ||
4957 | </member> | ||
4958 | <member name="M:HttpServer.RequestCookies.Add(HttpServer.RequestCookie)"> | ||
4959 | <summary> | ||
4960 | Adds a cookie in the collection. | ||
4961 | </summary> | ||
4962 | <param name="cookie">cookie to add</param> | ||
4963 | <exception cref="T:System.ArgumentNullException">cookie is null</exception> | ||
4964 | </member> | ||
4965 | <member name="P:HttpServer.RequestCookies.Count"> | ||
4966 | <summary> | ||
4967 | Gets the count of cookies in the collection. | ||
4968 | </summary> | ||
4969 | </member> | ||
4970 | <member name="P:HttpServer.RequestCookies.Item(System.String)"> | ||
4971 | <summary> | ||
4972 | Gets the cookie of a given identifier (null if not existing). | ||
4973 | </summary> | ||
4974 | </member> | ||
4975 | <member name="M:HttpServer.RequestCookies.GetEnumerator"> | ||
4976 | <summary> | ||
4977 | Gets a collection enumerator on the cookie list. | ||
4978 | </summary> | ||
4979 | <returns>collection enumerator</returns> | ||
4980 | </member> | ||
4981 | <member name="M:HttpServer.RequestCookies.Clear"> | ||
4982 | <summary> | ||
4983 | Remove all cookies. | ||
4984 | </summary> | ||
4985 | </member> | ||
4986 | <member name="M:HttpServer.RequestCookies.System#Collections#Generic#IEnumerable{HttpServer#RequestCookie}#GetEnumerator"> | ||
4987 | <summary> | ||
4988 | Returns an enumerator that iterates through the collection. | ||
4989 | </summary> | ||
4990 | |||
4991 | <returns> | ||
4992 | A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. | ||
4993 | </returns> | ||
4994 | <filterpriority>1</filterpriority> | ||
4995 | </member> | ||
4996 | <member name="M:HttpServer.RequestCookies.Remove(System.String)"> | ||
4997 | <summary> | ||
4998 | Remove a cookie from the collection. | ||
4999 | </summary> | ||
5000 | <param name="cookieName">Name of cookie.</param> | ||
5001 | </member> | ||
5002 | <member name="T:HttpServer.RequestQueue"> | ||
5003 | <summary> | ||
5004 | Used to queue incoming requests. | ||
5005 | </summary> | ||
5006 | </member> | ||
5007 | <member name="M:HttpServer.RequestQueue.#ctor(HttpServer.ProcessRequestHandler)"> | ||
5008 | <summary> | ||
5009 | Initializes a new instance of the <see cref="T:HttpServer.RequestQueue"/> class. | ||
5010 | </summary> | ||
5011 | <param name="handler">Called when a request should be processed.</param> | ||
5012 | </member> | ||
5013 | <member name="T:HttpServer.RequestQueue.QueueItem"> | ||
5014 | <summary> | ||
5015 | Used two queue incoming requests to avoid | ||
5016 | thread starvation. | ||
5017 | </summary> | ||
5018 | </member> | ||
5019 | <member name="P:HttpServer.RequestQueue.MaxRequestCount"> | ||
5020 | <summary> | ||
5021 | Gets or sets maximum number of allowed simultaneous requests. | ||
5022 | </summary> | ||
5023 | </member> | ||
5024 | <member name="P:HttpServer.RequestQueue.MaxQueueSize"> | ||
5025 | <summary> | ||
5026 | Gets or sets maximum number of requests queuing to be handled. | ||
5027 | </summary> | ||
5028 | </member> | ||
5029 | <member name="P:HttpServer.RequestQueue.CurrentRequestCount"> | ||
5030 | <summary> | ||
5031 | Specifies how many requests the HTTP server is currently processing. | ||
5032 | </summary> | ||
5033 | </member> | ||
5034 | <member name="M:HttpServer.RequestQueue.QueueThread"> | ||
5035 | <summary> | ||
5036 | Used to process queued requests. | ||
5037 | </summary> | ||
5038 | </member> | ||
5039 | <member name="T:HttpServer.ProcessRequestHandler"> | ||
5040 | <summary> | ||
5041 | Method used to process a queued request | ||
5042 | </summary> | ||
5043 | <param name="context">Context that the request was received from.</param> | ||
5044 | <param name="request">Request to process.</param> | ||
5045 | </member> | ||
5046 | <member name="T:HttpServer.ResponseCookie"> | ||
5047 | <summary> | ||
5048 | cookie being sent back to the browser. | ||
5049 | </summary> | ||
5050 | <seealso cref="T:HttpServer.ResponseCookie"/> | ||
5051 | </member> | ||
5052 | <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime)"> | ||
5053 | <summary> | ||
5054 | Constructor. | ||
5055 | </summary> | ||
5056 | <param name="id">cookie identifier</param> | ||
5057 | <param name="content">cookie content</param> | ||
5058 | <param name="expiresAt">cookie expiration date. Use DateTime.MinValue for session cookie.</param> | ||
5059 | <exception cref="T:System.ArgumentNullException">id or content is null</exception> | ||
5060 | <exception cref="T:System.ArgumentException">id is empty</exception> | ||
5061 | </member> | ||
5062 | <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime,System.String,System.String)"> | ||
5063 | <summary> | ||
5064 | Create a new cookie | ||
5065 | </summary> | ||
5066 | <param name="name">name identifying the cookie</param> | ||
5067 | <param name="value">cookie value</param> | ||
5068 | <param name="expires">when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed.</param> | ||
5069 | <param name="path">Path to where the cookie is valid</param> | ||
5070 | <param name="domain">Domain that the cookie is valid for.</param> | ||
5071 | </member> | ||
5072 | <member name="M:HttpServer.ResponseCookie.#ctor(HttpServer.RequestCookie,System.DateTime)"> | ||
5073 | <summary> | ||
5074 | Create a new cookie | ||
5075 | </summary> | ||
5076 | <param name="cookie">Name and value will be used</param> | ||
5077 | <param name="expires">when the cookie expires.</param> | ||
5078 | </member> | ||
5079 | <member name="M:HttpServer.ResponseCookie.ToString"> | ||
5080 | <summary> | ||
5081 | Gets the cookie HTML representation. | ||
5082 | </summary> | ||
5083 | <returns>cookie string</returns> | ||
5084 | </member> | ||
5085 | <member name="P:HttpServer.ResponseCookie.Expires"> | ||
5086 | <summary> | ||
5087 | When the cookie expires. | ||
5088 | DateTime.MinValue means that the cookie expires when the session do so. | ||
5089 | </summary> | ||
5090 | </member> | ||
5091 | <member name="P:HttpServer.ResponseCookie.Path"> | ||
5092 | <summary> | ||
5093 | Cookie is only valid under this path. | ||
5094 | </summary> | ||
5095 | </member> | ||
5096 | <member name="T:HttpServer.ResponseCookies"> | ||
5097 | <summary> | ||
5098 | Cookies that should be set. | ||
5099 | </summary> | ||
5100 | </member> | ||
5101 | <member name="M:HttpServer.ResponseCookies.Add(HttpServer.ResponseCookie)"> | ||
5102 | <summary> | ||
5103 | Adds a cookie in the collection. | ||
5104 | </summary> | ||
5105 | <param name="cookie">cookie to add</param> | ||
5106 | <exception cref="T:System.ArgumentNullException">cookie is null</exception> | ||
5107 | </member> | ||
5108 | <member name="M:HttpServer.ResponseCookies.Add(HttpServer.RequestCookie,System.DateTime)"> | ||
5109 | <summary> | ||
5110 | Copy a request cookie | ||
5111 | </summary> | ||
5112 | <param name="cookie"></param> | ||
5113 | <param name="expires">When the cookie should expire</param> | ||
5114 | </member> | ||
5115 | <member name="P:HttpServer.ResponseCookies.Count"> | ||
5116 | <summary> | ||
5117 | Gets the count of cookies in the collection. | ||
5118 | </summary> | ||
5119 | </member> | ||
5120 | <member name="P:HttpServer.ResponseCookies.Item(System.String)"> | ||
5121 | <summary> | ||
5122 | Gets the cookie of a given identifier (null if not existing). | ||
5123 | </summary> | ||
5124 | </member> | ||
5125 | <member name="M:HttpServer.ResponseCookies.GetEnumerator"> | ||
5126 | <summary> | ||
5127 | Gets a collection enumerator on the cookie list. | ||
5128 | </summary> | ||
5129 | <returns>collection enumerator</returns> | ||
5130 | </member> | ||
5131 | <member name="M:HttpServer.ResponseCookies.Clear"> | ||
5132 | <summary> | ||
5133 | Remove all cookies | ||
5134 | </summary> | ||
5135 | </member> | ||
5136 | <member name="M:HttpServer.ResponseCookies.System#Collections#Generic#IEnumerable{HttpServer#ResponseCookie}#GetEnumerator"> | ||
5137 | <summary> | ||
5138 | Returns an enumerator that iterates through the collection. | ||
5139 | </summary> | ||
5140 | |||
5141 | <returns> | ||
5142 | A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. | ||
5143 | </returns> | ||
5144 | <filterpriority>1</filterpriority> | ||
5145 | </member> | ||
5146 | <member name="T:HttpServer.Rules.IRule"> | ||
5147 | <summary> | ||
5148 | Rules are used to perform operations before a request is being handled. | ||
5149 | Rules can be used to create routing etc. | ||
5150 | </summary> | ||
5151 | </member> | ||
5152 | <member name="M:HttpServer.Rules.IRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> | ||
5153 | <summary> | ||
5154 | Process the incoming request. | ||
5155 | </summary> | ||
5156 | <param name="request">incoming HTTP request</param> | ||
5157 | <param name="response">outgoing HTTP response</param> | ||
5158 | <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> | ||
5159 | <remarks> | ||
5160 | returning true means that no modules will get the request. Returning true is typically being done | ||
5161 | for redirects. | ||
5162 | </remarks> | ||
5163 | <exception cref="T:System.ArgumentNullException">If request or response is null.</exception> | ||
5164 | </member> | ||
5165 | <member name="T:HttpServer.Rules.RedirectRule"> | ||
5166 | <summary> | ||
5167 | redirects from one URL to another. | ||
5168 | </summary> | ||
5169 | </member> | ||
5170 | <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String)"> | ||
5171 | <summary> | ||
5172 | Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. | ||
5173 | </summary> | ||
5174 | <param name="fromUrl">Absolute path (no server name)</param> | ||
5175 | <param name="toUrl">Absolute path (no server name)</param> | ||
5176 | <example> | ||
5177 | server.Add(new RedirectRule("/", "/user/index")); | ||
5178 | </example> | ||
5179 | </member> | ||
5180 | <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String,System.Boolean)"> | ||
5181 | <summary> | ||
5182 | Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. | ||
5183 | </summary> | ||
5184 | <param name="fromUrl">Absolute path (no server name)</param> | ||
5185 | <param name="toUrl">Absolute path (no server name)</param> | ||
5186 | <param name="shouldRedirect">true if request should be redirected, false if the request URI should be replaced.</param> | ||
5187 | <example> | ||
5188 | server.Add(new RedirectRule("/", "/user/index")); | ||
5189 | </example> | ||
5190 | </member> | ||
5191 | <member name="P:HttpServer.Rules.RedirectRule.FromUrl"> | ||
5192 | <summary> | ||
5193 | Gets string to match request URI with. | ||
5194 | </summary> | ||
5195 | <remarks>Is compared to request.Uri.AbsolutePath</remarks> | ||
5196 | </member> | ||
5197 | <member name="P:HttpServer.Rules.RedirectRule.ToUrl"> | ||
5198 | <summary> | ||
5199 | Gets where to redirect. | ||
5200 | </summary> | ||
5201 | </member> | ||
5202 | <member name="P:HttpServer.Rules.RedirectRule.ShouldRedirect"> | ||
5203 | <summary> | ||
5204 | Gets whether server should redirect client. | ||
5205 | </summary> | ||
5206 | <remarks> | ||
5207 | <c>false</c> means that the rule will replace | ||
5208 | the current request URI with the new one from this class. | ||
5209 | <c>true</c> means that a redirect response is sent to the client. | ||
5210 | </remarks> | ||
5211 | </member> | ||
5212 | <member name="M:HttpServer.Rules.RedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> | ||
5213 | <summary> | ||
5214 | Process the incoming request. | ||
5215 | </summary> | ||
5216 | <param name="request">incoming HTTP request</param> | ||
5217 | <param name="response">outgoing HTTP response</param> | ||
5218 | <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> | ||
5219 | <remarks> | ||
5220 | returning true means that no modules will get the request. Returning true is typically being done | ||
5221 | for redirects. | ||
5222 | </remarks> | ||
5223 | </member> | ||
5224 | <member name="T:HttpServer.Rules.RegexRedirectRule"> | ||
5225 | <summary> | ||
5226 | Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules | ||
5227 | a regular expression can be used to identify redirect URLs and their targets. | ||
5228 | </summary> | ||
5229 | <example> | ||
5230 | <![CDATA[ | ||
5231 | new RegexRedirectRule("/(?<target>[a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) | ||
5232 | ]]> | ||
5233 | </example> | ||
5234 | </member> | ||
5235 | <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String)"> | ||
5236 | <summary> | ||
5237 | Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. | ||
5238 | </summary> | ||
5239 | <param name="fromUrlExpression">Expression to match URL</param> | ||
5240 | <param name="toUrlExpression">Expression to generate URL</param> | ||
5241 | <example> | ||
5242 | <![CDATA[ | ||
5243 | server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}")); | ||
5244 | Result of ie. /employee1 will then be /user/employee1 | ||
5245 | ]]> | ||
5246 | </example> | ||
5247 | </member> | ||
5248 | <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions)"> | ||
5249 | <summary> | ||
5250 | Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. | ||
5251 | </summary> | ||
5252 | <param name="fromUrlExpression">Expression to match URL</param> | ||
5253 | <param name="toUrlExpression">Expression to generate URL</param> | ||
5254 | <param name="options">Regular expression options to use, can be null</param> | ||
5255 | <example> | ||
5256 | <![CDATA[ | ||
5257 | server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); | ||
5258 | Result of ie. /employee1 will then be /user/employee1 | ||
5259 | ]]> | ||
5260 | </example> | ||
5261 | </member> | ||
5262 | <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.Boolean)"> | ||
5263 | <summary> | ||
5264 | Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. | ||
5265 | </summary> | ||
5266 | <param name="fromUrlExpression">Expression to match URL</param> | ||
5267 | <param name="toUrlExpression">Expression to generate URL</param> | ||
5268 | <param name="options">Regular expression options to apply</param> | ||
5269 | <param name="shouldRedirect"><c>true</c> if request should be redirected, <c>false</c> if the request URI should be replaced.</param> | ||
5270 | <example> | ||
5271 | <![CDATA[ | ||
5272 | server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); | ||
5273 | Result of ie. /employee1 will then be /user/employee1 | ||
5274 | ]]> | ||
5275 | </example> | ||
5276 | <exception cref="T:System.ArgumentNullException">Argument is null.</exception> | ||
5277 | <seealso cref="P:HttpServer.Rules.RedirectRule.ShouldRedirect"/> | ||
5278 | </member> | ||
5279 | <member name="M:HttpServer.Rules.RegexRedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> | ||
5280 | <summary> | ||
5281 | Process the incoming request. | ||
5282 | </summary> | ||
5283 | <param name="request">incoming HTTP request</param> | ||
5284 | <param name="response">outgoing HTTP response</param> | ||
5285 | <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> | ||
5286 | <remarks> | ||
5287 | returning true means that no modules will get the request. Returning true is typically being done | ||
5288 | for redirects. | ||
5289 | </remarks> | ||
5290 | <exception cref="T:System.ArgumentNullException">If request or response is null</exception> | ||
5291 | </member> | ||
5292 | <member name="T:HttpServer.Sessions.IHttpSession"> | ||
5293 | <summary> | ||
5294 | Interface for sessions | ||
5295 | </summary> | ||
5296 | </member> | ||
5297 | <member name="P:HttpServer.Sessions.IHttpSession.Id"> | ||
5298 | <summary> | ||
5299 | Session id | ||
5300 | </summary> | ||
5301 | </member> | ||
5302 | <member name="P:HttpServer.Sessions.IHttpSession.Item(System.String)"> | ||
5303 | <summary> | ||
5304 | Should | ||
5305 | </summary> | ||
5306 | <param name="name">Name of the session variable</param> | ||
5307 | <returns>null if it's not set</returns> | ||
5308 | <exception cref="T:System.Runtime.Serialization.SerializationException">If the object cant be serialized.</exception> | ||
5309 | </member> | ||
5310 | <member name="P:HttpServer.Sessions.IHttpSession.Accessed"> | ||
5311 | <summary> | ||
5312 | When the session was last accessed. | ||
5313 | This property is touched by the http server each time the | ||
5314 | session is requested. | ||
5315 | </summary> | ||
5316 | </member> | ||
5317 | <member name="P:HttpServer.Sessions.IHttpSession.Count"> | ||
5318 | <summary> | ||
5319 | Number of session variables. | ||
5320 | </summary> | ||
5321 | </member> | ||
5322 | <member name="M:HttpServer.Sessions.IHttpSession.Clear"> | ||
5323 | <summary> | ||
5324 | Remove everything from the session | ||
5325 | </summary> | ||
5326 | </member> | ||
5327 | <member name="M:HttpServer.Sessions.IHttpSession.Clear(System.Boolean)"> | ||
5328 | <summary> | ||
5329 | Remove everything from the session | ||
5330 | </summary> | ||
5331 | <param name="expires">True if the session is cleared due to expiration</param> | ||
5332 | </member> | ||
5333 | <member name="E:HttpServer.Sessions.IHttpSession.BeforeClear"> | ||
5334 | <summary> | ||
5335 | Event triggered upon clearing the session | ||
5336 | </summary> | ||
5337 | </member> | ||
5338 | <member name="T:HttpServer.Sessions.HttpSessionClearedArgs"> | ||
5339 | <summary> | ||
5340 | Arguments sent when a <see cref="T:HttpServer.Sessions.IHttpSession" /> is cleared | ||
5341 | </summary> | ||
5342 | </member> | ||
5343 | <member name="M:HttpServer.Sessions.HttpSessionClearedArgs.#ctor(System.Boolean)"> | ||
5344 | <summary> | ||
5345 | Instantiates the arguments for the event | ||
5346 | </summary> | ||
5347 | <param name="expired">True if the session is cleared due to expiration</param> | ||
5348 | </member> | ||
5349 | <member name="P:HttpServer.Sessions.HttpSessionClearedArgs.Expired"> | ||
5350 | <summary> | ||
5351 | Returns true if the session is cleared due to expiration | ||
5352 | </summary> | ||
5353 | </member> | ||
5354 | <member name="T:HttpServer.Sessions.HttpSessionClearedHandler"> | ||
5355 | <summary> | ||
5356 | Delegate for when a IHttpSession is cleared | ||
5357 | </summary> | ||
5358 | <param name="session"><see cref="T:HttpServer.Sessions.IHttpSession"/> this is being cleared.</param> | ||
5359 | <param name="args">Arguments for the clearing</param> | ||
5360 | </member> | ||
5361 | <member name="T:HttpServer.Sessions.IHttpSessionStore"> | ||
5362 | <summary> | ||
5363 | A session store is used to store and load sessions on a media. | ||
5364 | The default implementation (<see cref="T:HttpServer.Sessions.MemorySessionStore"/>) saves/retrieves sessions from memory. | ||
5365 | </summary> | ||
5366 | </member> | ||
5367 | <member name="P:HttpServer.Sessions.IHttpSessionStore.Item(System.String)"> | ||
5368 | <summary> | ||
5369 | Load a session from the store | ||
5370 | </summary> | ||
5371 | <param name="sessionId"></param> | ||
5372 | <returns>null if session is not found.</returns> | ||
5373 | </member> | ||
5374 | <member name="P:HttpServer.Sessions.IHttpSessionStore.ExpireTime"> | ||
5375 | <summary> | ||
5376 | Number of minutes before a session expires. | ||
5377 | </summary> | ||
5378 | <value>Default time is 20 minutes.</value> | ||
5379 | </member> | ||
5380 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Create"> | ||
5381 | <summary> | ||
5382 | Creates a new http session with a generated id. | ||
5383 | </summary> | ||
5384 | <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object</returns> | ||
5385 | </member> | ||
5386 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Create(System.String)"> | ||
5387 | <summary> | ||
5388 | Creates a new http session with a specific id | ||
5389 | </summary> | ||
5390 | <param name="id">Id used to identify the new cookie..</param> | ||
5391 | <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> | ||
5392 | <remarks> | ||
5393 | Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. | ||
5394 | </remarks> | ||
5395 | </member> | ||
5396 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Load(System.String)"> | ||
5397 | <summary> | ||
5398 | Load an existing session. | ||
5399 | </summary> | ||
5400 | <param name="sessionId">Session id (usually retrieved from a client side cookie).</param> | ||
5401 | <returns>A session if found; otherwise null.</returns> | ||
5402 | </member> | ||
5403 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Save(HttpServer.Sessions.IHttpSession)"> | ||
5404 | <summary> | ||
5405 | Save an updated session to the store. | ||
5406 | </summary> | ||
5407 | <param name="session">Session id (usually retrieved from a client side cookie).</param> | ||
5408 | <exception cref="T:System.ArgumentException">If Id property have not been specified.</exception> | ||
5409 | </member> | ||
5410 | <member name="M:HttpServer.Sessions.IHttpSessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> | ||
5411 | <summary> | ||
5412 | We use the flyweight pattern which reuses small objects | ||
5413 | instead of creating new each time. | ||
5414 | </summary> | ||
5415 | <param name="session">Unused session that should be reused next time Create is called.</param> | ||
5416 | </member> | ||
5417 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Cleanup"> | ||
5418 | <summary> | ||
5419 | Remove expired sessions | ||
5420 | </summary> | ||
5421 | </member> | ||
5422 | <member name="M:HttpServer.Sessions.IHttpSessionStore.Remove(System.String)"> | ||
5423 | <summary> | ||
5424 | Remove a session | ||
5425 | </summary> | ||
5426 | <param name="sessionId">id of the session.</param> | ||
5427 | </member> | ||
5428 | <member name="T:HttpServer.Sessions.MemorySession"> | ||
5429 | <summary> | ||
5430 | A session stored in memory. | ||
5431 | </summary> | ||
5432 | </member> | ||
5433 | <member name="M:HttpServer.Sessions.MemorySession.#ctor(System.String)"> | ||
5434 | <summary> | ||
5435 | |||
5436 | </summary> | ||
5437 | <param name="id">A unique id used by the sessions store to identify the session</param> | ||
5438 | </member> | ||
5439 | <member name="M:HttpServer.Sessions.MemorySession.SetId(System.String)"> | ||
5440 | <summary> | ||
5441 | Id | ||
5442 | </summary> | ||
5443 | <param name="id"></param> | ||
5444 | </member> | ||
5445 | <member name="P:HttpServer.Sessions.MemorySession.Id"> | ||
5446 | <summary> | ||
5447 | Session id | ||
5448 | </summary> | ||
5449 | </member> | ||
5450 | <member name="P:HttpServer.Sessions.MemorySession.Item(System.String)"> | ||
5451 | <summary> | ||
5452 | Should | ||
5453 | </summary> | ||
5454 | <param name="name">Name of the session variable</param> | ||
5455 | <returns>null if it's not set</returns> | ||
5456 | </member> | ||
5457 | <member name="P:HttpServer.Sessions.MemorySession.Accessed"> | ||
5458 | <summary> | ||
5459 | when the session was last accessed. | ||
5460 | </summary> | ||
5461 | <remarks> | ||
5462 | Used to determine when the session should be removed. | ||
5463 | </remarks> | ||
5464 | </member> | ||
5465 | <member name="P:HttpServer.Sessions.MemorySession.Count"> | ||
5466 | <summary> | ||
5467 | Number of values in the session | ||
5468 | </summary> | ||
5469 | </member> | ||
5470 | <member name="P:HttpServer.Sessions.MemorySession.Changed"> | ||
5471 | <summary> | ||
5472 | Flag to indicate that the session have been changed | ||
5473 | and should be saved into the session store. | ||
5474 | </summary> | ||
5475 | </member> | ||
5476 | <member name="M:HttpServer.Sessions.MemorySession.Clear"> | ||
5477 | <summary> | ||
5478 | Remove everything from the session | ||
5479 | </summary> | ||
5480 | </member> | ||
5481 | <member name="M:HttpServer.Sessions.MemorySession.Clear(System.Boolean)"> | ||
5482 | <summary> | ||
5483 | Clears the specified expire. | ||
5484 | </summary> | ||
5485 | <param name="expires">True if the session is cleared due to expiration</param> | ||
5486 | </member> | ||
5487 | <member name="M:HttpServer.Sessions.MemorySession.Dispose"> | ||
5488 | <summary> | ||
5489 | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | ||
5490 | </summary> | ||
5491 | <filterpriority>2</filterpriority> | ||
5492 | </member> | ||
5493 | <member name="E:HttpServer.Sessions.MemorySession.BeforeClear"> | ||
5494 | <summary> | ||
5495 | Event triggered upon clearing the session | ||
5496 | </summary> | ||
5497 | </member> | ||
5498 | <member name="T:HttpServer.Sessions.MemorySessionStore"> | ||
5499 | <summary> | ||
5500 | Session store using memory for each session. | ||
5501 | </summary> | ||
5502 | </member> | ||
5503 | <member name="M:HttpServer.Sessions.MemorySessionStore.#ctor"> | ||
5504 | <summary> | ||
5505 | Initializes the class setting the expirationtimer to clean the session every minute | ||
5506 | </summary> | ||
5507 | </member> | ||
5508 | <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup(System.Object)"> | ||
5509 | <summary> | ||
5510 | Delegate for the cleanup timer | ||
5511 | </summary> | ||
5512 | </member> | ||
5513 | <member name="P:HttpServer.Sessions.MemorySessionStore.Item(System.String)"> | ||
5514 | <summary> | ||
5515 | Load a session from the store | ||
5516 | </summary> | ||
5517 | <param name="sessionId"></param> | ||
5518 | <returns>null if session is not found.</returns> | ||
5519 | </member> | ||
5520 | <member name="M:HttpServer.Sessions.MemorySessionStore.Create"> | ||
5521 | <summary> | ||
5522 | Creates a new http session | ||
5523 | </summary> | ||
5524 | <returns></returns> | ||
5525 | </member> | ||
5526 | <member name="M:HttpServer.Sessions.MemorySessionStore.Create(System.String)"> | ||
5527 | <summary> | ||
5528 | Creates a new http session with a specific id | ||
5529 | </summary> | ||
5530 | <param name="id">Id used to identify the new cookie..</param> | ||
5531 | <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> | ||
5532 | <remarks> | ||
5533 | Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. | ||
5534 | </remarks> | ||
5535 | </member> | ||
5536 | <member name="M:HttpServer.Sessions.MemorySessionStore.Load(System.String)"> | ||
5537 | <summary> | ||
5538 | Load an existing session. | ||
5539 | </summary> | ||
5540 | <param name="sessionId"></param> | ||
5541 | <returns></returns> | ||
5542 | </member> | ||
5543 | <member name="M:HttpServer.Sessions.MemorySessionStore.Save(HttpServer.Sessions.IHttpSession)"> | ||
5544 | <summary> | ||
5545 | Save an updated session to the store. | ||
5546 | </summary> | ||
5547 | <param name="session"></param> | ||
5548 | </member> | ||
5549 | <member name="M:HttpServer.Sessions.MemorySessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> | ||
5550 | <summary> | ||
5551 | We use the flyweight pattern which reuses small objects | ||
5552 | instead of creating new each time. | ||
5553 | </summary> | ||
5554 | <param name="session">EmptyLanguageNode (unused) session that should be reused next time Create is called.</param> | ||
5555 | </member> | ||
5556 | <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup"> | ||
5557 | <summary> | ||
5558 | Remove expired sessions | ||
5559 | </summary> | ||
5560 | </member> | ||
5561 | <member name="M:HttpServer.Sessions.MemorySessionStore.Remove(System.String)"> | ||
5562 | <summary> | ||
5563 | Remove a session | ||
5564 | </summary> | ||
5565 | <param name="sessionId">id of the session.</param> | ||
5566 | </member> | ||
5567 | <member name="P:HttpServer.Sessions.MemorySessionStore.ExpireTime"> | ||
5568 | <summary> | ||
5569 | Number of minutes before a session expires. | ||
5570 | Default is 20 minutes. | ||
5571 | </summary> | ||
5572 | </member> | ||
5573 | </members> | ||
5574 | </doc> | ||
diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 1d3590e..9294198 100755 --- a/bin/OpenMetaverseTypes.dll +++ b/bin/OpenMetaverseTypes.dll | |||
Binary files differ | |||
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 05a43f4..0ef6cfc 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -46,11 +46,8 @@ | |||
46 | 46 | ||
47 | 47 | ||
48 | [Const] | 48 | [Const] |
49 | ; For a grid these will usually be the externally accessible IP/DNS | 49 | ; this section defines constants for grid services |
50 | ; name and use default public port 8002 and default private port 8003 | 50 | ; to simplify other configuration files default settings |
51 | ; For a standalone this will usually be the externally accessible IP/DNS | ||
52 | ; name and use default public port 9000. The private port is not used | ||
53 | ; in the configuration for a standalone. | ||
54 | 51 | ||
55 | ;# {BaseHostname} {} {BaseHostname} {"example.com" "127.0.0.1"} "127.0.0.1" | 52 | ;# {BaseHostname} {} {BaseHostname} {"example.com" "127.0.0.1"} "127.0.0.1" |
56 | BaseHostname = "127.0.0.1" | 53 | BaseHostname = "127.0.0.1" |
@@ -61,13 +58,13 @@ | |||
61 | ;# {PublicPort} {} {PublicPort} {8002 9000} "8002" | 58 | ;# {PublicPort} {} {PublicPort} {8002 9000} "8002" |
62 | PublicPort = "8002" | 59 | PublicPort = "8002" |
63 | 60 | ||
61 | ;grid default private port 8003, not used in standalone | ||
64 | ;# {PrivatePort} {} {PrivatePort} {8003} "8003" | 62 | ;# {PrivatePort} {} {PrivatePort} {8003} "8003" |
65 | ; port to access private grid services. | 63 | ; port to access private grid services. |
66 | ; grids that run all their regions should deny access to this port | 64 | ; grids that run all their regions should deny access to this port |
67 | ; from outside their networks, using firewalls | 65 | ; from outside their networks, using firewalls |
68 | PrivatePort = "8003" | 66 | PrivatePort = "8003" |
69 | 67 | ||
70 | |||
71 | [Startup] | 68 | [Startup] |
72 | ;# {ConsolePrompt} {} {ConsolePrompt} {} "Region (\R) " | 69 | ;# {ConsolePrompt} {} {ConsolePrompt} {} "Region (\R) " |
73 | ;; Console prompt | 70 | ;; Console prompt |
@@ -299,7 +296,18 @@ | |||
299 | ;; default is false | 296 | ;; default is false |
300 | ; TelehubAllowLandmark = false | 297 | ; TelehubAllowLandmark = false |
301 | 298 | ||
302 | 299 | ||
300 | ;; SSL certificate validation options | ||
301 | ;; you can allow selfsigned certificates or no official CA with next option set to true | ||
302 | ;# {NoVerifyCertChain} {} {do not verify SSL Cert Chain} {true false} true | ||
303 | ; NoVerifyCertChain = true | ||
304 | |||
305 | ;; you can also bypass the hostname or domain verification | ||
306 | ;# {NoVerifyCertHostname} {} {do not verify SSL Cert name versus peer name} {true false} true | ||
307 | ; NoVerifyCertHostname = true | ||
308 | ;; having both options true does provide encryption but with low security | ||
309 | ;; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it. | ||
310 | |||
303 | [AccessControl] | 311 | [AccessControl] |
304 | ;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {} | 312 | ;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {} |
305 | ;; Bar (|) separated list of viewers which may gain access to the regions. | 313 | ;; Bar (|) separated list of viewers which may gain access to the regions. |
@@ -443,7 +451,6 @@ | |||
443 | ;; Password for the default estate owner | 451 | ;; Password for the default estate owner |
444 | ; DefaultEstateOwnerPassword = password | 452 | ; DefaultEstateOwnerPassword = password |
445 | 453 | ||
446 | |||
447 | [SMTP] | 454 | [SMTP] |
448 | ;; The SMTP server enabled the email module to send email to external | 455 | ;; The SMTP server enabled the email module to send email to external |
449 | ;; destinations. | 456 | ;; destinations. |
@@ -476,7 +483,6 @@ | |||
476 | ;# {SMTP_SERVER_PASSWORD} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server password} {} | 483 | ;# {SMTP_SERVER_PASSWORD} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server password} {} |
477 | ; SMTP_SERVER_PASSWORD = "" | 484 | ; SMTP_SERVER_PASSWORD = "" |
478 | 485 | ||
479 | |||
480 | [Network] | 486 | [Network] |
481 | ;# {ConsoleUser} {} {User name for console account} {} | 487 | ;# {ConsoleUser} {} {User name for console account} {} |
482 | ;; Configure the remote console user here. This will not actually be used | 488 | ;; Configure the remote console user here. This will not actually be used |
@@ -493,10 +499,39 @@ | |||
493 | ;; the region ports use UDP. | 499 | ;; the region ports use UDP. |
494 | ; http_listener_port = 9000 | 500 | ; http_listener_port = 9000 |
495 | 501 | ||
502 | ; optional main server secure http (ssl) | ||
503 | ; to use ssl you need a ssl certificate in PKCS12 format that validates the ExternalHostnames | ||
504 | ; or their domains | ||
505 | ; some viewers by default only accept certificates signed by a oficial CA | ||
506 | ; to use others like self signed certificates with those viewers, | ||
507 | ; their debug option NoVerifySSLCert needs to be set true, You need to inform users about this | ||
508 | ; the main unsecure port will still open for some services. this may change in future. | ||
509 | |||
510 | ; set http_listener_ssl to enable main server ssl. it will replace unsecure port on most functions | ||
511 | ;# {http_listener_ssl}{} {enable main server ssl port)} {} false | ||
512 | ;http_listener_ssl = false | ||
513 | |||
514 | ; Set port for main SSL connections | ||
515 | ;# {http_listener_sslport}{} {main server ssl port)} {} 9001 | ||
516 | ;http_listener_sslport = 9001 ; | ||
517 | |||
518 | ; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn | ||
519 | ; this may be removed in future | ||
520 | ;# {http_listener_cn}{} {main server ssl externalHostName)} {} "" | ||
521 | ;http_listener_cn = "myRegionsExternalHostName" | ||
522 | |||
523 | ; the path for the certificate path | ||
524 | ;# {http_listener_cert_path}{} {main server ssl certificate file path)} {} "" | ||
525 | ;http_listener_cert_path = "mycert.p12" | ||
526 | |||
527 | ;# {http_listener_cert_pass}{} {main server ssl certificate password)} {} "" | ||
528 | ;http_listener_cert_pass = "mycertpass" ; the cert passwork | ||
529 | |||
496 | ; By default, OpenSimulator does not allow scripts to make HTTP calls to addresses on the simulator's LAN. | 530 | ; By default, OpenSimulator does not allow scripts to make HTTP calls to addresses on the simulator's LAN. |
497 | ; See the OutboundDisallowForUserScripts parameter in OpenSimDefaults.ini for more information on this filter. | 531 | ; See the OutboundDisallowForUserScripts parameter in OpenSimDefaults.ini for more information on this filter. |
498 | ; If you need to allow scripts to make some LAN calls use the OutboundDisallowForUserScriptsExcept parameter below. | 532 | ; If you need to allow scripts to make some LAN calls use the OutboundDisallowForUserScriptsExcept parameter below. |
499 | ; We recommend that you do not override OutboundDisallowForUserScripts directly unless you are very sure about what you're doing. | 533 | ; We recommend that you do not override OutboundDisallowForUserScripts directly unless you are very sure about what you're doing. |
534 | ; this HTTP calls can also use ssl see opensimDefaults.ini | ||
500 | ; | 535 | ; |
501 | ; You can whitelist individual endpoints by IP or FQDN, e.g. | 536 | ; You can whitelist individual endpoints by IP or FQDN, e.g. |
502 | ; | 537 | ; |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 3747fcf..5ca4ff1 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -401,7 +401,18 @@ | |||
401 | ; routing and land at the landmark coordinates when set to true | 401 | ; routing and land at the landmark coordinates when set to true |
402 | ; default is false | 402 | ; default is false |
403 | ; TelehubAllowLandmark = false | 403 | ; TelehubAllowLandmark = false |
404 | 404 | ||
405 | ; # | ||
406 | ; # SSL certificates validation options | ||
407 | ; # | ||
408 | |||
409 | ; SSL certificate validation options | ||
410 | ; you can allow selfsigned certificates or no official CA with next option set to true | ||
411 | ; NoVerifyCertChain = true | ||
412 | ; you can also bypass the hostname or domain verification | ||
413 | ; NoVerifyCertHostname = true | ||
414 | ; having both options true does provide encryption but with low security | ||
415 | ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it. | ||
405 | 416 | ||
406 | [Map] | 417 | [Map] |
407 | ; Map tile options. | 418 | ; Map tile options. |
@@ -571,16 +582,18 @@ | |||
571 | http_listener_port = 9000 | 582 | http_listener_port = 9000 |
572 | console_port = 0 | 583 | console_port = 0 |
573 | 584 | ||
574 | ; ssl config: Experimental! The auto https config only really works definately on windows XP now | 585 | ; ssl config: Experimental! |
575 | ; you need a Cert Request/Signed pair installed in the MY store with the CN specified below | 586 | http_listener_ssl = false ; if set to true main server is replaced by a ssl one |
576 | ; you can use https on other platforms, but you'll need to configure the httpapi yourself for now | ||
577 | http_listener_ssl = false ; Also create a SSL server | ||
578 | http_listener_cn = "localhost" ; Use the cert with the common name | ||
579 | http_listener_sslport = 9001 ; Use this port for SSL connections | 587 | http_listener_sslport = 9001 ; Use this port for SSL connections |
580 | http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer | 588 | ; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn |
581 | 589 | ; this will change is future | |
582 | ; HTTPS for "Out of band" management applications such as the remote | 590 | http_listener_cn = "myRegionsExternalHostName" |
583 | ; admin module | 591 | ; if the cert doesnt have a oficial CA or is selfsigned viewers option NoVerifySSLCert need to be set true |
592 | http_listener_cert_path = "mycert.p12" ; path for the cert file that is valid for the ExternalHostName | ||
593 | http_listener_cert_pass = "mycertpass" ; the cert passwork | ||
594 | |||
595 | ; addicional HTTPS for "Out of band" management applications such as the remote | ||
596 | ; admin module or scripts | ||
584 | ; | 597 | ; |
585 | ; Create https_listener = "True" will create a listener on the port | 598 | ; Create https_listener = "True" will create a listener on the port |
586 | ; specified. Provide the path to your server certificate along with it's | 599 | ; specified. Provide the path to your server certificate along with it's |
@@ -588,7 +601,7 @@ | |||
588 | ; https_listener = False | 601 | ; https_listener = False |
589 | ; Set our listener to this port | 602 | ; Set our listener to this port |
590 | ; https_port = 0 | 603 | ; https_port = 0 |
591 | ; Path to X509 certificate | 604 | ; Path to X509 certificate, can be the same as main or another |
592 | ; cert_path = "path/to/cert.p12" | 605 | ; cert_path = "path/to/cert.p12" |
593 | ; Password for cert | 606 | ; Password for cert |
594 | ; cert_pass = "password" | 607 | ; cert_pass = "password" |
@@ -600,7 +613,8 @@ | |||
600 | ; HttpBodyMaxLenMAX=16384 | 613 | ; HttpBodyMaxLenMAX=16384 |
601 | 614 | ||
602 | ; Hostname to use in llRequestURL/llRequestSecureURL | 615 | ; Hostname to use in llRequestURL/llRequestSecureURL |
603 | ; if not defined - llRequestURL/llRequestSecureURL are disabled | 616 | ; must be a valid hostname for the ssl cert. |
617 | ; if not defined - llRequestURL/llRequestSecureURL are disabled | ||
604 | ; ExternalHostNameForLSL=127.0.0.1 | 618 | ; ExternalHostNameForLSL=127.0.0.1 |
605 | 619 | ||
606 | ; Disallow the following address ranges for user scripting calls (e.g. llHttpRequest()) | 620 | ; Disallow the following address ranges for user scripting calls (e.g. llHttpRequest()) |
diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe index 05deb1f..aeecacc 100755 --- a/bin/Prebuild.exe +++ b/bin/Prebuild.exe | |||
Binary files differ | |||
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 2cd1897..146d538 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example | |||
@@ -70,6 +70,14 @@ | |||
70 | ; How many lines of command history should we keep? (default is 100) | 70 | ; How many lines of command history should we keep? (default is 100) |
71 | ConsoleHistoryFileLines = 100 | 71 | ConsoleHistoryFileLines = 100 |
72 | 72 | ||
73 | ; peers SSL certificate validation options | ||
74 | ; you can allow selfsigned certificates or no official CA with next option set to true | ||
75 | NoVerifyCertChain = true | ||
76 | ; you can also bypass the hostname or domain verification | ||
77 | NoVerifyCertHostname = true | ||
78 | ; having both options true does provide encryption but with low security | ||
79 | ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it. | ||
80 | |||
73 | 81 | ||
74 | [ServiceList] | 82 | [ServiceList] |
75 | AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector" | 83 | AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector" |
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 2ebcef7..fac5b60 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example | |||
@@ -61,6 +61,14 @@ | |||
61 | 61 | ||
62 | ; How many lines of command history should we keep? (default is 100) | 62 | ; How many lines of command history should we keep? (default is 100) |
63 | ConsoleHistoryFileLines = 100 | 63 | ConsoleHistoryFileLines = 100 |
64 | |||
65 | ; peers SSL certificate validation options | ||
66 | ; you can allow selfsigned certificates or no official CA with next option set to true | ||
67 | NoVerifyCertChain = true | ||
68 | ; you can also bypass the hostname or domain verification | ||
69 | NoVerifyCertHostname = true | ||
70 | ; having both options true does provide encryption but with low security | ||
71 | ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it. | ||
64 | 72 | ||
65 | [ServiceList] | 73 | [ServiceList] |
66 | AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector" | 74 | AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector" |
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll index cb4d1a0..6d02b53 100755 --- a/bin/lib32/ode.dll +++ b/bin/lib32/ode.dll | |||
Binary files differ | |||
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll index 050ee46..b8e3414 100755 --- a/bin/lib64/ode.dll +++ b/bin/lib64/ode.dll | |||
Binary files differ | |||
diff --git a/prebuild.xml b/prebuild.xml index f31f749..2d65db4 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1,7 +1,7 @@ | |||
1 | <?xml version="1.0" ?> | 1 | <?xml version="1.0" ?> |
2 | <Prebuild version="1.10" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd"> | 2 | <Prebuild version="1.10" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd"> |
3 | <Solution activeConfig="Debug" name="OpenSim" path="./" version="0.5.0-$Rev$"> | 3 | <Solution activeConfig="Debug" name="OpenSim" path="./" version="0.5.0-$Rev$"> |
4 | <Configuration name="Debug"> | 4 | <Configuration name="Debug" > |
5 | <Options> | 5 | <Options> |
6 | <CompilerDefines>TRACE;DEBUG</CompilerDefines> | 6 | <CompilerDefines>TRACE;DEBUG</CompilerDefines> |
7 | <OptimizeCode>false</OptimizeCode> | 7 | <OptimizeCode>false</OptimizeCode> |
@@ -14,6 +14,7 @@ | |||
14 | <DebugInformation>true</DebugInformation> | 14 | <DebugInformation>true</DebugInformation> |
15 | <IncrementalBuild>true</IncrementalBuild> | 15 | <IncrementalBuild>true</IncrementalBuild> |
16 | <NoStdLib>false</NoStdLib> | 16 | <NoStdLib>false</NoStdLib> |
17 | <Prefer32Bit>false</Prefer32Bit> | ||
17 | </Options> | 18 | </Options> |
18 | </Configuration> | 19 | </Configuration> |
19 | <Configuration name="Release"> | 20 | <Configuration name="Release"> |
@@ -29,12 +30,13 @@ | |||
29 | <DebugInformation>false</DebugInformation> | 30 | <DebugInformation>false</DebugInformation> |
30 | <IncrementalBuild>true</IncrementalBuild> | 31 | <IncrementalBuild>true</IncrementalBuild> |
31 | <NoStdLib>false</NoStdLib> | 32 | <NoStdLib>false</NoStdLib> |
33 | <Prefer32Bit>false</Prefer32Bit> | ||
32 | </Options> | 34 | </Options> |
33 | </Configuration> | 35 | </Configuration> |
34 | 36 | ||
35 | <!-- Core OpenSim Projects --> | 37 | <!-- Core OpenSim Projects --> |
36 | <!-- | 38 | <!-- |
37 | <Project frameworkVersion="v4_0" name="OpenSim.Model" path="OpenSim/Model" type="Library"> | 39 | <Project frameworkVersion="v4_5" name="OpenSim.Model" path="OpenSim/Model" type="Library"> |
38 | <Configuration name="Debug"> | 40 | <Configuration name="Debug"> |
39 | <Options> | 41 | <Options> |
40 | <OutputPath>../../../bin/</OutputPath> | 42 | <OutputPath>../../../bin/</OutputPath> |
@@ -55,7 +57,7 @@ | |||
55 | </Project> | 57 | </Project> |
56 | --> | 58 | --> |
57 | 59 | ||
58 | <Project frameworkVersion="v4_0" name="SmartThreadPool" path="ThirdParty/SmartThreadPool" type="Library"> | 60 | <Project frameworkVersion="v4_5" name="SmartThreadPool" path="ThirdParty/SmartThreadPool" type="Library"> |
59 | <Configuration name="Debug"> | 61 | <Configuration name="Debug"> |
60 | <Options> | 62 | <Options> |
61 | <OutputPath>../../bin/</OutputPath> | 63 | <OutputPath>../../bin/</OutputPath> |
@@ -77,7 +79,7 @@ | |||
77 | </Files> | 79 | </Files> |
78 | </Project> | 80 | </Project> |
79 | 81 | ||
80 | <Project frameworkVersion="v4_0" name="OpenSim.Framework" path="OpenSim/Framework" type="Library"> | 82 | <Project frameworkVersion="v4_5" name="OpenSim.Framework" path="OpenSim/Framework" type="Library"> |
81 | <Configuration name="Debug"> | 83 | <Configuration name="Debug"> |
82 | <Options> | 84 | <Options> |
83 | <OutputPath>../../bin/</OutputPath> | 85 | <OutputPath>../../bin/</OutputPath> |
@@ -116,7 +118,7 @@ | |||
116 | </Files> | 118 | </Files> |
117 | </Project> | 119 | </Project> |
118 | 120 | ||
119 | <Project frameworkVersion="v4_0" name="OpenSim.Services.Interfaces" path="OpenSim/Services/Interfaces" type="Library"> | 121 | <Project frameworkVersion="v4_5" name="OpenSim.Services.Interfaces" path="OpenSim/Services/Interfaces" type="Library"> |
120 | <Configuration name="Debug"> | 122 | <Configuration name="Debug"> |
121 | <Options> | 123 | <Options> |
122 | <OutputPath>../../../bin/</OutputPath> | 124 | <OutputPath>../../../bin/</OutputPath> |
@@ -145,7 +147,7 @@ | |||
145 | </Files> | 147 | </Files> |
146 | </Project> | 148 | </Project> |
147 | 149 | ||
148 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Monitoring" path="OpenSim/Framework/Monitoring" type="Library"> | 150 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Monitoring" path="OpenSim/Framework/Monitoring" type="Library"> |
149 | <Configuration name="Debug"> | 151 | <Configuration name="Debug"> |
150 | <Options> | 152 | <Options> |
151 | <OutputPath>../../../bin/</OutputPath> | 153 | <OutputPath>../../../bin/</OutputPath> |
@@ -172,7 +174,7 @@ | |||
172 | </Files> | 174 | </Files> |
173 | </Project> | 175 | </Project> |
174 | 176 | ||
175 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Servers.HttpServer" path="OpenSim/Framework/Servers/HttpServer" type="Library"> | 177 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Servers.HttpServer" path="OpenSim/Framework/Servers/HttpServer" type="Library"> |
176 | <Configuration name="Debug"> | 178 | <Configuration name="Debug"> |
177 | <Options> | 179 | <Options> |
178 | <OutputPath>../../../../bin/</OutputPath> | 180 | <OutputPath>../../../../bin/</OutputPath> |
@@ -200,6 +202,7 @@ | |||
200 | 202 | ||
201 | <Files> | 203 | <Files> |
202 | <Match pattern="*.cs" recurse="true"> | 204 | <Match pattern="*.cs" recurse="true"> |
205 | <Exclude name="obj" pattern="obj"/> | ||
203 | <Exclude pattern="Tests"/> | 206 | <Exclude pattern="Tests"/> |
204 | 207 | ||
205 | <!-- on temporary suspension --> | 208 | <!-- on temporary suspension --> |
@@ -213,7 +216,7 @@ | |||
213 | </Files> | 216 | </Files> |
214 | </Project> | 217 | </Project> |
215 | 218 | ||
216 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Console" path="OpenSim/Framework/Console" type="Library"> | 219 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Console" path="OpenSim/Framework/Console" type="Library"> |
217 | <Configuration name="Debug"> | 220 | <Configuration name="Debug"> |
218 | <Options> | 221 | <Options> |
219 | <OutputPath>../../../bin/</OutputPath> | 222 | <OutputPath>../../../bin/</OutputPath> |
@@ -240,7 +243,7 @@ | |||
240 | </Files> | 243 | </Files> |
241 | </Project> | 244 | </Project> |
242 | 245 | ||
243 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Serialization" path="OpenSim/Framework/Serialization" type="Library"> | 246 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Serialization" path="OpenSim/Framework/Serialization" type="Library"> |
244 | <Configuration name="Debug"> | 247 | <Configuration name="Debug"> |
245 | <Options> | 248 | <Options> |
246 | <OutputPath>../../../bin/</OutputPath> | 249 | <OutputPath>../../../bin/</OutputPath> |
@@ -264,12 +267,13 @@ | |||
264 | 267 | ||
265 | <Files> | 268 | <Files> |
266 | <Match pattern="*.cs" recurse="true"> | 269 | <Match pattern="*.cs" recurse="true"> |
270 | <Exclude name="obj" pattern="obj"/> | ||
267 | <Exclude name="Tests" pattern="Tests"/> | 271 | <Exclude name="Tests" pattern="Tests"/> |
268 | </Match> | 272 | </Match> |
269 | </Files> | 273 | </Files> |
270 | </Project> | 274 | </Project> |
271 | 275 | ||
272 | <Project frameworkVersion="v4_0" name="OpenSim.Data" path="OpenSim/Data" type="Library"> | 276 | <Project frameworkVersion="v4_5" name="OpenSim.Data" path="OpenSim/Data" type="Library"> |
273 | <Configuration name="Debug"> | 277 | <Configuration name="Debug"> |
274 | <Options> | 278 | <Options> |
275 | <OutputPath>../../bin/</OutputPath> | 279 | <OutputPath>../../bin/</OutputPath> |
@@ -300,7 +304,7 @@ | |||
300 | </Files> | 304 | </Files> |
301 | </Project> | 305 | </Project> |
302 | 306 | ||
303 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.AssetLoader.Filesystem" path="OpenSim/Framework/AssetLoader/Filesystem" type="Library"> | 307 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.AssetLoader.Filesystem" path="OpenSim/Framework/AssetLoader/Filesystem" type="Library"> |
304 | <Configuration name="Debug"> | 308 | <Configuration name="Debug"> |
305 | <Options> | 309 | <Options> |
306 | <OutputPath>../../../../bin/</OutputPath> | 310 | <OutputPath>../../../../bin/</OutputPath> |
@@ -325,7 +329,7 @@ | |||
325 | </Files> | 329 | </Files> |
326 | </Project> | 330 | </Project> |
327 | 331 | ||
328 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Servers" path="OpenSim/Framework/Servers" type="Library"> | 332 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Servers" path="OpenSim/Framework/Servers" type="Library"> |
329 | <Configuration name="Debug"> | 333 | <Configuration name="Debug"> |
330 | <Options> | 334 | <Options> |
331 | <OutputPath>../../../bin/</OutputPath> | 335 | <OutputPath>../../../bin/</OutputPath> |
@@ -359,7 +363,7 @@ | |||
359 | </Files> | 363 | </Files> |
360 | </Project> | 364 | </Project> |
361 | 365 | ||
362 | <Project frameworkVersion="v4_0" name="OpenSim.Capabilities" path="OpenSim/Capabilities" type="Library"> | 366 | <Project frameworkVersion="v4_5" name="OpenSim.Capabilities" path="OpenSim/Capabilities" type="Library"> |
363 | <Configuration name="Debug"> | 367 | <Configuration name="Debug"> |
364 | <Options> | 368 | <Options> |
365 | <OutputPath>../../bin/</OutputPath> | 369 | <OutputPath>../../bin/</OutputPath> |
@@ -394,7 +398,7 @@ | |||
394 | </Project> | 398 | </Project> |
395 | 399 | ||
396 | 400 | ||
397 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModules.SharedBase" path="OpenSim/Region/PhysicsModules/SharedBase" type="Library"> | 401 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModules.SharedBase" path="OpenSim/Region/PhysicsModules/SharedBase" type="Library"> |
398 | <Configuration name="Debug"> | 402 | <Configuration name="Debug"> |
399 | <Options> | 403 | <Options> |
400 | <OutputPath>../../../../bin/</OutputPath> | 404 | <OutputPath>../../../../bin/</OutputPath> |
@@ -421,7 +425,7 @@ | |||
421 | </Files> | 425 | </Files> |
422 | </Project> | 426 | </Project> |
423 | 427 | ||
424 | <Project frameworkVersion="v4_0" name="OpenSim.Region.Framework" path="OpenSim/Region/Framework" type="Library"> | 428 | <Project frameworkVersion="v4_5" name="OpenSim.Region.Framework" path="OpenSim/Region/Framework" type="Library"> |
425 | <Configuration name="Debug"> | 429 | <Configuration name="Debug"> |
426 | <Options> | 430 | <Options> |
427 | <OutputPath>../../../bin/</OutputPath> | 431 | <OutputPath>../../../bin/</OutputPath> |
@@ -462,6 +466,7 @@ | |||
462 | 466 | ||
463 | <Files> | 467 | <Files> |
464 | <Match pattern="*.cs" recurse="true"> | 468 | <Match pattern="*.cs" recurse="true"> |
469 | <Exclude name="obj" pattern="obj"/> | ||
465 | <Exclude name="Tests" pattern="Tests"/> | 470 | <Exclude name="Tests" pattern="Tests"/> |
466 | </Match> | 471 | </Match> |
467 | </Files> | 472 | </Files> |
@@ -470,7 +475,7 @@ | |||
470 | <!-- OGS projects --> | 475 | <!-- OGS projects --> |
471 | 476 | ||
472 | 477 | ||
473 | <Project frameworkVersion="v4_0" name="OpenSim.Server.Base" path="OpenSim/Server/Base" type="Library"> | 478 | <Project frameworkVersion="v4_5" name="OpenSim.Server.Base" path="OpenSim/Server/Base" type="Library"> |
474 | <Configuration name="Debug"> | 479 | <Configuration name="Debug"> |
475 | <Options> | 480 | <Options> |
476 | <OutputPath>../../../bin/</OutputPath> | 481 | <OutputPath>../../../bin/</OutputPath> |
@@ -505,7 +510,7 @@ | |||
505 | </Files> | 510 | </Files> |
506 | </Project> | 511 | </Project> |
507 | 512 | ||
508 | <Project frameworkVersion="v4_0" name="OpenSim.Services.Base" path="OpenSim/Services/Base" type="Library"> | 513 | <Project frameworkVersion="v4_5" name="OpenSim.Services.Base" path="OpenSim/Services/Base" type="Library"> |
509 | <Configuration name="Debug"> | 514 | <Configuration name="Debug"> |
510 | <Options> | 515 | <Options> |
511 | <OutputPath>../../../bin/</OutputPath> | 516 | <OutputPath>../../../bin/</OutputPath> |
@@ -532,7 +537,7 @@ | |||
532 | </Files> | 537 | </Files> |
533 | </Project> | 538 | </Project> |
534 | 539 | ||
535 | <Project frameworkVersion="v4_0" name="OpenSim.Services.UserAccountService" path="OpenSim/Services/UserAccountService" type="Library"> | 540 | <Project frameworkVersion="v4_5" name="OpenSim.Services.UserAccountService" path="OpenSim/Services/UserAccountService" type="Library"> |
536 | <Configuration name="Debug"> | 541 | <Configuration name="Debug"> |
537 | <Options> | 542 | <Options> |
538 | <OutputPath>../../../bin/</OutputPath> | 543 | <OutputPath>../../../bin/</OutputPath> |
@@ -563,7 +568,7 @@ | |||
563 | </Files> | 568 | </Files> |
564 | </Project> | 569 | </Project> |
565 | 570 | ||
566 | <Project frameworkVersion="v4_0" name="OpenSim.Services.FriendsService" path="OpenSim/Services/Friends" type="Library"> | 571 | <Project frameworkVersion="v4_5" name="OpenSim.Services.FriendsService" path="OpenSim/Services/Friends" type="Library"> |
567 | <Configuration name="Debug"> | 572 | <Configuration name="Debug"> |
568 | <Options> | 573 | <Options> |
569 | <OutputPath>../../../bin/</OutputPath> | 574 | <OutputPath>../../../bin/</OutputPath> |
@@ -594,7 +599,7 @@ | |||
594 | </Files> | 599 | </Files> |
595 | </Project> | 600 | </Project> |
596 | 601 | ||
597 | <Project frameworkVersion="v4_0" name="OpenSim.Services.Connectors" path="OpenSim/Services/Connectors" type="Library"> | 602 | <Project frameworkVersion="v4_5" name="OpenSim.Services.Connectors" path="OpenSim/Services/Connectors" type="Library"> |
598 | <Configuration name="Debug"> | 603 | <Configuration name="Debug"> |
599 | <Options> | 604 | <Options> |
600 | <OutputPath>../../../bin/</OutputPath> | 605 | <OutputPath>../../../bin/</OutputPath> |
@@ -635,7 +640,7 @@ | |||
635 | </Files> | 640 | </Files> |
636 | </Project> | 641 | </Project> |
637 | 642 | ||
638 | <Project frameworkVersion="v4_0" name="OpenSim.Services.SimulationService" path="OpenSim/Services/SimulationService" type="Library"> | 643 | <Project frameworkVersion="v4_5" name="OpenSim.Services.SimulationService" path="OpenSim/Services/SimulationService" type="Library"> |
639 | <Configuration name="Debug"> | 644 | <Configuration name="Debug"> |
640 | <Options> | 645 | <Options> |
641 | <OutputPath>../../../bin/</OutputPath> | 646 | <OutputPath>../../../bin/</OutputPath> |
@@ -669,7 +674,7 @@ | |||
669 | </Files> | 674 | </Files> |
670 | </Project> | 675 | </Project> |
671 | 676 | ||
672 | <Project frameworkVersion="v4_0" name="OpenSim.Services.AssetService" path="OpenSim/Services/AssetService" type="Library"> | 677 | <Project frameworkVersion="v4_5" name="OpenSim.Services.AssetService" path="OpenSim/Services/AssetService" type="Library"> |
673 | <Configuration name="Debug"> | 678 | <Configuration name="Debug"> |
674 | <Options> | 679 | <Options> |
675 | <OutputPath>../../../bin/</OutputPath> | 680 | <OutputPath>../../../bin/</OutputPath> |
@@ -701,7 +706,7 @@ | |||
701 | </Files> | 706 | </Files> |
702 | </Project> | 707 | </Project> |
703 | 708 | ||
704 | <Project frameworkVersion="v4_0" name="OpenSim.Services.FSAssetService" path="OpenSim/Services/FSAssetService" type="Library"> | 709 | <Project frameworkVersion="v4_5" name="OpenSim.Services.FSAssetService" path="OpenSim/Services/FSAssetService" type="Library"> |
705 | <Configuration name="Debug"> | 710 | <Configuration name="Debug"> |
706 | <Options> | 711 | <Options> |
707 | <OutputPath>../../../bin/</OutputPath> | 712 | <OutputPath>../../../bin/</OutputPath> |
@@ -735,7 +740,7 @@ | |||
735 | </Files> | 740 | </Files> |
736 | </Project> | 741 | </Project> |
737 | 742 | ||
738 | <Project frameworkVersion="v4_0" name="OpenSim.Services.AuthorizationService" path="OpenSim/Services/AuthorizationService" type="Library"> | 743 | <Project frameworkVersion="v4_5" name="OpenSim.Services.AuthorizationService" path="OpenSim/Services/AuthorizationService" type="Library"> |
739 | <Configuration name="Debug"> | 744 | <Configuration name="Debug"> |
740 | <Options> | 745 | <Options> |
741 | <OutputPath>../../../bin/</OutputPath> | 746 | <OutputPath>../../../bin/</OutputPath> |
@@ -766,7 +771,7 @@ | |||
766 | </Files> | 771 | </Files> |
767 | </Project> | 772 | </Project> |
768 | 773 | ||
769 | <Project frameworkVersion="v4_0" name="OpenSim.Services.FreeswitchService" path="OpenSim/Services/FreeswitchService" type="Library"> | 774 | <Project frameworkVersion="v4_5" name="OpenSim.Services.FreeswitchService" path="OpenSim/Services/FreeswitchService" type="Library"> |
770 | <Configuration name="Debug"> | 775 | <Configuration name="Debug"> |
771 | <Options> | 776 | <Options> |
772 | <OutputPath>../../../bin/</OutputPath> | 777 | <OutputPath>../../../bin/</OutputPath> |
@@ -798,7 +803,7 @@ | |||
798 | </Files> | 803 | </Files> |
799 | </Project> | 804 | </Project> |
800 | 805 | ||
801 | <Project frameworkVersion="v4_0" name="OpenSim.Services.AuthenticationService" path="OpenSim/Services/AuthenticationService" type="Library"> | 806 | <Project frameworkVersion="v4_5" name="OpenSim.Services.AuthenticationService" path="OpenSim/Services/AuthenticationService" type="Library"> |
802 | <Configuration name="Debug"> | 807 | <Configuration name="Debug"> |
803 | <Options> | 808 | <Options> |
804 | <OutputPath>../../../bin/</OutputPath> | 809 | <OutputPath>../../../bin/</OutputPath> |
@@ -831,7 +836,7 @@ | |||
831 | </Files> | 836 | </Files> |
832 | </Project> | 837 | </Project> |
833 | 838 | ||
834 | <Project frameworkVersion="v4_0" name="OpenSim.Services.GridService" path="OpenSim/Services/GridService" type="Library"> | 839 | <Project frameworkVersion="v4_5" name="OpenSim.Services.GridService" path="OpenSim/Services/GridService" type="Library"> |
835 | <Configuration name="Debug"> | 840 | <Configuration name="Debug"> |
836 | <Options> | 841 | <Options> |
837 | <OutputPath>../../../bin/</OutputPath> | 842 | <OutputPath>../../../bin/</OutputPath> |
@@ -865,7 +870,7 @@ | |||
865 | </Files> | 870 | </Files> |
866 | </Project> | 871 | </Project> |
867 | 872 | ||
868 | <Project frameworkVersion="v4_0" name="OpenSim.Services.EstateService" path="OpenSim/Services/EstateService" type="Library"> | 873 | <Project frameworkVersion="v4_5" name="OpenSim.Services.EstateService" path="OpenSim/Services/EstateService" type="Library"> |
869 | <Configuration name="Debug"> | 874 | <Configuration name="Debug"> |
870 | <Options> | 875 | <Options> |
871 | <OutputPath>../../../bin/</OutputPath> | 876 | <OutputPath>../../../bin/</OutputPath> |
@@ -894,7 +899,7 @@ | |||
894 | </Files> | 899 | </Files> |
895 | </Project> | 900 | </Project> |
896 | 901 | ||
897 | <Project frameworkVersion="v4_0" name="OpenSim.Services.PresenceService" path="OpenSim/Services/PresenceService" type="Library"> | 902 | <Project frameworkVersion="v4_5" name="OpenSim.Services.PresenceService" path="OpenSim/Services/PresenceService" type="Library"> |
898 | <Configuration name="Debug"> | 903 | <Configuration name="Debug"> |
899 | <Options> | 904 | <Options> |
900 | <OutputPath>../../../bin/</OutputPath> | 905 | <OutputPath>../../../bin/</OutputPath> |
@@ -925,7 +930,7 @@ | |||
925 | </Files> | 930 | </Files> |
926 | </Project> | 931 | </Project> |
927 | 932 | ||
928 | <Project frameworkVersion="v4_0" name="OpenSim.Services.AvatarService" path="OpenSim/Services/AvatarService" type="Library"> | 933 | <Project frameworkVersion="v4_5" name="OpenSim.Services.AvatarService" path="OpenSim/Services/AvatarService" type="Library"> |
929 | <Configuration name="Debug"> | 934 | <Configuration name="Debug"> |
930 | <Options> | 935 | <Options> |
931 | <OutputPath>../../../bin/</OutputPath> | 936 | <OutputPath>../../../bin/</OutputPath> |
@@ -956,7 +961,7 @@ | |||
956 | </Files> | 961 | </Files> |
957 | </Project> | 962 | </Project> |
958 | 963 | ||
959 | <Project frameworkVersion="v4_0" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library"> | 964 | <Project frameworkVersion="v4_5" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library"> |
960 | <Configuration name="Debug"> | 965 | <Configuration name="Debug"> |
961 | <Options> | 966 | <Options> |
962 | <OutputPath>../../../bin/</OutputPath> | 967 | <OutputPath>../../../bin/</OutputPath> |
@@ -985,13 +990,14 @@ | |||
985 | 990 | ||
986 | <Files> | 991 | <Files> |
987 | <Match pattern="*.cs" recurse="true"> | 992 | <Match pattern="*.cs" recurse="true"> |
993 | <Exclude name="obj" pattern="obj"/> | ||
988 | <Exclude name="Tests" pattern="Tests"/> | 994 | <Exclude name="Tests" pattern="Tests"/> |
989 | </Match> | 995 | </Match> |
990 | </Files> | 996 | </Files> |
991 | </Project> | 997 | </Project> |
992 | 998 | ||
993 | 999 | ||
994 | <Project frameworkVersion="v4_0" name="OpenSim.Services.LLLoginService" path="OpenSim/Services/LLLoginService" type="Library"> | 1000 | <Project frameworkVersion="v4_5" name="OpenSim.Services.LLLoginService" path="OpenSim/Services/LLLoginService" type="Library"> |
995 | <Configuration name="Debug"> | 1001 | <Configuration name="Debug"> |
996 | <Options> | 1002 | <Options> |
997 | <OutputPath>../../../bin/</OutputPath> | 1003 | <OutputPath>../../../bin/</OutputPath> |
@@ -1024,7 +1030,7 @@ | |||
1024 | </Files> | 1030 | </Files> |
1025 | </Project> | 1031 | </Project> |
1026 | 1032 | ||
1027 | <Project frameworkVersion="v4_0" name="OpenSim.Services.HypergridService" path="OpenSim/Services/HypergridService" type="Library"> | 1033 | <Project frameworkVersion="v4_5" name="OpenSim.Services.HypergridService" path="OpenSim/Services/HypergridService" type="Library"> |
1028 | <Configuration name="Debug"> | 1034 | <Configuration name="Debug"> |
1029 | <Options> | 1035 | <Options> |
1030 | <OutputPath>../../../bin/</OutputPath> | 1036 | <OutputPath>../../../bin/</OutputPath> |
@@ -1063,7 +1069,7 @@ | |||
1063 | </Files> | 1069 | </Files> |
1064 | </Project> | 1070 | </Project> |
1065 | 1071 | ||
1066 | <Project frameworkVersion="v4_0" name="OpenSim.Services.MapImageService" path="OpenSim/Services/MapImageService" type="Library"> | 1072 | <Project frameworkVersion="v4_5" name="OpenSim.Services.MapImageService" path="OpenSim/Services/MapImageService" type="Library"> |
1067 | <Configuration name="Debug"> | 1073 | <Configuration name="Debug"> |
1068 | <Options> | 1074 | <Options> |
1069 | <OutputPath>../../../bin/</OutputPath> | 1075 | <OutputPath>../../../bin/</OutputPath> |
@@ -1093,7 +1099,7 @@ | |||
1093 | </Files> | 1099 | </Files> |
1094 | </Project> | 1100 | </Project> |
1095 | 1101 | ||
1096 | <Project frameworkVersion="v4_0" name="OpenSim.Services.UserProfilesService" path="OpenSim/Services/UserProfilesService" type="Library"> | 1102 | <Project frameworkVersion="v4_5" name="OpenSim.Services.UserProfilesService" path="OpenSim/Services/UserProfilesService" type="Library"> |
1097 | <Configuration name="Debug"> | 1103 | <Configuration name="Debug"> |
1098 | <Options> | 1104 | <Options> |
1099 | <OutputPath>../../../bin/</OutputPath> | 1105 | <OutputPath>../../../bin/</OutputPath> |
@@ -1128,7 +1134,7 @@ | |||
1128 | </Files> | 1134 | </Files> |
1129 | </Project> | 1135 | </Project> |
1130 | 1136 | ||
1131 | <Project frameworkVersion="v4_0" name="OpenSim.Server.Handlers" path="OpenSim/Server/Handlers" type="Library"> | 1137 | <Project frameworkVersion="v4_5" name="OpenSim.Server.Handlers" path="OpenSim/Server/Handlers" type="Library"> |
1132 | <Configuration name="Debug"> | 1138 | <Configuration name="Debug"> |
1133 | <Options> | 1139 | <Options> |
1134 | <OutputPath>../../../bin/</OutputPath> | 1140 | <OutputPath>../../../bin/</OutputPath> |
@@ -1162,13 +1168,14 @@ | |||
1162 | 1168 | ||
1163 | <Files> | 1169 | <Files> |
1164 | <Match pattern="*.cs" recurse="true"> | 1170 | <Match pattern="*.cs" recurse="true"> |
1171 | <Exclude name="obj" pattern="obj"/> | ||
1165 | <Exclude pattern="Tests"/> | 1172 | <Exclude pattern="Tests"/> |
1166 | </Match> | 1173 | </Match> |
1167 | </Files> | 1174 | </Files> |
1168 | </Project> | 1175 | </Project> |
1169 | 1176 | ||
1170 | 1177 | ||
1171 | <Project frameworkVersion="v4_0" name="OpenSim.Capabilities.Handlers" path="OpenSim/Capabilities/Handlers" type="Library"> | 1178 | <Project frameworkVersion="v4_5" name="OpenSim.Capabilities.Handlers" path="OpenSim/Capabilities/Handlers" type="Library"> |
1172 | <Configuration name="Debug"> | 1179 | <Configuration name="Debug"> |
1173 | <Options> | 1180 | <Options> |
1174 | <OutputPath>../../../bin/</OutputPath> | 1181 | <OutputPath>../../../bin/</OutputPath> |
@@ -1203,13 +1210,14 @@ | |||
1203 | 1210 | ||
1204 | <Files> | 1211 | <Files> |
1205 | <Match pattern="*.cs" recurse="true"> | 1212 | <Match pattern="*.cs" recurse="true"> |
1213 | <Exclude name="obj" pattern="obj"/> | ||
1206 | <Exclude pattern="Tests"/> | 1214 | <Exclude pattern="Tests"/> |
1207 | </Match> | 1215 | </Match> |
1208 | </Files> | 1216 | </Files> |
1209 | </Project> | 1217 | </Project> |
1210 | 1218 | ||
1211 | 1219 | ||
1212 | <Project frameworkVersion="v4_0" name="Robust" path="OpenSim/Server" type="Exe"> | 1220 | <Project frameworkVersion="v4_5" name="Robust" path="OpenSim/Server" type="Exe"> |
1213 | <Configuration name="Debug"> | 1221 | <Configuration name="Debug"> |
1214 | <Options> | 1222 | <Options> |
1215 | <OutputPath>../../bin/</OutputPath> | 1223 | <OutputPath>../../bin/</OutputPath> |
@@ -1245,7 +1253,7 @@ | |||
1245 | </Files> | 1253 | </Files> |
1246 | </Project> | 1254 | </Project> |
1247 | 1255 | ||
1248 | <Project frameworkVersion="v4_0" name="OpenSim.ConsoleClient" path="OpenSim/ConsoleClient" type="Exe"> | 1256 | <Project frameworkVersion="v4_5" name="OpenSim.ConsoleClient" path="OpenSim/ConsoleClient" type="Exe"> |
1249 | <Configuration name="Debug"> | 1257 | <Configuration name="Debug"> |
1250 | <Options> | 1258 | <Options> |
1251 | <OutputPath>../../bin/</OutputPath> | 1259 | <OutputPath>../../bin/</OutputPath> |
@@ -1279,7 +1287,7 @@ | |||
1279 | </Project> | 1287 | </Project> |
1280 | 1288 | ||
1281 | <!-- ClientStack Plugins --> | 1289 | <!-- ClientStack Plugins --> |
1282 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenUDP" path="OpenSim/Region/ClientStack/Linden/UDP" type="Library"> | 1290 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ClientStack.LindenUDP" path="OpenSim/Region/ClientStack/Linden/UDP" type="Library"> |
1283 | <Configuration name="Debug"> | 1291 | <Configuration name="Debug"> |
1284 | <Options> | 1292 | <Options> |
1285 | <OutputPath>../../../../../bin/</OutputPath> | 1293 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -1317,6 +1325,7 @@ | |||
1317 | 1325 | ||
1318 | <Files> | 1326 | <Files> |
1319 | <Match pattern="*.cs" recurse="true"> | 1327 | <Match pattern="*.cs" recurse="true"> |
1328 | <Exclude name="obj" pattern="obj"/> | ||
1320 | <Exclude name="Tests" pattern="Tests"/> | 1329 | <Exclude name="Tests" pattern="Tests"/> |
1321 | </Match> | 1330 | </Match> |
1322 | </Files> | 1331 | </Files> |
@@ -1324,7 +1333,7 @@ | |||
1324 | 1333 | ||
1325 | 1334 | ||
1326 | 1335 | ||
1327 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenCaps" path="OpenSim/Region/ClientStack/Linden/Caps" type="Library"> | 1336 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ClientStack.LindenCaps" path="OpenSim/Region/ClientStack/Linden/Caps" type="Library"> |
1328 | <Configuration name="Debug"> | 1337 | <Configuration name="Debug"> |
1329 | <Options> | 1338 | <Options> |
1330 | <OutputPath>../../../../../bin/</OutputPath> | 1339 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -1366,13 +1375,14 @@ | |||
1366 | 1375 | ||
1367 | <Files> | 1376 | <Files> |
1368 | <Match pattern="*.cs" recurse="true"> | 1377 | <Match pattern="*.cs" recurse="true"> |
1378 | <Exclude name="obj" pattern="obj"/> | ||
1369 | <Exclude name="Tests" pattern="Tests"/> | 1379 | <Exclude name="Tests" pattern="Tests"/> |
1370 | </Match> | 1380 | </Match> |
1371 | </Files> | 1381 | </Files> |
1372 | </Project> | 1382 | </Project> |
1373 | 1383 | ||
1374 | 1384 | ||
1375 | <Project frameworkVersion="v4_0" name="OpenSim.Region.CoreModules" path="OpenSim/Region/CoreModules" type="Library"> | 1385 | <Project frameworkVersion="v4_5" name="OpenSim.Region.CoreModules" path="OpenSim/Region/CoreModules" type="Library"> |
1376 | <Configuration name="Debug"> | 1386 | <Configuration name="Debug"> |
1377 | <Options> | 1387 | <Options> |
1378 | <OutputPath>../../../bin/</OutputPath> | 1388 | <OutputPath>../../../bin/</OutputPath> |
@@ -1433,13 +1443,14 @@ | |||
1433 | <Files> | 1443 | <Files> |
1434 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> | 1444 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> |
1435 | <Match pattern="*.cs" recurse="true"> | 1445 | <Match pattern="*.cs" recurse="true"> |
1446 | <Exclude name="obj" pattern="obj"/> | ||
1436 | <Exclude name="Tests" pattern="Tests"/> | 1447 | <Exclude name="Tests" pattern="Tests"/> |
1437 | </Match> | 1448 | </Match> |
1438 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> | 1449 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> |
1439 | </Files> | 1450 | </Files> |
1440 | </Project> | 1451 | </Project> |
1441 | 1452 | ||
1442 | <Project frameworkVersion="v4_0" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library"> | 1453 | <Project frameworkVersion="v4_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library"> |
1443 | <Configuration name="Debug"> | 1454 | <Configuration name="Debug"> |
1444 | <Options> | 1455 | <Options> |
1445 | <OutputPath>../../../bin/</OutputPath> | 1456 | <OutputPath>../../../bin/</OutputPath> |
@@ -1493,6 +1504,7 @@ | |||
1493 | 1504 | ||
1494 | <Files> | 1505 | <Files> |
1495 | <Match pattern="*.cs" recurse="true"> | 1506 | <Match pattern="*.cs" recurse="true"> |
1507 | <Exclude name="obj" pattern="obj"/> | ||
1496 | <Exclude name="Tests" pattern="Tests"/> | 1508 | <Exclude name="Tests" pattern="Tests"/> |
1497 | </Match> | 1509 | </Match> |
1498 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> | 1510 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> |
@@ -1500,7 +1512,7 @@ | |||
1500 | </Project> | 1512 | </Project> |
1501 | 1513 | ||
1502 | <!-- Datastore Plugins --> | 1514 | <!-- Datastore Plugins --> |
1503 | <Project frameworkVersion="v4_0" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library"> | 1515 | <Project frameworkVersion="v4_5" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library"> |
1504 | <Configuration name="Debug"> | 1516 | <Configuration name="Debug"> |
1505 | <Options> | 1517 | <Options> |
1506 | <OutputPath>../../../bin/</OutputPath> | 1518 | <OutputPath>../../../bin/</OutputPath> |
@@ -1528,7 +1540,7 @@ | |||
1528 | </Files> | 1540 | </Files> |
1529 | </Project> | 1541 | </Project> |
1530 | 1542 | ||
1531 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet" path="OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet" type="Library"> | 1543 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet" path="OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet" type="Library"> |
1532 | <Configuration name="Debug"> | 1544 | <Configuration name="Debug"> |
1533 | <Options> | 1545 | <Options> |
1534 | <OutputPath>../../../../bin/</OutputPath> | 1546 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1550,12 +1562,13 @@ | |||
1550 | 1562 | ||
1551 | <Files> | 1563 | <Files> |
1552 | <Match pattern="*.cs" recurse="true"> | 1564 | <Match pattern="*.cs" recurse="true"> |
1565 | <Exclude name="obj" pattern="obj"/> | ||
1553 | <Exclude name="Tests" pattern="Tests"/> | 1566 | <Exclude name="Tests" pattern="Tests"/> |
1554 | </Match> | 1567 | </Match> |
1555 | </Files> | 1568 | </Files> |
1556 | </Project> | 1569 | </Project> |
1557 | 1570 | ||
1558 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.Meshing" path="OpenSim/Region/PhysicsModules/Meshing" type="Library"> | 1571 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.Meshing" path="OpenSim/Region/PhysicsModules/Meshing" type="Library"> |
1559 | <Configuration name="Debug"> | 1572 | <Configuration name="Debug"> |
1560 | <Options> | 1573 | <Options> |
1561 | <OutputPath>../../../../bin/</OutputPath> | 1574 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1588,7 +1601,7 @@ | |||
1588 | </Project> | 1601 | </Project> |
1589 | 1602 | ||
1590 | <!-- Physics Plug-ins --> | 1603 | <!-- Physics Plug-ins --> |
1591 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.BasicPhysics" path="OpenSim/Region/PhysicsModules/BasicPhysics" type="Library"> | 1604 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.BasicPhysics" path="OpenSim/Region/PhysicsModules/BasicPhysics" type="Library"> |
1592 | <Configuration name="Debug"> | 1605 | <Configuration name="Debug"> |
1593 | <Options> | 1606 | <Options> |
1594 | <OutputPath>../../../../bin/</OutputPath> | 1607 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1613,7 +1626,7 @@ | |||
1613 | </Files> | 1626 | </Files> |
1614 | </Project> | 1627 | </Project> |
1615 | 1628 | ||
1616 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.POS" path="OpenSim/Region/PhysicsModules/POS" type="Library"> | 1629 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.POS" path="OpenSim/Region/PhysicsModules/POS" type="Library"> |
1617 | <Configuration name="Debug"> | 1630 | <Configuration name="Debug"> |
1618 | <Options> | 1631 | <Options> |
1619 | <OutputPath>../../../../bin/</OutputPath> | 1632 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1638,7 +1651,7 @@ | |||
1638 | </Files> | 1651 | </Files> |
1639 | </Project> | 1652 | </Project> |
1640 | 1653 | ||
1641 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.Ode" path="OpenSim/Region/PhysicsModules/Ode" type="Library"> | 1654 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.Ode" path="OpenSim/Region/PhysicsModules/Ode" type="Library"> |
1642 | <Configuration name="Debug"> | 1655 | <Configuration name="Debug"> |
1643 | <Options> | 1656 | <Options> |
1644 | <OutputPath>../../../../bin/</OutputPath> | 1657 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1664,12 +1677,13 @@ | |||
1664 | 1677 | ||
1665 | <Files> | 1678 | <Files> |
1666 | <Match pattern="*.cs" recurse="true"> | 1679 | <Match pattern="*.cs" recurse="true"> |
1680 | <Exclude name="obj" pattern="obj"/> | ||
1667 | <Exclude name="Tests" pattern="Tests"/> | 1681 | <Exclude name="Tests" pattern="Tests"/> |
1668 | </Match> | 1682 | </Match> |
1669 | </Files> | 1683 | </Files> |
1670 | </Project> | 1684 | </Project> |
1671 | 1685 | ||
1672 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.ubOde" path="OpenSim/Region/PhysicsModules/ubOde" type="Library"> | 1686 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.ubOde" path="OpenSim/Region/PhysicsModules/ubOde" type="Library"> |
1673 | <Configuration name="Debug"> | 1687 | <Configuration name="Debug"> |
1674 | <Options> | 1688 | <Options> |
1675 | <OutputPath>../../../../bin/</OutputPath> | 1689 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1697,12 +1711,13 @@ | |||
1697 | 1711 | ||
1698 | <Files> | 1712 | <Files> |
1699 | <Match pattern="*.cs" recurse="true"> | 1713 | <Match pattern="*.cs" recurse="true"> |
1714 | <Exclude name="obj" pattern="obj"/> | ||
1700 | <Exclude name="Tests" pattern="Tests"/> | 1715 | <Exclude name="Tests" pattern="Tests"/> |
1701 | </Match> | 1716 | </Match> |
1702 | </Files> | 1717 | </Files> |
1703 | </Project> | 1718 | </Project> |
1704 | 1719 | ||
1705 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.ubOdeMeshing" path="OpenSim/Region/PhysicsModules/ubOdeMeshing" type="Library"> | 1720 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.ubOdeMeshing" path="OpenSim/Region/PhysicsModules/ubOdeMeshing" type="Library"> |
1706 | <Configuration name="Debug"> | 1721 | <Configuration name="Debug"> |
1707 | <Options> | 1722 | <Options> |
1708 | <OutputPath>../../../../bin/</OutputPath> | 1723 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1735,7 +1750,7 @@ | |||
1735 | </Files> | 1750 | </Files> |
1736 | </Project> | 1751 | </Project> |
1737 | 1752 | ||
1738 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.BulletS" path="OpenSim/Region/PhysicsModules/BulletS" type="Library"> | 1753 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.BulletS" path="OpenSim/Region/PhysicsModules/BulletS" type="Library"> |
1739 | <Configuration name="Debug"> | 1754 | <Configuration name="Debug"> |
1740 | <Options> | 1755 | <Options> |
1741 | <OutputPath>../../../../bin/</OutputPath> | 1756 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1768,13 +1783,14 @@ | |||
1768 | 1783 | ||
1769 | <Files> | 1784 | <Files> |
1770 | <Match pattern="*.cs" recurse="true"> | 1785 | <Match pattern="*.cs" recurse="true"> |
1786 | <Exclude name="obj" pattern="obj"/> | ||
1771 | <Exclude name="Tests" pattern="Tests"/> | 1787 | <Exclude name="Tests" pattern="Tests"/> |
1772 | </Match> | 1788 | </Match> |
1773 | </Files> | 1789 | </Files> |
1774 | </Project> | 1790 | </Project> |
1775 | 1791 | ||
1776 | <!-- OpenSim app --> | 1792 | <!-- OpenSim app --> |
1777 | <Project frameworkVersion="v4_0" name="OpenSim" path="OpenSim/Region/Application" type="Exe"> | 1793 | <Project frameworkVersion="v4_5" name="OpenSim" path="OpenSim/Region/Application" type="Exe"> |
1778 | <Configuration name="Debug"> | 1794 | <Configuration name="Debug"> |
1779 | <Options> | 1795 | <Options> |
1780 | <OutputPath>../../../bin/</OutputPath> | 1796 | <OutputPath>../../../bin/</OutputPath> |
@@ -1817,7 +1833,7 @@ | |||
1817 | </Files> | 1833 | </Files> |
1818 | </Project> | 1834 | </Project> |
1819 | 1835 | ||
1820 | <Project frameworkVersion="v4_0" name="OpenSim.ApplicationPlugins.LoadRegions" path="OpenSim/ApplicationPlugins/LoadRegions" type="Library"> | 1836 | <Project frameworkVersion="v4_5" name="OpenSim.ApplicationPlugins.LoadRegions" path="OpenSim/ApplicationPlugins/LoadRegions" type="Library"> |
1821 | <Configuration name="Debug"> | 1837 | <Configuration name="Debug"> |
1822 | <Options> | 1838 | <Options> |
1823 | <OutputPath>../../../bin/</OutputPath> | 1839 | <OutputPath>../../../bin/</OutputPath> |
@@ -1850,7 +1866,7 @@ | |||
1850 | </Files> | 1866 | </Files> |
1851 | </Project> | 1867 | </Project> |
1852 | 1868 | ||
1853 | <Project frameworkVersion="v4_0" name="OpenSim.ApplicationPlugins.RegionModulesController" path="OpenSim/ApplicationPlugins/RegionModulesController" type="Library"> | 1869 | <Project frameworkVersion="v4_5" name="OpenSim.ApplicationPlugins.RegionModulesController" path="OpenSim/ApplicationPlugins/RegionModulesController" type="Library"> |
1854 | <Configuration name="Debug"> | 1870 | <Configuration name="Debug"> |
1855 | <Options> | 1871 | <Options> |
1856 | <OutputPath>../../../bin/</OutputPath> | 1872 | <OutputPath>../../../bin/</OutputPath> |
@@ -1879,7 +1895,7 @@ | |||
1879 | </Files> | 1895 | </Files> |
1880 | </Project> | 1896 | </Project> |
1881 | 1897 | ||
1882 | <Project frameworkVersion="v4_0" name="OpenSim.ApplicationPlugins.RemoteController" path="OpenSim/ApplicationPlugins/RemoteController" type="Library"> | 1898 | <Project frameworkVersion="v4_5" name="OpenSim.ApplicationPlugins.RemoteController" path="OpenSim/ApplicationPlugins/RemoteController" type="Library"> |
1883 | <Configuration name="Debug"> | 1899 | <Configuration name="Debug"> |
1884 | <Options> | 1900 | <Options> |
1885 | <OutputPath>../../../bin/</OutputPath> | 1901 | <OutputPath>../../../bin/</OutputPath> |
@@ -1920,7 +1936,7 @@ | |||
1920 | <!-- Scene Server API Example Apps --> | 1936 | <!-- Scene Server API Example Apps --> |
1921 | 1937 | ||
1922 | <!-- Data Base Modules --> | 1938 | <!-- Data Base Modules --> |
1923 | <Project frameworkVersion="v4_0" name="OpenSim.Data.MySQL" path="OpenSim/Data/MySQL" type="Library"> | 1939 | <Project frameworkVersion="v4_5" name="OpenSim.Data.MySQL" path="OpenSim/Data/MySQL" type="Library"> |
1924 | <Configuration name="Debug"> | 1940 | <Configuration name="Debug"> |
1925 | <Options> | 1941 | <Options> |
1926 | <OutputPath>../../../bin/</OutputPath> | 1942 | <OutputPath>../../../bin/</OutputPath> |
@@ -1951,6 +1967,7 @@ | |||
1951 | 1967 | ||
1952 | <Files> | 1968 | <Files> |
1953 | <Match pattern="*.cs" recurse="true"> | 1969 | <Match pattern="*.cs" recurse="true"> |
1970 | <Exclude name="obj" pattern="obj"/> | ||
1954 | <Exclude name="Tests" pattern="Tests"/> | 1971 | <Exclude name="Tests" pattern="Tests"/> |
1955 | </Match> | 1972 | </Match> |
1956 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.sql"/> | 1973 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.sql"/> |
@@ -1959,7 +1976,7 @@ | |||
1959 | </Files> | 1976 | </Files> |
1960 | </Project> | 1977 | </Project> |
1961 | 1978 | ||
1962 | <Project frameworkVersion="v4_0" name="OpenSim.Data.PGSQL" path="OpenSim/Data/PGSQL" type="Library"> | 1979 | <Project frameworkVersion="v4_5" name="OpenSim.Data.PGSQL" path="OpenSim/Data/PGSQL" type="Library"> |
1963 | <Configuration name="Debug"> | 1980 | <Configuration name="Debug"> |
1964 | <Options> | 1981 | <Options> |
1965 | <OutputPath>../../../bin/</OutputPath> | 1982 | <OutputPath>../../../bin/</OutputPath> |
@@ -1995,7 +2012,7 @@ | |||
1995 | </Files> | 2012 | </Files> |
1996 | </Project> | 2013 | </Project> |
1997 | 2014 | ||
1998 | <Project frameworkVersion="v4_0" name="OpenSim.Data.SQLite" path="OpenSim/Data/SQLite" type="Library"> | 2015 | <Project frameworkVersion="v4_5" name="OpenSim.Data.SQLite" path="OpenSim/Data/SQLite" type="Library"> |
1999 | <Configuration name="Debug"> | 2016 | <Configuration name="Debug"> |
2000 | <Options> | 2017 | <Options> |
2001 | <OutputPath>../../../bin/</OutputPath> | 2018 | <OutputPath>../../../bin/</OutputPath> |
@@ -2026,6 +2043,7 @@ | |||
2026 | 2043 | ||
2027 | <Files> | 2044 | <Files> |
2028 | <Match pattern="*.cs" recurse="true"> | 2045 | <Match pattern="*.cs" recurse="true"> |
2046 | <Exclude name="obj" pattern="obj"/> | ||
2029 | <Exclude name="Tests" pattern="Tests"/> | 2047 | <Exclude name="Tests" pattern="Tests"/> |
2030 | </Match> | 2048 | </Match> |
2031 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.sql"/> | 2049 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.sql"/> |
@@ -2035,7 +2053,7 @@ | |||
2035 | </Project> | 2053 | </Project> |
2036 | 2054 | ||
2037 | 2055 | ||
2038 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Shared" path="OpenSim/Region/ScriptEngine/Shared" type="Library"> | 2056 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Shared" path="OpenSim/Region/ScriptEngine/Shared" type="Library"> |
2039 | <Configuration name="Debug"> | 2057 | <Configuration name="Debug"> |
2040 | <Options> | 2058 | <Options> |
2041 | <OutputPath>../../../../bin/</OutputPath> | 2059 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2071,7 +2089,7 @@ | |||
2071 | </Files> | 2089 | </Files> |
2072 | </Project> | 2090 | </Project> |
2073 | 2091 | ||
2074 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Shared.Api.Runtime" path="OpenSim/Region/ScriptEngine/Shared/Api/Runtime" type="Library"> | 2092 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Shared.Api.Runtime" path="OpenSim/Region/ScriptEngine/Shared/Api/Runtime" type="Library"> |
2075 | <Configuration name="Debug"> | 2093 | <Configuration name="Debug"> |
2076 | <Options> | 2094 | <Options> |
2077 | <OutputPath>../../../../../../bin/</OutputPath> | 2095 | <OutputPath>../../../../../../bin/</OutputPath> |
@@ -2103,7 +2121,7 @@ | |||
2103 | </Files> | 2121 | </Files> |
2104 | </Project> | 2122 | </Project> |
2105 | 2123 | ||
2106 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Shared.Api" path="OpenSim/Region/ScriptEngine/Shared/Api/Implementation" type="Library"> | 2124 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Shared.Api" path="OpenSim/Region/ScriptEngine/Shared/Api/Implementation" type="Library"> |
2107 | <Configuration name="Debug"> | 2125 | <Configuration name="Debug"> |
2108 | <Options> | 2126 | <Options> |
2109 | <OutputPath>../../../../../../bin/</OutputPath> | 2127 | <OutputPath>../../../../../../bin/</OutputPath> |
@@ -2144,7 +2162,7 @@ | |||
2144 | </Files> | 2162 | </Files> |
2145 | </Project> | 2163 | </Project> |
2146 | 2164 | ||
2147 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Shared.CodeTools" path="OpenSim/Region/ScriptEngine/Shared/CodeTools" type="Library"> | 2165 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Shared.CodeTools" path="OpenSim/Region/ScriptEngine/Shared/CodeTools" type="Library"> |
2148 | <Configuration name="Debug"> | 2166 | <Configuration name="Debug"> |
2149 | <Options> | 2167 | <Options> |
2150 | <OutputPath>../../../../../bin/</OutputPath> | 2168 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -2169,12 +2187,13 @@ | |||
2169 | 2187 | ||
2170 | <Files> | 2188 | <Files> |
2171 | <Match pattern="*.cs" recurse="true"> | 2189 | <Match pattern="*.cs" recurse="true"> |
2190 | <Exclude name="obj" pattern="obj"/> | ||
2172 | <Exclude name="Tests" pattern="Tests"/> | 2191 | <Exclude name="Tests" pattern="Tests"/> |
2173 | </Match> | 2192 | </Match> |
2174 | </Files> | 2193 | </Files> |
2175 | </Project> | 2194 | </Project> |
2176 | 2195 | ||
2177 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Shared.Instance" path="OpenSim/Region/ScriptEngine/Shared/Instance" type="Library"> | 2196 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Shared.Instance" path="OpenSim/Region/ScriptEngine/Shared/Instance" type="Library"> |
2178 | <Configuration name="Debug"> | 2197 | <Configuration name="Debug"> |
2179 | <Options> | 2198 | <Options> |
2180 | <OutputPath>../../../../../bin/</OutputPath> | 2199 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -2208,12 +2227,13 @@ | |||
2208 | 2227 | ||
2209 | <Files> | 2228 | <Files> |
2210 | <Match pattern="*.cs" recurse="true"> | 2229 | <Match pattern="*.cs" recurse="true"> |
2230 | <Exclude name="obj" pattern="obj"/> | ||
2211 | <Exclude name="Tests" pattern="Tests"/> | 2231 | <Exclude name="Tests" pattern="Tests"/> |
2212 | </Match> | 2232 | </Match> |
2213 | </Files> | 2233 | </Files> |
2214 | </Project> | 2234 | </Project> |
2215 | 2235 | ||
2216 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.XEngine.Api.Runtime" path="OpenSim/Region/ScriptEngine/XEngine/Api/Runtime" type="Library"> | 2236 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.XEngine.Api.Runtime" path="OpenSim/Region/ScriptEngine/XEngine/Api/Runtime" type="Library"> |
2217 | <Configuration name="Debug"> | 2237 | <Configuration name="Debug"> |
2218 | <Options> | 2238 | <Options> |
2219 | <OutputPath>../../../../../../bin/</OutputPath> | 2239 | <OutputPath>../../../../../../bin/</OutputPath> |
@@ -2246,7 +2266,7 @@ | |||
2246 | </Files> | 2266 | </Files> |
2247 | </Project> | 2267 | </Project> |
2248 | 2268 | ||
2249 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.XEngine" path="OpenSim/Region/ScriptEngine/XEngine" type="Library"> | 2269 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.XEngine" path="OpenSim/Region/ScriptEngine/XEngine" type="Library"> |
2250 | <Configuration name="Debug"> | 2270 | <Configuration name="Debug"> |
2251 | <Options> | 2271 | <Options> |
2252 | <OutputPath>../../../../bin/</OutputPath> | 2272 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2285,6 +2305,7 @@ | |||
2285 | <Files> | 2305 | <Files> |
2286 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> | 2306 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/> |
2287 | <Match pattern="*.cs" recurse="true"> | 2307 | <Match pattern="*.cs" recurse="true"> |
2308 | <Exclude name="obj" pattern="obj"/> | ||
2288 | <Exclude name="Api"/> | 2309 | <Exclude name="Api"/> |
2289 | <Exclude name="Tests" pattern="Tests"/> | 2310 | <Exclude name="Tests" pattern="Tests"/> |
2290 | </Match> | 2311 | </Match> |
@@ -2293,7 +2314,7 @@ | |||
2293 | 2314 | ||
2294 | <!-- Addons --> | 2315 | <!-- Addons --> |
2295 | 2316 | ||
2296 | <Project frameworkVersion="v4_0" name="OpenSim.Addons.OfflineIM" path="OpenSim/Addons/OfflineIM" type="Library"> | 2317 | <Project frameworkVersion="v4_5" name="OpenSim.Addons.OfflineIM" path="OpenSim/Addons/OfflineIM" type="Library"> |
2297 | <Configuration name="Debug"> | 2318 | <Configuration name="Debug"> |
2298 | <Options> | 2319 | <Options> |
2299 | <OutputPath>../../../bin/</OutputPath> | 2320 | <OutputPath>../../../bin/</OutputPath> |
@@ -2334,13 +2355,14 @@ | |||
2334 | 2355 | ||
2335 | <Files> | 2356 | <Files> |
2336 | <Match pattern="*.cs" recurse="true"> | 2357 | <Match pattern="*.cs" recurse="true"> |
2358 | <Exclude name="obj" pattern="obj"/> | ||
2337 | <Exclude pattern="Tests" /> | 2359 | <Exclude pattern="Tests" /> |
2338 | </Match> | 2360 | </Match> |
2339 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.migrations"/> | 2361 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.migrations"/> |
2340 | </Files> | 2362 | </Files> |
2341 | </Project> | 2363 | </Project> |
2342 | 2364 | ||
2343 | <Project frameworkVersion="v4_0" name="OpenSim.Addons.Groups" path="OpenSim/Addons/Groups" type="Library"> | 2365 | <Project frameworkVersion="v4_5" name="OpenSim.Addons.Groups" path="OpenSim/Addons/Groups" type="Library"> |
2344 | <Configuration name="Debug"> | 2366 | <Configuration name="Debug"> |
2345 | <Options> | 2367 | <Options> |
2346 | <OutputPath>../../../bin/</OutputPath> | 2368 | <OutputPath>../../../bin/</OutputPath> |
@@ -2382,6 +2404,7 @@ | |||
2382 | 2404 | ||
2383 | <Files> | 2405 | <Files> |
2384 | <Match pattern="*.cs" recurse="true"> | 2406 | <Match pattern="*.cs" recurse="true"> |
2407 | <Exclude name="obj" pattern="obj"/> | ||
2385 | <Exclude pattern="Tests" /> | 2408 | <Exclude pattern="Tests" /> |
2386 | </Match> | 2409 | </Match> |
2387 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.migrations"/> | 2410 | <Match buildAction="EmbeddedResource" path="Resources" pattern="*.migrations"/> |
@@ -2392,7 +2415,7 @@ | |||
2392 | 2415 | ||
2393 | <!-- Tools --> | 2416 | <!-- Tools --> |
2394 | 2417 | ||
2395 | <Project frameworkVersion="v4_0" name="pCampBot" path="OpenSim/Tools/pCampBot" type="Exe"> | 2418 | <Project frameworkVersion="v4_5" name="pCampBot" path="OpenSim/Tools/pCampBot" type="Exe"> |
2396 | <Configuration name="Debug"> | 2419 | <Configuration name="Debug"> |
2397 | <Options> | 2420 | <Options> |
2398 | <OutputPath>../../../bin/</OutputPath> | 2421 | <OutputPath>../../../bin/</OutputPath> |
@@ -2420,7 +2443,7 @@ | |||
2420 | </Files> | 2443 | </Files> |
2421 | </Project> | 2444 | </Project> |
2422 | 2445 | ||
2423 | <Project frameworkVersion="v4_0" name="OpenSim.Tools.lslc" path="OpenSim/Tools/Compiler" type="Exe"> | 2446 | <Project frameworkVersion="v4_5" name="OpenSim.Tools.lslc" path="OpenSim/Tools/Compiler" type="Exe"> |
2424 | <Configuration name="Debug"> | 2447 | <Configuration name="Debug"> |
2425 | <Options> | 2448 | <Options> |
2426 | <OutputPath>../../../bin/</OutputPath> | 2449 | <OutputPath>../../../bin/</OutputPath> |
@@ -2447,7 +2470,7 @@ | |||
2447 | </Files> | 2470 | </Files> |
2448 | </Project> | 2471 | </Project> |
2449 | 2472 | ||
2450 | <Project frameworkVersion="v4_0" name="OpenSim.Tools.Configger" path="OpenSim/Tools/Configger" type="Exe"> | 2473 | <Project frameworkVersion="v4_5" name="OpenSim.Tools.Configger" path="OpenSim/Tools/Configger" type="Exe"> |
2451 | <Configuration name="Debug"> | 2474 | <Configuration name="Debug"> |
2452 | <Options> | 2475 | <Options> |
2453 | <OutputPath>../../../bin/</OutputPath> | 2476 | <OutputPath>../../../bin/</OutputPath> |
@@ -2472,7 +2495,7 @@ | |||
2472 | </Project> | 2495 | </Project> |
2473 | 2496 | ||
2474 | <!-- Test Clients --> | 2497 | <!-- Test Clients --> |
2475 | <Project frameworkVersion="v4_0" name="OpenSim.Tests.Clients.AssetClient" path="OpenSim/Tests/Clients/Assets" type="Exe"> | 2498 | <Project frameworkVersion="v4_5" name="OpenSim.Tests.Clients.AssetClient" path="OpenSim/Tests/Clients/Assets" type="Exe"> |
2476 | <Configuration name="Debug"> | 2499 | <Configuration name="Debug"> |
2477 | <Options> | 2500 | <Options> |
2478 | <OutputPath>../../../../bin/</OutputPath> | 2501 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2500,7 +2523,7 @@ | |||
2500 | </Project> | 2523 | </Project> |
2501 | 2524 | ||
2502 | <!-- Test assemblies --> | 2525 | <!-- Test assemblies --> |
2503 | <Project frameworkVersion="v4_0" name="OpenSim.Tests.Common" path="OpenSim/Tests/Common" type="Library"> | 2526 | <Project frameworkVersion="v4_5" name="OpenSim.Tests.Common" path="OpenSim/Tests/Common" type="Library"> |
2504 | <Configuration name="Debug"> | 2527 | <Configuration name="Debug"> |
2505 | <Options> | 2528 | <Options> |
2506 | <OutputPath>../../../bin/</OutputPath> | 2529 | <OutputPath>../../../bin/</OutputPath> |
@@ -2549,7 +2572,7 @@ | |||
2549 | </Files> | 2572 | </Files> |
2550 | </Project> | 2573 | </Project> |
2551 | 2574 | ||
2552 | <Project frameworkVersion="v4_0" name="OpenSim.Tests" path="OpenSim/Tests" type="Library"> | 2575 | <Project frameworkVersion="v4_5" name="OpenSim.Tests" path="OpenSim/Tests" type="Library"> |
2553 | <Configuration name="Debug"> | 2576 | <Configuration name="Debug"> |
2554 | <Options> | 2577 | <Options> |
2555 | <OutputPath>../../bin/</OutputPath> | 2578 | <OutputPath>../../bin/</OutputPath> |
@@ -2572,7 +2595,7 @@ | |||
2572 | </Files> | 2595 | </Files> |
2573 | </Project> | 2596 | </Project> |
2574 | 2597 | ||
2575 | <Project frameworkVersion="v4_0" name="OpenSim.Services.InventoryService.Tests" path="OpenSim/Services/InventoryService/Tests" type="Library"> | 2598 | <Project frameworkVersion="v4_5" name="OpenSim.Services.InventoryService.Tests" path="OpenSim/Services/InventoryService/Tests" type="Library"> |
2576 | <Configuration name="Debug"> | 2599 | <Configuration name="Debug"> |
2577 | <Options> | 2600 | <Options> |
2578 | <OutputPath>../../../../bin/</OutputPath> | 2601 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2610,11 +2633,12 @@ | |||
2610 | 2633 | ||
2611 | <Files> | 2634 | <Files> |
2612 | <Match pattern="*.cs" recurse="true"> | 2635 | <Match pattern="*.cs" recurse="true"> |
2636 | <Exclude name="obj" pattern="obj"/> | ||
2613 | </Match> | 2637 | </Match> |
2614 | </Files> | 2638 | </Files> |
2615 | </Project> | 2639 | </Project> |
2616 | 2640 | ||
2617 | <Project frameworkVersion="v4_0" name="Robust.Tests" path="OpenSim/Tests/Robust" type="Library"> | 2641 | <Project frameworkVersion="v4_5" name="Robust.Tests" path="OpenSim/Tests/Robust" type="Library"> |
2618 | <Configuration name="Debug"> | 2642 | <Configuration name="Debug"> |
2619 | <Options> | 2643 | <Options> |
2620 | <OutputPath>../../../bin/</OutputPath> | 2644 | <OutputPath>../../../bin/</OutputPath> |
@@ -2650,7 +2674,7 @@ | |||
2650 | </Project> | 2674 | </Project> |
2651 | 2675 | ||
2652 | 2676 | ||
2653 | <Project frameworkVersion="v4_0" name="OpenSim.Capabilities.Handlers.Tests" path="OpenSim/Capabilities/Handlers" type="Library"> | 2677 | <Project frameworkVersion="v4_5" name="OpenSim.Capabilities.Handlers.Tests" path="OpenSim/Capabilities/Handlers" type="Library"> |
2654 | <Configuration name="Debug"> | 2678 | <Configuration name="Debug"> |
2655 | <Options> | 2679 | <Options> |
2656 | <OutputPath>../../../bin/</OutputPath> | 2680 | <OutputPath>../../../bin/</OutputPath> |
@@ -2701,7 +2725,7 @@ | |||
2701 | </Project> | 2725 | </Project> |
2702 | 2726 | ||
2703 | 2727 | ||
2704 | <Project frameworkVersion="v4_0" name="OpenSim.Data.Tests" path="OpenSim/Data/Tests" type="Library"> | 2728 | <Project frameworkVersion="v4_5" name="OpenSim.Data.Tests" path="OpenSim/Data/Tests" type="Library"> |
2705 | <Configuration name="Debug"> | 2729 | <Configuration name="Debug"> |
2706 | <Options> | 2730 | <Options> |
2707 | <OutputPath>../../../bin/</OutputPath> | 2731 | <OutputPath>../../../bin/</OutputPath> |
@@ -2742,7 +2766,7 @@ | |||
2742 | </Files> | 2766 | </Files> |
2743 | </Project> | 2767 | </Project> |
2744 | 2768 | ||
2745 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Tests" path="OpenSim/Framework/Tests" type="Library"> | 2769 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Tests" path="OpenSim/Framework/Tests" type="Library"> |
2746 | <Configuration name="Debug"> | 2770 | <Configuration name="Debug"> |
2747 | <Options> | 2771 | <Options> |
2748 | <OutputPath>../../../bin/</OutputPath> | 2772 | <OutputPath>../../../bin/</OutputPath> |
@@ -2773,7 +2797,7 @@ | |||
2773 | </Files> | 2797 | </Files> |
2774 | </Project> | 2798 | </Project> |
2775 | 2799 | ||
2776 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Serialization.Tests" path="OpenSim/Framework/Serialization/Tests" type="Library"> | 2800 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Serialization.Tests" path="OpenSim/Framework/Serialization/Tests" type="Library"> |
2777 | <Configuration name="Debug"> | 2801 | <Configuration name="Debug"> |
2778 | <Options> | 2802 | <Options> |
2779 | <OutputPath>../../../../bin/</OutputPath> | 2803 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2800,11 +2824,12 @@ | |||
2800 | 2824 | ||
2801 | <Files> | 2825 | <Files> |
2802 | <Match pattern="*.cs" recurse="true"> | 2826 | <Match pattern="*.cs" recurse="true"> |
2827 | <Exclude name="obj" pattern="obj"/> | ||
2803 | </Match> | 2828 | </Match> |
2804 | </Files> | 2829 | </Files> |
2805 | </Project> | 2830 | </Project> |
2806 | 2831 | ||
2807 | <Project frameworkVersion="v4_0" name="OpenSim.Framework.Servers.Tests" path="OpenSim/Framework/Servers/Tests" type="Library"> | 2832 | <Project frameworkVersion="v4_5" name="OpenSim.Framework.Servers.Tests" path="OpenSim/Framework/Servers/Tests" type="Library"> |
2808 | <Configuration name="Debug"> | 2833 | <Configuration name="Debug"> |
2809 | <Options> | 2834 | <Options> |
2810 | <OutputPath>../../../../bin/</OutputPath> | 2835 | <OutputPath>../../../../bin/</OutputPath> |
@@ -2830,11 +2855,12 @@ | |||
2830 | 2855 | ||
2831 | <Files> | 2856 | <Files> |
2832 | <Match pattern="*.cs" recurse="true"> | 2857 | <Match pattern="*.cs" recurse="true"> |
2858 | <Exclude name="obj" pattern="obj"/> | ||
2833 | </Match> | 2859 | </Match> |
2834 | </Files> | 2860 | </Files> |
2835 | </Project> | 2861 | </Project> |
2836 | 2862 | ||
2837 | <Project frameworkVersion="v4_0" name="OpenSim.Region.CoreModules.Tests" path="OpenSim/Region/CoreModules" type="Library"> | 2863 | <Project frameworkVersion="v4_5" name="OpenSim.Region.CoreModules.Tests" path="OpenSim/Region/CoreModules" type="Library"> |
2838 | <Configuration name="Debug"> | 2864 | <Configuration name="Debug"> |
2839 | <Options> | 2865 | <Options> |
2840 | <OutputPath>../../../bin/</OutputPath> | 2866 | <OutputPath>../../../bin/</OutputPath> |
@@ -2913,7 +2939,7 @@ | |||
2913 | </Project> | 2939 | </Project> |
2914 | 2940 | ||
2915 | 2941 | ||
2916 | <Project frameworkVersion="v4_0" name="OpenSim.Region.Framework.Tests" path="OpenSim/Region/Framework" type="Library"> | 2942 | <Project frameworkVersion="v4_5" name="OpenSim.Region.Framework.Tests" path="OpenSim/Region/Framework" type="Library"> |
2917 | <Configuration name="Debug"> | 2943 | <Configuration name="Debug"> |
2918 | <Options> | 2944 | <Options> |
2919 | <OutputPath>../../../bin/</OutputPath> | 2945 | <OutputPath>../../../bin/</OutputPath> |
@@ -2975,7 +3001,7 @@ | |||
2975 | </Files> | 3001 | </Files> |
2976 | </Project> | 3002 | </Project> |
2977 | 3003 | ||
2978 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenCaps.Tests" path="OpenSim/Region/ClientStack/Linden/Caps" type="Library"> | 3004 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ClientStack.LindenCaps.Tests" path="OpenSim/Region/ClientStack/Linden/Caps" type="Library"> |
2979 | <Configuration name="Debug"> | 3005 | <Configuration name="Debug"> |
2980 | <Options> | 3006 | <Options> |
2981 | <OutputPath>../../../../../bin/</OutputPath> | 3007 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -3016,7 +3042,7 @@ | |||
3016 | </Files> | 3042 | </Files> |
3017 | </Project> | 3043 | </Project> |
3018 | 3044 | ||
3019 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenUDP.Tests" path="OpenSim/Region/ClientStack/Linden/UDP/Tests" type="Library"> | 3045 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ClientStack.LindenUDP.Tests" path="OpenSim/Region/ClientStack/Linden/UDP/Tests" type="Library"> |
3020 | <Configuration name="Debug"> | 3046 | <Configuration name="Debug"> |
3021 | <Options> | 3047 | <Options> |
3022 | <OutputPath>../../../../../../bin/</OutputPath> | 3048 | <OutputPath>../../../../../../bin/</OutputPath> |
@@ -3050,7 +3076,7 @@ | |||
3050 | </Files> | 3076 | </Files> |
3051 | </Project> | 3077 | </Project> |
3052 | 3078 | ||
3053 | <Project frameworkVersion="v4_0" name="OpenSim.Region.ScriptEngine.Tests" path="OpenSim/Region/ScriptEngine" type="Library"> | 3079 | <Project frameworkVersion="v4_5" name="OpenSim.Region.ScriptEngine.Tests" path="OpenSim/Region/ScriptEngine" type="Library"> |
3054 | <Configuration name="Debug"> | 3080 | <Configuration name="Debug"> |
3055 | <Options> | 3081 | <Options> |
3056 | <OutputPath>../../../bin/</OutputPath> | 3082 | <OutputPath>../../../bin/</OutputPath> |
@@ -3108,7 +3134,7 @@ | |||
3108 | TODO: this is kind of lame, we basically build a duplicate | 3134 | TODO: this is kind of lame, we basically build a duplicate |
3109 | assembly but with tests added in, just because we can't resolve cross-bin-dir-refs. | 3135 | assembly but with tests added in, just because we can't resolve cross-bin-dir-refs. |
3110 | --> | 3136 | --> |
3111 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.Ode.Tests" path="OpenSim/Region/PhysicsModules/Ode/Tests" type="Library"> | 3137 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.Ode.Tests" path="OpenSim/Region/PhysicsModules/Ode/Tests" type="Library"> |
3112 | <Configuration name="Debug"> | 3138 | <Configuration name="Debug"> |
3113 | <Options> | 3139 | <Options> |
3114 | <OutputPath>../../../../../bin/</OutputPath> | 3140 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -3139,7 +3165,7 @@ | |||
3139 | </Files> | 3165 | </Files> |
3140 | </Project> | 3166 | </Project> |
3141 | 3167 | ||
3142 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.BulletS.Tests" path="OpenSim/Region/PhysicsModules/BulletS/Tests" type="Library"> | 3168 | <Project frameworkVersion="v4_5" name="OpenSim.Region.PhysicsModule.BulletS.Tests" path="OpenSim/Region/PhysicsModules/BulletS/Tests" type="Library"> |
3143 | <Configuration name="Debug"> | 3169 | <Configuration name="Debug"> |
3144 | <Options> | 3170 | <Options> |
3145 | <OutputPath>../../../../../bin/</OutputPath> | 3171 | <OutputPath>../../../../../bin/</OutputPath> |
@@ -3173,7 +3199,7 @@ | |||
3173 | </Project> | 3199 | </Project> |
3174 | 3200 | ||
3175 | 3201 | ||
3176 | <Project frameworkVersion="v4_0" name="OpenSim.Server.Handlers.Tests" path="OpenSim/Server/Handlers" type="Library"> | 3202 | <Project frameworkVersion="v4_5" name="OpenSim.Server.Handlers.Tests" path="OpenSim/Server/Handlers" type="Library"> |
3177 | <Configuration name="Debug"> | 3203 | <Configuration name="Debug"> |
3178 | <Options> | 3204 | <Options> |
3179 | <OutputPath>../../../bin/</OutputPath> | 3205 | <OutputPath>../../../bin/</OutputPath> |
@@ -3219,7 +3245,7 @@ | |||
3219 | </Files> | 3245 | </Files> |
3220 | </Project> | 3246 | </Project> |
3221 | 3247 | ||
3222 | <Project frameworkVersion="v4_0" name="OpenSim.Tests.Stress" path="OpenSim/Tests/Stress" type="Library"> | 3248 | <Project frameworkVersion="v4_5" name="OpenSim.Tests.Stress" path="OpenSim/Tests/Stress" type="Library"> |
3223 | <Configuration name="Debug"> | 3249 | <Configuration name="Debug"> |
3224 | <Options> | 3250 | <Options> |
3225 | <OutputPath>../../../bin/</OutputPath> | 3251 | <OutputPath>../../../bin/</OutputPath> |
@@ -3259,7 +3285,7 @@ | |||
3259 | </Files> | 3285 | </Files> |
3260 | </Project> | 3286 | </Project> |
3261 | 3287 | ||
3262 | <Project frameworkVersion="v4_0" name="OpenSim.Tests.Performance" path="OpenSim/Tests/Performance" type="Library"> | 3288 | <Project frameworkVersion="v4_5" name="OpenSim.Tests.Performance" path="OpenSim/Tests/Performance" type="Library"> |
3263 | <Configuration name="Debug"> | 3289 | <Configuration name="Debug"> |
3264 | <Options> | 3290 | <Options> |
3265 | <OutputPath>../../../bin/</OutputPath> | 3291 | <OutputPath>../../../bin/</OutputPath> |
@@ -3298,7 +3324,7 @@ | |||
3298 | </Files> | 3324 | </Files> |
3299 | </Project> | 3325 | </Project> |
3300 | 3326 | ||
3301 | <Project frameworkVersion="v4_0" name="OpenSim.Tests.Permissions" path="OpenSim/Tests/Permissions" type="Library"> | 3327 | <Project frameworkVersion="v4_5" name="OpenSim.Tests.Permissions" path="OpenSim/Tests/Permissions" type="Library"> |
3302 | <Configuration name="Debug"> | 3328 | <Configuration name="Debug"> |
3303 | <Options> | 3329 | <Options> |
3304 | <OutputPath>../../../bin/</OutputPath> | 3330 | <OutputPath>../../../bin/</OutputPath> |
diff --git a/runprebuild.bat b/runprebuild.bat index ed2def1..af56ee8 100755 --- a/runprebuild.bat +++ b/runprebuild.bat | |||
@@ -1,7 +1,7 @@ | |||
1 | @echo OFF | 1 | @echo OFF |
2 | 2 | ||
3 | bin\Prebuild.exe /target nant | 3 | bin\Prebuild.exe /target nant |
4 | bin\Prebuild.exe /target vs2010 | 4 | bin\Prebuild.exe /target vs2015 |
5 | 5 | ||
6 | setlocal ENABLEEXTENSIONS | 6 | setlocal ENABLEEXTENSIONS |
7 | set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" | 7 | set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" |
diff --git a/runprebuild.sh b/runprebuild.sh index 8c18db6..011936e 100755 --- a/runprebuild.sh +++ b/runprebuild.sh | |||
@@ -18,14 +18,14 @@ case "$1" in | |||
18 | 18 | ||
19 | 'vs2010') | 19 | 'vs2010') |
20 | 20 | ||
21 | mono bin/Prebuild.exe /target vs2010 | 21 | mono bin/Prebuild.exe /target vs2015 |
22 | 22 | ||
23 | ;; | 23 | ;; |
24 | 24 | ||
25 | *) | 25 | *) |
26 | 26 | ||
27 | mono bin/Prebuild.exe /target nant | 27 | mono bin/Prebuild.exe /target nant |
28 | mono bin/Prebuild.exe /target vs2010 | 28 | mono bin/Prebuild.exe /target vs2015 |
29 | 29 | ||
30 | ;; | 30 | ;; |
31 | 31 | ||