aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs148
-rw-r--r--OpenSim/Framework/IProfileModule.cs37
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs23
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs17
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs81
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs87
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs10
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs102
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs31
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs18
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs223
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs237
-rw-r--r--OpenSim/Region/Framework/Interfaces/IUserManagement.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs46
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs325
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs1
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs33
-rw-r--r--OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs2
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs21
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs27
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs57
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs81
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs3
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs4
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs55
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs33
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs1
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs4
-rw-r--r--OpenSim/Tools/pCampBot/pCampBot.cs8
-rw-r--r--Prebuild/COPYING130
-rw-r--r--Prebuild/NEWS400
-rwxr-xr-xPrebuild/Prebuild.exebin0 -> 226816 bytes
-rw-r--r--Prebuild/README548
-rw-r--r--Prebuild/prebuild.xml6
-rwxr-xr-xPrebuild/scripts/SharpDevelop2.bat8
-rwxr-xr-xPrebuild/scripts/VS2008.bat8
-rw-r--r--Prebuild/scripts/VS2010.bat8
-rwxr-xr-xPrebuild/scripts/autotools.bat8
-rw-r--r--Prebuild/src/Core/Nodes/CleanFilesNode.cs158
-rw-r--r--Prebuild/src/Core/Nodes/CleanupNode.cs168
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs142
-rw-r--r--Prebuild/src/Core/Nodes/DatabaseProjectNode.cs186
-rw-r--r--Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs126
-rw-r--r--Prebuild/src/Core/Nodes/FileNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/FilesNode.cs34
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs17
-rw-r--r--Prebuild/src/Core/Targets/AutotoolsTarget.cs2140
-rw-r--r--Prebuild/src/Core/Targets/DebugTarget.cs2
-rw-r--r--Prebuild/src/Core/Targets/VS2010Target.cs276
-rw-r--r--Prebuild/src/Core/Targets/VSGenericTarget.cs1894
-rw-r--r--Prebuild/src/Prebuild.cs2
-rw-r--r--Prebuild/src/data/prebuild-1.7.xsd700
-rw-r--r--Prebuild/src/data/prebuild-1.9.xsd672
-rwxr-xr-xbin/C5.dllbin272384 -> 276992 bytes
-rw-r--r--bin/OpenSimDefaults.ini5
-rwxr-xr-xbin/Prebuild.exebin228352 -> 226816 bytes
-rw-r--r--bin/Robust.HG.ini.example2
-rw-r--r--bin/config-include/GridHypergrid.ini2
-rw-r--r--bin/config-include/HyperSimianGrid.ini2
-rw-r--r--bin/config-include/StandaloneHypergrid.ini2
-rw-r--r--prebuild.xml1
75 files changed, 4784 insertions, 4683 deletions
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index e91a4b8..3ce4e66 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -240,78 +240,84 @@ namespace OpenSim.Capabilities.Handlers
240 240
241 if (containingFolder != null) 241 if (containingFolder != null)
242 { 242 {
243 version = containingFolder.Version; 243// m_log.DebugFormat(
244// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
245// containingFolder.Name, containingFolder.ID, agentID);
244 246
245 if (fetchItems) 247 version = containingFolder.Version;
246 { 248//
247 /* 249// if (fetchItems)
248 List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>(); 250// {
249 251// List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
250 foreach (InventoryItemBase item in contents.Items) 252//
251 { 253// foreach (InventoryItemBase item in contents.Items)
252 if (item.AssetType == (int)AssetType.Link) 254// {
253 { 255// if (item.AssetType == (int)AssetType.Link)
254 InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); 256// {
255 257// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
256 // Take care of genuinely broken links where the target doesn't exist 258//
257 // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, 259// // Take care of genuinely broken links where the target doesn't exist
258 // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles 260// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
259 // rather than having to keep track of every folder requested in the recursion. 261// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
260 if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link && linkedItem.AssetType == (int)AssetType.Object) 262// // rather than having to keep track of every folder requested in the recursion.
261 linkedItemsToAdd.Add(linkedItem); 263// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
262 } 264// linkedItemsToAdd.Insert(0, linkedItem);
263 } 265// }
264 266// }
265 foreach (InventoryItemBase linkedItem in linkedItemsToAdd) 267//
266 { 268// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
267 m_log.DebugFormat( 269// {
268 "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}", 270// m_log.DebugFormat(
269 linkedItem.Name, folderID, agentID); 271// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
270 272// linkedItem.Name, folderID, agentID);
271 contents.Items.Insert(0, linkedItem); 273//
272 } 274// contents.Items.Add(linkedItem);
273 */ 275// }
274 276//
275 /* 277// // If the folder requested contains links, then we need to send those folders first, otherwise the links
276 // If the folder requested contains links, then we need to send those folders first, otherwise the links 278// // will be broken in the viewer.
277 // will be broken in the viewer. 279// HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
278 HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>(); 280// foreach (InventoryItemBase item in contents.Items)
279 foreach (InventoryItemBase item in contents.Items) 281// {
280 { 282// if (item.AssetType == (int)AssetType.Link)
281 if (item.AssetType == (int)AssetType.Link) 283// {
282 { 284// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
283 InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); 285//
284 286// // Take care of genuinely broken links where the target doesn't exist
285 // Take care of genuinely broken links where the target doesn't exist 287// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
286 // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, 288// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
287 // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles 289// // rather than having to keep track of every folder requested in the recursion.
288 // rather than having to keep track of every folder requested in the recursion. 290// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
289 if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) 291// {
290 { 292// // We don't need to send the folder if source and destination of the link are in the same
291 // We don't need to send the folder if source and destination of the link are in the same 293// // folder.
292 // folder. 294// if (linkedItem.Folder != containingFolder.ID)
293 if (linkedItem.Folder != containingFolder.ID) 295// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
294 linkedItemFolderIdsToSend.Add(linkedItem.Folder); 296// }
295 } 297// }
296 } 298// }
297 } 299//
298 300// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
299 foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) 301// {
300 { 302// m_log.DebugFormat(
301 m_log.DebugFormat( 303// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
302 "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}", 304// linkedItemFolderId, folderID, agentID);
303 linkedItemFolderId, folderID, agentID); 305//
304 306// int dummyVersion;
305 int dummyVersion; 307// InventoryCollection linkedCollection
306 InventoryCollection linkedCollection 308// = Fetch(
307 = Fetch( 309// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
308 agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion); 310//
309 311// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
310 contents.Folders.AddRange(linkedCollection.Folders); 312// linkedFolder.Owner = agentID;
311 contents.Items.AddRange(linkedCollection.Items); 313// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
312 } 314//
313 */ 315//// contents.Folders.AddRange(linkedCollection.Folders);
314 } 316//
317// contents.Folders.Add(linkedFolder);
318// contents.Items.AddRange(linkedCollection.Items);
319// }
320// }
315 } 321 }
316 } 322 }
317 else 323 else
diff --git a/OpenSim/Framework/IProfileModule.cs b/OpenSim/Framework/IProfileModule.cs
new file mode 100644
index 0000000..ef03d4a
--- /dev/null
+++ b/OpenSim/Framework/IProfileModule.cs
@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public interface IProfileModule
33 {
34 void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID);
35
36 }
37}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
index e9e2dca..cb9692a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
@@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
56 public IAssetService AssetService; 56 public IAssetService AssetService;
57 public UUID AgentID; 57 public UUID AgentID;
58 public IInventoryAccessModule InventoryAccessModule; 58 public IInventoryAccessModule InventoryAccessModule;
59 public OpenJPEG.J2KLayerInfo[] Layers; 59 private OpenJPEG.J2KLayerInfo[] m_layers;
60 public bool IsDecoded; 60 public bool IsDecoded { get; private set; }
61 public bool HasAsset; 61 public bool HasAsset { get; private set; }
62 public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; 62 public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
63 63
64 private uint m_currentPacket; 64 private uint m_currentPacket;
@@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
170 if (DiscardLevel >= 0 || m_stopPacket == 0) 170 if (DiscardLevel >= 0 || m_stopPacket == 0)
171 { 171 {
172 // This shouldn't happen, but if it does, we really can't proceed 172 // This shouldn't happen, but if it does, we really can't proceed
173 if (Layers == null) 173 if (m_layers == null)
174 { 174 {
175 m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); 175 m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
176 m_currentPacket = m_stopPacket; 176 m_currentPacket = m_stopPacket;
177 return; 177 return;
178 } 178 }
179 179
180 int maxDiscardLevel = Math.Max(0, Layers.Length - 1); 180 int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
181 181
182 // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel 182 // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
183 if (DiscardLevel < 0 && m_stopPacket == 0) 183 if (DiscardLevel < 0 && m_stopPacket == 0)
@@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
187 DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); 187 DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
188 188
189 //Calculate the m_stopPacket 189 //Calculate the m_stopPacket
190 if (Layers.Length > 0) 190 if (m_layers.Length > 0)
191 { 191 {
192 m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End); 192 m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
193 //I don't know why, but the viewer seems to expect the final packet if the file 193 //I don't know why, but the viewer seems to expect the final packet if the file
194 //is just one packet bigger. 194 //is just one packet bigger.
195 if (TexturePacketCount() == m_stopPacket + 1) 195 if (TexturePacketCount() == m_stopPacket + 1)
@@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
341 341
342 private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) 342 private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
343 { 343 {
344 Layers = layers; 344 m_layers = layers;
345 IsDecoded = true; 345 IsDecoded = true;
346 RunUpdate(); 346 RunUpdate();
347 } 347 }
@@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
385 string assetServerURL = string.Empty; 385 string assetServerURL = string.Empty;
386 if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) 386 if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
387 { 387 {
388 m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); 388 if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
389 AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); 389 assetServerURL = assetServerURL + "/";
390
391 m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id);
392 AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived);
390 return; 393 return;
391 } 394 }
392 } 395 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
index 9e0db12..e3a881f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
@@ -39,6 +39,9 @@ using log4net;
39 39
40namespace OpenSim.Region.ClientStack.LindenUDP 40namespace OpenSim.Region.ClientStack.LindenUDP
41{ 41{
42 /// <summary>
43 /// This class handles UDP texture requests.
44 /// </summary>
42 public class LLImageManager 45 public class LLImageManager
43 { 46 {
44 private sealed class J2KImageComparer : IComparer<J2KImage> 47 private sealed class J2KImageComparer : IComparer<J2KImage>
@@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
208 211
209 #region Priority Queue Helpers 212 #region Priority Queue Helpers
210 213
211 J2KImage GetHighestPriorityImage() 214 private J2KImage GetHighestPriorityImage()
212 { 215 {
213 J2KImage image = null; 216 J2KImage image = null;
214 217
@@ -223,23 +226,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
223 return image; 226 return image;
224 } 227 }
225 228
226 void AddImageToQueue(J2KImage image) 229 private void AddImageToQueue(J2KImage image)
227 { 230 {
228 image.PriorityQueueHandle = null; 231 image.PriorityQueueHandle = null;
229 232
230 lock (m_syncRoot) 233 lock (m_syncRoot)
234 {
231 try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); } 235 try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
232 catch (Exception) { } 236 catch (Exception) { }
237 }
233 } 238 }
234 239
235 void RemoveImageFromQueue(J2KImage image) 240 private void RemoveImageFromQueue(J2KImage image)
236 { 241 {
237 lock (m_syncRoot) 242 lock (m_syncRoot)
243 {
238 try { m_priorityQueue.Delete(image.PriorityQueueHandle); } 244 try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
239 catch (Exception) { } 245 catch (Exception) { }
246 }
240 } 247 }
241 248
242 void UpdateImageInQueue(J2KImage image) 249 private void UpdateImageInQueue(J2KImage image)
243 { 250 {
244 lock (m_syncRoot) 251 lock (m_syncRoot)
245 { 252 {
@@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
254 261
255 #endregion Priority Queue Helpers 262 #endregion Priority Queue Helpers
256 } 263 }
257} 264} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 1386e86..7dd9087 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
152 /// <param name="j2kData">JPEG2000 data</param> 152 /// <param name="j2kData">JPEG2000 data</param>
153 private void DoJ2KDecode(UUID assetID, byte[] j2kData) 153 private void DoJ2KDecode(UUID assetID, byte[] j2kData)
154 { 154 {
155// m_log.DebugFormat(
156// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
157
155 //int DecodeTime = 0; 158 //int DecodeTime = 0;
156 //DecodeTime = Environment.TickCount; 159 //DecodeTime = Environment.TickCount;
157 OpenJPEG.J2KLayerInfo[] layers; 160 OpenJPEG.J2KLayerInfo[] layers;
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 9a97925..a77646c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -50,6 +50,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
50 { 50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 IUserManagement m_uMan;
54 IUserManagement UserManagementModule
55 {
56 get
57 {
58 if (m_uMan == null)
59 m_uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
60 return m_uMan;
61 }
62 }
63
53 #region ISharedRegionModule 64 #region ISharedRegionModule
54 public override string Name 65 public override string Name
55 { 66 {
@@ -369,9 +380,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
369 protected override FriendInfo[] GetFriendsFromService(IClientAPI client) 380 protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
370 { 381 {
371// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); 382// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
383 Boolean agentIsLocal = true;
384 if (UserManagementModule != null)
385 agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
372 386
373 UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, client.AgentId); 387 if (agentIsLocal)
374 if (account1 != null)
375 return base.GetFriendsFromService(client); 388 return base.GetFriendsFromService(client);
376 389
377 FriendInfo[] finfos = new FriendInfo[0]; 390 FriendInfo[] finfos = new FriendInfo[0];
@@ -392,16 +405,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
392 405
393 protected override bool StoreRights(UUID agentID, UUID friendID, int rights) 406 protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
394 { 407 {
395 UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); 408 Boolean agentIsLocal = true;
396 UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); 409 Boolean friendIsLocal = true;
410 if (UserManagementModule != null)
411 {
412 agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
413 friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
414 }
415
397 // Are they both local users? 416 // Are they both local users?
398 if (account1 != null && account2 != null) 417 if (agentIsLocal && friendIsLocal)
399 { 418 {
400 // local grid users 419 // local grid users
401 return base.StoreRights(agentID, friendID, rights); 420 return base.StoreRights(agentID, friendID, rights);
402 } 421 }
403 422
404 if (account1 != null) // agent is local, friend is foreigner 423 if (agentIsLocal) // agent is local, friend is foreigner
405 { 424 {
406 FriendInfo[] finfos = GetFriends(agentID); 425 FriendInfo[] finfos = GetFriends(agentID);
407 FriendInfo finfo = GetFriend(finfos, friendID); 426 FriendInfo finfo = GetFriend(finfos, friendID);
@@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
412 } 431 }
413 } 432 }
414 433
415 if (account2 != null) // agent is foreigner, friend is local 434 if (friendIsLocal) // agent is foreigner, friend is local
416 { 435 {
417 string agentUUI = GetUUI(friendID, agentID); 436 string agentUUI = GetUUI(friendID, agentID);
418 if (agentUUI != string.Empty) 437 if (agentUUI != string.Empty)
@@ -427,10 +446,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
427 446
428 protected override void StoreBackwards(UUID friendID, UUID agentID) 447 protected override void StoreBackwards(UUID friendID, UUID agentID)
429 { 448 {
430 UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); 449 Boolean agentIsLocal = true;
431 UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); 450 Boolean friendIsLocal = true;
451 if (UserManagementModule != null)
452 {
453 agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
454 friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
455 }
456
432 // Are they both local users? 457 // Are they both local users?
433 if (account1 != null && account2 != null) 458 if (agentIsLocal && friendIsLocal)
434 { 459 {
435 // local grid users 460 // local grid users
436 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); 461 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -444,10 +469,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
444 469
445 protected override void StoreFriendships(UUID agentID, UUID friendID) 470 protected override void StoreFriendships(UUID agentID, UUID friendID)
446 { 471 {
447 UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); 472 Boolean agentIsLocal = true;
448 UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); 473 Boolean friendIsLocal = true;
474 if (UserManagementModule != null)
475 {
476 agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
477 friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
478 }
479
449 // Are they both local users? 480 // Are they both local users?
450 if (agentAccount != null && friendAccount != null) 481 if (agentIsLocal && friendIsLocal)
451 { 482 {
452 // local grid users 483 // local grid users
453 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); 484 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -465,13 +496,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
465 string agentFriendService = string.Empty; 496 string agentFriendService = string.Empty;
466 string friendFriendService = string.Empty; 497 string friendFriendService = string.Empty;
467 498
468 if (agentClient != null) 499 if (agentIsLocal)
469 { 500 {
470 agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode); 501 agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
471 agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); 502 agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
472 agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); 503 agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
473 } 504 }
474 if (friendClient != null) 505 if (friendIsLocal)
475 { 506 {
476 friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode); 507 friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode);
477 friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit); 508 friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit);
@@ -484,7 +515,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
484 // Generate a random 8-character hex number that will sign this friendship 515 // Generate a random 8-character hex number that will sign this friendship
485 string secret = UUID.Random().ToString().Substring(0, 8); 516 string secret = UUID.Random().ToString().Substring(0, 8);
486 517
487 if (agentAccount != null) // agent is local, 'friend' is foreigner 518 if (agentIsLocal) // agent is local, 'friend' is foreigner
488 { 519 {
489 // This may happen when the agent returned home, in which case the friend is not there 520 // This may happen when the agent returned home, in which case the friend is not there
490 // We need to look for its information in the friends list itself 521 // We need to look for its information in the friends list itself
@@ -520,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
520 friendsConn.NewFriendship(friendID, agentUUI + ";" + secret); 551 friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
521 } 552 }
522 } 553 }
523 else if (friendAccount != null) // 'friend' is local, agent is foreigner 554 else if (friendIsLocal) // 'friend' is local, agent is foreigner
524 { 555 {
525 // store in the local friends service a reference to the foreign agent 556 // store in the local friends service a reference to the foreign agent
526 FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1); 557 FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
@@ -553,10 +584,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
553 584
554 protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) 585 protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
555 { 586 {
556 UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); 587 Boolean agentIsLocal = true;
557 UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, exfriendID); 588 Boolean friendIsLocal = true;
589 if (UserManagementModule != null)
590 {
591 agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
592 friendIsLocal = UserManagementModule.IsLocalGridUser(exfriendID);
593 }
594
558 // Are they both local users? 595 // Are they both local users?
559 if (agentAccount != null && friendAccount != null) 596 if (agentIsLocal && friendIsLocal)
560 { 597 {
561 // local grid users 598 // local grid users
562 return base.DeleteFriendship(agentID, exfriendID); 599 return base.DeleteFriendship(agentID, exfriendID);
@@ -566,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
566 string agentUUI = string.Empty; 603 string agentUUI = string.Empty;
567 string friendUUI = string.Empty; 604 string friendUUI = string.Empty;
568 605
569 if (agentAccount != null) // agent is local, 'friend' is foreigner 606 if (agentIsLocal) // agent is local, 'friend' is foreigner
570 { 607 {
571 // We need to look for its information in the friends list itself 608 // We need to look for its information in the friends list itself
572 FriendInfo[] finfos = GetFriends(agentID); 609 FriendInfo[] finfos = GetFriends(agentID);
@@ -587,7 +624,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
587 return true; 624 return true;
588 } 625 }
589 } 626 }
590 else if (friendAccount != null) // agent is foreigner, 'friend' is local 627 else if (friendIsLocal) // agent is foreigner, 'friend' is local
591 { 628 {
592 agentUUI = GetUUI(exfriendID, agentID); 629 agentUUI = GetUUI(exfriendID, agentID);
593 630
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 560d913..bf1d787 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -180,10 +180,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
180 180
181// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); 181// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
182 // Is the user a local user? 182 // Is the user a local user?
183 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, toAgentID);
184 string url = string.Empty; 183 string url = string.Empty;
185 bool foreigner = false; 184 bool foreigner = false;
186 if (account == null) // foreign user 185 if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(toAgentID)) // foreign user
187 { 186 {
188 url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI"); 187 url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI");
189 foreigner = true; 188 foreigner = true;
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
index dee0ad4..eb1e4b5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
@@ -43,7 +43,7 @@ using OpenSim.Services.Interfaces;
43namespace OpenSim.Region.CoreModules.Avatar.Profile 43namespace OpenSim.Region.CoreModules.Avatar.Profile
44{ 44{
45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
46 public class BasicProfileModule : ISharedRegionModule 46 public class BasicProfileModule : IProfileModule, ISharedRegionModule
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
@@ -57,6 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
57 57
58 public void Initialise(IConfigSource config) 58 public void Initialise(IConfigSource config)
59 { 59 {
60 // This can be reduced later as the loader will determine
61 // whether we are needed
60 if (config.Configs["Profile"] != null) 62 if (config.Configs["Profile"] != null)
61 { 63 {
62 if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule") 64 if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule")
@@ -65,14 +67,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
65 67
66 m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); 68 m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled");
67 m_Enabled = true; 69 m_Enabled = true;
68
69 } 70 }
70 71
71 public void AddRegion(Scene scene) 72 public void AddRegion(Scene scene)
72 { 73 {
73 if (!m_Enabled) 74 if (!m_Enabled)
74 return; 75 return;
75 76
76 lock (m_Scenes) 77 lock (m_Scenes)
77 { 78 {
78 if (!m_Scenes.Contains(scene)) 79 if (!m_Scenes.Contains(scene))
@@ -80,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
80 m_Scenes.Add(scene); 81 m_Scenes.Add(scene);
81 // Hook up events 82 // Hook up events
82 scene.EventManager.OnNewClient += OnNewClient; 83 scene.EventManager.OnNewClient += OnNewClient;
84 scene.RegisterModuleInterface<IProfileModule>(this);
83 } 85 }
84 } 86 }
85 } 87 }
@@ -116,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
116 118
117 public Type ReplaceableInterface 119 public Type ReplaceableInterface
118 { 120 {
119 get { return null; } 121 get { return typeof(IProfileModule); }
120 } 122 }
121 123
122 #endregion 124 #endregion
@@ -170,4 +172,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
170 } 172 }
171 173
172 } 174 }
173} \ No newline at end of file 175}
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 87f292c..cbef6ce 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -676,9 +676,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
676 Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); 676 Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
677 Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); 677 Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
678 678
679 // distance to edge that will trigger crossing
680
681
682 // distance into new region to place avatar 679 // distance into new region to place avatar
683 const float enterDistance = 0.5f; 680 const float enterDistance = 0.5f;
684 681
@@ -960,29 +957,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
960 m_log.DebugFormat( 957 m_log.DebugFormat(
961 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", 958 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
962 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); 959 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
963 960
964 pos = pos + (agent.Velocity); 961 pos = pos + agent.Velocity;
965 962 Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
963
964 agent.RemoveFromPhysicalScene();
966 SetInTransit(agent.UUID); 965 SetInTransit(agent.UUID);
967 AgentData cAgent = new AgentData(); 966
967 AgentData cAgent = new AgentData();
968 agent.CopyTo(cAgent); 968 agent.CopyTo(cAgent);
969 cAgent.Position = pos; 969 cAgent.Position = pos;
970 if (isFlying) 970 if (isFlying)
971 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 971 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
972 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 972
973 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 973 // We don't need the callback anymnore
974 974 cAgent.CallbackURI = String.Empty;
975
975 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 976 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
976 { 977 {
977 // region doesn't take it 978 // region doesn't take it
978 ReInstantiateScripts(agent); 979 ReInstantiateScripts(agent);
980 agent.AddToPhysicalScene(isFlying);
979 ResetFromTransit(agent.UUID); 981 ResetFromTransit(agent.UUID);
980 return agent; 982 return agent;
981 } 983 }
982 984
983 // Next, let's close the child agent connections that are too far away.
984 agent.CloseChildAgents(neighbourx, neighboury);
985
986 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); 985 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
987 agent.ControllingClient.RequestClientInfo(); 986 agent.ControllingClient.RequestClientInfo();
988 987
@@ -999,11 +998,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
999 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); 998 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
1000 999
1001 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 1000 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
1002 1001
1003 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); 1002 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
1004 if (eq != null) 1003 if (eq != null)
1005 { 1004 {
1006 eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1005 eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
1007 capsPath, agent.UUID, agent.ControllingClient.SessionId); 1006 capsPath, agent.UUID, agent.ControllingClient.SessionId);
1008 } 1007 }
1009 else 1008 else
@@ -1011,32 +1010,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1011 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1010 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1012 capsPath); 1011 capsPath);
1013 } 1012 }
1014 1013
1015 if (!WaitForCallback(agent.UUID)) 1014 // SUCCESS!
1016 {
1017 m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
1018 ReInstantiateScripts(agent);
1019 ResetFromTransit(agent.UUID);
1020
1021 // Yikes! We should just have a ref to scene here.
1022 //agent.Scene.InformClientOfNeighbours(agent);
1023 EnableChildAgents(agent);
1024
1025 return agent;
1026 }
1027
1028 agent.MakeChildAgent(); 1015 agent.MakeChildAgent();
1029 1016 ResetFromTransit(agent.UUID);
1017
1030 // now we have a child agent in this region. Request all interesting data about other (root) agents 1018 // now we have a child agent in this region. Request all interesting data about other (root) agents
1031 agent.SendOtherAgentsAvatarDataToMe(); 1019 agent.SendOtherAgentsAvatarDataToMe();
1032 agent.SendOtherAgentsAppearanceToMe(); 1020 agent.SendOtherAgentsAppearanceToMe();
1033 1021
1034 // Backwards compatibility 1022 // Backwards compatibility. Best effort
1035 if (version == "Unknown" || version == string.Empty) 1023 if (version == "Unknown" || version == string.Empty)
1036 { 1024 {
1037 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one..."); 1025 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
1026 Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
1038 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); 1027 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1039 } 1028 }
1029
1030
1031 // Next, let's close the child agent connections that are too far away.
1032 agent.CloseChildAgents(neighbourx, neighboury);
1040 1033
1041 AgentHasMovedAway(agent, false); 1034 AgentHasMovedAway(agent, false);
1042 1035
@@ -1069,16 +1062,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1069 CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; 1062 CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
1070 ScenePresence agent = icon.EndInvoke(iar); 1063 ScenePresence agent = icon.EndInvoke(iar);
1071 1064
1072 // If the cross was successful, this agent is a child agent 1065 //// If the cross was successful, this agent is a child agent
1073 if (agent.IsChildAgent) 1066 //if (agent.IsChildAgent)
1074 agent.Reset(); 1067 // agent.Reset();
1075 else // Not successful 1068 //else // Not successful
1076 agent.RestoreInCurrentScene(); 1069 // agent.RestoreInCurrentScene();
1077 1070
1078 // In any case 1071 // In any case
1079 agent.IsInTransit = false; 1072 agent.IsInTransit = false;
1080 1073
1081 //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); 1074 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
1082 } 1075 }
1083 1076
1084 #endregion 1077 #endregion
@@ -1712,9 +1705,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1712 uint x = 0, y = 0; 1705 uint x = 0, y = 0;
1713 Utils.LongToUInts(newRegionHandle, out x, out y); 1706 Utils.LongToUInts(newRegionHandle, out x, out y);
1714 GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); 1707 GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
1715 if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) 1708
1709 if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
1716 { 1710 {
1711 m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
1712
1713 // We are going to move the object back to the old position so long as the old position
1714 // is in the region
1715 oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
1716 oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
1717 oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
1718
1717 grp.RootPart.GroupPosition = oldGroupPosition; 1719 grp.RootPart.GroupPosition = oldGroupPosition;
1720
1721 // Need to turn off the physics flags, otherwise the object will continue to attempt to
1722 // move out of the region creating an infinite loop of failed attempts to cross
1723 grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
1724
1718 grp.ScheduleGroupForFullUpdate(); 1725 grp.ScheduleGroupForFullUpdate();
1719 } 1726 }
1720 } 1727 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index cc9ba97..8d41728 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
187 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); 187 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
188 188
189 // Let's find out if this is a foreign user or a local user 189 // Let's find out if this is a foreign user or a local user
190 UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id); 190 IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
191 if (account != null) 191 if (uMan != null && uMan.IsLocalGridUser(id))
192 { 192 {
193 // local grid user 193 // local grid user
194 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); 194 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
@@ -227,8 +227,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
227 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); 227 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
228 GridRegion homeGatekeeper = MakeRegion(aCircuit); 228 GridRegion homeGatekeeper = MakeRegion(aCircuit);
229 229
230 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}", 230 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
231 aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName); 231 aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
232 232
233 DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); 233 DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
234 } 234 }
@@ -313,8 +313,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
313 } 313 }
314 314
315 // Let's find out if this is a foreign user or a local user 315 // Let's find out if this is a foreign user or a local user
316 IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
316 UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); 317 UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
317 if (account != null) 318 if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
318 { 319 {
319 // local grid user 320 // local grid user
320 return; 321 return;
@@ -347,6 +348,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
347 348
348 region.ExternalHostName = uri.Host; 349 region.ExternalHostName = uri.Host;
349 region.HttpPort = (uint)uri.Port; 350 region.HttpPort = (uint)uri.Port;
351 region.ServerURI = uri.ToString();
350 region.RegionName = string.Empty; 352 region.RegionName = string.Empty;
351 region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); 353 region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
352 return region; 354 return region;
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 81b65c5..d20c9eb 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
73 73
74 public AssetBase FetchAsset(string url, UUID assetID) 74 public AssetBase FetchAsset(string url, UUID assetID)
75 { 75 {
76 AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString()); 76 if (!url.EndsWith("/") && !url.EndsWith("="))
77 url = url + "/";
78
79 AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString());
77 80
78 if (asset != null) 81 if (asset != null)
79 { 82 {
@@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
87 { 90 {
88 if (asset != null) 91 if (asset != null)
89 { 92 {
93 if (!url.EndsWith("/") && !url.EndsWith("="))
94 url = url + "/";
95
90 // See long comment in AssetCache.AddAsset 96 // See long comment in AssetCache.AddAsset
91 if (!asset.Temporary || asset.Local) 97 if (!asset.Temporary || asset.Local)
92 { 98 {
@@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
99 Copy(asset, asset1); 105 Copy(asset, asset1);
100 try 106 try
101 { 107 {
102 asset1.ID = url + "/" + asset.ID; 108 asset1.ID = url + asset.ID;
103 } 109 }
104 catch 110 catch
105 { 111 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 49d484b..bf24ebc 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -124,8 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
124 124
125 protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix) 125 protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
126 { 126 {
127 UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID); 127 if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID))
128 if (account == null)
129 prefix = "HG "; 128 prefix = "HG ";
130 else 129 else
131 prefix = string.Empty; 130 prefix = string.Empty;
@@ -210,12 +209,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
210 public override bool IsForeignUser(UUID userID, out string assetServerURL) 209 public override bool IsForeignUser(UUID userID, out string assetServerURL)
211 { 210 {
212 assetServerURL = string.Empty; 211 assetServerURL = string.Empty;
213 UserAccount account = null;
214 if (m_Scene.UserAccountService != null)
215 account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
216 212
217 if (account == null) // foreign 213 if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
218 { 214 { // foreign
219 ScenePresence sp = null; 215 ScenePresence sp = null;
220 if (m_Scene.TryGetScenePresence(userID, out sp)) 216 if (m_Scene.TryGetScenePresence(userID, out sp))
221 { 217 {
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index a40a6a4..37292d6 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -50,6 +50,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
50 public string LastName { get; set; } 50 public string LastName { get; set; }
51 public string HomeURL { get; set; } 51 public string HomeURL { get; set; }
52 public Dictionary<string, object> ServerURLs { get; set; } 52 public Dictionary<string, object> ServerURLs { get; set; }
53 public string Title { get; set; }
54 public int Flags { get; set; }
55 public int Created { get; set; }
53 } 56 }
54 57
55 public class UserManagementModule : ISharedRegionModule, IUserManagement 58 public class UserManagementModule : ISharedRegionModule, IUserManagement
@@ -281,6 +284,94 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
281 return string.Empty; 284 return string.Empty;
282 } 285 }
283 286
287 public int GetUserFlags(UUID userID)
288 {
289 UserData userdata;
290 lock (m_UserCache)
291 m_UserCache.TryGetValue(userID, out userdata);
292
293 if (userdata.Flags == -1)
294 GetUserInfo(userID);
295
296 if (userdata.Flags != -1)
297 return userdata.Flags;
298
299 return 0;
300 }
301
302 public int GetUserCreated(UUID userID)
303 {
304 UserData userdata;
305 lock (m_UserCache)
306 m_UserCache.TryGetValue(userID, out userdata);
307
308 if (userdata.Flags == -1)
309 GetUserInfo(userID);
310
311 if (userdata.Created != -1)
312 return userdata.Created;
313
314 return 0;
315 }
316
317 public string GetUserTitle(UUID userID)
318 {
319 UserData userdata;
320 lock (m_UserCache)
321 m_UserCache.TryGetValue(userID, out userdata);
322
323 if (userdata.Flags == -1)
324 GetUserInfo(userID);
325
326 if (userdata.Created != -1)
327 return userdata.Title;
328
329 return string.Empty;
330 }
331
332 // This will cache the user data
333 // Change this to return bool
334 private bool GetUserInfo(UUID userID)
335 {
336 UserData userdata;
337 lock (m_UserCache)
338 m_UserCache.TryGetValue(userID, out userdata);
339
340 if (userdata != null)
341 {
342// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID);
343
344 if (userdata.Flags >= 0)
345 {
346 // This is already populated
347 return true;
348 }
349
350 if (userdata.HomeURL != null && userdata.HomeURL != string.Empty)
351 {
352 m_log.DebugFormat(
353 "[USER MANAGEMENT MODULE]: Requesting user flags from '{0}' for {1}",
354 userdata.HomeURL, userID);
355
356 UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL);
357 Dictionary<string, object> info = uConn.GetUserInfo(userID);
358
359 // Pull our data now
360 if (info["result"].ToString() == "success")
361 {
362 userdata.Flags = (int)info["user_flags"];
363 userdata.Created = (int)info["user_created"];
364 userdata.Title = (string)info["user_title"];
365
366 return true;
367 }
368 }
369 }
370
371 return false;
372 }
373
374
284 public string GetUserUUI(UUID userID) 375 public string GetUserUUI(UUID userID)
285 { 376 {
286 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); 377 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID);
@@ -352,6 +443,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
352 { 443 {
353 UserData user = new UserData(); 444 UserData user = new UserData();
354 user.Id = id; 445 user.Id = id;
446 user.Flags = -1;
447 user.Created = -1;
355 448
356 if (creatorData != null && creatorData != string.Empty) 449 if (creatorData != null && creatorData != string.Empty)
357 { 450 {
@@ -425,6 +518,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
425 518
426 //} 519 //}
427 520
521 public bool IsLocalGridUser(UUID uuid)
522 {
523 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid);
524 if (account == null || (account != null && !account.LocalToGrid))
525 return false;
526
527 return true;
528 }
529
428 #endregion IUserManagement 530 #endregion IUserManagement
429 531
430 private void HandleShowUsers(string module, string[] cmd) 532 private void HandleShowUsers(string module, string[] cmd)
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index cabbd31..16cbbf5 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare
153 153
154 public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) 154 public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
155 { 155 {
156 if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) 156 if (m_enableWindlight)
157 { 157 {
158 List<byte[]> param = compileWindlightSettings(wl); 158 if (m_scene.RegionInfo.WindlightSettings.valid)
159 client.SendGenericMessage("Windlight", param); 159 {
160 List<byte[]> param = compileWindlightSettings(wl);
161 client.SendGenericMessage("Windlight", param);
162 }
163 else
164 {
165 List<byte[]> param = new List<byte[]>();
166 client.SendGenericMessage("WindlightReset", param);
167 }
160 } 168 }
161 } 169 }
162 170
@@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
175 183
176 private void EventManager_OnSaveNewWindlightProfile() 184 private void EventManager_OnSaveNewWindlightProfile()
177 { 185 {
178 if (m_scene.RegionInfo.WindlightSettings.valid) 186 m_scene.ForEachRootClient(SendProfileToClient);
179 m_scene.ForEachRootClient(SendProfileToClient);
180 } 187 }
181 188
182 public void PostInitialise() 189 public void PostInitialise()
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 43672d1..8fb5d75 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -411,8 +411,21 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
411 } 411 }
412 412
413 Request.Timeout = HttpTimeout; 413 Request.Timeout = HttpTimeout;
414 // execute the request 414 try
415 response = (HttpWebResponse) Request.GetResponse(); 415 {
416 // execute the request
417 response = (HttpWebResponse) Request.GetResponse();
418 }
419 catch (WebException e)
420 {
421 if (e.Status != WebExceptionStatus.ProtocolError)
422 {
423 throw;
424 }
425 response = (HttpWebResponse)e.Response;
426 }
427
428 Status = (int)response.StatusCode;
416 429
417 Stream resStream = response.GetResponseStream(); 430 Stream resStream = response.GetResponseStream();
418 431
@@ -436,17 +449,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
436 } 449 }
437 catch (Exception e) 450 catch (Exception e)
438 { 451 {
439 if (e is WebException && ((WebException)e).Status == WebExceptionStatus.ProtocolError) 452 Status = (int)OSHttpStatusCode.ClientErrorJoker;
440 { 453 ResponseBody = e.Message;
441 HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
442 Status = (int)webRsp.StatusCode;
443 ResponseBody = webRsp.StatusDescription;
444 }
445 else
446 {
447 Status = (int)OSHttpStatusCode.ClientErrorJoker;
448 ResponseBody = e.Message;
449 }
450 454
451 _finished = true; 455 _finished = true;
452 return; 456 return;
@@ -457,7 +461,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
457 response.Close(); 461 response.Close();
458 } 462 }
459 463
460 Status = (int)OSHttpStatusCode.SuccessOk;
461 _finished = true; 464 _finished = true;
462 } 465 }
463 466
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index e31be21..8395f83 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -382,23 +382,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
382 return result; 382 return result;
383 } 383 }
384 384
385 #region IHyperAssetService
386
387 public string GetUserAssetServer(UUID userID)
388 {
389 UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID);
390
391 if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null)
392 return account.ServiceURLs["AssetServerURI"].ToString();
393
394 return string.Empty;
395 }
396
397 public string GetSimAssetServer()
398 {
399 return m_LocalAssetServiceURI;
400 }
401
402 #endregion
403 } 385 }
404} 386}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
index cc5d061..2e6ec90 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
@@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
170 170
171 public AssetBase GetCached(string id) 171 public AssetBase GetCached(string id)
172 { 172 {
173// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
174
173 if (m_Cache != null) 175 if (m_Cache != null)
174 return m_Cache.Get(id); 176 return m_Cache.Get(id);
175 177
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
deleted file mode 100644
index dcf08e3..0000000
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
+++ /dev/null
@@ -1,223 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using Nini.Config;
32using log4net;
33using OpenSim.Framework;
34using OpenSim.Services.Interfaces;
35
36namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
37{
38 public abstract class BaseInventoryConnector : IInventoryService
39 {
40 protected static InventoryCache m_cache;
41 private static bool m_Initialized;
42
43 protected virtual void Init(IConfigSource source)
44 {
45 if (!m_Initialized)
46 {
47 m_cache = new InventoryCache();
48 m_cache.Init(source, this);
49 m_Initialized = true;
50 }
51 }
52
53 /// <summary>
54 /// Create the entire inventory for a given user
55 /// </summary>
56 /// <param name="user"></param>
57 /// <returns></returns>
58 public abstract bool CreateUserInventory(UUID user);
59
60 /// <summary>
61 /// Gets the skeleton of the inventory -- folders only
62 /// </summary>
63 /// <param name="userId"></param>
64 /// <returns></returns>
65 public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId);
66
67 /// <summary>
68 /// Synchronous inventory fetch.
69 /// </summary>
70 /// <param name="userID"></param>
71 /// <returns></returns>
72 public abstract InventoryCollection GetUserInventory(UUID userID);
73
74 /// <summary>
75 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
76 /// inventory has been received
77 /// </summary>
78 /// <param name="userID"></param>
79 /// <param name="callback"></param>
80 public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
81
82 /// <summary>
83 /// Retrieve the root inventory folder for the given user.
84 /// </summary>
85 /// <param name="userID"></param>
86 /// <returns>null if no root folder was found</returns>
87 public InventoryFolderBase GetRootFolder(UUID userID)
88 {
89 // Root folder is here as system type Folder.
90 return m_cache.GetFolderForType(userID, AssetType.Folder);
91 }
92
93 public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID);
94
95 /// <summary>
96 /// Gets the user folder for the given folder-type
97 /// </summary>
98 /// <param name="userID"></param>
99 /// <param name="type"></param>
100 /// <returns></returns>
101 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
102 {
103 return m_cache.GetFolderForType(userID, type);
104 }
105
106 /// <summary>
107 /// Gets everything (folders and items) inside a folder
108 /// </summary>
109 /// <param name="userId"></param>
110 /// <param name="folderID"></param>
111 /// <returns></returns>
112 public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID);
113
114 /// <summary>
115 /// Gets the items inside a folder
116 /// </summary>
117 /// <param name="userID"></param>
118 /// <param name="folderID"></param>
119 /// <returns></returns>
120 public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID);
121
122 /// <summary>
123 /// Add a new folder to the user's inventory
124 /// </summary>
125 /// <param name="folder"></param>
126 /// <returns>true if the folder was successfully added</returns>
127 public abstract bool AddFolder(InventoryFolderBase folder);
128
129 /// <summary>
130 /// Update a folder in the user's inventory
131 /// </summary>
132 /// <param name="folder"></param>
133 /// <returns>true if the folder was successfully updated</returns>
134 public abstract bool UpdateFolder(InventoryFolderBase folder);
135
136 /// <summary>
137 /// Move an inventory folder to a new location
138 /// </summary>
139 /// <param name="folder">A folder containing the details of the new location</param>
140 /// <returns>true if the folder was successfully moved</returns>
141 public abstract bool MoveFolder(InventoryFolderBase folder);
142
143 /// <summary>
144 /// Delete a list of inventory folders (from trash)
145 /// </summary>
146 public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs);
147
148 /// <summary>
149 /// Purge an inventory folder of all its items and subfolders.
150 /// </summary>
151 /// <param name="folder"></param>
152 /// <returns>true if the folder was successfully purged</returns>
153 public abstract bool PurgeFolder(InventoryFolderBase folder);
154
155 /// <summary>
156 /// Add a new item to the user's inventory.
157 /// If the given item has to parent folder, it tries to find the most
158 /// suitable folder for it.
159 /// </summary>
160 /// <param name="item"></param>
161 /// <returns>true if the item was successfully added</returns>
162 public bool AddItem(InventoryItemBase item)
163 {
164 if (item == null)
165 return false;
166
167 if (item.Folder == UUID.Zero)
168 {
169 InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
170 if (f != null)
171 item.Folder = f.ID;
172 else
173 {
174 f = GetRootFolder(item.Owner);
175 if (f != null)
176 item.Folder = f.ID;
177 else
178 return false;
179 }
180 }
181
182 return AddItemPlain(item);
183 }
184
185 protected abstract bool AddItemPlain(InventoryItemBase item);
186
187 /// <summary>
188 /// Update an item in the user's inventory
189 /// </summary>
190 /// <param name="item"></param>
191 /// <returns>true if the item was successfully updated</returns>
192 public abstract bool UpdateItem(InventoryItemBase item);
193
194 public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items);
195
196 /// <summary>
197 /// Delete an item from the user's inventory
198 /// </summary>
199 /// <param name="item"></param>
200 /// <returns>true if the item was successfully deleted</returns>
201 public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs);
202
203 public abstract InventoryItemBase GetItem(InventoryItemBase item);
204
205 public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
206
207 /// <summary>
208 /// Does the given user have an inventory structure?
209 /// </summary>
210 /// <param name="userID"></param>
211 /// <returns></returns>
212 public abstract bool HasInventoryForUser(UUID userID);
213
214 /// <summary>
215 /// Get the active gestures of the agent.
216 /// </summary>
217 /// <param name="userId"></param>
218 /// <returns></returns>
219 public abstract List<InventoryItemBase> GetActiveGestures(UUID userId);
220
221 public abstract int GetAssetPermissions(UUID userID, UUID assetID);
222 }
223}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 0d121ed..b5c0af6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -218,9 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
218 /// <param name="userID"></param> 218 /// <param name="userID"></param>
219 private void CacheInventoryServiceURL(UUID userID) 219 private void CacheInventoryServiceURL(UUID userID)
220 { 220 {
221 if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null) 221 if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
222 { 222 {
223 // The user does not have a local account; let's cache its service URL 223 // The user is not local; let's cache its service URL
224 string inventoryURL = string.Empty; 224 string inventoryURL = string.Empty;
225 ScenePresence sp = null; 225 ScenePresence sp = null;
226 foreach (Scene scene in m_Scenes) 226 foreach (Scene scene in m_Scenes)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
deleted file mode 100644
index 2322d7c..0000000
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
+++ /dev/null
@@ -1,237 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31
32using OpenSim.Framework;
33using OpenSim.Framework.Client;
34using OpenSim.Region.Framework.Scenes;
35
36using OpenMetaverse;
37using Nini.Config;
38using log4net;
39
40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
41{
42 public class InventoryCache
43 {
44 private static readonly ILog m_log =
45 LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType);
47
48 protected BaseInventoryConnector m_Connector;
49 protected List<Scene> m_Scenes;
50
51 // The cache proper
52 protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;
53
54 // A cache of userIDs --> ServiceURLs, for HGBroker only
55 protected Dictionary<UUID, string> m_InventoryURLs =
56 new Dictionary<UUID, string>();
57
58 public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
59 {
60 m_Scenes = new List<Scene>();
61 m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>();
62 m_Connector = connector;
63 }
64
65 public virtual void AddRegion(Scene scene)
66 {
67 m_Scenes.Add(scene);
68 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
69 scene.EventManager.OnClientClosed += OnClientClosed;
70 }
71
72 public virtual void RemoveRegion(Scene scene)
73 {
74 if ((m_Scenes != null) && m_Scenes.Contains(scene))
75 {
76 m_Scenes.Remove(scene);
77 }
78 }
79
80 void OnMakeRootAgent(ScenePresence presence)
81 {
82 // Get system folders
83
84 // First check if they're here already
85 lock (m_InventoryCache)
86 {
87 if (m_InventoryCache.ContainsKey(presence.UUID))
88 {
89 m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname);
90 return;
91 }
92 }
93
94 // If not, go get them and place them in the cache
95 Dictionary<AssetType, InventoryFolderBase> folders = CacheSystemFolders(presence.UUID);
96 CacheInventoryServiceURL(presence.Scene, presence.UUID);
97
98 m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
99 presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
100
101 }
102
103 void OnClientClosed(UUID clientID, Scene scene)
104 {
105 if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
106 {
107 ScenePresence sp = null;
108 foreach (Scene s in m_Scenes)
109 {
110 s.TryGetScenePresence(clientID, out sp);
111 if ((sp != null) && !sp.IsChildAgent && (s != scene))
112 {
113 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
114 scene.RegionInfo.RegionName, clientID);
115 return;
116 }
117 }
118
119 m_log.DebugFormat(
120 "[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
121 scene.RegionInfo.RegionName, clientID);
122 DropCachedSystemFolders(clientID);
123 DropInventoryServiceURL(clientID);
124 }
125 }
126
127 /// <summary>
128 /// Cache a user's 'system' folders.
129 /// </summary>
130 /// <param name="userID"></param>
131 /// <returns>Folders cached</returns>
132 protected Dictionary<AssetType, InventoryFolderBase> CacheSystemFolders(UUID userID)
133 {
134 // If not, go get them and place them in the cache
135 Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(userID);
136
137 if (folders.Count > 0)
138 lock (m_InventoryCache)
139 m_InventoryCache.Add(userID, folders);
140
141 return folders;
142 }
143
144 /// <summary>
145 /// Drop a user's cached 'system' folders
146 /// </summary>
147 /// <param name="userID"></param>
148 protected void DropCachedSystemFolders(UUID userID)
149 {
150 // Drop system folders
151 lock (m_InventoryCache)
152 if (m_InventoryCache.ContainsKey(userID))
153 m_InventoryCache.Remove(userID);
154 }
155
156 /// <summary>
157 /// Get the system folder for a particular asset type
158 /// </summary>
159 /// <param name="userID"></param>
160 /// <param name="type"></param>
161 /// <returns></returns>
162 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
163 {
164 m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID);
165
166 Dictionary<AssetType, InventoryFolderBase> folders = null;
167
168 lock (m_InventoryCache)
169 {
170 m_InventoryCache.TryGetValue(userID, out folders);
171
172 // In some situations (such as non-secured standalones), system folders can be requested without
173 // the user being logged in. So we need to try caching them here if we don't already have them.
174 if (null == folders)
175 CacheSystemFolders(userID);
176
177 m_InventoryCache.TryGetValue(userID, out folders);
178 }
179
180 if ((folders != null) && folders.ContainsKey(type))
181 {
182 m_log.DebugFormat(
183 "[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID);
184
185 return folders[type];
186 }
187
188 m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID);
189
190 return null;
191 }
192
193 /// <summary>
194 /// Gets the user's inventory URL from its serviceURLs, if the user is foreign,
195 /// and sticks it in the cache
196 /// </summary>
197 /// <param name="userID"></param>
198 private void CacheInventoryServiceURL(Scene scene, UUID userID)
199 {
200 if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null)
201 {
202 // The user does not have a local account; let's cache its service URL
203 string inventoryURL = string.Empty;
204 ScenePresence sp = null;
205 scene.TryGetScenePresence(userID, out sp);
206 if (sp != null)
207 {
208 AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
209 if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
210 {
211 inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
212 if (inventoryURL != null && inventoryURL != string.Empty)
213 {
214 inventoryURL = inventoryURL.Trim(new char[] { '/' });
215 m_InventoryURLs.Add(userID, inventoryURL);
216 }
217 }
218 }
219 }
220 }
221
222 private void DropInventoryServiceURL(UUID userID)
223 {
224 lock (m_InventoryURLs)
225 if (m_InventoryURLs.ContainsKey(userID))
226 m_InventoryURLs.Remove(userID);
227 }
228
229 public string GetInventoryServiceURL(UUID userID)
230 {
231 if (m_InventoryURLs.ContainsKey(userID))
232 return m_InventoryURLs[userID];
233
234 return null;
235 }
236 }
237}
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
index c66e053..54dfaf4 100644
--- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
+++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
@@ -14,6 +14,9 @@ namespace OpenSim.Region.Framework.Interfaces
14 string GetUserHomeURL(UUID uuid); 14 string GetUserHomeURL(UUID uuid);
15 string GetUserUUI(UUID uuid); 15 string GetUserUUI(UUID uuid);
16 string GetUserServerURL(UUID uuid, string serverType); 16 string GetUserServerURL(UUID uuid, string serverType);
17 int GetUserFlags(UUID userID);
18 int GetUserCreated(UUID userID);
19 string GetUserTitle(UUID userID);
17 20
18 /// <summary> 21 /// <summary>
19 /// Add a user. 22 /// Add a user.
@@ -48,5 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces
48 /// <param name="firstName"></param> 51 /// <param name="firstName"></param>
49 /// <param name="profileURL"></param> 52 /// <param name="profileURL"></param>
50 void AddUser(UUID uuid, string firstName, string lastName, string profileURL); 53 void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
54
55 bool IsLocalGridUser(UUID uuid);
51 } 56 }
52} 57}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6666328..0f84da9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes
77 /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a 77 /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
78 /// PhysicsScene in order to perform collision detection 78 /// PhysicsScene in order to perform collision detection
79 /// </summary> 79 /// </summary>
80 public bool m_physicalPrim; 80 public bool PhysicalPrims { get; private set; }
81
82 /// <summary>
83 /// Controls whether prims can be collided with.
84 /// </summary>
85 /// <remarks>
86 /// If this is set to false then prims cannot be subject to physics either.
87 /// </summary>
88 public bool CollidablePrims { get; private set; }
81 89
82 public float m_maxNonphys = 256; 90 public float m_maxNonphys = 256;
83 public float m_maxPhys = 10; 91 public float m_maxPhys = 10;
@@ -650,7 +658,8 @@ namespace OpenSim.Region.Framework.Scenes
650 //Animation states 658 //Animation states
651 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 659 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
652 660
653 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); 661 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
662 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
654 663
655 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); 664 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
656 if (RegionInfo.NonphysPrimMax > 0) 665 if (RegionInfo.NonphysPrimMax > 0)
@@ -701,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
701 if (maptileRefresh != 0) 710 if (maptileRefresh != 0)
702 { 711 {
703 m_mapGenerationTimer.Interval = maptileRefresh * 1000; 712 m_mapGenerationTimer.Interval = maptileRefresh * 1000;
704 m_mapGenerationTimer.Elapsed += RegenerateMaptile; 713 m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
705 m_mapGenerationTimer.AutoReset = true; 714 m_mapGenerationTimer.AutoReset = true;
706 m_mapGenerationTimer.Start(); 715 m_mapGenerationTimer.Start();
707 } 716 }
@@ -1638,21 +1647,17 @@ namespace OpenSim.Region.Framework.Scenes
1638 { 1647 {
1639 m_sceneGridService.SetScene(this); 1648 m_sceneGridService.SetScene(this);
1640 1649
1650 //// Unfortunately this needs to be here and it can't be async.
1651 //// The map tile image is stored in RegionSettings, but it also needs to be
1652 //// stored in the GridService, because that's what the world map module uses
1653 //// to send the map image UUIDs (of other regions) to the viewer...
1654 if (m_generateMaptiles)
1655 RegenerateMaptile();
1656
1641 GridRegion region = new GridRegion(RegionInfo); 1657 GridRegion region = new GridRegion(RegionInfo);
1642 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); 1658 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1643 if (error != String.Empty) 1659 if (error != String.Empty)
1644 {
1645 throw new Exception(error); 1660 throw new Exception(error);
1646 }
1647
1648 // Generate the maptile asynchronously, because sometimes it can be very slow and we
1649 // don't want this to delay starting the region.
1650 if (m_generateMaptiles)
1651 {
1652 Util.FireAndForget(delegate {
1653 RegenerateMaptile(null, null);
1654 });
1655 }
1656 } 1661 }
1657 1662
1658 #endregion 1663 #endregion
@@ -5023,13 +5028,24 @@ namespace OpenSim.Region.Framework.Scenes
5023 /// </summary> 5028 /// </summary>
5024 /// <param name="sender"></param> 5029 /// <param name="sender"></param>
5025 /// <param name="e"></param> 5030 /// <param name="e"></param>
5026 public void RegenerateMaptile(object sender, ElapsedEventArgs e) 5031 private void RegenerateMaptile()
5027 { 5032 {
5028 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); 5033 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
5029 if (mapModule != null) 5034 if (mapModule != null)
5030 mapModule.GenerateMaptile(); 5035 mapModule.GenerateMaptile();
5031 } 5036 }
5032 5037
5038 private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e)
5039 {
5040 RegenerateMaptile();
5041
5042 // We need to propagate the new image UUID to the grid service
5043 // so that all simulators can retrieve it
5044 string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
5045 if (error != string.Empty)
5046 throw new Exception(error);
5047 }
5048
5033 // This method is called across the simulation connector to 5049 // This method is called across the simulation connector to
5034 // determine if a given agent is allowed in this region 5050 // determine if a given agent is allowed in this region
5035 // AS A ROOT AGENT. Returning false here will prevent them 5051 // AS A ROOT AGENT. Returning false here will prevent them
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a3e4b46..1e2901b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes
333 if (rot != null) 333 if (rot != null)
334 sceneObject.UpdateGroupRotationR((Quaternion)rot); 334 sceneObject.UpdateGroupRotationR((Quaternion)rot);
335 335
336 //group.ApplyPhysics(m_physicalPrim);
337 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) 336 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
338 { 337 {
339 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); 338 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index abea788..8860764 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes
210 /// </remarks> 210 /// </remarks>
211 public bool UsesPhysics 211 public bool UsesPhysics
212 { 212 {
213 get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; } 213 get { return (RootPart.Flags & PrimFlags.Physics) != 0; }
214 } 214 }
215 215
216 /// <summary> 216 /// <summary>
@@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes
669 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); 669 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
670 } 670 }
671 671
672 ApplyPhysics(m_scene.m_physicalPrim); 672 ApplyPhysics();
673 673
674 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 674 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
675 // for the same object with very different properties. The caller must schedule the update. 675 // for the same object with very different properties. The caller must schedule the update.
@@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes
1239 /// <summary> 1239 /// <summary>
1240 /// Apply physics to this group 1240 /// Apply physics to this group
1241 /// </summary> 1241 /// </summary>
1242 /// <param name="m_physicalPrim"></param> 1242 public void ApplyPhysics()
1243 public void ApplyPhysics(bool m_physicalPrim)
1244 { 1243 {
1245 // Apply physics to the root prim 1244 // Apply physics to the root prim
1246 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); 1245 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b29ecc6..aea47e6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes
1473 /// <param name="VolumeDetectActive"></param> 1473 /// <param name="VolumeDetectActive"></param>
1474 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) 1474 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
1475 { 1475 {
1476 if (!ParentGroup.Scene.CollidablePrims)
1477 return;
1478
1476// m_log.DebugFormat( 1479// m_log.DebugFormat(
1477// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", 1480// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
1478// Name, LocalId, UUID, m_physicalPrim); 1481// Name, LocalId, UUID, m_physicalPrim);
@@ -1739,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes
1739 /// <param name="isNew"></param> 1742 /// <param name="isNew"></param>
1740 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) 1743 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
1741 { 1744 {
1742 if (!ParentGroup.Scene.m_physicalPrim && UsePhysics) 1745 if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
1743 return; 1746 return;
1744 1747
1745 if (IsJoint()) 1748 if (IsJoint())
@@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes
4318 if (ParentGroup.Scene == null) 4321 if (ParentGroup.Scene == null)
4319 return; 4322 return;
4320 4323
4321 if (PhysActor == null) 4324 if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
4322 { 4325 {
4323 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 4326 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
4324 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( 4327 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b8ae553..42cd4be 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
118 /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is 118 /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is
119 /// necessary. 119 /// necessary.
120 /// </remarks> 120 /// </remarks>
121 protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); 121 private List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
122 122
123 public Object AttachmentsSyncLock { get; private set; } 123 public Object AttachmentsSyncLock { get; private set; }
124 124
@@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes
550 } 550 }
551 } 551 }
552 552
553 m_pos = value; 553 // Don't update while sitting
554 ParentPosition = Vector3.Zero; 554 if (ParentID == 0)
555 {
556 m_pos = value;
557 ParentPosition = Vector3.Zero;
558 }
555 559
556 //m_log.DebugFormat( 560 //m_log.DebugFormat(
557 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", 561 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
@@ -566,6 +570,15 @@ namespace OpenSim.Region.Framework.Scenes
566 public Vector3 OffsetPosition 570 public Vector3 OffsetPosition
567 { 571 {
568 get { return m_pos; } 572 get { return m_pos; }
573 // Don't remove setter. It's not currently used in core but
574 // upcoming Avination code needs it.
575 set
576 {
577 // There is no offset position when not seated
578 if (ParentID == 0)
579 return;
580 m_pos = value;
581 }
569 } 582 }
570 583
571 /// <summary> 584 /// <summary>
@@ -1161,10 +1174,10 @@ namespace OpenSim.Region.Framework.Scenes
1161 public void CompleteMovement(IClientAPI client, bool openChildAgents) 1174 public void CompleteMovement(IClientAPI client, bool openChildAgents)
1162 { 1175 {
1163// DateTime startTime = DateTime.Now; 1176// DateTime startTime = DateTime.Now;
1164 1177
1165// m_log.DebugFormat( 1178 m_log.DebugFormat(
1166// "[SCENE PRESENCE]: Completing movement of {0} into region {1}", 1179 "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}",
1167// client.Name, Scene.RegionInfo.RegionName); 1180 client.Name, Scene.RegionInfo.RegionName, AbsolutePosition);
1168 1181
1169 Vector3 look = Velocity; 1182 Vector3 look = Velocity;
1170 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) 1183 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
@@ -2383,9 +2396,7 @@ namespace OpenSim.Region.Framework.Scenes
2383 m_lastVelocity = Velocity; 2396 m_lastVelocity = Velocity;
2384 } 2397 }
2385 2398
2386 // followed suggestion from mic bowman. reversed the two lines below. 2399 CheckForBorderCrossing();
2387 if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something
2388 CheckForBorderCrossing();
2389 2400
2390 CheckForSignificantMovement(); // sends update to the modules. 2401 CheckForSignificantMovement(); // sends update to the modules.
2391 } 2402 }
@@ -2738,143 +2749,146 @@ namespace OpenSim.Region.Framework.Scenes
2738 /// </remarks> 2749 /// </remarks>
2739 protected void CheckForBorderCrossing() 2750 protected void CheckForBorderCrossing()
2740 { 2751 {
2741 if (IsChildAgent) 2752 // Check that we we are not a child
2753 if (IsChildAgent)
2742 return; 2754 return;
2743 2755
2744 Vector3 pos2 = AbsolutePosition; 2756 // If we don't have a PhysActor, we can't cross anyway
2745 Vector3 vel = Velocity; 2757 // Also don't do this while sat, sitting avatars cross with the
2746 int neighbor = 0; 2758 // object they sit on.
2747 int[] fix = new int[2]; 2759 if (ParentID != 0 || PhysicsActor == null)
2748 2760 return;
2749 float timeStep = 0.1f;
2750 pos2.X = pos2.X + (vel.X*timeStep);
2751 pos2.Y = pos2.Y + (vel.Y*timeStep);
2752 pos2.Z = pos2.Z + (vel.Z*timeStep);
2753 2761
2754 if (!IsInTransit) 2762 if (!IsInTransit)
2755 { 2763 {
2756 // Checks if where it's headed exists a region 2764 Vector3 pos2 = AbsolutePosition;
2765 Vector3 vel = Velocity;
2766 int neighbor = 0;
2767 int[] fix = new int[2];
2757 2768
2758 bool needsTransit = false; 2769 float timeStep = 0.1f;
2759 if (m_scene.TestBorderCross(pos2, Cardinals.W)) 2770 pos2.X = pos2.X + (vel.X * timeStep);
2771 pos2.Y = pos2.Y + (vel.Y * timeStep);
2772 pos2.Z = pos2.Z + (vel.Z * timeStep);
2773
2774 if (!IsInTransit)
2760 { 2775 {
2761 if (m_scene.TestBorderCross(pos2, Cardinals.S)) 2776 // Checks if where it's headed exists a region
2762 { 2777 bool needsTransit = false;
2763 needsTransit = true; 2778 if (m_scene.TestBorderCross(pos2, Cardinals.W))
2764 neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix);
2765 }
2766 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2767 { 2779 {
2768 needsTransit = true; 2780 if (m_scene.TestBorderCross(pos2, Cardinals.S))
2769 neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); 2781 {
2782 needsTransit = true;
2783 neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix);
2784 }
2785 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2786 {
2787 needsTransit = true;
2788 neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix);
2789 }
2790 else
2791 {
2792 needsTransit = true;
2793 neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix);
2794 }
2770 } 2795 }
2771 else 2796 else if (m_scene.TestBorderCross(pos2, Cardinals.E))
2772 { 2797 {
2773 needsTransit = true; 2798 if (m_scene.TestBorderCross(pos2, Cardinals.S))
2774 neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); 2799 {
2800 needsTransit = true;
2801 neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix);
2802 }
2803 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2804 {
2805 needsTransit = true;
2806 neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix);
2807 }
2808 else
2809 {
2810 needsTransit = true;
2811 neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix);
2812 }
2775 } 2813 }
2776 } 2814 else if (m_scene.TestBorderCross(pos2, Cardinals.S))
2777 else if (m_scene.TestBorderCross(pos2, Cardinals.E))
2778 {
2779 if (m_scene.TestBorderCross(pos2, Cardinals.S))
2780 { 2815 {
2781 needsTransit = true; 2816 needsTransit = true;
2782 neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); 2817 neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix);
2783 } 2818 }
2784 else if (m_scene.TestBorderCross(pos2, Cardinals.N)) 2819 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2785 { 2820 {
2786 needsTransit = true; 2821 needsTransit = true;
2787 neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); 2822 neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix);
2788 } 2823 }
2789 else
2790 {
2791 needsTransit = true;
2792 neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix);
2793 }
2794 }
2795 else if (m_scene.TestBorderCross(pos2, Cardinals.S))
2796 {
2797 needsTransit = true;
2798 neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix);
2799 }
2800 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2801 {
2802 needsTransit = true;
2803 neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix);
2804 }
2805 2824
2806 // Makes sure avatar does not end up outside region 2825 // Makes sure avatar does not end up outside region
2807 if (neighbor <= 0) 2826 if (neighbor <= 0)
2808 {
2809 if (needsTransit)
2810 { 2827 {
2811 if (m_requestedSitTargetUUID == UUID.Zero) 2828 if (needsTransit)
2812 { 2829 {
2813 bool isFlying = Flying; 2830 if (m_requestedSitTargetUUID == UUID.Zero)
2814 RemoveFromPhysicalScene(); 2831 {
2815 2832 bool isFlying = Flying;
2816 Vector3 pos = AbsolutePosition; 2833 RemoveFromPhysicalScene();
2817 if (AbsolutePosition.X < 0) 2834
2818 pos.X += Velocity.X * 2; 2835 Vector3 pos = AbsolutePosition;
2819 else if (AbsolutePosition.X > Constants.RegionSize) 2836 if (AbsolutePosition.X < 0)
2820 pos.X -= Velocity.X * 2; 2837 pos.X += Velocity.X * 2;
2821 if (AbsolutePosition.Y < 0) 2838 else if (AbsolutePosition.X > Constants.RegionSize)
2822 pos.Y += Velocity.Y * 2; 2839 pos.X -= Velocity.X * 2;
2823 else if (AbsolutePosition.Y > Constants.RegionSize) 2840 if (AbsolutePosition.Y < 0)
2824 pos.Y -= Velocity.Y * 2; 2841 pos.Y += Velocity.Y * 2;
2825 Velocity = Vector3.Zero; 2842 else if (AbsolutePosition.Y > Constants.RegionSize)
2826 AbsolutePosition = pos; 2843 pos.Y -= Velocity.Y * 2;
2827 2844 Velocity = Vector3.Zero;
2828// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); 2845 AbsolutePosition = pos;
2829 2846
2830 AddToPhysicalScene(isFlying); 2847// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition);
2848
2849 AddToPhysicalScene(isFlying);
2850 }
2831 } 2851 }
2832 } 2852 }
2833 } 2853 else if (neighbor > 0)
2834 else if (neighbor > 0)
2835 {
2836 if (!CrossToNewRegion())
2837 { 2854 {
2838 if (m_requestedSitTargetUUID == UUID.Zero) 2855 if (!CrossToNewRegion())
2839 { 2856 {
2840 bool isFlying = Flying; 2857 if (m_requestedSitTargetUUID == UUID.Zero)
2841 RemoveFromPhysicalScene(); 2858 {
2842 2859 bool isFlying = Flying;
2843 Vector3 pos = AbsolutePosition; 2860 RemoveFromPhysicalScene();
2844 if (AbsolutePosition.X < 0) 2861
2845 pos.X += Velocity.X * 2; 2862 Vector3 pos = AbsolutePosition;
2846 else if (AbsolutePosition.X > Constants.RegionSize) 2863 if (AbsolutePosition.X < 0)
2847 pos.X -= Velocity.X * 2; 2864 pos.X += Velocity.X * 2;
2848 if (AbsolutePosition.Y < 0) 2865 else if (AbsolutePosition.X > Constants.RegionSize)
2849 pos.Y += Velocity.Y * 2; 2866 pos.X -= Velocity.X * 2;
2850 else if (AbsolutePosition.Y > Constants.RegionSize) 2867 if (AbsolutePosition.Y < 0)
2851 pos.Y -= Velocity.Y * 2; 2868 pos.Y += Velocity.Y * 2;
2852 Velocity = Vector3.Zero; 2869 else if (AbsolutePosition.Y > Constants.RegionSize)
2853 AbsolutePosition = pos; 2870 pos.Y -= Velocity.Y * 2;
2854 2871 Velocity = Vector3.Zero;
2855 AddToPhysicalScene(isFlying); 2872 AbsolutePosition = pos;
2873
2874 AddToPhysicalScene(isFlying);
2875 }
2856 } 2876 }
2857 } 2877 }
2858 } 2878 }
2859 } 2879 else
2860 else 2880 {
2861 { 2881 // This constant has been inferred from experimentation
2862 // We must remove the agent from the physical scene if it has been placed in transit. If we don't, 2882 // I'm not sure what this value should be, so I tried a few values.
2863 // then this method continues to be called from ScenePresence.Update() until the handover of the client between 2883 timeStep = 0.04f;
2864 // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms 2884 pos2 = AbsolutePosition;
2865 // event queue polling response from the server), this results in the avatar pausing on the border 2885 pos2.X = pos2.X + (vel.X * timeStep);
2866 // for the handover period. 2886 pos2.Y = pos2.Y + (vel.Y * timeStep);
2867 RemoveFromPhysicalScene(); 2887 // Don't touch the Z
2868 2888 m_pos = pos2;
2869 // This constant has been inferred from experimentation 2889 m_log.DebugFormat("[SCENE PRESENCE]: In transit m_pos={0}", m_pos);
2870 // I'm not sure what this value should be, so I tried a few values. 2890 }
2871 timeStep = 0.04f; 2891 }
2872 pos2 = AbsolutePosition;
2873 pos2.X = pos2.X + (vel.X * timeStep);
2874 pos2.Y = pos2.Y + (vel.Y * timeStep);
2875 pos2.Z = pos2.Z + (vel.Z * timeStep);
2876 m_pos = pos2;
2877 }
2878 } 2892 }
2879 2893
2880 /// <summary> 2894 /// <summary>
@@ -3104,30 +3118,28 @@ namespace OpenSim.Region.Framework.Scenes
3104 catch { } 3118 catch { }
3105 3119
3106 // Attachment objects 3120 // Attachment objects
3107 lock (m_attachments) 3121 List<SceneObjectGroup> attachments = GetAttachments();
3122 if (attachments.Count > 0)
3108 { 3123 {
3109 if (m_attachments.Count > 0) 3124 cAgent.AttachmentObjects = new List<ISceneObject>();
3110 { 3125 cAgent.AttachmentObjectStates = new List<string>();
3111 cAgent.AttachmentObjects = new List<ISceneObject>(); 3126// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
3112 cAgent.AttachmentObjectStates = new List<string>(); 3127 InTransitScriptStates.Clear();
3113 // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
3114 InTransitScriptStates.Clear();
3115 3128
3116 foreach (SceneObjectGroup sog in m_attachments) 3129 foreach (SceneObjectGroup sog in attachments)
3117 { 3130 {
3118 // We need to make a copy and pass that copy 3131 // We need to make a copy and pass that copy
3119 // because of transfers withn the same sim 3132 // because of transfers withn the same sim
3120 ISceneObject clone = sog.CloneForNewScene(); 3133 ISceneObject clone = sog.CloneForNewScene();
3121 // Attachment module assumes that GroupPosition holds the offsets...! 3134 // Attachment module assumes that GroupPosition holds the offsets...!
3122 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; 3135 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
3123 ((SceneObjectGroup)clone).IsAttachment = false; 3136 ((SceneObjectGroup)clone).IsAttachment = false;
3124 cAgent.AttachmentObjects.Add(clone); 3137 cAgent.AttachmentObjects.Add(clone);
3125 string state = sog.GetStateSnapshot(); 3138 string state = sog.GetStateSnapshot();
3126 cAgent.AttachmentObjectStates.Add(state); 3139 cAgent.AttachmentObjectStates.Add(state);
3127 InTransitScriptStates.Add(state); 3140 InTransitScriptStates.Add(state);
3128 // Let's remove the scripts of the original object here 3141 // Let's remove the scripts of the original object here
3129 sog.RemoveScriptInstances(true); 3142 sog.RemoveScriptInstances(true);
3130 }
3131 } 3143 }
3132 } 3144 }
3133 } 3145 }
@@ -3535,26 +3547,29 @@ namespace OpenSim.Region.Framework.Scenes
3535 /// <param name="args">The arguments for the event</param> 3547 /// <param name="args">The arguments for the event</param>
3536 public void SendScriptEventToAttachments(string eventName, Object[] args) 3548 public void SendScriptEventToAttachments(string eventName, Object[] args)
3537 { 3549 {
3538 if (m_scriptEngines.Length == 0) 3550 Util.FireAndForget(delegate(object x)
3539 return;
3540
3541 lock (m_attachments)
3542 { 3551 {
3543 foreach (SceneObjectGroup grp in m_attachments) 3552 if (m_scriptEngines.Length == 0)
3553 return;
3554
3555 lock (m_attachments)
3544 { 3556 {
3545 // 16384 is CHANGED_ANIMATION 3557 foreach (SceneObjectGroup grp in m_attachments)
3546 //
3547 // Send this to all attachment root prims
3548 //
3549 foreach (IScriptModule m in m_scriptEngines)
3550 { 3558 {
3551 if (m == null) // No script engine loaded 3559 // 16384 is CHANGED_ANIMATION
3552 continue; 3560 //
3561 // Send this to all attachment root prims
3562 //
3563 foreach (IScriptModule m in m_scriptEngines)
3564 {
3565 if (m == null) // No script engine loaded
3566 continue;
3553 3567
3554 m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); 3568 m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION });
3569 }
3555 } 3570 }
3556 } 3571 }
3557 } 3572 });
3558 } 3573 }
3559 3574
3560 internal void PushForce(Vector3 impulse) 3575 internal void PushForce(Vector3 impulse)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 04ba738..228eca9 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin
110 private const uint m_regionWidth = Constants.RegionSize; 110 private const uint m_regionWidth = Constants.RegionSize;
111 private const uint m_regionHeight = Constants.RegionSize; 111 private const uint m_regionHeight = Constants.RegionSize;
112 112
113 private float ODE_STEPSIZE = 0.020f; 113 private float ODE_STEPSIZE = 0.0178f;
114 private float metersInSpace = 29.9f; 114 private float metersInSpace = 29.9f;
115 private float m_timeDilation = 1.0f; 115 private float m_timeDilation = 1.0f;
116 116
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin
456 mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f); 456 mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f);
457 mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f); 457 mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f);
458 458
459 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f); 459 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
460 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); 460 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
461 461
462 avDensity = physicsconfig.GetFloat("av_density", 80f); 462 avDensity = physicsconfig.GetFloat("av_density", 80f);
@@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2822 m_global_contactcount = 0; 2822 m_global_contactcount = 0;
2823 2823
2824 d.WorldQuickStep(world, ODE_STEPSIZE); 2824 d.WorldQuickStep(world, ODE_STEPSIZE);
2825
2825 d.JointGroupEmpty(contactgroup); 2826 d.JointGroupEmpty(contactgroup);
2826 } 2827 }
2827 catch (Exception e) 2828 catch (Exception e)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index cb0d765..77a784d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
486 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; 486 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
487 if (m_host.ParentGroup.Scene.SimulationDataService != null) 487 if (m_host.ParentGroup.Scene.SimulationDataService != null)
488 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); 488 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
489 m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile();
489 } 490 }
490 /// <summary> 491 /// <summary>
491 /// Set the current Windlight scene to a target avatar 492 /// Set the current Windlight scene to a target avatar
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index 07c6962..1bd3706 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -91,6 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
91 91
92 server.AddXmlRPCHandler("status_notification", StatusNotification, false); 92 server.AddXmlRPCHandler("status_notification", StatusNotification, false);
93 server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); 93 server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false);
94 server.AddXmlRPCHandler("get_user_info", GetUserInfo, false);
94 server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); 95 server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false);
95 96
96 server.AddXmlRPCHandler("locate_user", LocateUser, false); 97 server.AddXmlRPCHandler("locate_user", LocateUser, false);
@@ -299,6 +300,38 @@ namespace OpenSim.Server.Handlers.Hypergrid
299 300
300 } 301 }
301 302
303 public XmlRpcResponse GetUserInfo(XmlRpcRequest request, IPEndPoint remoteClient)
304 {
305 Hashtable hash = new Hashtable();
306 Hashtable requestData = (Hashtable)request.Params[0];
307
308 // This needs checking!
309 if (requestData.ContainsKey("userID"))
310 {
311 string userID_str = (string)requestData["userID"];
312 UUID userID = UUID.Zero;
313 UUID.TryParse(userID_str, out userID);
314
315 //int userFlags = m_HomeUsersService.GetUserFlags(userID);
316 Dictionary<string,object> userInfo = m_HomeUsersService.GetUserInfo(userID);
317 if (userInfo.Count > 0)
318 {
319 foreach (KeyValuePair<string, object> kvp in userInfo)
320 {
321 hash[kvp.Key] = kvp.Value;
322 }
323 }
324 else
325 {
326 hash["result"] = "failure";
327 }
328 }
329
330 XmlRpcResponse response = new XmlRpcResponse();
331 response.Value = hash;
332 return response;
333 }
334
302 public XmlRpcResponse GetServerURLs(XmlRpcRequest request, IPEndPoint remoteClient) 335 public XmlRpcResponse GetServerURLs(XmlRpcRequest request, IPEndPoint remoteClient)
303 { 336 {
304 Hashtable hash = new Hashtable(); 337 Hashtable hash = new Hashtable();
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
index ab383ef..3fd69ae 100644
--- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
@@ -231,7 +231,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
231 231
232 int userLevel = 0; 232 int userLevel = 0;
233 if (request.ContainsKey("UserLevel") && int.TryParse(request["UserLevel"].ToString(), out userLevel)) 233 if (request.ContainsKey("UserLevel") && int.TryParse(request["UserLevel"].ToString(), out userLevel))
234 existingAccount.UserFlags = userLevel; 234 existingAccount.UserLevel = userLevel;
235 235
236 int userFlags = 0; 236 int userFlags = 0;
237 if (request.ContainsKey("UserFlags") && int.TryParse(request["UserFlags"].ToString(), out userFlags)) 237 if (request.ContainsKey("UserFlags") && int.TryParse(request["UserFlags"].ToString(), out userFlags))
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
index fdab254..d7b2ff8 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
@@ -100,6 +100,8 @@ namespace OpenSim.Services.Connectors
100 100
101 public AssetBase Get(string id) 101 public AssetBase Get(string id)
102 { 102 {
103// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id);
104
103 string uri = m_ServerURI + "/assets/" + id; 105 string uri = m_ServerURI + "/assets/" + id;
104 106
105 AssetBase asset = null; 107 AssetBase asset = null;
@@ -119,6 +121,8 @@ namespace OpenSim.Services.Connectors
119 121
120 public AssetBase GetCached(string id) 122 public AssetBase GetCached(string id)
121 { 123 {
124// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
125
122 if (m_Cache != null) 126 if (m_Cache != null)
123 return m_Cache.Get(id); 127 return m_Cache.Get(id);
124 128
@@ -177,6 +181,8 @@ namespace OpenSim.Services.Connectors
177 181
178 public bool Get(string id, Object sender, AssetRetrieved handler) 182 public bool Get(string id, Object sender, AssetRetrieved handler)
179 { 183 {
184// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id);
185
180 string uri = m_ServerURI + "/assets/" + id; 186 string uri = m_ServerURI + "/assets/" + id;
181 187
182 AssetBase asset = null; 188 AssetBase asset = null;
diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
index 5c31639..bb5d51f 100644
--- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
@@ -29,7 +29,9 @@ using log4net;
29using Nini.Config; 29using Nini.Config;
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Collections.Specialized;
32using System.Reflection; 33using System.Reflection;
34using System.Web;
33using OpenSim.Framework; 35using OpenSim.Framework;
34using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
35using OpenSim.Services.Connectors.Hypergrid; 37using OpenSim.Services.Connectors.Hypergrid;
@@ -73,11 +75,26 @@ namespace OpenSim.Services.Connectors
73 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && 75 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) &&
74 assetUri.Scheme == Uri.UriSchemeHttp) 76 assetUri.Scheme == Uri.UriSchemeHttp)
75 { 77 {
76 url = "http://" + assetUri.Authority; 78 // Simian
77 assetID = assetUri.LocalPath.Trim(new char[] {'/'}); 79 if (assetUri.Query != string.Empty)
80 {
81 NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query);
82 assetID = qscoll["id"];
83 if (assetID != null)
84 url = id.Replace(assetID, ""); // Malformed again, as simian expects
85 else
86 url = id; // !!! best effort
87 }
88 else // robust
89 {
90 url = "http://" + assetUri.Authority;
91 assetID = assetUri.LocalPath.Trim(new char[] { '/' });
92 }
93
78 return true; 94 return true;
79 } 95 }
80 96
97 m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id);
81 return false; 98 return false;
82 } 99 }
83 100
diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
index 7cfd6e8..c030bca 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
@@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors
47 47
48 public HeloServicesConnector(string serverURI) 48 public HeloServicesConnector(string serverURI)
49 { 49 {
50 m_ServerURI = serverURI.TrimEnd('/'); 50 if (!serverURI.EndsWith("="))
51 m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
52 else
53 {
54 // Simian sends malformed urls like this:
55 // http://valley.virtualportland.org/simtest/Grid/?id=
56 //
57 try
58 {
59 Uri uri = new Uri(serverURI + "xxx");
60 if (uri.Query == string.Empty)
61 m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
62 else
63 {
64 serverURI = serverURI + "xxx";
65 m_ServerURI = serverURI.Replace(uri.Query, "");
66 m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
67 }
68 }
69 catch (UriFormatException e)
70 {
71 m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
72 }
73 }
51 } 74 }
52 75
53 76
54 public virtual string Helo() 77 public virtual string Helo()
55 { 78 {
56 HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo"); 79 HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
57 // Eventually we need to switch to HEAD 80 // Eventually we need to switch to HEAD
58 /* req.Method = "HEAD"; */ 81 /* req.Method = "HEAD"; */
59 82
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 0c55c2e..5b27cf6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -334,6 +334,9 @@ namespace OpenSim.Services.Connectors.Hypergrid
334 UInt32.TryParse((string)hash["http_port"], out p); 334 UInt32.TryParse((string)hash["http_port"], out p);
335 region.HttpPort = p; 335 region.HttpPort = p;
336 } 336 }
337 if (hash.ContainsKey("server_uri") && hash["server_uri"] != null)
338 region.ServerURI = (string)hash["server_uri"];
339
337 if (hash["internal_port"] != null) 340 if (hash["internal_port"] != null)
338 { 341 {
339 int p = 0; 342 int p = 0;
@@ -558,6 +561,60 @@ namespace OpenSim.Services.Connectors.Hypergrid
558 return online; 561 return online;
559 } 562 }
560 563
564 public Dictionary<string,object> GetUserInfo (UUID userID)
565 {
566 Hashtable hash = new Hashtable();
567 hash["userID"] = userID.ToString();
568
569 IList paramList = new ArrayList();
570 paramList.Add(hash);
571
572 XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList);
573
574 Dictionary<string, object> info = new Dictionary<string, object>();
575 XmlRpcResponse response = null;
576 try
577 {
578 response = request.Send(m_ServerURL, 10000);
579 }
580 catch
581 {
582 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL);
583 return info;
584 }
585
586 if (response.IsFault)
587 {
588 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString);
589 return info;
590 }
591
592 hash = (Hashtable)response.Value;
593 try
594 {
595 if (hash == null)
596 {
597 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
598 return info;
599 }
600
601 // Here is the actual response
602 foreach (object key in hash.Keys)
603 {
604 if (hash[key] != null)
605 {
606 info.Add(key.ToString(), hash[key]);
607 }
608 }
609 }
610 catch
611 {
612 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
613 }
614
615 return info;
616 }
617
561 public Dictionary<string, object> GetServerURLs(UUID userID) 618 public Dictionary<string, object> GetServerURLs(UUID userID)
562 { 619 {
563 Hashtable hash = new Hashtable(); 620 Hashtable hash = new Hashtable();
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 9573e21..99523a1 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -86,6 +86,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
86 86
87 public SimianAssetServiceConnector(string url) 87 public SimianAssetServiceConnector(string url)
88 { 88 {
89 if (!url.EndsWith("/") && !url.EndsWith("="))
90 url = url + '/';
89 m_serverUrl = url; 91 m_serverUrl = url;
90 } 92 }
91 93
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 918544f..67a65ff 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -341,26 +341,54 @@ namespace OpenSim.Services.Connectors.SimianGrid
341 341
342 public List<GridRegion> GetHyperlinks(UUID scopeID) 342 public List<GridRegion> GetHyperlinks(UUID scopeID)
343 { 343 {
344 // Hypergrid/linked regions are not supported 344 List<GridRegion> foundRegions = new List<GridRegion>();
345 return new List<GridRegion>(); 345
346 NameValueCollection requestArgs = new NameValueCollection
347 {
348 { "RequestMethod", "GetScenes" },
349 { "HyperGrid", "true" },
350 { "Enabled", "1" }
351 };
352
353 OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
354 if (response["Success"].AsBoolean())
355 {
356 // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name);
357
358 OSDArray array = response["Scenes"] as OSDArray;
359 if (array != null)
360 {
361 for (int i = 0; i < array.Count; i++)
362 {
363 GridRegion region = ResponseToGridRegion(array[i] as OSDMap);
364 if (region != null)
365 foundRegions.Add(region);
366 }
367 }
368 }
369
370 return foundRegions;
346 } 371 }
347 372
348 public int GetRegionFlags(UUID scopeID, UUID regionID) 373 public int GetRegionFlags(UUID scopeID, UUID regionID)
349 { 374 {
350 const int REGION_ONLINE = 4;
351
352 NameValueCollection requestArgs = new NameValueCollection 375 NameValueCollection requestArgs = new NameValueCollection
353 { 376 {
354 { "RequestMethod", "GetScene" }, 377 { "RequestMethod", "GetScene" },
355 { "SceneID", regionID.ToString() } 378 { "SceneID", regionID.ToString() }
356 }; 379 };
357 380
358 // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); 381 m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString());
359 382
360 OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); 383 OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
361 if (response["Success"].AsBoolean()) 384 if (response["Success"].AsBoolean())
362 { 385 {
363 return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0; 386 OSDMap extraData = response["ExtraData"] as OSDMap;
387 int enabled = response["Enabled"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.RegionOnline : 0;
388 int hypergrid = extraData["HyperGrid"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.Hyperlink : 0;
389 int flags = enabled | hypergrid;
390 m_log.DebugFormat("[SGGC] enabled - {0} hg - {1} flags - {2}", enabled, hypergrid, flags);
391 return flags;
364 } 392 }
365 else 393 else
366 { 394 {
@@ -411,24 +439,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
411 Vector3d minPosition = response["MinPosition"].AsVector3d(); 439 Vector3d minPosition = response["MinPosition"].AsVector3d();
412 region.RegionLocX = (int)minPosition.X; 440 region.RegionLocX = (int)minPosition.X;
413 region.RegionLocY = (int)minPosition.Y; 441 region.RegionLocY = (int)minPosition.Y;
414 442
415 Uri httpAddress = response["Address"].AsUri(); 443 if ( ! extraData["HyperGrid"] ) {
416 region.ExternalHostName = httpAddress.Host; 444 Uri httpAddress = response["Address"].AsUri();
417 region.HttpPort = (uint)httpAddress.Port; 445 region.ExternalHostName = httpAddress.Host;
418 446 region.HttpPort = (uint)httpAddress.Port;
419 region.ServerURI = extraData["ServerURI"].AsString(); 447
420 448 IPAddress internalAddress;
421 IPAddress internalAddress; 449 IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress);
422 IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); 450 if (internalAddress == null)
423 if (internalAddress == null) 451 internalAddress = IPAddress.Any;
424 internalAddress = IPAddress.Any; 452
425 453 region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger());
426 region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); 454 region.TerrainImage = extraData["MapTexture"].AsUUID();
427 region.TerrainImage = extraData["MapTexture"].AsUUID(); 455 region.Access = (byte)extraData["Access"].AsInteger();
428 region.Access = (byte)extraData["Access"].AsInteger(); 456 region.RegionSecret = extraData["RegionSecret"].AsString();
429 region.RegionSecret = extraData["RegionSecret"].AsString(); 457 region.EstateOwner = extraData["EstateOwner"].AsUUID();
430 region.EstateOwner = extraData["EstateOwner"].AsUUID(); 458 region.Token = extraData["Token"].AsString();
431 region.Token = extraData["Token"].AsString(); 459 region.ServerURI = extraData["ServerURI"].AsString();
460 } else {
461 region.ServerURI = response["Address"];
462 }
432 463
433 return region; 464 return region;
434 } 465 }
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 39df1f5..f828abb 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -92,7 +92,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
92 92
93 public SimianInventoryServiceConnector(string url) 93 public SimianInventoryServiceConnector(string url)
94 { 94 {
95 if (!url.EndsWith("/") && !url.EndsWith("="))
96 url = url + '/';
95 m_serverUrl = url; 97 m_serverUrl = url;
98
96 } 99 }
97 100
98 public void Initialise(IConfigSource source) 101 public void Initialise(IConfigSource source)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 91e2976..4350749 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -287,6 +287,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
287 account.UserFlags = response["UserFlags"].AsInteger(); 287 account.UserFlags = response["UserFlags"].AsInteger();
288 account.UserLevel = response["AccessLevel"].AsInteger(); 288 account.UserLevel = response["AccessLevel"].AsInteger();
289 account.UserTitle = response["UserTitle"].AsString(); 289 account.UserTitle = response["UserTitle"].AsString();
290 account.LocalToGrid = true;
291 if (response.ContainsKey("LocalToGrid"))
292 account.LocalToGrid = (response["LocalToGrid"].AsString() == "true" ? true : false);
293
290 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); 294 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
291 295
292 // Cache the user account info 296 // Cache the user account info
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 90c022f..78eab3d 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -102,50 +102,45 @@ namespace OpenSim.Services.GridService
102 102
103 public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db) 103 public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db)
104 { 104 {
105 IConfig modulesConfig = config.Configs["Modules"]; 105 IConfig gridConfig = config.Configs["GridService"];
106 if (modulesConfig == null) 106 if (gridConfig == null)
107 return; 107 return;
108
109 if (modulesConfig.GetString("HypergridLinker", "") != "HypergridLinker")
110 return;
111 108
112 m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType()); 109 if (!gridConfig.GetBoolean("HypergridLinker", false))
110 return;
113 111
114 m_Database = db; 112 m_Database = db;
115 m_GridService = gridService; 113 m_GridService = gridService;
114 m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType());
116 115
117 IConfig gridConfig = config.Configs["GridService"]; 116 string assetService = gridConfig.GetString("AssetService", string.Empty);
118 if (gridConfig != null)
119 {
120 string assetService = gridConfig.GetString("AssetService", string.Empty);
121 117
122 Object[] args = new Object[] { config }; 118 Object[] args = new Object[] { config };
123 119
124 if (assetService != string.Empty) 120 if (assetService != string.Empty)
125 m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args); 121 m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);
126 122
127 string scope = gridConfig.GetString("ScopeID", string.Empty); 123 string scope = gridConfig.GetString("ScopeID", string.Empty);
128 if (scope != string.Empty) 124 if (scope != string.Empty)
129 UUID.TryParse(scope, out m_ScopeID); 125 UUID.TryParse(scope, out m_ScopeID);
130 126
131// m_Check4096 = gridConfig.GetBoolean("Check4096", true); 127// m_Check4096 = gridConfig.GetBoolean("Check4096", true);
132 128
133 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); 129 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
134 130
135 m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); 131 m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
136 try 132 try
137 { 133 {
138 m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper); 134 m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper);
139 } 135 }
140 catch 136 catch
141 { 137 {
142 m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); 138 m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper);
143 } 139 }
144 140
145 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 141 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
146 142
147 m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); 143 m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
148 }
149 144
150 if (!string.IsNullOrEmpty(m_MapTileDirectory)) 145 if (!string.IsNullOrEmpty(m_MapTileDirectory))
151 { 146 {
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index cdc560c..f681df4 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -161,6 +161,14 @@ namespace OpenSim.Services.HypergridService
161 { 161 {
162 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 162 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
163 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); 163 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI);
164
165 if (m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID) == null)
166 {
167 m_log.WarnFormat("[USER AGENT SERVICE]: Someone attempted to lauch a foreign user from here {0} {1}", agentCircuit.firstname, agentCircuit.lastname);
168 reason = "Forbidden to launch your agents from here";
169 return false;
170 }
171
164 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 172 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
165 GridRegion region = new GridRegion(gatekeeper); 173 GridRegion region = new GridRegion(gatekeeper);
166 region.ServerURI = gatekeeper.ServerURI; 174 region.ServerURI = gatekeeper.ServerURI;
@@ -480,6 +488,31 @@ namespace OpenSim.Services.HypergridService
480 return online; 488 return online;
481 } 489 }
482 490
491 public Dictionary<string, object> GetUserInfo(UUID userID)
492 {
493 Dictionary<string, object> info = new Dictionary<string, object>();
494
495 if (m_UserAccountService == null)
496 {
497 m_log.WarnFormat("[USER AGENT SERVICE]: Unable to get user flags because user account service is missing");
498 info["result"] = "fail";
499 info["message"] = "UserAccountService is missing!";
500 return info;
501 }
502
503 UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero /*!!!*/, userID);
504
505 if (account != null)
506 {
507 info.Add("user_flags", (object)account.UserFlags);
508 info.Add("user_created", (object)account.Created);
509 info.Add("user_title", (object)account.UserTitle);
510 info.Add("result", "success");
511 }
512
513 return info;
514 }
515
483 public Dictionary<string, object> GetServerURLs(UUID userID) 516 public Dictionary<string, object> GetServerURLs(UUID userID)
484 { 517 {
485 if (m_UserAccountService == null) 518 if (m_UserAccountService == null)
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs
index e86ec51..5b293ac 100644
--- a/OpenSim/Services/Interfaces/IHypergridServices.cs
+++ b/OpenSim/Services/Interfaces/IHypergridServices.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Interfaces
55 void LogoutAgent(UUID userID, UUID sessionID); 55 void LogoutAgent(UUID userID, UUID sessionID);
56 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); 56 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt);
57 Dictionary<string, object> GetServerURLs(UUID userID); 57 Dictionary<string, object> GetServerURLs(UUID userID);
58 Dictionary<string,object> GetUserInfo(UUID userID);
58 59
59 string LocateUser(UUID userID); 60 string LocateUser(UUID userID);
60 // Tries to get the universal user identifier for the targetUserId 61 // Tries to get the universal user identifier for the targetUserId
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index 6cc8eb8..1b85980 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -91,6 +91,7 @@ namespace OpenSim.Services.Interfaces
91 public int UserLevel; 91 public int UserLevel;
92 public int UserFlags; 92 public int UserFlags;
93 public string UserTitle; 93 public string UserTitle;
94 public Boolean LocalToGrid = true;
94 95
95 public Dictionary<string, object> ServiceURLs; 96 public Dictionary<string, object> ServiceURLs;
96 97
@@ -119,6 +120,8 @@ namespace OpenSim.Services.Interfaces
119 UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); 120 UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString());
120 if (kvp.ContainsKey("UserTitle")) 121 if (kvp.ContainsKey("UserTitle"))
121 UserTitle = kvp["UserTitle"].ToString(); 122 UserTitle = kvp["UserTitle"].ToString();
123 if (kvp.ContainsKey("LocalToGrid"))
124 Boolean.TryParse(kvp["LocalToGrid"].ToString(), out LocalToGrid);
122 125
123 if (kvp.ContainsKey("Created")) 126 if (kvp.ContainsKey("Created"))
124 Created = Convert.ToInt32(kvp["Created"].ToString()); 127 Created = Convert.ToInt32(kvp["Created"].ToString());
@@ -152,6 +155,7 @@ namespace OpenSim.Services.Interfaces
152 result["UserLevel"] = UserLevel.ToString(); 155 result["UserLevel"] = UserLevel.ToString();
153 result["UserFlags"] = UserFlags.ToString(); 156 result["UserFlags"] = UserFlags.ToString();
154 result["UserTitle"] = UserTitle; 157 result["UserTitle"] = UserTitle;
158 result["LocalToGrid"] = LocalToGrid.ToString();
155 159
156 string str = string.Empty; 160 string str = string.Empty;
157 foreach (KeyValuePair<string, object> kvp in ServiceURLs) 161 foreach (KeyValuePair<string, object> kvp in ServiceURLs)
diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs
index 6249fae..a73fcbe 100644
--- a/OpenSim/Tools/pCampBot/pCampBot.cs
+++ b/OpenSim/Tools/pCampBot/pCampBot.cs
@@ -112,10 +112,10 @@ namespace pCampBot
112 " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n" + 112 " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n" +
113 " -password password for the bots\n" + 113 " -password password for the bots\n" +
114 " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" + 114 " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" +
115 " current options are:" + 115 " current options are:\n" +
116 " p (physics)" + 116 " p (physics)\n" +
117 " g (grab)" + 117 " g (grab)\n" +
118 " t (teleport)" + 118 " t (teleport)\n" +
119// " c (cross)" + 119// " c (cross)" +
120 " -wear set appearance folder to load from (default: no)\n" + 120 " -wear set appearance folder to load from (default: no)\n" +
121 " -h, -help show this message"); 121 " -h, -help show this message");
diff --git a/Prebuild/COPYING b/Prebuild/COPYING
index c57c080..d3cdf7e 100644
--- a/Prebuild/COPYING
+++ b/Prebuild/COPYING
@@ -1,65 +1,65 @@
1BSD License 1BSD License
2Copyright (c)2004-2008 2Copyright (c)2004-2008
3 3
4See AUTHORS file for list of copyright holders 4See AUTHORS file for list of copyright holders
5 5
6Dave Hudson (jendave@yahoo.com), 6Dave Hudson (jendave@yahoo.com),
7Matthew Holmes (matthew@wildfiregames.com) 7Matthew Holmes (matthew@wildfiregames.com)
8Dan Moorehead (dan05a@gmail.com) 8Dan Moorehead (dan05a@gmail.com)
9Rob Loach (http://www.robloach.net) 9Rob Loach (http://www.robloach.net)
10C.J. Adams-Collier (cjac@colliertech.org) 10C.J. Adams-Collier (cjac@colliertech.org)
11 11
12http://dnpb.sourceforge.net 12http://dnpb.sourceforge.net
13All rights reserved. 13All rights reserved.
14 14
15Redistribution and use in source and binary forms, with or without 15Redistribution and use in source and binary forms, with or without
16modification, are permitted provided that the following conditions 16modification, are permitted provided that the following conditions
17are met: 17are met:
18 18
191. Redistributions of source code must retain the above copyright notice, 191. Redistributions of source code must retain the above copyright notice,
20 this list of conditions and the following disclaimer. 20 this list of conditions and the following disclaimer.
21 21
222. Redistributions in binary form must reproduce the above copyright notice, 222. Redistributions in binary form must reproduce the above copyright notice,
23 this list of conditions and the following disclaimer in the documentation 23 this list of conditions and the following disclaimer in the documentation
24 and/or other materials provided with the distribution. 24 and/or other materials provided with the distribution.
25 25
263. The names of the authors may not be used to endorse or promote 263. The names of the authors may not be used to endorse or promote
27 products derived from this software without specific prior written 27 products derived from this software without specific prior written
28 permission. 28 permission.
29 29
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
33 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
34 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
35 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
36 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
40 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 POSSIBILITY OF SUCH DAMAGE. 41 POSSIBILITY OF SUCH DAMAGE.
42 42
43--- 43---
44 44
45Portions of src/Core/Targets/AutotoolsTarget.cs 45Portions of src/Core/Targets/AutotoolsTarget.cs
46// Copyright (C) 2006 Novell, Inc (http://www.novell.com) 46// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
47// 47//
48// Permission is hereby granted, free of charge, to any person obtaining 48// Permission is hereby granted, free of charge, to any person obtaining
49// a copy of this software and associated documentation files (the 49// a copy of this software and associated documentation files (the
50// "Software"), to deal in the Software without restriction, including 50// "Software"), to deal in the Software without restriction, including
51// without limitation the rights to use, copy, modify, merge, publish, 51// without limitation the rights to use, copy, modify, merge, publish,
52// distribute, sublicense, and/or sell copies of the Software, and to 52// distribute, sublicense, and/or sell copies of the Software, and to
53// permit persons to whom the Software is furnished to do so, subject to 53// permit persons to whom the Software is furnished to do so, subject to
54// the following conditions: 54// the following conditions:
55// 55//
56// The above copyright notice and this permission notice shall be 56// The above copyright notice and this permission notice shall be
57// included in all copies or substantial portions of the Software. 57// included in all copies or substantial portions of the Software.
58// 58//
59// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 59// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
60// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 60// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
61// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 61// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
62// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 62// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
63// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 63// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
64// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 64// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
65// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 65// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Prebuild/NEWS b/Prebuild/NEWS
index 3ab3108..bea28da 100644
--- a/Prebuild/NEWS
+++ b/Prebuild/NEWS
@@ -1,200 +1,200 @@
1Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop, and NAnt. 1Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop, and NAnt.
2 2
3Documentation and downloads are available at http://dnpb.sourceforge.net. 3Documentation and downloads are available at http://dnpb.sourceforge.net.
4 4
5Prebuild is licensed under the BSD license. 5Prebuild is licensed under the BSD license.
6 6
7[ XXXXXXX XX, XXX - 1.3.2 ] 7[ XXXXXXX XX, XXX - 1.3.2 ]
8 + Added Keyfile signing to NAnt target and VS2005 target 8 + Added Keyfile signing to NAnt target and VS2005 target
9 + Updated XSD file to 1.7 9 + Updated XSD file to 1.7
10 + Boo and VisualBasic Language support in VS2005 target 10 + Boo and VisualBasic Language support in VS2005 target
11 + Added basic Autotools target. It creates a non-recursive Autotools system. 11 + Added basic Autotools target. It creates a non-recursive Autotools system.
12 ! Multiple files can be excluded from the Match node 12 ! Multiple files can be excluded from the Match node
13 ! VS2005 now handles .resx files correctly. 13 ! VS2005 now handles .resx files correctly.
14 ! NAnt and Autotools now handle defines 14 ! NAnt and Autotools now handle defines
15 ! NAnt and Autotools now handle resources 15 ! NAnt and Autotools now handle resources
16 + Conditional XML variables can be passed through the command line. 16 + Conditional XML variables can be passed through the command line.
17 + Added /install and /remove command line flags to install and remove assemblies from the GAC 17 + Added /install and /remove command line flags to install and remove assemblies from the GAC
18 + Many fixes to VS2005 target 18 + Many fixes to VS2005 target
19 19
20[ July 21, 2006 - 1.3.1 ] 20[ July 21, 2006 - 1.3.1 ]
21 ! VS2005 fixes from Rob Loach 21 ! VS2005 fixes from Rob Loach
22 ! NAnt fixes from Rob Loach and David Hudson 22 ! NAnt fixes from Rob Loach and David Hudson
23 ! XML doc fixes from Rob Loach 23 ! XML doc fixes from Rob Loach
24 + Added SharpDevelop2 target (really just uses VS2005 target) 24 + Added SharpDevelop2 target (really just uses VS2005 target)
25 ! Fixed bug with BuildEvents in Monodevelop target 25 ! Fixed bug with BuildEvents in Monodevelop target
26 + Passing /yes will default to answering yes to any warnings 26 + Passing /yes will default to answering yes to any warnings
27 27
28[ February 28, 2006 - 1.3 ] 28[ February 28, 2006 - 1.3 ]
29 + Added MonoDevelop target. 29 + Added MonoDevelop target.
30 + Added NAnt target. 30 + Added NAnt target.
31 + Lots of fixes to all targets. 31 + Lots of fixes to all targets.
32 * Cleaned up the code using FXCop. 32 * Cleaned up the code using FXCop.
33 * Updated schema to 1.6 to fix a typo and add a new parameter. 33 * Updated schema to 1.6 to fix a typo and add a new parameter.
34 * jendave is now the maintainer of the project. RobLoach has been added as a developer. 34 * jendave is now the maintainer of the project. RobLoach has been added as a developer.
35 * Removed references to 'dnpb'. 35 * Removed references to 'dnpb'.
36 + Added rudimentary support for pre- and post- build scripts 36 + Added rudimentary support for pre- and post- build scripts
37 * Updated examples. 37 * Updated examples.
38 38
39[ August 5, 2004 - 1.2 ] 39[ August 5, 2004 - 1.2 ]
40 + Added Visual Studio Express (vs2005express) target contributed by Borrillis and modified for use with different languages 40 + Added Visual Studio Express (vs2005express) target contributed by Borrillis and modified for use with different languages
41 + Added the allowedgroups command line option followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags 41 + Added the allowedgroups command line option followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags
42 + Added the filterGroups XML attribute to the project node and updated the scheme to v1.5 for this addition, it is used to specified the delimited list of filter groups to which a project belongs 42 + Added the filterGroups XML attribute to the project node and updated the scheme to v1.5 for this addition, it is used to specified the delimited list of filter groups to which a project belongs
43 * Modified the removedir command line option to allow for a pipe-delimited list of directory names 43 * Modified the removedir command line option to allow for a pipe-delimited list of directory names
44 ! Modified the resource loading code to search for resourced without the prepended namespace (as Visual Studio .NET does it) to allow for it to be compiled with SharpDevelop as well 44 ! Modified the resource loading code to search for resourced without the prepended namespace (as Visual Studio .NET does it) to allow for it to be compiled with SharpDevelop as well
45 + Added the GenerateXmlDocFile boolean option to the Options XML element 45 + Added the GenerateXmlDocFile boolean option to the Options XML element
46 * Changed the behavior of the XmlDocFile option so that if not specified it uses the assemblyName (without file extension) + .xml for the file name instead of just not generating the file since the new GenerateXmlDocFile takes care of this 46 * Changed the behavior of the XmlDocFile option so that if not specified it uses the assemblyName (without file extension) + .xml for the file name instead of just not generating the file since the new GenerateXmlDocFile takes care of this
47 47
48[ January 3, 2004 - 1.1 ] 48[ January 3, 2004 - 1.1 ]
49 ! Replaced regex use for more efficient manual parsing to allow use on non-windows platforms with Mono which has Regex problems 49 ! Replaced regex use for more efficient manual parsing to allow use on non-windows platforms with Mono which has Regex problems
50 + Added the checkOsVars attribute to the root element for enabling interpolation for Enviroment variables in the form ${var}, otherwise no checking is performed for efficiency-sake 50 + Added the checkOsVars attribute to the root element for enabling interpolation for Enviroment variables in the form ${var}, otherwise no checking is performed for efficiency-sake
51 * Make the version attribute on the root element optional as it isn't used and not needed since the schema url contains the version 51 * Make the version attribute on the root element optional as it isn't used and not needed since the schema url contains the version
52 52
53[ December 30, 2004 - 1.1 ] 53[ December 30, 2004 - 1.1 ]
54 ! Applied Leed's fix for SharpDevelop references 54 ! Applied Leed's fix for SharpDevelop references
55 + Rewrote much of the processing for better validation and without the use of a temp file 55 + Rewrote much of the processing for better validation and without the use of a temp file
56 + Added support for configurations at the project level which are named All. They now apply changes to all Solution level defined configs 56 + Added support for configurations at the project level which are named All. They now apply changes to all Solution level defined configs
57 * Changed all spaces into tabs 57 * Changed all spaces into tabs
58 + Added support for the None build action 58 + Added support for the None build action
59 * Replaced all sequence's in the XML schema for all's because the order doesn't matter since the xml file is loaded into an XmlDocument 59 * Replaced all sequence's in the XML schema for all's because the order doesn't matter since the xml file is loaded into an XmlDocument
60 60
61[ December 25, 2004 - 1.0 ] 61[ December 25, 2004 - 1.0 ]
62 + Added the /removedir option for cleaning directories like obj before file releases 62 + Added the /removedir option for cleaning directories like obj before file releases
63 + Changed WriteTempXml() and the new DeleteTempXml() methods to be compiled only in DEBUG builds 63 + Changed WriteTempXml() and the new DeleteTempXml() methods to be compiled only in DEBUG builds
64 * Made path optional for Match elements (defaults to current directory) and updates schema for it 64 * Made path optional for Match elements (defaults to current directory) and updates schema for it
65 ! Fixed XML example in the readme.txt 65 ! Fixed XML example in the readme.txt
66 + Added example xml files to docs directory 66 + Added example xml files to docs directory
67 * Updated license.txt to add Dan Moorehead and update copyright years 67 * Updated license.txt to add Dan Moorehead and update copyright years
68 + Updated prebuild.xml to take advantage of the default path attribute for match elements 68 + Updated prebuild.xml to take advantage of the default path attribute for match elements
69 + Updated Clean to delete the obj directories 69 + Updated Clean to delete the obj directories
70 70
71[ December 25, 2004 - 0.13 ] 71[ December 25, 2004 - 0.13 ]
72 + Added dnpb.exe so that it can be used to generate the project files 72 + Added dnpb.exe so that it can be used to generate the project files
73 + Added dnpb.ico 73 + Added dnpb.ico
74 * Added parameterless Write statement to Log for writing a single line 74 * Added parameterless Write statement to Log for writing a single line
75 * Changed scehema to version 1.3 for support of icon attribute 75 * Changed scehema to version 1.3 for support of icon attribute
76 * Added support for All configuration name under a Project node signifying common settings for all configurations 76 * Added support for All configuration name under a Project node signifying common settings for all configurations
77 ! Fixed the SupressWarnings by adding the corresponding field to OptionsNode 77 ! Fixed the SupressWarnings by adding the corresponding field to OptionsNode
78 * Wrote documentation in docs/readme.txt 78 * Wrote documentation in docs/readme.txt
79 * Added Dan Moorehead to copyrights and extended date from 2004 to 2004-2005 79 * Added Dan Moorehead to copyrights and extended date from 2004 to 2004-2005
80 * Updated prebuild.xml 80 * Updated prebuild.xml
81 * Optimized Log class 81 * Optimized Log class
82 * Updated OutputUsage() 82 * Updated OutputUsage()
83 * /clean targets all by default 83 * /clean targets all by default
84 * No log file is used by default, /log without value specified uses default file name 84 * No log file is used by default, /log without value specified uses default file name
85 + Added support for the /pause which pauses the utility after execution to observe output 85 + Added support for the /pause which pauses the utility after execution to observe output
86 86
87 87
88[ September 27, 2004 - 0.12.2a ] 88[ September 27, 2004 - 0.12.2a ]
89 ! Fixed a nasty bug when trying to delete our temp file for pre-processing. 89 ! Fixed a nasty bug when trying to delete our temp file for pre-processing.
90 90
91[ September 15, 2004 - 0.12.2 ] 91[ September 15, 2004 - 0.12.2 ]
92 + Expanded platform identification, thanks to the NAnt guys for shedding some 92 + Expanded platform identification, thanks to the NAnt guys for shedding some
93 light on how to properly check for UNIX platforms! Thanks guys! 93 light on how to properly check for UNIX platforms! Thanks guys!
94 * POSIX OS identifier changed to UNIX. Valid OS names are now "Win32", "UNIX", 94 * POSIX OS identifier changed to UNIX. Valid OS names are now "Win32", "UNIX",
95 and "Unknown". 95 and "Unknown".
96 ! Fixed SharpDevelop target to properly use the 'rootNamespace' attribute of 96 ! Fixed SharpDevelop target to properly use the 'rootNamespace' attribute of
97 the Project tag. 97 the Project tag.
98 + New command-line switch, /ppo, forces DNPB to pre-process the file and write 98 + New command-line switch, /ppo, forces DNPB to pre-process the file and write
99 the pre-processed file. This allows you to test/debug your pre-processor 99 the pre-processed file. This allows you to test/debug your pre-processor
100 macros. No other processing will be done. You can specify a target file as 100 macros. No other processing will be done. You can specify a target file as
101 a paramter for the /ppo switch, or DNPB will write the file 'preprocessed.xml' 101 a paramter for the /ppo switch, or DNPB will write the file 'preprocessed.xml'
102 if you do not specify a file. 102 if you do not specify a file.
103 + The Match tag now has a 'buildAction' attribute which functions exactly like 103 + The Match tag now has a 'buildAction' attribute which functions exactly like
104 the attribute of the same name for the File tag. 104 the attribute of the same name for the File tag.
105 105
106[ August 5, 2004 - 0.12.1 ] 106[ August 5, 2004 - 0.12.1 ]
107 + Added environment variable expansion for all values. Environment variables 107 + Added environment variable expansion for all values. Environment variables
108 should be listed in the form ${VAR}. 108 should be listed in the form ${VAR}.
109 109
110[ July 30, 2004 - 0.12.0 ] 110[ July 30, 2004 - 0.12.0 ]
111 + Added preprocessing via XML processing information tags. Available tags 111 + Added preprocessing via XML processing information tags. Available tags
112 are: <?if <exp> ?>, <?elseif <exp> ?>, <?else ?> and <?endif ?>. The 112 are: <?if <exp> ?>, <?elseif <exp> ?>, <?else ?> and <?endif ?>. The
113 current expression parser is very basic, but will be replaced with a more 113 current expression parser is very basic, but will be replaced with a more
114 capable parser over time. Current operators available are: =, !=, <, >, 114 capable parser over time. Current operators available are: =, !=, <, >,
115 <=, >=. Current test variables available: OS, RuntimeVersion, RuntimeMajor, 115 <=, >=. Current test variables available: OS, RuntimeVersion, RuntimeMajor,
116 RuntimeMinor, RuntimeRevision. 116 RuntimeMinor, RuntimeRevision.
117 117
118[ July 27, 2004 - 0.11.4 ] 118[ July 27, 2004 - 0.11.4 ]
119 + Added 'useRegex' attribute to the Match tag. Matches can now use regular 119 + Added 'useRegex' attribute to the Match tag. Matches can now use regular
120 expressions to match filenames. 120 expressions to match filenames.
121 + Added the 'assemblyName' attribute to the Project tag. Projects can now 121 + Added the 'assemblyName' attribute to the Project tag. Projects can now
122 set their output assembly name. 122 set their output assembly name.
123 ! Fixed several bugs in the way that Project tags inheirt their parent 123 ! Fixed several bugs in the way that Project tags inheirt their parent
124 Solutions configuration options. This operation should now work fully as 124 Solutions configuration options. This operation should now work fully as
125 intended. 125 intended.
126 ! Due to some wierdness, Project Guid's are now stored as part of the Project 126 ! Due to some wierdness, Project Guid's are now stored as part of the Project
127 node and created at parse time. 127 node and created at parse time.
128 128
129[ May 11, 2004 - 0.11.3 ] 129[ May 11, 2004 - 0.11.3 ]
130 ! Fixed a bug where I was writing the wrong property name for a projects root 130 ! Fixed a bug where I was writing the wrong property name for a projects root
131 namespace. 131 namespace.
132 ! Removed a DEBUG statement I had left in the code in 0.11.2. 132 ! Removed a DEBUG statement I had left in the code in 0.11.2.
133 ! Fixed a bug in the VS2002 writer which caused the version variables to not 133 ! Fixed a bug in the VS2002 writer which caused the version variables to not
134 be overriden correctly. 134 be overriden correctly.
135 + Added the rootNamespace property to the <Project> element, allowing you to 135 + Added the rootNamespace property to the <Project> element, allowing you to
136 specify the root namespace. 136 specify the root namespace.
137 * /target and /clean are now mutually exclusive command line switches, and 137 * /target and /clean are now mutually exclusive command line switches, and
138 they both now take the all option. In the case of /target all, all build 138 they both now take the all option. In the case of /target all, all build
139 file for all targets will be created. In the case of /clean all, the user 139 file for all targets will be created. In the case of /clean all, the user
140 will be prompted to make sure they want to do it, and if so, will clean 140 will be prompted to make sure they want to do it, and if so, will clean
141 all build files for all targets. 141 all build files for all targets.
142 142
143[ April 22, 2004 - 0.11.2 ] 143[ April 22, 2004 - 0.11.2 ]
144 ! Fixed a bug with the /file command-line operator. Was using the unresolved 144 ! Fixed a bug with the /file command-line operator. Was using the unresolved
145 file path rather then the resolved one, was making the attempt to open the 145 file path rather then the resolved one, was making the attempt to open the
146 dnpb file fail. 146 dnpb file fail.
147 ! Fixed a bug in the schema that required at least 1 solution and 1 reference 147 ! Fixed a bug in the schema that required at least 1 solution and 1 reference
148 path. We can do just fine with 0 of either of these. Some files may be all 148 path. We can do just fine with 0 of either of these. Some files may be all
149 <Process> statements and not have any <Solution> tags. 149 <Process> statements and not have any <Solution> tags.
150 ! Fixed a bug that caused the project references not to be written with the 150 ! Fixed a bug that caused the project references not to be written with the
151 SharpDevelop target. 151 SharpDevelop target.
152 * Changed the schema to version 1.2, allowing for Configuration nodes to exist 152 * Changed the schema to version 1.2, allowing for Configuration nodes to exist
153 under project nodes. The inheritance of values is hierarchical. Meaning, if 153 under project nodes. The inheritance of values is hierarchical. Meaning, if
154 you define a configuration named Debug at the Soltion level, and one by the 154 you define a configuration named Debug at the Soltion level, and one by the
155 same name at the Project level, the one at the Project level will first 155 same name at the Project level, the one at the Project level will first
156 inherit the options of the Solution level configuration, then set it's own 156 inherit the options of the Solution level configuration, then set it's own
157 options. If you define a configuration at the Project level and it does not 157 options. If you define a configuration at the Project level and it does not
158 exist at the Solution level, it will be created at the Solution level. 158 exist at the Solution level, it will be created at the Solution level.
159 * Project references should now work correctly across the board. Note that due 159 * Project references should now work correctly across the board. Note that due
160 to a restriction in Visual Studio, you can only reference projects in the same 160 to a restriction in Visual Studio, you can only reference projects in the same
161 solution. 161 solution.
162 162
163[ April 21, 2004 - 0.11.1 ] 163[ April 21, 2004 - 0.11.1 ]
164 ! Fixed a problem with resolving paths in various targets. Was not properly 164 ! Fixed a problem with resolving paths in various targets. Was not properly
165 setting the CWD. 165 setting the CWD.
166 * Schema updated to 1.1, moving the ReferencePath element from the Options 166 * Schema updated to 1.1, moving the ReferencePath element from the Options
167 element to the Project element. This makes more logical sense, given that 167 element to the Project element. This makes more logical sense, given that
168 reference paths are resolved relative to the project path. Any prebuild.xml 168 reference paths are resolved relative to the project path. Any prebuild.xml
169 file referecning verison 1.0 will fail! Please update to the 1.1 schema. 169 file referecning verison 1.0 will fail! Please update to the 1.1 schema.
170 170
171[ April 19, 2004 - 0.11.0 ] 171[ April 19, 2004 - 0.11.0 ]
172 * Added several attributes across the code to make FxCop happy 172 * Added several attributes across the code to make FxCop happy
173 ! Fixed bugs in reference paths being written in the VS targets. 173 ! Fixed bugs in reference paths being written in the VS targets.
174 ! Fixed a bug in ProjectNode which was doing two CWDStack.Push() calls instead of 174 ! Fixed a bug in ProjectNode which was doing two CWDStack.Push() calls instead of
175 a Push/Pop pair. Was wreaking havoc with <Process> tags. 175 a Push/Pop pair. Was wreaking havoc with <Process> tags.
176 ! Fixed some bugs in the path tracking, both the Project and Solution nodes now 176 ! Fixed some bugs in the path tracking, both the Project and Solution nodes now
177 have a FullPath property, which is the full path to the file resolved at load 177 have a FullPath property, which is the full path to the file resolved at load
178 time. This should fix all path relativity problems. 178 time. This should fix all path relativity problems.
179 + Added new /clean switch, allowing the target to clean up any files it generated. 179 + Added new /clean switch, allowing the target to clean up any files it generated.
180 in accordance, the ITarget interface has been updated to support a new Clean() 180 in accordance, the ITarget interface has been updated to support a new Clean()
181 method. 181 method.
182 + Completed addition of the <Process> tag, to allow the referencing of external 182 + Completed addition of the <Process> tag, to allow the referencing of external
183 prebuild.xml files. 183 prebuild.xml files.
184 + Added the runtime attribute to the Project element. This allows the developer 184 + Added the runtime attribute to the Project element. This allows the developer
185 to specify which runtime a project should target (Mono or Microsoft). This is 185 to specify which runtime a project should target (Mono or Microsoft). This is
186 of course ignored in certain targets like the Visual Studio targets. 186 of course ignored in certain targets like the Visual Studio targets.
187 + Added the SharpDevelop target. 187 + Added the SharpDevelop target.
188 188
189[ April 13, 2004 - 0.10.1a ] 189[ April 13, 2004 - 0.10.1a ]
190 + Added the buildAction attribute to the File node. This is needed for dnpb 190 + Added the buildAction attribute to the File node. This is needed for dnpb
191 to even be able to bootstrap itself (dnpb-1.0.xsd must be an embedded resource) 191 to even be able to bootstrap itself (dnpb-1.0.xsd must be an embedded resource)
192 192
193[ April 13, 2004 - 0.10.1 ] 193[ April 13, 2004 - 0.10.1 ]
194 * First Release 194 * First Release
195 195
196[ Key ] 196[ Key ]
197* = Change or information 197* = Change or information
198+ = Addition 198+ = Addition
199! = Bug Fix 199! = Bug Fix
200 200
diff --git a/Prebuild/Prebuild.exe b/Prebuild/Prebuild.exe
new file mode 100755
index 0000000..bdb25b6
--- /dev/null
+++ b/Prebuild/Prebuild.exe
Binary files differ
diff --git a/Prebuild/README b/Prebuild/README
index e8a2d69..2b05fb5 100644
--- a/Prebuild/README
+++ b/Prebuild/README
@@ -1,274 +1,274 @@
1Prebuild Instructions 1Prebuild Instructions
2 2
3Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt. 3Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt.
4 4
5_______________________________________________________________________________ 5_______________________________________________________________________________
6Overview 6Overview
7 7
8Prebuild can be either be run from the command line to generate the 8Prebuild can be either be run from the command line to generate the
9project and make files or you can execute the included batch (*.bat) 9project and make files or you can execute the included batch (*.bat)
10and Unix Shell script (*.sh) files. 10and Unix Shell script (*.sh) files.
11 11
12_______________________________________________________________________________ 12_______________________________________________________________________________
13The currently supported developement tools and their associated batch 13The currently supported developement tools and their associated batch
14and shell script files. 14and shell script files.
15 15
16Visual Studio .NET 2005 (VS2005.bat) 16Visual Studio .NET 2005 (VS2005.bat)
17Visual Studio .NET 2003 (VS2003.bat) 17Visual Studio .NET 2003 (VS2003.bat)
18Visual Studio .NET 2002 (VS2002.bat) 18Visual Studio .NET 2002 (VS2002.bat)
19SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ 19SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
20SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ 20SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
21MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/ 21MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/
22NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/ 22NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/
23Autotools (autotools.bat and autotools.sh) - http://en.wikipedia.org/wiki/GNU_build_system 23Autotools (autotools.bat and autotools.sh) - http://en.wikipedia.org/wiki/GNU_build_system
24 24
25Notes: 25Notes:
26 26
27A Unix Shell script is provided for MonoDevelop, as it does not run on 27A Unix Shell script is provided for MonoDevelop, as it does not run on
28Windows at this time. 28Windows at this time.
29 29
30Visual Studio .NET 2005 and the Visual Express IDE's can import 30Visual Studio .NET 2005 and the Visual Express IDE's can import
31solutions from older versions of Visual Studio .NET. 31solutions from older versions of Visual Studio .NET.
32 32
33Makefiles are not currently supported. 33Makefiles are not currently supported.
34 34
35_______________________________________________________________________________ 35_______________________________________________________________________________
36Command Line Syntax: 36Command Line Syntax:
37 37
38Example: 38Example:
39> Prebuild /target vs2003 39> Prebuild /target vs2003
40 40
41This will generate the project files for Visual Studio.NET 2003 and 41This will generate the project files for Visual Studio.NET 2003 and
42place the redirect the log to a file named PrebuildLog.txt in the 42place the redirect the log to a file named PrebuildLog.txt in the
43parent directory 43parent directory
44 44
45 45
46The syntax structure is as below, where commandParameter is optional 46The syntax structure is as below, where commandParameter is optional
47depending on the command and you can provide several option-value 47depending on the command and you can provide several option-value
48pairs. 48pairs.
49 49
50Note: The '> ' signifies the command prompt, do not enter this literally 50Note: The '> ' signifies the command prompt, do not enter this literally
51 51
52> Prebuild /<option> <commandParameter> 52> Prebuild /<option> <commandParameter>
53 53
54> Prebuild /target vs2003 /pause 54> Prebuild /target vs2003 /pause
55 55
56> Prebuild /target vs2003 /log ../Log.txt /pause /ppo /file ProjectConfig.xml 56> Prebuild /target vs2003 /log ../Log.txt /pause /ppo /file ProjectConfig.xml
57 57
58> Prebuild /target sharpdev /log 58> Prebuild /target sharpdev /log
59 59
60> Prebuild /removedir obj|bin 60> Prebuild /removedir obj|bin
61 61
62> Prebuild /target vs2003 /allowedgroups Group1|Group2 62> Prebuild /target vs2003 /allowedgroups Group1|Group2
63 63
64> Prebuild /clean 64> Prebuild /clean
65 65
66> Prebuild /clean /yes 66> Prebuild /clean /yes
67 67
68> Prebuild /clean vs2003 68> Prebuild /clean vs2003
69 69
70_______________________________________________________________________________ 70_______________________________________________________________________________
71Command Line Options: 71Command Line Options:
72 72
73/usage - Shows the help information on how to use Prebuild and what 73/usage - Shows the help information on how to use Prebuild and what
74the different options are and what they do 74the different options are and what they do
75 75
76/clean - The project files generated for the target type specified as 76/clean - The project files generated for the target type specified as
77a parameter for this option will be deleted. If no value is specified 77a parameter for this option will be deleted. If no value is specified
78or if 'all' is specified, then project files for all the target types 78or if 'all' is specified, then project files for all the target types
79will be deleted. 79will be deleted.
80 80
81/target - Specified the name of the development tool for which project 81/target - Specified the name of the development tool for which project
82or make files will be generated. Possible parameter values include: 82or make files will be generated. Possible parameter values include:
83vs2003, vs2002, sharpdev 83vs2003, vs2002, sharpdev
84 84
85/file - Specifies the name of the XML which defines what files are to 85/file - Specifies the name of the XML which defines what files are to
86be referenced by the generated project files as well as configures the 86be referenced by the generated project files as well as configures the
87options for them. If not specified, prebuild.xml in the current 87options for them. If not specified, prebuild.xml in the current
88directory will be used as the default. 88directory will be used as the default.
89 89
90/log - Specified the log file that should be written to for build 90/log - Specified the log file that should be written to for build
91errors. If this option is not specified, no log file is generated, 91errors. If this option is not specified, no log file is generated,
92but if just no value is specified, then the defaul filename will be 92but if just no value is specified, then the defaul filename will be
93used for the log (Prebuild.log). 93used for the log (Prebuild.log).
94 94
95/ppo - Preprocesses the xml file to test for syntax errors or problems 95/ppo - Preprocesses the xml file to test for syntax errors or problems
96but doesn't generate the files 96but doesn't generate the files
97 97
98/pause - Shows the console until you press a key so that you can view 98/pause - Shows the console until you press a key so that you can view
99the messages written while performing the specified actions. 99the messages written while performing the specified actions.
100 100
101This allows you to check if an errors occurred and - if so - what it 101This allows you to check if an errors occurred and - if so - what it
102was. 102was.
103 103
104/showtargets - Shows a list of all the targets that can be specified 104/showtargets - Shows a list of all the targets that can be specified
105as values for the /clean and /target commands. 105as values for the /clean and /target commands.
106 106
107/allowedgroups - This is followed by a pipe-delimited list of project 107/allowedgroups - This is followed by a pipe-delimited list of project
108group filter flags (eg. Group1|Group2) allow optional filtering of all 108group filter flags (eg. Group1|Group2) allow optional filtering of all
109projects that dont have at least one of these flags 109projects that dont have at least one of these flags
110 110
111/removedir - This is followed by a pipe-delimited list of directory 111/removedir - This is followed by a pipe-delimited list of directory
112names that will be deleted while recursivly searching the directory of 112names that will be deleted while recursivly searching the directory of
113the prebuild application and its child directories (eg. use obj|bin to 113the prebuild application and its child directories (eg. use obj|bin to
114delete all output and temporary directories before file releases) 114delete all output and temporary directories before file releases)
115 115
116/yes - Answer yes to any warnings (e.g. when cleaning all projects). 116/yes - Answer yes to any warnings (e.g. when cleaning all projects).
117 117
118_______________________________________________________________________________ 118_______________________________________________________________________________
119Example Batch Files and Shell Scripts 119Example Batch Files and Shell Scripts
120 120
121NOTE: Common batch and shell script files are included with Prebuild source and file releases. 121NOTE: Common batch and shell script files are included with Prebuild source and file releases.
122______________________________ 122______________________________
123MonoDevelop 123MonoDevelop
124 124
125#!/bin/sh 125#!/bin/sh
126# Generates a solution (.mds) and a set of project files (.mdp) 126# Generates a solution (.mds) and a set of project files (.mdp)
127 127
128# for MonoDevelop, a Mono port of SharpDevelop 128# for MonoDevelop, a Mono port of SharpDevelop
129# (http://icsharpcode.net/OpenSource/SD/Default.aspx) 129# (http://icsharpcode.net/OpenSource/SD/Default.aspx)
130 130
131./Prebuild /target monodev /pause 131./Prebuild /target monodev /pause
132 132
133______________________________ 133______________________________
134Visual Studio .NET 2003 134Visual Studio .NET 2003
135 135
136@rem Generates a solution (.sln) and a set of project files (.csproj) 136@rem Generates a solution (.sln) and a set of project files (.csproj)
137@rem for Microsoft Visual Studio .NET 2002 137@rem for Microsoft Visual Studio .NET 2002
138Prebuild /target vs2003 /pause 138Prebuild /target vs2003 /pause
139 139
140Notes: 140Notes:
141Text after lines that start with @rem are comments and are not evaluated 141Text after lines that start with @rem are comments and are not evaluated
142You can also place pause on the last line instead of specifing the /pause command. 142You can also place pause on the last line instead of specifing the /pause command.
143 143
144_______________________________________________________________________________ 144_______________________________________________________________________________
145Example XML Configuration File 145Example XML Configuration File
146 146
147Note: 147Note:
148 148
149XML Comments (<!-- Comment -->) are used to markup the prebuild.xml 149XML Comments (<!-- Comment -->) are used to markup the prebuild.xml
150file with notes 150file with notes
151 151
152The below file may be out-of-date, however the RealmForge Prebuild 152The below file may be out-of-date, however the RealmForge Prebuild
153file serves as an up-to-date and extensive example. 153file serves as an up-to-date and extensive example.
154 154
155It can be viewed using Tigris.org's WebSVN 155It can be viewed using Tigris.org's WebSVN
156(http://realmforge.tigris.org/source/browse/realmforge/trunk/src/prebuild.xml) 156(http://realmforge.tigris.org/source/browse/realmforge/trunk/src/prebuild.xml)
157by just clicking on the "view file" link for the latest revision. 157by just clicking on the "view file" link for the latest revision.
158 158
159_________________________________ 159_________________________________
160 160
161<?xml version="1.0" encoding="utf-8"?> 161<?xml version="1.0" encoding="utf-8"?>
162 <!--The version of the XML schema specified in the version and xmlns attributes should match the one for which the version of Prebuild.exe used was compiled for. In this example it is the version 1.3 schema, you can find the XSD schema file at the url specified in the xmlns attribute. --> 162 <!--The version of the XML schema specified in the version and xmlns attributes should match the one for which the version of Prebuild.exe used was compiled for. In this example it is the version 1.3 schema, you can find the XSD schema file at the url specified in the xmlns attribute. -->
163<Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd"> 163<Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
164 <Solution name="RealmForge"> <!--The title and file name for the solution, combine, workspace, or project group (depending on what development tool you are using)--> 164 <Solution name="RealmForge"> <!--The title and file name for the solution, combine, workspace, or project group (depending on what development tool you are using)-->
165 <!--Configurations found as children of Solution are used as templates for the configurations found in the project, this allows you to avoid writing the same options in each project (and maintaining each of these). You can provide defaults and then override them in the configurations defined for each project. All options are optional.--> 165 <!--Configurations found as children of Solution are used as templates for the configurations found in the project, this allows you to avoid writing the same options in each project (and maintaining each of these). You can provide defaults and then override them in the configurations defined for each project. All options are optional.-->
166 <Configuration name="Debug"> 166 <Configuration name="Debug">
167 <Options> 167 <Options>
168 <!-- simple logically expressions can be evaluated, if, else, elseif, and endif are valid statements. Note that it is not neccisary to define POSIX or WIN32 --> 168 <!-- simple logically expressions can be evaluated, if, else, elseif, and endif are valid statements. Note that it is not neccisary to define POSIX or WIN32 -->
169 <?if OS = "Win32" ?> 169 <?if OS = "Win32" ?>
170 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines> 170 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
171 <?else ?> 171 <?else ?>
172 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines> 172 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
173 <?endif ?> 173 <?endif ?>
174 <OptimizeCode>false</OptimizeCode> 174 <OptimizeCode>false</OptimizeCode>
175 <CheckUnderflowOverflow>false</CheckUnderflowOverflow> 175 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
176 <AllowUnsafe>false</AllowUnsafe> 176 <AllowUnsafe>false</AllowUnsafe>
177 <WarningLevel>4</WarningLevel> 177 <WarningLevel>4</WarningLevel>
178 <!-The filter for the number of warnings or errors shown and the tolerance level as to what is an error. This is value from 0 to 4 where 4 is the most strict (least tolerent).--> 178 <!-The filter for the number of warnings or errors shown and the tolerance level as to what is an error. This is value from 0 to 4 where 4 is the most strict (least tolerent).-->
179 179
180 <WarningsAsErrors>false</WarningsAsErrors> 180 <WarningsAsErrors>false</WarningsAsErrors>
181 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings> 181 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
182 <!-- A semicolon ';' delimited list of the warnings that are filtered and not shown in the output window during compiling a project. Only include the number portion of the warning codes that are shown in output during compilation (eg CS1591, should be entered as 1591)--> 182 <!-- A semicolon ';' delimited list of the warnings that are filtered and not shown in the output window during compiling a project. Only include the number portion of the warning codes that are shown in output during compilation (eg CS1591, should be entered as 1591)-->
183 183
184 <OutputPath>..\bin</OutputPath> 184 <OutputPath>..\bin</OutputPath>
185 <DebugInformation>true</DebugInformation> 185 <DebugInformation>true</DebugInformation>
186 <RegisterComInterop>false</RegisterComInterop> 186 <RegisterComInterop>false</RegisterComInterop>
187 <IncrementalBuild>true</IncrementalBuild> 187 <IncrementalBuild>true</IncrementalBuild>
188 <BaseAddress>285212672</BaseAddress> 188 <BaseAddress>285212672</BaseAddress>
189 <FileAlignment>4096</FileAlignment> 189 <FileAlignment>4096</FileAlignment>
190 <NoStdLib>false</NoStdLib> 190 <NoStdLib>false</NoStdLib>
191 <XmlDocFile>Docs.xml</XmlDocFile> 191 <XmlDocFile>Docs.xml</XmlDocFile>
192 </Options> 192 </Options>
193 </Configuration> 193 </Configuration>
194 <Configuration name="Release"> <!-- You can define multple configurations that projects can have, but there is no way to define which one is selected by default as this is a part of the user preferences for a project, not the solution or project files --> 194 <Configuration name="Release"> <!-- You can define multple configurations that projects can have, but there is no way to define which one is selected by default as this is a part of the user preferences for a project, not the solution or project files -->
195 <Options> 195 <Options>
196 <CompilerDefines>TRACE</CompilerDefines> 196 <CompilerDefines>TRACE</CompilerDefines>
197 <OptimizeCode>true</OptimizeCode> 197 <OptimizeCode>true</OptimizeCode>
198 <CheckUnderflowOverflow>false</CheckUnderflowOverflow> 198 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
199 <AllowUnsafe>false</AllowUnsafe> 199 <AllowUnsafe>false</AllowUnsafe>
200 <WarningLevel>4</WarningLevel> 200 <WarningLevel>4</WarningLevel>
201 <WarningsAsErrors>false</WarningsAsErrors> 201 <WarningsAsErrors>false</WarningsAsErrors>
202 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings> 202 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
203 <OutputPath>..\bin</OutputPath> 203 <OutputPath>..\bin</OutputPath>
204 <DebugInformation>false</DebugInformation> 204 <DebugInformation>false</DebugInformation>
205 <RegisterComInterop>false</RegisterComInterop> 205 <RegisterComInterop>false</RegisterComInterop>
206 <IncrementalBuild>true</IncrementalBuild> 206 <IncrementalBuild>true</IncrementalBuild>
207 <BaseAddress>285212672</BaseAddress> 207 <BaseAddress>285212672</BaseAddress>
208 <FileAlignment>4096</FileAlignment> 208 <FileAlignment>4096</FileAlignment>
209 <NoStdLib>false</NoStdLib> 209 <NoStdLib>false</NoStdLib>
210 <GenerateXmlDocFile>true</GenerateXmlDocFile> 210 <GenerateXmlDocFile>true</GenerateXmlDocFile>
211 <XmlDocFile>Docs.xml</XmlDocFile> 211 <XmlDocFile>Docs.xml</XmlDocFile>
212 </Options> 212 </Options>
213 </Configuration> 213 </Configuration>
214 214
215 <!-- One of the projects that is included in the Solution --> 215 <!-- One of the projects that is included in the Solution -->
216 <Project name="RealmForge.Utility" Language="VisualBasic" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge"> 216 <Project name="RealmForge.Utility" Language="VisualBasic" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge">
217 <Configuration name="Debug"> 217 <Configuration name="Debug">
218 <Options> 218 <Options>
219 <OutputPath>..\bin\lib\Utility</OutputPath> 219 <OutputPath>..\bin\lib\Utility</OutputPath>
220 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile> 220 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
221 </Options> 221 </Options>
222 </Configuration> 222 </Configuration>
223 <Configuration name="Release"> 223 <Configuration name="Release">
224 <Options> 224 <Options>
225 <OutputPath>..\bin\lib\Utility</OutputPath> 225 <OutputPath>..\bin\lib\Utility</OutputPath>
226 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile> 226 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
227 </Options> 227 </Options>
228 </Configuration> 228 </Configuration>
229 <ReferencePath>../bin</ReferencePath> 229 <ReferencePath>../bin</ReferencePath>
230 <Reference name="System"/> 230 <Reference name="System"/>
231 <Reference name="System.Data"/> 231 <Reference name="System.Data"/>
232 <Reference name="System.Drawing"/> 232 <Reference name="System.Drawing"/>
233 <Reference name="System.Xml"/> 233 <Reference name="System.Xml"/>
234 <Reference name="System.Runtime.Serialization.Formatters.Soap"/> 234 <Reference name="System.Runtime.Serialization.Formatters.Soap"/>
235 <Reference name="ICSharpCode.SharpZipLib"/> 235 <Reference name="ICSharpCode.SharpZipLib"/>
236 <Files> 236 <Files>
237 <Match path="." pattern="*.vb" recurse="true"/> 237 <Match path="." pattern="*.vb" recurse="true"/>
238 </Files> 238 </Files>
239 </Project> 239 </Project>
240 240
241 <!-- Another projects that is included in the Solution --> 241 <!-- Another projects that is included in the Solution -->
242 <Project name="DemoGame" Language="C#" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge"> 242 <Project name="DemoGame" Language="C#" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge">
243 <!-- icon is used to define the location of the .ico file that is embeeded in the assembly when the project is compiled. This is relative to the project path --> 243 <!-- icon is used to define the location of the .ico file that is embeeded in the assembly when the project is compiled. This is relative to the project path -->
244 <!--type defines the type of project, valid types are Library (.dll), WinExe (.exe), and Exe (.exe). WinExe is not windows specific, it just defines that it is a GUI application and that no Console or Command window will show when it is started--> 244 <!--type defines the type of project, valid types are Library (.dll), WinExe (.exe), and Exe (.exe). WinExe is not windows specific, it just defines that it is a GUI application and that no Console or Command window will show when it is started-->
245 245
246 <Configuration name="Debug"> 246 <Configuration name="Debug">
247 <Options> 247 <Options>
248 <OutputPath>..\bin</OutputPath> 248 <OutputPath>..\bin</OutputPath>
249 <XmlDocFile>DemoGame.xml</XmlDocFile> 249 <XmlDocFile>DemoGame.xml</XmlDocFile>
250 </Options> 250 </Options>
251 </Configuration> 251 </Configuration>
252 <Configuration name="Release"> 252 <Configuration name="Release">
253 <Options> 253 <Options>
254 <OutputPath>..\bin</OutputPath> 254 <OutputPath>..\bin</OutputPath>
255 <XmlDocFile>DemoGame.xml</XmlDocFile> 255 <XmlDocFile>DemoGame.xml</XmlDocFile>
256 </Options> 256 </Options>
257 </Configuration> 257 </Configuration>
258 <ReferencePath>../bin</ReferencePath> 258 <ReferencePath>../bin</ReferencePath>
259 <Reference name="System"/> <!-- Assemblies that are located in the GAC (installed, global) can be referenced--> 259 <Reference name="System"/> <!-- Assemblies that are located in the GAC (installed, global) can be referenced-->
260 <Reference name="ode"/> <!-- Assemblies that are located in the output directory to which the file is built can be referenced --> 260 <Reference name="ode"/> <!-- Assemblies that are located in the output directory to which the file is built can be referenced -->
261 <Reference name="RealmForge.Utility"/> <!-- When you reference the name of another project, then that project (and it's output) will be referenced instead of looking for a pre-built assembly--> 261 <Reference name="RealmForge.Utility"/> <!-- When you reference the name of another project, then that project (and it's output) will be referenced instead of looking for a pre-built assembly-->
262 <Files> 262 <Files>
263 <Match path="." pattern="*.cs" recurse="true"/> 263 <Match path="." pattern="*.cs" recurse="true"/>
264 <Match path="." pattern="*.bmp" recurse="true" buildAction="EmbeddedResource"/> 264 <Match path="." pattern="*.bmp" recurse="true" buildAction="EmbeddedResource"/>
265 <Match path="." pattern="[^a]*\.(png|jpg)" useRegex="true" buildAction="EmbeddedResource"/> 265 <Match path="." pattern="[^a]*\.(png|jpg)" useRegex="true" buildAction="EmbeddedResource"/>
266 266
267 <!-- Uses a regex or regular expression to find all files that end with .png or .jpg but dont have the letter 'a' in their name and add them to the project as EmbeddedResource's. Because recurse enabled (default is false), only the values in the files in that are directly in the project directory (not child directories) are checked.--> 267 <!-- Uses a regex or regular expression to find all files that end with .png or .jpg but dont have the letter 'a' in their name and add them to the project as EmbeddedResource's. Because recurse enabled (default is false), only the values in the files in that are directly in the project directory (not child directories) are checked.-->
268 <!--EmbeddedResource, Content, and Compile are valid buildAction's--> 268 <!--EmbeddedResource, Content, and Compile are valid buildAction's-->
269 </Files> 269 </Files>
270 </Project> 270 </Project>
271 271
272 </Solution> 272 </Solution>
273</Prebuild> 273</Prebuild>
274 274
diff --git a/Prebuild/prebuild.xml b/Prebuild/prebuild.xml
index d14b94f..588d788 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.9.xsd" version="1.9"> 2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd" version="1.9">
3 <Solution name="Prebuild" version="2.0.4"> 3 <Solution name="Prebuild" version="2.0.5">
4 <Configuration name="Debug"> 4 <Configuration name="Debug">
5 <Options> 5 <Options>
6 <CompilerDefines>DEBUG;TRACE</CompilerDefines> 6 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
@@ -31,13 +31,15 @@
31 type="Exe" 31 type="Exe"
32 rootNamespace="Prebuild" 32 rootNamespace="Prebuild"
33 startupObject="Prebuild.Prebuild" 33 startupObject="Prebuild.Prebuild"
34 version="2.0.3" 34 version="2.0.5"
35 frameworkVersion="v3_5"
35 > 36 >
36 <Author>Matthew Holmes (matthew@wildfiregames.com)</Author> 37 <Author>Matthew Holmes (matthew@wildfiregames.com)</Author>
37 <Author>Dan Moorehead (dan05a@gmail.com)</Author> 38 <Author>Dan Moorehead (dan05a@gmail.com)</Author>
38 <Author>Dave Hudson (jendave@yahoo.com)</Author> 39 <Author>Dave Hudson (jendave@yahoo.com)</Author>
39 <Author>Rob Loach (http://robloach.net)</Author> 40 <Author>Rob Loach (http://robloach.net)</Author>
40 <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author> 41 <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author>
42 <Author>John Hurliman (john.hurliman@intel.com)</Author>
41 <Description>The Prebuild project generator</Description> 43 <Description>The Prebuild project generator</Description>
42 <Configuration name="Debug"> 44 <Configuration name="Debug">
43 <Options> 45 <Options>
diff --git a/Prebuild/scripts/SharpDevelop2.bat b/Prebuild/scripts/SharpDevelop2.bat
index 49120ab..4ca0272 100755
--- a/Prebuild/scripts/SharpDevelop2.bat
+++ b/Prebuild/scripts/SharpDevelop2.bat
@@ -1,4 +1,4 @@
1@rem Generates a combine (.cmbx) and a set of project files (.prjx) 1@rem Generates a combine (.cmbx) and a set of project files (.prjx)
2@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx) 2@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
3cd .. 3cd ..
4Prebuild.exe /target sharpdev2 /file prebuild.xml /pause 4Prebuild.exe /target sharpdev2 /file prebuild.xml /pause
diff --git a/Prebuild/scripts/VS2008.bat b/Prebuild/scripts/VS2008.bat
index eb51a82..b465668 100755
--- a/Prebuild/scripts/VS2008.bat
+++ b/Prebuild/scripts/VS2008.bat
@@ -1,4 +1,4 @@
1@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.) 1@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
2@rem for Microsoft Visual Studio .NET 2008 2@rem for Microsoft Visual Studio .NET 2008
3cd .. 3cd ..
4Prebuild.exe /target vs2008 /file prebuild.xml /pause 4Prebuild.exe /target vs2008 /file prebuild.xml /pause
diff --git a/Prebuild/scripts/VS2010.bat b/Prebuild/scripts/VS2010.bat
index 1b98818..87676ac 100644
--- a/Prebuild/scripts/VS2010.bat
+++ b/Prebuild/scripts/VS2010.bat
@@ -1,4 +1,4 @@
1@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.) 1@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
2@rem for Microsoft Visual Studio .NET 2010 2@rem for Microsoft Visual Studio .NET 2010
3cd .. 3cd ..
4Prebuild.exe /target vs2010 /file prebuild.xml /pause 4Prebuild.exe /target vs2010 /file prebuild.xml /pause
diff --git a/Prebuild/scripts/autotools.bat b/Prebuild/scripts/autotools.bat
index 43f9a74..1fd3469 100755
--- a/Prebuild/scripts/autotools.bat
+++ b/Prebuild/scripts/autotools.bat
@@ -1,4 +1,4 @@
1@rem Generates Makefiles 1@rem Generates Makefiles
2@rem for autotools 2@rem for autotools
3cd .. 3cd ..
4Prebuild.exe /target autotools /file prebuild.xml /pause 4Prebuild.exe /target autotools /file prebuild.xml /pause
diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs
index 71405f9..dc2da9a 100644
--- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs
+++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs
@@ -1,80 +1,80 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) 3Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided 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
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26using System; 26using System;
27using System.Collections.Generic; 27using System.Collections.Generic;
28using System.Xml; 28using System.Xml;
29 29
30using Prebuild.Core.Attributes; 30using Prebuild.Core.Attributes;
31using Prebuild.Core.Interfaces; 31using Prebuild.Core.Interfaces;
32using Prebuild.Core.Utilities; 32using Prebuild.Core.Utilities;
33 33
34namespace Prebuild.Core.Nodes 34namespace Prebuild.Core.Nodes
35{ 35{
36 [DataNode("CleanFiles")] 36 [DataNode("CleanFiles")]
37 public class CleanFilesNode : DataNode 37 public class CleanFilesNode : DataNode
38 { 38 {
39 #region Fields 39 #region Fields
40 40
41 private string m_Pattern; 41 private string m_Pattern;
42 42
43 #endregion 43 #endregion
44 44
45 #region Properties 45 #region Properties
46 46
47 /// <summary> 47 /// <summary>
48 /// Gets the signature. 48 /// Gets the signature.
49 /// </summary> 49 /// </summary>
50 /// <value>The signature.</value> 50 /// <value>The signature.</value>
51 public string Pattern 51 public string Pattern
52 { 52 {
53 get 53 get
54 { 54 {
55 return m_Pattern; 55 return m_Pattern;
56 } 56 }
57 } 57 }
58 58
59 #endregion 59 #endregion
60 60
61 #region Public Methods 61 #region Public Methods
62 62
63 /// <summary> 63 /// <summary>
64 /// Parses the specified node. 64 /// Parses the specified node.
65 /// </summary> 65 /// </summary>
66 /// <param name="node">The node.</param> 66 /// <param name="node">The node.</param>
67 public override void Parse(XmlNode node) 67 public override void Parse(XmlNode node)
68 { 68 {
69 if (node == null) 69 if (node == null)
70 { 70 {
71 throw new ArgumentNullException("node"); 71 throw new ArgumentNullException("node");
72 } 72 }
73 73
74 m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; 74 m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ;
75 m_Pattern = m_Pattern.Trim(); 75 m_Pattern = m_Pattern.Trim();
76 } 76 }
77 77
78 #endregion 78 #endregion
79 } 79 }
80} \ No newline at end of file 80} \ No newline at end of file
diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs
index b8131b0..a9b77eb 100644
--- a/Prebuild/src/Core/Nodes/CleanupNode.cs
+++ b/Prebuild/src/Core/Nodes/CleanupNode.cs
@@ -1,85 +1,85 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) 3Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided 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
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26using System; 26using System;
27using System.Collections.Generic; 27using System.Collections.Generic;
28using System.Xml; 28using System.Xml;
29 29
30using Prebuild.Core.Attributes; 30using Prebuild.Core.Attributes;
31using Prebuild.Core.Interfaces; 31using Prebuild.Core.Interfaces;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
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 {
75 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 75 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
76 if (dataNode is CleanFilesNode) 76 if (dataNode is CleanFilesNode)
77 { 77 {
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/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
index 1c38d9e..7c59ac5 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
@@ -1,71 +1,71 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided 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
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26using System.Collections.Generic; 26using System.Collections.Generic;
27 27
28namespace Prebuild.Core.Nodes 28namespace 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/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs
index 278ecd8..20095c3 100644
--- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs
+++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs
@@ -1,93 +1,93 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.Xml; 4using System.Xml;
5 5
6using Prebuild.Core.Attributes; 6using Prebuild.Core.Attributes;
7using Prebuild.Core.Interfaces; 7using Prebuild.Core.Interfaces;
8using Prebuild.Core.Utilities; 8using Prebuild.Core.Utilities;
9 9
10namespace Prebuild.Core.Nodes 10namespace Prebuild.Core.Nodes
11{ 11{
12 [DataNode("DatabaseProject")] 12 [DataNode("DatabaseProject")]
13 public class DatabaseProjectNode : DataNode 13 public class DatabaseProjectNode : DataNode
14 { 14 {
15 string name; 15 string name;
16 string path; 16 string path;
17 string fullpath; 17 string fullpath;
18 Guid guid = Guid.NewGuid(); 18 Guid guid = Guid.NewGuid();
19 readonly List<AuthorNode> authors = new List<AuthorNode>(); 19 readonly List<AuthorNode> authors = new List<AuthorNode>();
20 readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>(); 20 readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>();
21 21
22 public Guid Guid 22 public Guid Guid
23 { 23 {
24 get { return guid; } 24 get { return guid; }
25 } 25 }
26 26
27 public string Name 27 public string Name
28 { 28 {
29 get { return name; } 29 get { return name; }
30 } 30 }
31 31
32 public string Path 32 public string Path
33 { 33 {
34 get { return path; } 34 get { return path; }
35 } 35 }
36 36
37 public string FullPath 37 public string FullPath
38 { 38 {
39 get { return fullpath; } 39 get { return fullpath; }
40 } 40 }
41 41
42 public IEnumerable<DatabaseReferenceNode> References 42 public IEnumerable<DatabaseReferenceNode> References
43 { 43 {
44 get { return references; } 44 get { return references; }
45 } 45 }
46 46
47 public override void Parse(XmlNode node) 47 public override void Parse(XmlNode node)
48 { 48 {
49 name = Helper.AttributeValue(node, "name", name); 49 name = Helper.AttributeValue(node, "name", name);
50 path = Helper.AttributeValue(node, "path", name); 50 path = Helper.AttributeValue(node, "path", name);
51 51
52 try 52 try
53 { 53 {
54 fullpath = Helper.ResolvePath(path); 54 fullpath = Helper.ResolvePath(path);
55 } 55 }
56 catch 56 catch
57 { 57 {
58 throw new WarningException("Could not resolve Solution path: {0}", path); 58 throw new WarningException("Could not resolve Solution path: {0}", path);
59 } 59 }
60 60
61 Kernel.Instance.CurrentWorkingDirectory.Push(); 61 Kernel.Instance.CurrentWorkingDirectory.Push();
62 62
63 try 63 try
64 { 64 {
65 Helper.SetCurrentDir(fullpath); 65 Helper.SetCurrentDir(fullpath);
66 66
67 if (node == null) 67 if (node == null)
68 { 68 {
69 throw new ArgumentNullException("node"); 69 throw new ArgumentNullException("node");
70 } 70 }
71 71
72 foreach (XmlNode child in node.ChildNodes) 72 foreach (XmlNode child in node.ChildNodes)
73 { 73 {
74 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 74 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
75 75
76 if (dataNode == null) 76 if (dataNode == null)
77 continue; 77 continue;
78 78
79 if (dataNode is AuthorNode) 79 if (dataNode is AuthorNode)
80 authors.Add((AuthorNode)dataNode); 80 authors.Add((AuthorNode)dataNode);
81 else if (dataNode is DatabaseReferenceNode) 81 else if (dataNode is DatabaseReferenceNode)
82 references.Add((DatabaseReferenceNode)dataNode); 82 references.Add((DatabaseReferenceNode)dataNode);
83 } 83 }
84 } 84 }
85 finally 85 finally
86 { 86 {
87 Kernel.Instance.CurrentWorkingDirectory.Pop(); 87 Kernel.Instance.CurrentWorkingDirectory.Pop();
88 } 88 }
89 89
90 base.Parse(node); 90 base.Parse(node);
91 } 91 }
92 } 92 }
93} 93}
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
index 845db24..97c3964 100644
--- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
+++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
@@ -1,63 +1,63 @@
1using System; 1using System;
2using Prebuild.Core.Attributes; 2using Prebuild.Core.Attributes;
3using Prebuild.Core.Utilities; 3using Prebuild.Core.Utilities;
4 4
5namespace Prebuild.Core.Nodes 5namespace Prebuild.Core.Nodes
6{ 6{
7 [DataNode("DatabaseReference")] 7 [DataNode("DatabaseReference")]
8 public class DatabaseReferenceNode : DataNode 8 public class DatabaseReferenceNode : DataNode
9 { 9 {
10 string name; 10 string name;
11 Guid providerId; 11 Guid providerId;
12 string connectionString; 12 string connectionString;
13 13
14 public string Name 14 public string Name
15 { 15 {
16 get { return name; } 16 get { return name; }
17 } 17 }
18 18
19 public Guid ProviderId 19 public Guid ProviderId
20 { 20 {
21 get { return providerId; } 21 get { return providerId; }
22 } 22 }
23 23
24 public string ConnectionString 24 public string ConnectionString
25 { 25 {
26 get { return connectionString; } 26 get { return connectionString; }
27 } 27 }
28 28
29 public override void Parse(System.Xml.XmlNode node) 29 public override void Parse(System.Xml.XmlNode node)
30 { 30 {
31 name = Helper.AttributeValue(node, "name", name); 31 name = Helper.AttributeValue(node, "name", name);
32 32
33 string providerName = Helper.AttributeValue(node, "providerName", string.Empty); 33 string providerName = Helper.AttributeValue(node, "providerName", string.Empty);
34 if (providerName != null) 34 if (providerName != null)
35 { 35 {
36 switch (providerName) 36 switch (providerName)
37 { 37 {
38 // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\* 38 // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\*
39 // Not sure if these will help other operating systems, or if there's a better way. 39 // Not sure if these will help other operating systems, or if there's a better way.
40 case "Microsoft.SqlServerCe.Client.3.5": 40 case "Microsoft.SqlServerCe.Client.3.5":
41 providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; 41 providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break;
42 case "System.Data.OleDb": 42 case "System.Data.OleDb":
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);
61 } 61 }
62 } 62 }
63} 63}
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs
index 01cea1e..b313ffa 100644
--- a/Prebuild/src/Core/Nodes/FileNode.cs
+++ b/Prebuild/src/Core/Nodes/FileNode.cs
@@ -62,7 +62,11 @@ namespace Prebuild.Core.Nodes
62 /// <summary> 62 /// <summary>
63 /// 63 ///
64 /// </summary> 64 /// </summary>
65 Page 65 Page,
66 /// <summary>
67 ///
68 /// </summary>
69 Copy
66 } 70 }
67 71
68 /// <summary> 72 /// <summary>
@@ -245,6 +249,9 @@ namespace Prebuild.Core.Nodes
245 if (subType != String.Empty) 249 if (subType != String.Empty)
246 m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); 250 m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
247 251
252 Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction);
253
254
248 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 255 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
249 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 256 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
250 if ( this.m_Link == true ) 257 if ( this.m_Link == true )
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs
index 23a716c..16658f3 100644
--- a/Prebuild/src/Core/Nodes/FilesNode.cs
+++ b/Prebuild/src/Core/Nodes/FilesNode.cs
@@ -25,6 +25,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
25 25
26using System; 26using System;
27using System.Collections.Generic; 27using System.Collections.Generic;
28using System.Collections.Specialized;
28using System.Xml; 29using System.Xml;
29 30
30using Prebuild.Core.Attributes; 31using Prebuild.Core.Attributes;
@@ -49,6 +50,8 @@ namespace Prebuild.Core.Nodes
49 private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); 50 private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>();
50 private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); 51 private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>();
51 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>();
54 private readonly NameValueCollection m_CopyFiles = new NameValueCollection();
52 55
53 #endregion 56 #endregion
54 57
@@ -62,6 +65,16 @@ namespace Prebuild.Core.Nodes
62 } 65 }
63 } 66 }
64 67
68 public string[] Destinations
69 {
70 get { return m_CopyFiles.AllKeys; }
71 }
72
73 public int CopyFiles
74 {
75 get { return m_CopyFiles.Count; }
76 }
77
65 #endregion 78 #endregion
66 79
67 #region Public Methods 80 #region Public Methods
@@ -76,6 +89,20 @@ namespace Prebuild.Core.Nodes
76 return m_BuildActions[file]; 89 return m_BuildActions[file];
77 } 90 }
78 91
92 public string GetDestinationPath(string file)
93 {
94 if( !m_DestinationPath.ContainsKey(file))
95 {
96 return null;
97 }
98 return m_DestinationPath[file];
99 }
100
101 public string[] SourceFiles(string dest)
102 {
103 return m_CopyFiles.GetValues(dest);
104 }
105
79 public CopyToOutput GetCopyToOutput(string file) 106 public CopyToOutput GetCopyToOutput(string file)
80 { 107 {
81 if (!m_CopyToOutputs.ContainsKey(file)) 108 if (!m_CopyToOutputs.ContainsKey(file))
@@ -178,6 +205,13 @@ namespace Prebuild.Core.Nodes
178 m_BuildActions[file] = GetBuildActionByFileName(file); 205 m_BuildActions[file] = GetBuildActionByFileName(file);
179 else 206 else
180 m_BuildActions[file] = matchNode.BuildAction.Value; 207 m_BuildActions[file] = matchNode.BuildAction.Value;
208
209 if (matchNode.BuildAction == BuildAction.Copy)
210 {
211 m_CopyFiles.Add(matchNode.DestinationPath, file);
212 m_DestinationPath[file] = matchNode.DestinationPath;
213 }
214
181 m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; 215 m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value;
182 m_ResourceNames[ file ] = matchNode.ResourceName; 216 m_ResourceNames[ file ] = matchNode.ResourceName;
183 m_PreservePaths[ file ] = matchNode.PreservePath; 217 m_PreservePaths[ file ] = matchNode.PreservePath;
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs
index 9735265..000bde9 100644
--- a/Prebuild/src/Core/Nodes/MatchNode.cs
+++ b/Prebuild/src/Core/Nodes/MatchNode.cs
@@ -52,6 +52,7 @@ namespace Prebuild.Core.Nodes
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 readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); 56 private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>();
56 57
57 #endregion 58 #endregion
@@ -80,6 +81,13 @@ namespace Prebuild.Core.Nodes
80 } 81 }
81 } 82 }
82 83
84 public string DestinationPath
85 {
86 get
87 {
88 return m_Destination;
89 }
90 }
83 /// <summary> 91 /// <summary>
84 /// 92 ///
85 /// </summary> 93 /// </summary>
@@ -285,12 +293,14 @@ namespace Prebuild.Core.Nodes
285 } 293 }
286 string path = Helper.AttributeValue(node, "path", "."); 294 string path = Helper.AttributeValue(node, "path", ".");
287 string pattern = Helper.AttributeValue(node, "pattern", "*"); 295 string pattern = Helper.AttributeValue(node, "pattern", "*");
296 string destination = Helper.AttributeValue(node, "destination", string.Empty);
288 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"));
289 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"));
290 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); 299 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
291 if (buildAction != string.Empty) 300 if (buildAction != string.Empty)
292 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); 301 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
293 302
303
294 //TODO: Figure out where the subtype node is being assigned 304 //TODO: Figure out where the subtype node is being assigned
295 //string subType = Helper.AttributeValue(node, "subType", string.Empty); 305 //string subType = Helper.AttributeValue(node, "subType", string.Empty);
296 //if (subType != String.Empty) 306 //if (subType != String.Empty)
@@ -304,11 +314,12 @@ namespace Prebuild.Core.Nodes
304 } 314 }
305 m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); 315 m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) );
306 316
317 if ( buildAction == "Copy")
318 m_Destination = destination;
307 319
308 if(path != null && path.Length == 0) 320 if(path != null && path.Length == 0)
309 {
310 path = ".";//use current directory 321 path = ".";//use current directory
311 } 322
312 //throw new WarningException("Match must have a 'path' attribute"); 323 //throw new WarningException("Match must have a 'path' attribute");
313 324
314 if(pattern == null) 325 if(pattern == null)
diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
index 485e4dd..e46b5a5 100644
--- a/Prebuild/src/Core/Targets/AutotoolsTarget.cs
+++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
@@ -1,1070 +1,1070 @@
1#region BSD License 1#region BSD License
2/* 2/*
3 3
4Copyright (c) 2004 - 2008 4Copyright (c) 2004 - 2008
5Matthew Holmes (matthew@wildfiregames.com), 5Matthew Holmes (matthew@wildfiregames.com),
6Dan Moorehead (dan05a@gmail.com), 6Dan Moorehead (dan05a@gmail.com),
7Dave Hudson (jendave@yahoo.com), 7Dave Hudson (jendave@yahoo.com),
8C.J. Adams-Collier (cjac@colliertech.org), 8C.J. Adams-Collier (cjac@colliertech.org),
9 9
10Redistribution and use in source and binary forms, with or without 10Redistribution and use in source and binary forms, with or without
11modification, are permitted provided that the following conditions are 11modification, are permitted provided that the following conditions are
12met: 12met:
13 13
14* Redistributions of source code must retain the above copyright 14* Redistributions of source code must retain the above copyright
15notice, this list of conditions and the following disclaimer. 15notice, this list of conditions and the following disclaimer.
16 16
17* Redistributions in binary form must reproduce the above copyright 17* Redistributions in binary form must reproduce the above copyright
18notice, this list of conditions and the following disclaimer in the 18notice, this list of conditions and the following disclaimer in the
19documentation and/or other materials provided with the distribution. 19documentation and/or other materials provided with the distribution.
20 20
21* The name of the author may not be used to endorse or promote 21* The name of the author may not be used to endorse or promote
22products derived from this software without specific prior written 22products derived from this software without specific prior written
23permission. 23permission.
24 24
25THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 25THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 28DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 32HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 33STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35POSSIBILITY OF SUCH DAMAGE. 35POSSIBILITY OF SUCH DAMAGE.
36 36
37*/ 37*/
38#endregion 38#endregion
39 39
40#region MIT X11 license 40#region MIT X11 license
41 41
42/* 42/*
43 Portions of this file authored by Lluis Sanchez Gual 43 Portions of this file authored by Lluis Sanchez Gual
44 44
45 Copyright (C) 2006 Novell, Inc (http://www.novell.com) 45 Copyright (C) 2006 Novell, Inc (http://www.novell.com)
46 46
47 Permission is hereby granted, free of charge, to any person obtaining 47 Permission is hereby granted, free of charge, to any person obtaining
48 a copy of this software and associated documentation files (the 48 a copy of this software and associated documentation files (the
49 "Software"), to deal in the Software without restriction, including 49 "Software"), to deal in the Software without restriction, including
50 without limitation the rights to use, copy, modify, merge, publish, 50 without limitation the rights to use, copy, modify, merge, publish,
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
61 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 61 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
62 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 62 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
63 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 63 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
64 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65 */ 65 */
66 66
67#endregion 67#endregion
68using System; 68using System;
69using System.Collections.Generic; 69using System.Collections.Generic;
70using System.IO; 70using System.IO;
71using System.Reflection; 71using System.Reflection;
72using System.Text; 72using System.Text;
73using System.Text.RegularExpressions; 73using System.Text.RegularExpressions;
74using System.Xml; 74using System.Xml;
75using System.Xml.Xsl; 75using System.Xml.Xsl;
76using System.Net; 76using System.Net;
77using System.Diagnostics; 77using System.Diagnostics;
78 78
79using Prebuild.Core.Attributes; 79using Prebuild.Core.Attributes;
80using Prebuild.Core.Interfaces; 80using Prebuild.Core.Interfaces;
81using Prebuild.Core.Nodes; 81using Prebuild.Core.Nodes;
82using Prebuild.Core.Utilities; 82using Prebuild.Core.Utilities;
83 83
84namespace Prebuild.Core.Targets 84namespace Prebuild.Core.Targets
85{ 85{
86 public enum ClrVersion 86 public enum ClrVersion
87 { 87 {
88 Default, 88 Default,
89 Net_1_1, 89 Net_1_1,
90 Net_2_0 90 Net_2_0
91 } 91 }
92 92
93 public class SystemPackage 93 public class SystemPackage
94 { 94 {
95 string name; 95 string name;
96 string version; 96 string version;
97 string description; 97 string description;
98 string[] assemblies; 98 string[] assemblies;
99 bool isInternal; 99 bool isInternal;
100 ClrVersion targetVersion; 100 ClrVersion targetVersion;
101 101
102 public void Initialize(string name, 102 public void Initialize(string name,
103 string version, 103 string version,
104 string description, 104 string description,
105 string[] assemblies, 105 string[] assemblies,
106 ClrVersion targetVersion, 106 ClrVersion targetVersion,
107 bool isInternal) 107 bool isInternal)
108 { 108 {
109 this.isInternal = isInternal; 109 this.isInternal = isInternal;
110 this.name = name; 110 this.name = name;
111 this.version = version; 111 this.version = version;
112 this.assemblies = assemblies; 112 this.assemblies = assemblies;
113 this.description = description; 113 this.description = description;
114 this.targetVersion = targetVersion; 114 this.targetVersion = targetVersion;
115 } 115 }
116 116
117 public string Name 117 public string Name
118 { 118 {
119 get { return name; } 119 get { return name; }
120 } 120 }
121 121
122 public string Version 122 public string Version
123 { 123 {
124 get { return version; } 124 get { return version; }
125 } 125 }
126 126
127 public string Description 127 public string Description
128 { 128 {
129 get { return description; } 129 get { return description; }
130 } 130 }
131 131
132 public ClrVersion TargetVersion 132 public ClrVersion TargetVersion
133 { 133 {
134 get { return targetVersion; } 134 get { return targetVersion; }
135 } 135 }
136 136
137 // The package is part of the mono SDK 137 // The package is part of the mono SDK
138 public bool IsCorePackage 138 public bool IsCorePackage
139 { 139 {
140 get { return name == "mono"; } 140 get { return name == "mono"; }
141 } 141 }
142 142
143 // The package has been registered by an add-in, and is not installed 143 // The package has been registered by an add-in, and is not installed
144 // in the system. 144 // in the system.
145 public bool IsInternalPackage 145 public bool IsInternalPackage
146 { 146 {
147 get { return isInternal; } 147 get { return isInternal; }
148 } 148 }
149 149
150 public string[] Assemblies 150 public string[] Assemblies
151 { 151 {
152 get { return assemblies; } 152 get { return assemblies; }
153 } 153 }
154 154
155 } 155 }
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
163 { 163 {
164 #region Fields 164 #region Fields
165 165
166 Kernel m_Kernel; 166 Kernel m_Kernel;
167 XmlDocument autotoolsDoc; 167 XmlDocument autotoolsDoc;
168 XmlUrlResolver xr; 168 XmlUrlResolver xr;
169 System.Security.Policy.Evidence e; 169 System.Security.Policy.Evidence e;
170 readonly Dictionary<string, SystemPackage> assemblyPathToPackage = new Dictionary<string, SystemPackage>(); 170 readonly Dictionary<string, SystemPackage> assemblyPathToPackage = new Dictionary<string, SystemPackage>();
171 readonly Dictionary<string, string> assemblyFullNameToPath = new Dictionary<string, string>(); 171 readonly Dictionary<string, string> assemblyFullNameToPath = new Dictionary<string, string>();
172 readonly Dictionary<string, SystemPackage> packagesHash = new Dictionary<string, SystemPackage>(); 172 readonly Dictionary<string, SystemPackage> packagesHash = new Dictionary<string, SystemPackage>();
173 readonly List<SystemPackage> packages = new List<SystemPackage>(); 173 readonly List<SystemPackage> packages = new List<SystemPackage>();
174 174
175 #endregion 175 #endregion
176 176
177 #region Private Methods 177 #region Private Methods
178 178
179 private static void mkdirDashP(string dirName) 179 private static void mkdirDashP(string dirName)
180 { 180 {
181 DirectoryInfo di = new DirectoryInfo(dirName); 181 DirectoryInfo di = new DirectoryInfo(dirName);
182 if (di.Exists) 182 if (di.Exists)
183 return; 183 return;
184 184
185 string parentDirName = System.IO.Path.GetDirectoryName(dirName); 185 string parentDirName = System.IO.Path.GetDirectoryName(dirName);
186 DirectoryInfo parentDi = new DirectoryInfo(parentDirName); 186 DirectoryInfo parentDi = new DirectoryInfo(parentDirName);
187 if (!parentDi.Exists) 187 if (!parentDi.Exists)
188 mkdirDashP(parentDirName); 188 mkdirDashP(parentDirName);
189 189
190 di.Create(); 190 di.Create();
191 } 191 }
192 192
193 private static void chkMkDir(string dirName) 193 private static void chkMkDir(string dirName)
194 { 194 {
195 System.IO.DirectoryInfo di = 195 System.IO.DirectoryInfo di =
196 new System.IO.DirectoryInfo(dirName); 196 new System.IO.DirectoryInfo(dirName);
197 197
198 if (!di.Exists) 198 if (!di.Exists)
199 di.Create(); 199 di.Create();
200 } 200 }
201 201
202 private void transformToFile(string filename, XsltArgumentList argList, string nodeName) 202 private void transformToFile(string filename, XsltArgumentList argList, string nodeName)
203 { 203 {
204 // Create an XslTransform for this file 204 // Create an XslTransform for this file
205 XslTransform templateTransformer = 205 XslTransform templateTransformer =
206 new XslTransform(); 206 new XslTransform();
207 207
208 // Load up the template 208 // Load up the template
209 XmlNode templateNode = 209 XmlNode templateNode =
210 autotoolsDoc.SelectSingleNode(nodeName + "/*"); 210 autotoolsDoc.SelectSingleNode(nodeName + "/*");
211 templateTransformer.Load(templateNode.CreateNavigator(), xr, e); 211 templateTransformer.Load(templateNode.CreateNavigator(), xr, e);
212 212
213 // Create a writer for the transformed template 213 // Create a writer for the transformed template
214 XmlTextWriter templateWriter = 214 XmlTextWriter templateWriter =
215 new XmlTextWriter(filename, null); 215 new XmlTextWriter(filename, null);
216 216
217 // Perform transformation, writing the file 217 // Perform transformation, writing the file
218 templateTransformer.Transform 218 templateTransformer.Transform
219 (m_Kernel.CurrentDoc, argList, templateWriter, xr); 219 (m_Kernel.CurrentDoc, argList, templateWriter, xr);
220 } 220 }
221 221
222 static string NormalizeAsmName(string name) 222 static string NormalizeAsmName(string name)
223 { 223 {
224 int i = name.IndexOf(", PublicKeyToken=null"); 224 int i = name.IndexOf(", PublicKeyToken=null");
225 if (i != -1) 225 if (i != -1)
226 return name.Substring(0, i).Trim(); 226 return name.Substring(0, i).Trim();
227 return name; 227 return name;
228 } 228 }
229 229
230 private void AddAssembly(string assemblyfile, SystemPackage package) 230 private void AddAssembly(string assemblyfile, SystemPackage package)
231 { 231 {
232 if (!File.Exists(assemblyfile)) 232 if (!File.Exists(assemblyfile))
233 return; 233 return;
234 234
235 try 235 try
236 { 236 {
237 System.Reflection.AssemblyName an = System.Reflection.AssemblyName.GetAssemblyName(assemblyfile); 237 System.Reflection.AssemblyName an = System.Reflection.AssemblyName.GetAssemblyName(assemblyfile);
238 assemblyFullNameToPath[NormalizeAsmName(an.FullName)] = assemblyfile; 238 assemblyFullNameToPath[NormalizeAsmName(an.FullName)] = assemblyfile;
239 assemblyPathToPackage[assemblyfile] = package; 239 assemblyPathToPackage[assemblyfile] = package;
240 } 240 }
241 catch 241 catch
242 { 242 {
243 } 243 }
244 } 244 }
245 245
246 private static List<string> GetAssembliesWithLibInfo(string line, string file) 246 private static List<string> GetAssembliesWithLibInfo(string line, string file)
247 { 247 {
248 List<string> references = new List<string>(); 248 List<string> references = new List<string>();
249 List<string> libdirs = new List<string>(); 249 List<string> libdirs = new List<string>();
250 List<string> retval = new List<string>(); 250 List<string> retval = new List<string>();
251 foreach (string piece in line.Split(' ')) 251 foreach (string piece in line.Split(' '))
252 { 252 {
253 if (piece.ToLower().Trim().StartsWith("/r:") || piece.ToLower().Trim().StartsWith("-r:")) 253 if (piece.ToLower().Trim().StartsWith("/r:") || piece.ToLower().Trim().StartsWith("-r:"))
254 { 254 {
255 references.Add(ProcessPiece(piece.Substring(3).Trim(), file)); 255 references.Add(ProcessPiece(piece.Substring(3).Trim(), file));
256 } 256 }
257 else if (piece.ToLower().Trim().StartsWith("/lib:") || piece.ToLower().Trim().StartsWith("-lib:")) 257 else if (piece.ToLower().Trim().StartsWith("/lib:") || piece.ToLower().Trim().StartsWith("-lib:"))
258 { 258 {
259 libdirs.Add(ProcessPiece(piece.Substring(5).Trim(), file)); 259 libdirs.Add(ProcessPiece(piece.Substring(5).Trim(), file));
260 } 260 }
261 } 261 }
262 262
263 foreach (string refrnc in references) 263 foreach (string refrnc in references)
264 { 264 {
265 foreach (string libdir in libdirs) 265 foreach (string libdir in libdirs)
266 { 266 {
267 if (File.Exists(libdir + Path.DirectorySeparatorChar + refrnc)) 267 if (File.Exists(libdir + Path.DirectorySeparatorChar + refrnc))
268 { 268 {
269 retval.Add(libdir + Path.DirectorySeparatorChar + refrnc); 269 retval.Add(libdir + Path.DirectorySeparatorChar + refrnc);
270 } 270 }
271 } 271 }
272 } 272 }
273 273
274 return retval; 274 return retval;
275 } 275 }
276 276
277 private static List<string> GetAssembliesWithoutLibInfo(string line, string file) 277 private static List<string> GetAssembliesWithoutLibInfo(string line, string file)
278 { 278 {
279 List<string> references = new List<string>(); 279 List<string> references = new List<string>();
280 foreach (string reference in line.Split(' ')) 280 foreach (string reference in line.Split(' '))
281 { 281 {
282 if (reference.ToLower().Trim().StartsWith("/r:") || reference.ToLower().Trim().StartsWith("-r:")) 282 if (reference.ToLower().Trim().StartsWith("/r:") || reference.ToLower().Trim().StartsWith("-r:"))
283 { 283 {
284 string final_ref = reference.Substring(3).Trim(); 284 string final_ref = reference.Substring(3).Trim();
285 references.Add(ProcessPiece(final_ref, file)); 285 references.Add(ProcessPiece(final_ref, file));
286 } 286 }
287 } 287 }
288 return references; 288 return references;
289 } 289 }
290 290
291 private static string ProcessPiece(string piece, string pcfile) 291 private static string ProcessPiece(string piece, string pcfile)
292 { 292 {
293 int start = piece.IndexOf("${"); 293 int start = piece.IndexOf("${");
294 if (start == -1) 294 if (start == -1)
295 return piece; 295 return piece;
296 296
297 int end = piece.IndexOf("}"); 297 int end = piece.IndexOf("}");
298 if (end == -1) 298 if (end == -1)
299 return piece; 299 return piece;
300 300
301 string variable = piece.Substring(start + 2, end - start - 2); 301 string variable = piece.Substring(start + 2, end - start - 2);
302 string interp = GetVariableFromPkgConfig(variable, Path.GetFileNameWithoutExtension(pcfile)); 302 string interp = GetVariableFromPkgConfig(variable, Path.GetFileNameWithoutExtension(pcfile));
303 return ProcessPiece(piece.Replace("${" + variable + "}", interp), pcfile); 303 return ProcessPiece(piece.Replace("${" + variable + "}", interp), pcfile);
304 } 304 }
305 305
306 private static string GetVariableFromPkgConfig(string var, string pcfile) 306 private static string GetVariableFromPkgConfig(string var, string pcfile)
307 { 307 {
308 ProcessStartInfo psi = new ProcessStartInfo("pkg-config"); 308 ProcessStartInfo psi = new ProcessStartInfo("pkg-config");
309 psi.RedirectStandardOutput = true; 309 psi.RedirectStandardOutput = true;
310 psi.UseShellExecute = false; 310 psi.UseShellExecute = false;
311 psi.Arguments = String.Format("--variable={0} {1}", var, pcfile); 311 psi.Arguments = String.Format("--variable={0} {1}", var, pcfile);
312 Process p = new Process(); 312 Process p = new Process();
313 p.StartInfo = psi; 313 p.StartInfo = psi;
314 p.Start(); 314 p.Start();
315 string ret = p.StandardOutput.ReadToEnd().Trim(); 315 string ret = p.StandardOutput.ReadToEnd().Trim();
316 p.WaitForExit(); 316 p.WaitForExit();
317 if (String.IsNullOrEmpty(ret)) 317 if (String.IsNullOrEmpty(ret))
318 return String.Empty; 318 return String.Empty;
319 return ret; 319 return ret;
320 } 320 }
321 321
322 private void ParsePCFile(string pcfile) 322 private void ParsePCFile(string pcfile)
323 { 323 {
324 // Don't register the package twice 324 // Don't register the package twice
325 string pname = Path.GetFileNameWithoutExtension(pcfile); 325 string pname = Path.GetFileNameWithoutExtension(pcfile);
326 if (packagesHash.ContainsKey(pname)) 326 if (packagesHash.ContainsKey(pname))
327 return; 327 return;
328 328
329 List<string> fullassemblies = null; 329 List<string> fullassemblies = null;
330 string version = ""; 330 string version = "";
331 string desc = ""; 331 string desc = "";
332 332
333 SystemPackage package = new SystemPackage(); 333 SystemPackage package = new SystemPackage();
334 334
335 using (StreamReader reader = new StreamReader(pcfile)) 335 using (StreamReader reader = new StreamReader(pcfile))
336 { 336 {
337 string line; 337 string line;
338 while ((line = reader.ReadLine()) != null) 338 while ((line = reader.ReadLine()) != null)
339 { 339 {
340 string lowerLine = line.ToLower(); 340 string lowerLine = line.ToLower();
341 if (lowerLine.StartsWith("libs:") && lowerLine.IndexOf(".dll") != -1) 341 if (lowerLine.StartsWith("libs:") && lowerLine.IndexOf(".dll") != -1)
342 { 342 {
343 string choppedLine = line.Substring(5).Trim(); 343 string choppedLine = line.Substring(5).Trim();
344 if (choppedLine.IndexOf("-lib:") != -1 || choppedLine.IndexOf("/lib:") != -1) 344 if (choppedLine.IndexOf("-lib:") != -1 || choppedLine.IndexOf("/lib:") != -1)
345 { 345 {
346 fullassemblies = GetAssembliesWithLibInfo(choppedLine, pcfile); 346 fullassemblies = GetAssembliesWithLibInfo(choppedLine, pcfile);
347 } 347 }
348 else 348 else
349 { 349 {
350 fullassemblies = GetAssembliesWithoutLibInfo(choppedLine, pcfile); 350 fullassemblies = GetAssembliesWithoutLibInfo(choppedLine, pcfile);
351 } 351 }
352 } 352 }
353 else if (lowerLine.StartsWith("version:")) 353 else if (lowerLine.StartsWith("version:"))
354 { 354 {
355 // "version:".Length == 8 355 // "version:".Length == 8
356 version = line.Substring(8).Trim(); 356 version = line.Substring(8).Trim();
357 } 357 }
358 else if (lowerLine.StartsWith("description:")) 358 else if (lowerLine.StartsWith("description:"))
359 { 359 {
360 // "description:".Length == 12 360 // "description:".Length == 12
361 desc = line.Substring(12).Trim(); 361 desc = line.Substring(12).Trim();
362 } 362 }
363 } 363 }
364 } 364 }
365 365
366 if (fullassemblies == null) 366 if (fullassemblies == null)
367 return; 367 return;
368 368
369 foreach (string assembly in fullassemblies) 369 foreach (string assembly in fullassemblies)
370 { 370 {
371 AddAssembly(assembly, package); 371 AddAssembly(assembly, package);
372 } 372 }
373 373
374 package.Initialize(pname, 374 package.Initialize(pname,
375 version, 375 version,
376 desc, 376 desc,
377 fullassemblies.ToArray(), 377 fullassemblies.ToArray(),
378 ClrVersion.Default, 378 ClrVersion.Default,
379 false); 379 false);
380 packages.Add(package); 380 packages.Add(package);
381 packagesHash[pname] = package; 381 packagesHash[pname] = package;
382 } 382 }
383 383
384 void RegisterSystemAssemblies(string prefix, string version, ClrVersion ver) 384 void RegisterSystemAssemblies(string prefix, string version, ClrVersion ver)
385 { 385 {
386 SystemPackage package = new SystemPackage(); 386 SystemPackage package = new SystemPackage();
387 List<string> list = new List<string>(); 387 List<string> list = new List<string>();
388 388
389 string dir = Path.Combine(prefix, version); 389 string dir = Path.Combine(prefix, version);
390 if (!Directory.Exists(dir)) 390 if (!Directory.Exists(dir))
391 { 391 {
392 return; 392 return;
393 } 393 }
394 394
395 foreach (string assembly in Directory.GetFiles(dir, "*.dll")) 395 foreach (string assembly in Directory.GetFiles(dir, "*.dll"))
396 { 396 {
397 AddAssembly(assembly, package); 397 AddAssembly(assembly, package);
398 list.Add(assembly); 398 list.Add(assembly);
399 } 399 }
400 400
401 package.Initialize("mono", 401 package.Initialize("mono",
402 version, 402 version,
403 "The Mono runtime", 403 "The Mono runtime",
404 list.ToArray(), 404 list.ToArray(),
405 ver, 405 ver,
406 false); 406 false);
407 packages.Add(package); 407 packages.Add(package);
408 } 408 }
409 409
410 void RunInitialization() 410 void RunInitialization()
411 { 411 {
412 string versionDir; 412 string versionDir;
413 413
414 if (Environment.Version.Major == 1) 414 if (Environment.Version.Major == 1)
415 { 415 {
416 versionDir = "1.0"; 416 versionDir = "1.0";
417 } 417 }
418 else 418 else
419 { 419 {
420 versionDir = "2.0"; 420 versionDir = "2.0";
421 } 421 }
422 422
423 //Pull up assemblies from the installed mono system. 423 //Pull up assemblies from the installed mono system.
424 string prefix = Path.GetDirectoryName(typeof(int).Assembly.Location); 424 string prefix = Path.GetDirectoryName(typeof(int).Assembly.Location);
425 425
426 if (prefix.IndexOf(Path.Combine("mono", versionDir)) == -1) 426 if (prefix.IndexOf(Path.Combine("mono", versionDir)) == -1)
427 prefix = Path.Combine(prefix, "mono"); 427 prefix = Path.Combine(prefix, "mono");
428 else 428 else
429 prefix = Path.GetDirectoryName(prefix); 429 prefix = Path.GetDirectoryName(prefix);
430 430
431 RegisterSystemAssemblies(prefix, "1.0", ClrVersion.Net_1_1); 431 RegisterSystemAssemblies(prefix, "1.0", ClrVersion.Net_1_1);
432 RegisterSystemAssemblies(prefix, "2.0", ClrVersion.Net_2_0); 432 RegisterSystemAssemblies(prefix, "2.0", ClrVersion.Net_2_0);
433 433
434 string search_dirs = Environment.GetEnvironmentVariable("PKG_CONFIG_PATH"); 434 string search_dirs = Environment.GetEnvironmentVariable("PKG_CONFIG_PATH");
435 string libpath = Environment.GetEnvironmentVariable("PKG_CONFIG_LIBPATH"); 435 string libpath = Environment.GetEnvironmentVariable("PKG_CONFIG_LIBPATH");
436 436
437 if (String.IsNullOrEmpty(libpath)) 437 if (String.IsNullOrEmpty(libpath))
438 { 438 {
439 string path_dirs = Environment.GetEnvironmentVariable("PATH"); 439 string path_dirs = Environment.GetEnvironmentVariable("PATH");
440 foreach (string pathdir in path_dirs.Split(Path.PathSeparator)) 440 foreach (string pathdir in path_dirs.Split(Path.PathSeparator))
441 { 441 {
442 if (pathdir == null) 442 if (pathdir == null)
443 continue; 443 continue;
444 if (File.Exists(pathdir + Path.DirectorySeparatorChar + "pkg-config")) 444 if (File.Exists(pathdir + Path.DirectorySeparatorChar + "pkg-config"))
445 { 445 {
446 libpath = Path.Combine(pathdir, ".."); 446 libpath = Path.Combine(pathdir, "..");
447 libpath = Path.Combine(libpath, "lib"); 447 libpath = Path.Combine(libpath, "lib");
448 libpath = Path.Combine(libpath, "pkgconfig"); 448 libpath = Path.Combine(libpath, "pkgconfig");
449 break; 449 break;
450 } 450 }
451 } 451 }
452 } 452 }
453 search_dirs += Path.PathSeparator + libpath; 453 search_dirs += Path.PathSeparator + libpath;
454 if (!string.IsNullOrEmpty(search_dirs)) 454 if (!string.IsNullOrEmpty(search_dirs))
455 { 455 {
456 List<string> scanDirs = new List<string>(); 456 List<string> scanDirs = new List<string>();
457 foreach (string potentialDir in search_dirs.Split(Path.PathSeparator)) 457 foreach (string potentialDir in search_dirs.Split(Path.PathSeparator))
458 { 458 {
459 if (!scanDirs.Contains(potentialDir)) 459 if (!scanDirs.Contains(potentialDir))
460 scanDirs.Add(potentialDir); 460 scanDirs.Add(potentialDir);
461 } 461 }
462 foreach (string pcdir in scanDirs) 462 foreach (string pcdir in scanDirs)
463 { 463 {
464 if (pcdir == null) 464 if (pcdir == null)
465 continue; 465 continue;
466 466
467 if (Directory.Exists(pcdir)) 467 if (Directory.Exists(pcdir))
468 { 468 {
469 foreach (string pcfile in Directory.GetFiles(pcdir, "*.pc")) 469 foreach (string pcfile in Directory.GetFiles(pcdir, "*.pc"))
470 { 470 {
471 ParsePCFile(pcfile); 471 ParsePCFile(pcfile);
472 } 472 }
473 } 473 }
474 } 474 }
475 } 475 }
476 } 476 }
477 477
478 private void WriteCombine(SolutionNode solution) 478 private void WriteCombine(SolutionNode solution)
479 { 479 {
480 #region "Create Solution directory if it doesn't exist" 480 #region "Create Solution directory if it doesn't exist"
481 string solutionDir = Path.Combine(solution.FullPath, 481 string solutionDir = Path.Combine(solution.FullPath,
482 Path.Combine("autotools", 482 Path.Combine("autotools",
483 solution.Name)); 483 solution.Name));
484 chkMkDir(solutionDir); 484 chkMkDir(solutionDir);
485 #endregion 485 #endregion
486 486
487 #region "Write Solution-level files" 487 #region "Write Solution-level files"
488 XsltArgumentList argList = new XsltArgumentList(); 488 XsltArgumentList argList = new XsltArgumentList();
489 argList.AddParam("solutionName", "", solution.Name); 489 argList.AddParam("solutionName", "", solution.Name);
490 // $solutionDir is $rootDir/$solutionName/ 490 // $solutionDir is $rootDir/$solutionName/
491 transformToFile(Path.Combine(solutionDir, "configure.ac"), 491 transformToFile(Path.Combine(solutionDir, "configure.ac"),
492 argList, "/Autotools/SolutionConfigureAc"); 492 argList, "/Autotools/SolutionConfigureAc");
493 transformToFile(Path.Combine(solutionDir, "Makefile.am"), 493 transformToFile(Path.Combine(solutionDir, "Makefile.am"),
494 argList, "/Autotools/SolutionMakefileAm"); 494 argList, "/Autotools/SolutionMakefileAm");
495 transformToFile(Path.Combine(solutionDir, "autogen.sh"), 495 transformToFile(Path.Combine(solutionDir, "autogen.sh"),
496 argList, "/Autotools/SolutionAutogenSh"); 496 argList, "/Autotools/SolutionAutogenSh");
497 #endregion 497 #endregion
498 498
499 foreach (ProjectNode project in solution.ProjectsTableOrder) 499 foreach (ProjectNode project in solution.ProjectsTableOrder)
500 { 500 {
501 m_Kernel.Log.Write(String.Format("Writing project: {0}", 501 m_Kernel.Log.Write(String.Format("Writing project: {0}",
502 project.Name)); 502 project.Name));
503 WriteProject(solution, project); 503 WriteProject(solution, project);
504 } 504 }
505 } 505 }
506 506
507 private static string FindFileReference(string refName, 507 private static string FindFileReference(string refName,
508 ProjectNode project) 508 ProjectNode project)
509 { 509 {
510 foreach (ReferencePathNode refPath in project.ReferencePaths) 510 foreach (ReferencePathNode refPath in project.ReferencePaths)
511 { 511 {
512 string fullPath = 512 string fullPath =
513 Helper.MakeFilePath(refPath.Path, refName, "dll"); 513 Helper.MakeFilePath(refPath.Path, refName, "dll");
514 514
515 if (File.Exists(fullPath)) { 515 if (File.Exists(fullPath)) {
516 return fullPath; 516 return fullPath;
517 } 517 }
518 } 518 }
519 519
520 return null; 520 return null;
521 } 521 }
522 522
523 /// <summary> 523 /// <summary>
524 /// Gets the XML doc file. 524 /// Gets the XML doc file.
525 /// </summary> 525 /// </summary>
526 /// <param name="project">The project.</param> 526 /// <param name="project">The project.</param>
527 /// <param name="conf">The conf.</param> 527 /// <param name="conf">The conf.</param>
528 /// <returns></returns> 528 /// <returns></returns>
529 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) 529 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
530 { 530 {
531 if (conf == null) 531 if (conf == null)
532 { 532 {
533 throw new ArgumentNullException("conf"); 533 throw new ArgumentNullException("conf");
534 } 534 }
535 if (project == null) 535 if (project == null)
536 { 536 {
537 throw new ArgumentNullException("project"); 537 throw new ArgumentNullException("project");
538 } 538 }
539 string docFile = (string)conf.Options["XmlDocFile"]; 539 string docFile = (string)conf.Options["XmlDocFile"];
540 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified 540 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
541 // { 541 // {
542 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; 542 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
543 // } 543 // }
544 return docFile; 544 return docFile;
545 } 545 }
546 546
547 /// <summary> 547 /// <summary>
548 /// Normalizes the path. 548 /// Normalizes the path.
549 /// </summary> 549 /// </summary>
550 /// <param name="path">The path.</param> 550 /// <param name="path">The path.</param>
551 /// <returns></returns> 551 /// <returns></returns>
552 public static string NormalizePath(string path) 552 public static string NormalizePath(string path)
553 { 553 {
554 if (path == null) 554 if (path == null)
555 { 555 {
556 return ""; 556 return "";
557 } 557 }
558 558
559 StringBuilder tmpPath; 559 StringBuilder tmpPath;
560 560
561 if (Core.Parse.Preprocessor.GetOS() == "Win32") 561 if (Core.Parse.Preprocessor.GetOS() == "Win32")
562 { 562 {
563 tmpPath = new StringBuilder(path.Replace('\\', '/')); 563 tmpPath = new StringBuilder(path.Replace('\\', '/'));
564 tmpPath.Replace("/", @"\\"); 564 tmpPath.Replace("/", @"\\");
565 } 565 }
566 else 566 else
567 { 567 {
568 tmpPath = new StringBuilder(path.Replace('\\', '/')); 568 tmpPath = new StringBuilder(path.Replace('\\', '/'));
569 tmpPath = tmpPath.Replace('/', Path.DirectorySeparatorChar); 569 tmpPath = tmpPath.Replace('/', Path.DirectorySeparatorChar);
570 } 570 }
571 return tmpPath.ToString(); 571 return tmpPath.ToString();
572 } 572 }
573 573
574 private void WriteProject(SolutionNode solution, ProjectNode project) 574 private void WriteProject(SolutionNode solution, ProjectNode project)
575 { 575 {
576 string solutionDir = Path.Combine(solution.FullPath, Path.Combine("autotools", solution.Name)); 576 string solutionDir = Path.Combine(solution.FullPath, Path.Combine("autotools", solution.Name));
577 string projectDir = Path.Combine(solutionDir, project.Name); 577 string projectDir = Path.Combine(solutionDir, project.Name);
578 string projectVersion = project.Version; 578 string projectVersion = project.Version;
579 bool hasAssemblyConfig = false; 579 bool hasAssemblyConfig = false;
580 chkMkDir(projectDir); 580 chkMkDir(projectDir);
581 581
582 List<string> 582 List<string>
583 compiledFiles = new List<string>(), 583 compiledFiles = new List<string>(),
584 contentFiles = new List<string>(), 584 contentFiles = new List<string>(),
585 embeddedFiles = new List<string>(), 585 embeddedFiles = new List<string>(),
586 586
587 binaryLibs = new List<string>(), 587 binaryLibs = new List<string>(),
588 pkgLibs = new List<string>(), 588 pkgLibs = new List<string>(),
589 systemLibs = new List<string>(), 589 systemLibs = new List<string>(),
590 runtimeLibs = new List<string>(), 590 runtimeLibs = new List<string>(),
591 591
592 extraDistFiles = new List<string>(), 592 extraDistFiles = new List<string>(),
593 localCopyTargets = new List<string>(); 593 localCopyTargets = new List<string>();
594 594
595 // If there exists a .config file for this assembly, copy 595 // If there exists a .config file for this assembly, copy
596 // it to the project folder 596 // it to the project folder
597 597
598 // TODO: Support copying .config.osx files 598 // TODO: Support copying .config.osx files
599 // TODO: support processing the .config file for native library deps 599 // TODO: support processing the .config file for native library deps
600 string projectAssemblyName = project.Name; 600 string projectAssemblyName = project.Name;
601 if (project.AssemblyName != null) 601 if (project.AssemblyName != null)
602 projectAssemblyName = project.AssemblyName; 602 projectAssemblyName = project.AssemblyName;
603 603
604 if (File.Exists(Path.Combine(project.FullPath, projectAssemblyName) + ".dll.config")) 604 if (File.Exists(Path.Combine(project.FullPath, projectAssemblyName) + ".dll.config"))
605 { 605 {
606 hasAssemblyConfig = true; 606 hasAssemblyConfig = true;
607 System.IO.File.Copy(Path.Combine(project.FullPath, projectAssemblyName + ".dll.config"), Path.Combine(projectDir, projectAssemblyName + ".dll.config"), true); 607 System.IO.File.Copy(Path.Combine(project.FullPath, projectAssemblyName + ".dll.config"), Path.Combine(projectDir, projectAssemblyName + ".dll.config"), true);
608 extraDistFiles.Add(project.AssemblyName + ".dll.config"); 608 extraDistFiles.Add(project.AssemblyName + ".dll.config");
609 } 609 }
610 610
611 foreach (ConfigurationNode conf in project.Configurations) 611 foreach (ConfigurationNode conf in project.Configurations)
612 { 612 {
613 if (conf.Options.KeyFile != string.Empty) 613 if (conf.Options.KeyFile != string.Empty)
614 { 614 {
615 // Copy snk file into the project's directory 615 // Copy snk file into the project's directory
616 // Use the snk from the project directory directly 616 // Use the snk from the project directory directly
617 string source = Path.Combine(project.FullPath, conf.Options.KeyFile); 617 string source = Path.Combine(project.FullPath, conf.Options.KeyFile);
618 string keyFile = conf.Options.KeyFile; 618 string keyFile = conf.Options.KeyFile;
619 Regex re = new Regex(".*/"); 619 Regex re = new Regex(".*/");
620 keyFile = re.Replace(keyFile, ""); 620 keyFile = re.Replace(keyFile, "");
621 621
622 string dest = Path.Combine(projectDir, keyFile); 622 string dest = Path.Combine(projectDir, keyFile);
623 // Tell the user if there's a problem copying the file 623 // Tell the user if there's a problem copying the file
624 try 624 try
625 { 625 {
626 mkdirDashP(System.IO.Path.GetDirectoryName(dest)); 626 mkdirDashP(System.IO.Path.GetDirectoryName(dest));
627 System.IO.File.Copy(source, dest, true); 627 System.IO.File.Copy(source, dest, true);
628 } 628 }
629 catch (System.IO.IOException e) 629 catch (System.IO.IOException e)
630 { 630 {
631 Console.WriteLine(e.Message); 631 Console.WriteLine(e.Message);
632 } 632 }
633 } 633 }
634 } 634 }
635 635
636 // Copy compiled, embedded and content files into the project's directory 636 // Copy compiled, embedded and content files into the project's directory
637 foreach (string filename in project.Files) 637 foreach (string filename in project.Files)
638 { 638 {
639 string source = Path.Combine(project.FullPath, filename); 639 string source = Path.Combine(project.FullPath, filename);
640 string dest = Path.Combine(projectDir, filename); 640 string dest = Path.Combine(projectDir, filename);
641 641
642 if (filename.Contains("AssemblyInfo.cs")) 642 if (filename.Contains("AssemblyInfo.cs"))
643 { 643 {
644 // If we've got an AssemblyInfo.cs, pull the version number from it 644 // If we've got an AssemblyInfo.cs, pull the version number from it
645 string[] sources = { source }; 645 string[] sources = { source };
646 string[] args = { "" }; 646 string[] args = { "" };
647 Microsoft.CSharp.CSharpCodeProvider cscp = 647 Microsoft.CSharp.CSharpCodeProvider cscp =
648 new Microsoft.CSharp.CSharpCodeProvider(); 648 new Microsoft.CSharp.CSharpCodeProvider();
649 649
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
657 foreach (System.CodeDom.Compiler.CompilerError error in cr.Errors) 657 foreach (System.CodeDom.Compiler.CompilerError error in cr.Errors)
658 Console.WriteLine("Error! '{0}'", error.ErrorText); 658 Console.WriteLine("Error! '{0}'", error.ErrorText);
659 659
660 try { 660 try {
661 string projectFullName = cr.CompiledAssembly.FullName; 661 string projectFullName = cr.CompiledAssembly.FullName;
662 Regex verRegex = new Regex("Version=([\\d\\.]+)"); 662 Regex verRegex = new Regex("Version=([\\d\\.]+)");
663 Match verMatch = verRegex.Match(projectFullName); 663 Match verMatch = verRegex.Match(projectFullName);
664 if (verMatch.Success) 664 if (verMatch.Success)
665 projectVersion = verMatch.Groups[1].Value; 665 projectVersion = verMatch.Groups[1].Value;
666 }catch{ 666 }catch{
667 Console.WriteLine("Couldn't compile AssemblyInfo.cs"); 667 Console.WriteLine("Couldn't compile AssemblyInfo.cs");
668 } 668 }
669 669
670 // Clean up the temp file 670 // Clean up the temp file
671 try 671 try
672 { 672 {
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
684 try 684 try
685 { 685 {
686 mkdirDashP(System.IO.Path.GetDirectoryName(dest)); 686 mkdirDashP(System.IO.Path.GetDirectoryName(dest));
687 System.IO.File.Copy(source, dest, true); 687 System.IO.File.Copy(source, dest, true);
688 } 688 }
689 catch (System.IO.IOException e) 689 catch (System.IO.IOException e)
690 { 690 {
691 Console.WriteLine(e.Message); 691 Console.WriteLine(e.Message);
692 } 692 }
693 693
694 switch (project.Files.GetBuildAction(filename)) 694 switch (project.Files.GetBuildAction(filename))
695 { 695 {
696 case BuildAction.Compile: 696 case BuildAction.Compile:
697 compiledFiles.Add(filename); 697 compiledFiles.Add(filename);
698 break; 698 break;
699 case BuildAction.Content: 699 case BuildAction.Content:
700 contentFiles.Add(filename); 700 contentFiles.Add(filename);
701 extraDistFiles.Add(filename); 701 extraDistFiles.Add(filename);
702 break; 702 break;
703 case BuildAction.EmbeddedResource: 703 case BuildAction.EmbeddedResource:
704 embeddedFiles.Add(filename); 704 embeddedFiles.Add(filename);
705 break; 705 break;
706 } 706 }
707 } 707 }
708 708
709 // Set up references 709 // Set up references
710 for (int refNum = 0; refNum < project.References.Count; refNum++) 710 for (int refNum = 0; refNum < project.References.Count; refNum++)
711 { 711 {
712 ReferenceNode refr = project.References[refNum]; 712 ReferenceNode refr = project.References[refNum];
713 Assembly refAssembly = Assembly.LoadWithPartialName(refr.Name); 713 Assembly refAssembly = Assembly.LoadWithPartialName(refr.Name);
714 714
715 /* Determine which pkg-config (.pc) file refers to 715 /* Determine which pkg-config (.pc) file refers to
716 this assembly */ 716 this assembly */
717 717
718 SystemPackage package = null; 718 SystemPackage package = null;
719 719
720 if (packagesHash.ContainsKey(refr.Name)) 720 if (packagesHash.ContainsKey(refr.Name))
721 { 721 {
722 package = packagesHash[refr.Name]; 722 package = packagesHash[refr.Name];
723 723
724 } 724 }
725 else 725 else
726 { 726 {
727 string assemblyFullName = string.Empty; 727 string assemblyFullName = string.Empty;
728 if (refAssembly != null) 728 if (refAssembly != null)
729 assemblyFullName = refAssembly.FullName; 729 assemblyFullName = refAssembly.FullName;
730 730
731 string assemblyFileName = string.Empty; 731 string assemblyFileName = string.Empty;
732 if (assemblyFullName != string.Empty && 732 if (assemblyFullName != string.Empty &&
733 assemblyFullNameToPath.ContainsKey(assemblyFullName) 733 assemblyFullNameToPath.ContainsKey(assemblyFullName)
734 ) 734 )
735 assemblyFileName = 735 assemblyFileName =
736 assemblyFullNameToPath[assemblyFullName]; 736 assemblyFullNameToPath[assemblyFullName];
737 737
738 if (assemblyFileName != string.Empty && 738 if (assemblyFileName != string.Empty &&
739 assemblyPathToPackage.ContainsKey(assemblyFileName) 739 assemblyPathToPackage.ContainsKey(assemblyFileName)
740 ) 740 )
741 package = assemblyPathToPackage[assemblyFileName]; 741 package = assemblyPathToPackage[assemblyFileName];
742 742
743 } 743 }
744 744
745 /* If we know the .pc file and it is not "mono" 745 /* If we know the .pc file and it is not "mono"
746 (already in the path), add a -pkg: argument */ 746 (already in the path), add a -pkg: argument */
747 747
748 if (package != null && 748 if (package != null &&
749 package.Name != "mono" && 749 package.Name != "mono" &&
750 !pkgLibs.Contains(package.Name) 750 !pkgLibs.Contains(package.Name)
751 ) 751 )
752 pkgLibs.Add(package.Name); 752 pkgLibs.Add(package.Name);
753 753
754 string fileRef = 754 string fileRef =
755 FindFileReference(refr.Name, (ProjectNode)refr.Parent); 755 FindFileReference(refr.Name, (ProjectNode)refr.Parent);
756 756
757 if (refr.LocalCopy || 757 if (refr.LocalCopy ||
758 solution.ProjectsTable.ContainsKey(refr.Name) || 758 solution.ProjectsTable.ContainsKey(refr.Name) ||
759 fileRef != null || 759 fileRef != null ||
760 refr.Path != null 760 refr.Path != null
761 ) 761 )
762 { 762 {
763 763
764 /* Attempt to copy the referenced lib to the 764 /* Attempt to copy the referenced lib to the
765 project's directory */ 765 project's directory */
766 766
767 string filename = refr.Name + ".dll"; 767 string filename = refr.Name + ".dll";
768 string source = filename; 768 string source = filename;
769 if (refr.Path != null) 769 if (refr.Path != null)
770 source = Path.Combine(refr.Path, source); 770 source = Path.Combine(refr.Path, source);
771 source = Path.Combine(project.FullPath, source); 771 source = Path.Combine(project.FullPath, source);
772 string dest = Path.Combine(projectDir, filename); 772 string dest = Path.Combine(projectDir, filename);
773 773
774 /* Since we depend on this binary dll to build, we 774 /* Since we depend on this binary dll to build, we
775 * will add a compile- time dependency on the 775 * will add a compile- time dependency on the
776 * copied dll, and add the dll to the list of 776 * copied dll, and add the dll to the list of
777 * files distributed with this package 777 * files distributed with this package
778 */ 778 */
779 779
780 binaryLibs.Add(refr.Name + ".dll"); 780 binaryLibs.Add(refr.Name + ".dll");
781 extraDistFiles.Add(refr.Name + ".dll"); 781 extraDistFiles.Add(refr.Name + ".dll");
782 782
783 // TODO: Support copying .config.osx files 783 // TODO: Support copying .config.osx files
784 // TODO: Support for determining native dependencies 784 // TODO: Support for determining native dependencies
785 if (File.Exists(source + ".config")) 785 if (File.Exists(source + ".config"))
786 { 786 {
787 System.IO.File.Copy(source + ".config", Path.GetDirectoryName(dest), true); 787 System.IO.File.Copy(source + ".config", Path.GetDirectoryName(dest), true);
788 extraDistFiles.Add(refr.Name + ".dll.config"); 788 extraDistFiles.Add(refr.Name + ".dll.config");
789 } 789 }
790 790
791 try 791 try
792 { 792 {
793 System.IO.File.Copy(source, dest, true); 793 System.IO.File.Copy(source, dest, true);
794 } 794 }
795 catch (System.IO.IOException) 795 catch (System.IO.IOException)
796 { 796 {
797 if (solution.ProjectsTable.ContainsKey(refr.Name)){ 797 if (solution.ProjectsTable.ContainsKey(refr.Name)){
798 798
799 /* If an assembly is referenced, marked for 799 /* If an assembly is referenced, marked for
800 * local copy, in the list of projects for 800 * local copy, in the list of projects for
801 * this solution, but does not exist, put a 801 * this solution, but does not exist, put a
802 * target into the Makefile.am to build the 802 * target into the Makefile.am to build the
803 * assembly and copy it to this project's 803 * assembly and copy it to this project's
804 * directory 804 * directory
805 */ 805 */
806 806
807 ProjectNode sourcePrj = 807 ProjectNode sourcePrj =
808 ((solution.ProjectsTable[refr.Name])); 808 ((solution.ProjectsTable[refr.Name]));
809 809
810 string target = 810 string target =
811 String.Format("{0}:\n" + 811 String.Format("{0}:\n" +
812 "\t$(MAKE) -C ../{1}\n" + 812 "\t$(MAKE) -C ../{1}\n" +
813 "\tln ../{2}/$@ $@\n", 813 "\tln ../{2}/$@ $@\n",
814 filename, 814 filename,
815 sourcePrj.Name, 815 sourcePrj.Name,
816 sourcePrj.Name ); 816 sourcePrj.Name );
817 817
818 localCopyTargets.Add(target); 818 localCopyTargets.Add(target);
819 } 819 }
820 } 820 }
821 } 821 }
822 else if( !pkgLibs.Contains(refr.Name) ) 822 else if( !pkgLibs.Contains(refr.Name) )
823 { 823 {
824 // Else, let's assume it's in the GAC or the lib path 824 // Else, let's assume it's in the GAC or the lib path
825 string assemName = string.Empty; 825 string assemName = string.Empty;
826 int index = refr.Name.IndexOf(","); 826 int index = refr.Name.IndexOf(",");
827 827
828 if (index > 0) 828 if (index > 0)
829 assemName = refr.Name.Substring(0, index); 829 assemName = refr.Name.Substring(0, index);
830 else 830 else
831 assemName = refr.Name; 831 assemName = refr.Name;
832 832
833 m_Kernel.Log.Write(String.Format( 833 m_Kernel.Log.Write(String.Format(
834 "Warning: Couldn't find an appropriate assembly " + 834 "Warning: Couldn't find an appropriate assembly " +
835 "for reference:\n'{0}'", refr.Name 835 "for reference:\n'{0}'", refr.Name
836 )); 836 ));
837 systemLibs.Add(assemName); 837 systemLibs.Add(assemName);
838 } 838 }
839 } 839 }
840 840
841 const string lineSep = " \\\n\t"; 841 const string lineSep = " \\\n\t";
842 string compiledFilesString = string.Empty; 842 string compiledFilesString = string.Empty;
843 if (compiledFiles.Count > 0) 843 if (compiledFiles.Count > 0)
844 compiledFilesString = 844 compiledFilesString =
845 lineSep + string.Join(lineSep, compiledFiles.ToArray()); 845 lineSep + string.Join(lineSep, compiledFiles.ToArray());
846 846
847 string embeddedFilesString = ""; 847 string embeddedFilesString = "";
848 if (embeddedFiles.Count > 0) 848 if (embeddedFiles.Count > 0)
849 embeddedFilesString = 849 embeddedFilesString =
850 lineSep + string.Join(lineSep, embeddedFiles.ToArray()); 850 lineSep + string.Join(lineSep, embeddedFiles.ToArray());
851 851
852 string contentFilesString = ""; 852 string contentFilesString = "";
853 if (contentFiles.Count > 0) 853 if (contentFiles.Count > 0)
854 contentFilesString = 854 contentFilesString =
855 lineSep + string.Join(lineSep, contentFiles.ToArray()); 855 lineSep + string.Join(lineSep, contentFiles.ToArray());
856 856
857 string extraDistFilesString = ""; 857 string extraDistFilesString = "";
858 if (extraDistFiles.Count > 0) 858 if (extraDistFiles.Count > 0)
859 extraDistFilesString = 859 extraDistFilesString =
860 lineSep + string.Join(lineSep, extraDistFiles.ToArray()); 860 lineSep + string.Join(lineSep, extraDistFiles.ToArray());
861 861
862 string pkgLibsString = ""; 862 string pkgLibsString = "";
863 if (pkgLibs.Count > 0) 863 if (pkgLibs.Count > 0)
864 pkgLibsString = 864 pkgLibsString =
865 lineSep + string.Join(lineSep, pkgLibs.ToArray()); 865 lineSep + string.Join(lineSep, pkgLibs.ToArray());
866 866
867 string binaryLibsString = ""; 867 string binaryLibsString = "";
868 if (binaryLibs.Count > 0) 868 if (binaryLibs.Count > 0)
869 binaryLibsString = 869 binaryLibsString =
870 lineSep + string.Join(lineSep, binaryLibs.ToArray()); 870 lineSep + string.Join(lineSep, binaryLibs.ToArray());
871 871
872 string systemLibsString = ""; 872 string systemLibsString = "";
873 if (systemLibs.Count > 0) 873 if (systemLibs.Count > 0)
874 systemLibsString = 874 systemLibsString =
875 lineSep + string.Join(lineSep, systemLibs.ToArray()); 875 lineSep + string.Join(lineSep, systemLibs.ToArray());
876 876
877 string localCopyTargetsString = ""; 877 string localCopyTargetsString = "";
878 if (localCopyTargets.Count > 0) 878 if (localCopyTargets.Count > 0)
879 localCopyTargetsString = 879 localCopyTargetsString =
880 string.Join("\n", localCopyTargets.ToArray()); 880 string.Join("\n", localCopyTargets.ToArray());
881 881
882 string monoPath = ""; 882 string monoPath = "";
883 foreach (string runtimeLib in runtimeLibs) 883 foreach (string runtimeLib in runtimeLibs)
884 { 884 {
885 monoPath += ":`pkg-config --variable=libdir " + runtimeLib + "`"; 885 monoPath += ":`pkg-config --variable=libdir " + runtimeLib + "`";
886 } 886 }
887 887
888 // Add the project name to the list of transformation 888 // Add the project name to the list of transformation
889 // parameters 889 // parameters
890 XsltArgumentList argList = new XsltArgumentList(); 890 XsltArgumentList argList = new XsltArgumentList();
891 argList.AddParam("projectName", "", project.Name); 891 argList.AddParam("projectName", "", project.Name);
892 argList.AddParam("solutionName", "", solution.Name); 892 argList.AddParam("solutionName", "", solution.Name);
893 argList.AddParam("assemblyName", "", projectAssemblyName); 893 argList.AddParam("assemblyName", "", projectAssemblyName);
894 argList.AddParam("compiledFiles", "", compiledFilesString); 894 argList.AddParam("compiledFiles", "", compiledFilesString);
895 argList.AddParam("embeddedFiles", "", embeddedFilesString); 895 argList.AddParam("embeddedFiles", "", embeddedFilesString);
896 argList.AddParam("contentFiles", "", contentFilesString); 896 argList.AddParam("contentFiles", "", contentFilesString);
897 argList.AddParam("extraDistFiles", "", extraDistFilesString); 897 argList.AddParam("extraDistFiles", "", extraDistFilesString);
898 argList.AddParam("pkgLibs", "", pkgLibsString); 898 argList.AddParam("pkgLibs", "", pkgLibsString);
899 argList.AddParam("binaryLibs", "", binaryLibsString); 899 argList.AddParam("binaryLibs", "", binaryLibsString);
900 argList.AddParam("systemLibs", "", systemLibsString); 900 argList.AddParam("systemLibs", "", systemLibsString);
901 argList.AddParam("monoPath", "", monoPath); 901 argList.AddParam("monoPath", "", monoPath);
902 argList.AddParam("localCopyTargets", "", localCopyTargetsString); 902 argList.AddParam("localCopyTargets", "", localCopyTargetsString);
903 argList.AddParam("projectVersion", "", projectVersion); 903 argList.AddParam("projectVersion", "", projectVersion);
904 argList.AddParam("hasAssemblyConfig", "", hasAssemblyConfig ? "true" : ""); 904 argList.AddParam("hasAssemblyConfig", "", hasAssemblyConfig ? "true" : "");
905 905
906 // Transform the templates 906 // Transform the templates
907 transformToFile(Path.Combine(projectDir, "configure.ac"), argList, "/Autotools/ProjectConfigureAc"); 907 transformToFile(Path.Combine(projectDir, "configure.ac"), argList, "/Autotools/ProjectConfigureAc");
908 transformToFile(Path.Combine(projectDir, "Makefile.am"), argList, "/Autotools/ProjectMakefileAm"); 908 transformToFile(Path.Combine(projectDir, "Makefile.am"), argList, "/Autotools/ProjectMakefileAm");
909 transformToFile(Path.Combine(projectDir, "autogen.sh"), argList, "/Autotools/ProjectAutogenSh"); 909 transformToFile(Path.Combine(projectDir, "autogen.sh"), argList, "/Autotools/ProjectAutogenSh");
910 910
911 if (project.Type == Core.Nodes.ProjectType.Library) 911 if (project.Type == Core.Nodes.ProjectType.Library)
912 transformToFile(Path.Combine(projectDir, project.Name + ".pc.in"), argList, "/Autotools/ProjectPcIn"); 912 transformToFile(Path.Combine(projectDir, project.Name + ".pc.in"), argList, "/Autotools/ProjectPcIn");
913 if (project.Type == Core.Nodes.ProjectType.Exe || project.Type == Core.Nodes.ProjectType.WinExe) 913 if (project.Type == Core.Nodes.ProjectType.Exe || project.Type == Core.Nodes.ProjectType.WinExe)
914 transformToFile(Path.Combine(projectDir, project.Name.ToLower() + ".in"), argList, "/Autotools/ProjectWrapperScriptIn"); 914 transformToFile(Path.Combine(projectDir, project.Name.ToLower() + ".in"), argList, "/Autotools/ProjectWrapperScriptIn");
915 } 915 }
916 916
917 private void CleanProject(ProjectNode project) 917 private void CleanProject(ProjectNode project)
918 { 918 {
919 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); 919 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
920 string projectFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); 920 string projectFile = Helper.MakeFilePath(project.FullPath, "Include", "am");
921 Helper.DeleteIfExists(projectFile); 921 Helper.DeleteIfExists(projectFile);
922 } 922 }
923 923
924 private void CleanSolution(SolutionNode solution) 924 private void CleanSolution(SolutionNode solution)
925 { 925 {
926 m_Kernel.Log.Write("Cleaning Autotools make files for", solution.Name); 926 m_Kernel.Log.Write("Cleaning Autotools make files for", solution.Name);
927 927
928 string slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); 928 string slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am");
929 Helper.DeleteIfExists(slnFile); 929 Helper.DeleteIfExists(slnFile);
930 930
931 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "in"); 931 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "in");
932 Helper.DeleteIfExists(slnFile); 932 Helper.DeleteIfExists(slnFile);
933 933
934 slnFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); 934 slnFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac");
935 Helper.DeleteIfExists(slnFile); 935 Helper.DeleteIfExists(slnFile);
936 936
937 slnFile = Helper.MakeFilePath(solution.FullPath, "configure"); 937 slnFile = Helper.MakeFilePath(solution.FullPath, "configure");
938 Helper.DeleteIfExists(slnFile); 938 Helper.DeleteIfExists(slnFile);
939 939
940 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile"); 940 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile");
941 Helper.DeleteIfExists(slnFile); 941 Helper.DeleteIfExists(slnFile);
942 942
943 foreach (ProjectNode project in solution.Projects) 943 foreach (ProjectNode project in solution.Projects)
944 { 944 {
945 CleanProject(project); 945 CleanProject(project);
946 } 946 }
947 947
948 m_Kernel.Log.Write(""); 948 m_Kernel.Log.Write("");
949 } 949 }
950 950
951 #endregion 951 #endregion
952 952
953 #region ITarget Members 953 #region ITarget Members
954 954
955 /// <summary> 955 /// <summary>
956 /// Writes the specified kern. 956 /// Writes the specified kern.
957 /// </summary> 957 /// </summary>
958 /// <param name="kern">The kern.</param> 958 /// <param name="kern">The kern.</param>
959 public void Write(Kernel kern) 959 public void Write(Kernel kern)
960 { 960 {
961 if (kern == null) 961 if (kern == null)
962 { 962 {
963 throw new ArgumentNullException("kern"); 963 throw new ArgumentNullException("kern");
964 } 964 }
965 m_Kernel = kern; 965 m_Kernel = kern;
966 m_Kernel.Log.Write("Parsing system pkg-config files"); 966 m_Kernel.Log.Write("Parsing system pkg-config files");
967 RunInitialization(); 967 RunInitialization();
968 968
969 const string streamName = "autotools.xml"; 969 const string streamName = "autotools.xml";
970 string fqStreamName = String.Format("Prebuild.data.{0}", 970 string fqStreamName = String.Format("Prebuild.data.{0}",
971 streamName 971 streamName
972 ); 972 );
973 973
974 // Retrieve stream for the autotools template XML 974 // Retrieve stream for the autotools template XML
975 Stream autotoolsStream = Assembly.GetExecutingAssembly() 975 Stream autotoolsStream = Assembly.GetExecutingAssembly()
976 .GetManifestResourceStream(fqStreamName); 976 .GetManifestResourceStream(fqStreamName);
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
984 */ 984 */
985 985
986 autotoolsStream = Assembly.GetExecutingAssembly() 986 autotoolsStream = Assembly.GetExecutingAssembly()
987 .GetManifestResourceStream(streamName); 987 .GetManifestResourceStream(streamName);
988 if(autotoolsStream == null){ 988 if(autotoolsStream == null){
989 string errStr = 989 string errStr =
990 String.Format("Could not find embedded resource file:\n" + 990 String.Format("Could not find embedded resource file:\n" +
991 "'{0}' or '{1}'", 991 "'{0}' or '{1}'",
992 streamName, fqStreamName 992 streamName, fqStreamName
993 ); 993 );
994 994
995 m_Kernel.Log.Write(errStr); 995 m_Kernel.Log.Write(errStr);
996 996
997 throw new System.Reflection.TargetException(errStr); 997 throw new System.Reflection.TargetException(errStr);
998 } 998 }
999 } 999 }
1000 1000
1001 // Create an XML URL Resolver with default credentials 1001 // Create an XML URL Resolver with default credentials
1002 xr = new System.Xml.XmlUrlResolver(); 1002 xr = new System.Xml.XmlUrlResolver();
1003 xr.Credentials = CredentialCache.DefaultCredentials; 1003 xr.Credentials = CredentialCache.DefaultCredentials;
1004 1004
1005 // Create a default evidence - no need to limit access 1005 // Create a default evidence - no need to limit access
1006 e = new System.Security.Policy.Evidence(); 1006 e = new System.Security.Policy.Evidence();
1007 1007
1008 // Load the autotools XML 1008 // Load the autotools XML
1009 autotoolsDoc = new XmlDocument(); 1009 autotoolsDoc = new XmlDocument();
1010 autotoolsDoc.Load(autotoolsStream); 1010 autotoolsDoc.Load(autotoolsStream);
1011 1011
1012 /* rootDir is the filesystem location where the Autotools 1012 /* rootDir is the filesystem location where the Autotools
1013 * build tree will be created - for now we'll make it 1013 * build tree will be created - for now we'll make it
1014 * $PWD/autotools 1014 * $PWD/autotools
1015 */ 1015 */
1016 1016
1017 string pwd = Directory.GetCurrentDirectory(); 1017 string pwd = Directory.GetCurrentDirectory();
1018 //string pwd = System.Environment.GetEnvironmentVariable("PWD"); 1018 //string pwd = System.Environment.GetEnvironmentVariable("PWD");
1019 //if (pwd.Length != 0) 1019 //if (pwd.Length != 0)
1020 //{ 1020 //{
1021 string rootDir = Path.Combine(pwd, "autotools"); 1021 string rootDir = Path.Combine(pwd, "autotools");
1022 //} 1022 //}
1023 //else 1023 //else
1024 //{ 1024 //{
1025 // pwd = Assembly.GetExecutingAssembly() 1025 // pwd = Assembly.GetExecutingAssembly()
1026 //} 1026 //}
1027 chkMkDir(rootDir); 1027 chkMkDir(rootDir);
1028 1028
1029 foreach (SolutionNode solution in kern.Solutions) 1029 foreach (SolutionNode solution in kern.Solutions)
1030 { 1030 {
1031 m_Kernel.Log.Write(String.Format("Writing solution: {0}", 1031 m_Kernel.Log.Write(String.Format("Writing solution: {0}",
1032 solution.Name)); 1032 solution.Name));
1033 WriteCombine(solution); 1033 WriteCombine(solution);
1034 } 1034 }
1035 m_Kernel = null; 1035 m_Kernel = null;
1036 } 1036 }
1037 1037
1038 /// <summary> 1038 /// <summary>
1039 /// Cleans the specified kern. 1039 /// Cleans the specified kern.
1040 /// </summary> 1040 /// </summary>
1041 /// <param name="kern">The kern.</param> 1041 /// <param name="kern">The kern.</param>
1042 public virtual void Clean(Kernel kern) 1042 public virtual void Clean(Kernel kern)
1043 { 1043 {
1044 if (kern == null) 1044 if (kern == null)
1045 { 1045 {
1046 throw new ArgumentNullException("kern"); 1046 throw new ArgumentNullException("kern");
1047 } 1047 }
1048 m_Kernel = kern; 1048 m_Kernel = kern;
1049 foreach (SolutionNode sol in kern.Solutions) 1049 foreach (SolutionNode sol in kern.Solutions)
1050 { 1050 {
1051 CleanSolution(sol); 1051 CleanSolution(sol);
1052 } 1052 }
1053 m_Kernel = null; 1053 m_Kernel = null;
1054 } 1054 }
1055 1055
1056 /// <summary> 1056 /// <summary>
1057 /// Gets the name. 1057 /// Gets the name.
1058 /// </summary> 1058 /// </summary>
1059 /// <value>The name.</value> 1059 /// <value>The name.</value>
1060 public string Name 1060 public string Name
1061 { 1061 {
1062 get 1062 get
1063 { 1063 {
1064 return "autotools"; 1064 return "autotools";
1065 } 1065 }
1066 } 1066 }
1067 1067
1068 #endregion 1068 #endregion
1069 } 1069 }
1070} 1070}
diff --git a/Prebuild/src/Core/Targets/DebugTarget.cs b/Prebuild/src/Core/Targets/DebugTarget.cs
index 650007e..d78064f 100644
--- a/Prebuild/src/Core/Targets/DebugTarget.cs
+++ b/Prebuild/src/Core/Targets/DebugTarget.cs
@@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-09-20 08:42:51 +0100 (Wed, 20 Sep 2006) $ 30 * $Date: 2006-09-20 03:42:51 -0400 (Wed, 20 Sep 2006) $
31 * $Revision: 164 $ 31 * $Revision: 164 $
32 */ 32 */
33#endregion 33#endregion
diff --git a/Prebuild/src/Core/Targets/VS2010Target.cs b/Prebuild/src/Core/Targets/VS2010Target.cs
index b16120c..ea9f736 100644
--- a/Prebuild/src/Core/Targets/VS2010Target.cs
+++ b/Prebuild/src/Core/Targets/VS2010Target.cs
@@ -1,138 +1,138 @@
1using System; 1using System;
2using System.IO; 2using System.IO;
3using System.Text; 3using System.Text;
4 4
5using Prebuild.Core.Attributes; 5using Prebuild.Core.Attributes;
6using Prebuild.Core.Interfaces; 6using Prebuild.Core.Interfaces;
7using Prebuild.Core.Nodes; 7using Prebuild.Core.Nodes;
8using Prebuild.Core.Utilities; 8using Prebuild.Core.Utilities;
9using System.CodeDom.Compiler; 9using System.CodeDom.Compiler;
10 10
11namespace Prebuild.Core.Targets 11namespace 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 {
107 switch (frameworkVersion) 107 switch (frameworkVersion)
108 { 108 {
109 case FrameworkVersion.v4_0: 109 case FrameworkVersion.v4_0:
110 case FrameworkVersion.v3_5: 110 case FrameworkVersion.v3_5:
111 return "ToolsVersion=\"4.0\""; 111 return "ToolsVersion=\"4.0\"";
112 case FrameworkVersion.v3_0: 112 case FrameworkVersion.v3_0:
113 return "ToolsVersion=\"3.0\""; 113 return "ToolsVersion=\"3.0\"";
114 default: 114 default:
115 return "ToolsVersion=\"2.0\""; 115 return "ToolsVersion=\"2.0\"";
116 } 116 }
117 } 117 }
118 118
119 public override string SolutionTag 119 public override string SolutionTag
120 { 120 {
121 get { return "# Visual Studio 2010"; } 121 get { return "# Visual Studio 2010"; }
122 } 122 }
123 123
124 #endregion 124 #endregion
125 125
126 #region Constructors 126 #region Constructors
127 127
128 /// <summary> 128 /// <summary>
129 /// Initializes a new instance of the <see cref="VS2005Target"/> class. 129 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
130 /// </summary> 130 /// </summary>
131 public VS2010Target() 131 public VS2010Target()
132 : base() 132 : base()
133 { 133 {
134 } 134 }
135 135
136 #endregion 136 #endregion
137 } 137 }
138} 138}
diff --git a/Prebuild/src/Core/Targets/VSGenericTarget.cs b/Prebuild/src/Core/Targets/VSGenericTarget.cs
index cd3f5bb..af61704 100644
--- a/Prebuild/src/Core/Targets/VSGenericTarget.cs
+++ b/Prebuild/src/Core/Targets/VSGenericTarget.cs
@@ -1,922 +1,972 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (sontek@gmail.com) 3Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (sontek@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided 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
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#endregion 24#endregion
25 25
26using System; 26using System;
27using System.Collections.Generic; 27using System.Collections.Generic;
28using System.IO; 28using System.Collections.Specialized;
29using Prebuild.Core.Interfaces; 29using System.IO;
30using Prebuild.Core.Nodes; 30using Prebuild.Core.Interfaces;
31using Prebuild.Core.Utilities; 31using Prebuild.Core.Nodes;
32using System.CodeDom.Compiler; 32using Prebuild.Core.Utilities;
33 33using System.CodeDom.Compiler;
34namespace Prebuild.Core.Targets 34
35{ 35namespace Prebuild.Core.Targets
36 36{
37 /// <summary> 37
38 /// 38 /// <summary>
39 /// </summary> 39 ///
40 public abstract class VSGenericTarget : ITarget 40 /// </summary>
41 { 41 public abstract class VSGenericTarget : ITarget
42 #region Fields 42 {
43 43 #region Fields
44 readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>(); 44
45 Kernel kernel; 45 readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>();
46 #endregion 46// NameValueCollection CopyFiles = new NameValueCollection();
47 47 Kernel kernel;
48 #region Properties 48 #endregion
49 /// <summary> 49
50 /// Gets or sets the solution version. 50 #region Properties
51 /// </summary> 51 /// <summary>
52 /// <value>The solution version.</value> 52 /// Gets or sets the solution version.
53 public abstract string SolutionVersion { get; } 53 /// </summary>
54 /// <summary> 54 /// <value>The solution version.</value>
55 /// Gets or sets the product version. 55 public abstract string SolutionVersion { get; }
56 /// </summary> 56 /// <summary>
57 /// <value>The product version.</value> 57 /// Gets or sets the product version.
58 public abstract string ProductVersion { get; } 58 /// </summary>
59 /// <summary> 59 /// <value>The product version.</value>
60 /// Gets or sets the schema version. 60 public abstract string ProductVersion { get; }
61 /// </summary> 61 /// <summary>
62 /// <value>The schema version.</value> 62 /// Gets or sets the schema version.
63 public abstract string SchemaVersion { get; } 63 /// </summary>
64 /// <summary> 64 /// <value>The schema version.</value>
65 /// Gets or sets the name of the version. 65 public abstract string SchemaVersion { get; }
66 /// </summary> 66 /// <summary>
67 /// <value>The name of the version.</value> 67 /// Gets or sets the name of the version.
68 public abstract string VersionName { get; } 68 /// </summary>
69 /// <summary> 69 /// <value>The name of the version.</value>
70 /// Gets or sets the version. 70 public abstract string VersionName { get; }
71 /// </summary> 71 /// <summary>
72 /// <value>The version.</value> 72 /// Gets or sets the version.
73 public abstract VSVersion Version { get; } 73 /// </summary>
74 /// <summary> 74 /// <value>The version.</value>
75 /// Gets the name. 75 public abstract VSVersion Version { get; }
76 /// </summary> 76 /// <summary>
77 /// <value>The name.</value> 77 /// Gets the name.
78 public abstract string Name { get; } 78 /// </summary>
79 79 /// <value>The name.</value>
80 protected abstract string GetToolsVersionXml(FrameworkVersion version); 80 public abstract string Name { get; }
81 public abstract string SolutionTag { get; } 81
82 82 protected abstract string GetToolsVersionXml(FrameworkVersion version);
83 #endregion 83 public abstract string SolutionTag { get; }
84 84
85 #region Constructors 85 #endregion
86 86
87 /// <summary> 87 #region Constructors
88 /// Initializes a new instance of the <see cref="VSGenericTarget"/> class. 88
89 /// </summary> 89 /// <summary>
90 protected VSGenericTarget() 90 /// Initializes a new instance of the <see cref="VSGenericTarget"/> class.
91 { 91 /// </summary>
92 tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets"); 92 protected VSGenericTarget()
93 tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); 93 {
94 tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); 94 tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets");
95 tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); 95 tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN");
96 tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); 96 tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets");
97 } 97 tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets");
98 98 tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null);
99 #endregion 99 }
100 100
101 #region Private Methods 101 #endregion
102 102
103 private string MakeRefPath(ProjectNode project) 103 #region Private Methods
104 { 104
105 string ret = ""; 105 private string MakeRefPath(ProjectNode project)
106 foreach (ReferencePathNode node in project.ReferencePaths) 106 {
107 { 107 string ret = "";
108 try 108 foreach (ReferencePathNode node in project.ReferencePaths)
109 { 109 {
110 string fullPath = Helper.ResolvePath(node.Path); 110 try
111 if (ret.Length < 1) 111 {
112 { 112 string fullPath = Helper.ResolvePath(node.Path);
113 ret = fullPath; 113 if (ret.Length < 1)
114 } 114 {
115 else 115 ret = fullPath;
116 { 116 }
117 ret += ";" + fullPath; 117 else
118 } 118 {
119 } 119 ret += ";" + fullPath;
120 catch (ArgumentException) 120 }
121 { 121 }
122 kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); 122 catch (ArgumentException)
123 } 123 {
124 } 124 kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
125 125 }
126 return ret; 126 }
127 } 127
128 128 return ret;
129 private static ProjectNode FindProjectInSolution(string name, SolutionNode solution) 129 }
130 { 130
131 SolutionNode node = solution; 131 private static ProjectNode FindProjectInSolution(string name, SolutionNode solution)
132 132 {
133 while (node.Parent is SolutionNode) 133 SolutionNode node = solution;
134 node = node.Parent as SolutionNode; 134
135 135 while (node.Parent is SolutionNode)
136 return FindProjectInSolutionRecursively(name, node); 136 node = node.Parent as SolutionNode;
137 } 137
138 138 return FindProjectInSolutionRecursively(name, node);
139 private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution) 139 }
140 { 140
141 if (solution.ProjectsTable.ContainsKey(name)) 141 private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution)
142 return solution.ProjectsTable[name]; 142 {
143 143 if (solution.ProjectsTable.ContainsKey(name))
144 foreach (SolutionNode child in solution.Solutions) 144 return solution.ProjectsTable[name];
145 { 145
146 ProjectNode node = FindProjectInSolutionRecursively(name, child); 146 foreach (SolutionNode child in solution.Solutions)
147 if (node != null) 147 {
148 return node; 148 ProjectNode node = FindProjectInSolutionRecursively(name, child);
149 } 149 if (node != null)
150 150 return node;
151 return null; 151 }
152 } 152
153 153 return null;
154 private void WriteProject(SolutionNode solution, ProjectNode project) 154 }
155 { 155
156 if (!tools.ContainsKey(project.Language)) 156 private void WriteProject(SolutionNode solution, ProjectNode project)
157 { 157 {
158 throw new UnknownLanguageException("Unknown .NET language: " + project.Language); 158 if (!tools.ContainsKey(project.Language))
159 } 159 {
160 160 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
161 ToolInfo toolInfo = tools[project.Language]; 161 }
162 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 162
163 StreamWriter ps = new StreamWriter(projectFile); 163 ToolInfo toolInfo = tools[project.Language];
164 164 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
165 kernel.CurrentWorkingDirectory.Push(); 165 StreamWriter ps = new StreamWriter(projectFile);
166 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); 166
167 167 kernel.CurrentWorkingDirectory.Push();
168 #region Project File 168 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
169 using (ps) 169
170 { 170 #region Project File
171 ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {0}>", GetToolsVersionXml(project.FrameworkVersion)); 171 using (ps)
172 ps.WriteLine(" <PropertyGroup>"); 172 {
173 ps.WriteLine(" <ProjectType>Local</ProjectType>"); 173 string targets = "";
174 ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion); 174
175 ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion); 175 if(project.Files.CopyFiles > 0)
176 ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper()); 176 targets = "Build;CopyFiles";
177 177 else
178 // Visual Studio has a hard coded guid for the project type 178 targets = "Build";
179 if (project.Type == ProjectType.Web) 179
180 ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>"); 180 ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion));
181 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>"); 181 ps.WriteLine(" <PropertyGroup>");
182 ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon); 182 ps.WriteLine(" <ProjectType>Local</ProjectType>");
183 ps.WriteLine(" <AssemblyKeyContainerName>"); 183 ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion);
184 ps.WriteLine(" </AssemblyKeyContainerName>"); 184 ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion);
185 ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName); 185 ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper());
186 foreach (ConfigurationNode conf in project.Configurations) 186
187 { 187 // Visual Studio has a hard coded guid for the project type
188 if (conf.Options.KeyFile != "") 188 if (project.Type == ProjectType.Web)
189 { 189 ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>");
190 ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile); 190 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
191 ps.WriteLine(" <SignAssembly>true</SignAssembly>"); 191 ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon);
192 break; 192 ps.WriteLine(" <AssemblyKeyContainerName>");
193 } 193 ps.WriteLine(" </AssemblyKeyContainerName>");
194 } 194 ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName);
195 ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>"); 195 foreach (ConfigurationNode conf in project.Configurations)
196 ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>"); 196 {
197 ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>"); 197 if (conf.Options.KeyFile != "")
198 ps.WriteLine(" <DelaySign>false</DelaySign>"); 198 {
199 ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", ".")); 199 ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
200 200 ps.WriteLine(" <SignAssembly>true</SignAssembly>");
201 ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString()); 201 break;
202 ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder); 202 }
203 ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace); 203 }
204 ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject); 204 ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
205 if (string.IsNullOrEmpty(project.DebugStartParameters)) 205 ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
206 { 206 ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
207 ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters); 207 ps.WriteLine(" <DelaySign>false</DelaySign>");
208 } 208 ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", "."));
209 ps.WriteLine(" <FileUpgradeFlags>"); 209
210 ps.WriteLine(" </FileUpgradeFlags>"); 210 ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
211 211 ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
212 ps.WriteLine(" </PropertyGroup>"); 212 ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
213 213 ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
214 foreach (ConfigurationNode conf in project.Configurations) 214 if (string.IsNullOrEmpty(project.DebugStartParameters))
215 { 215 {
216 ps.Write(" <PropertyGroup "); 216 ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters);
217 ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform); 217 }
218 ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]); 218 ps.WriteLine(" <FileUpgradeFlags>");
219 ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]); 219 ps.WriteLine(" </FileUpgradeFlags>");
220 ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]); 220
221 ps.WriteLine(" <ConfigurationOverrideFile>"); 221 ps.WriteLine(" </PropertyGroup>");
222 ps.WriteLine(" </ConfigurationOverrideFile>"); 222
223 ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]); 223 foreach (ConfigurationNode conf in project.Configurations)
224 ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString())); 224 {
225 ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]); 225 ps.Write(" <PropertyGroup ");
226 ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]); 226 ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform);
227 ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]); 227 ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
228 if (project.Type != ProjectType.Web) 228 ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
229 ps.WriteLine(" <OutputPath>{0}</OutputPath>", 229 ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
230 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); 230 ps.WriteLine(" <ConfigurationOverrideFile>");
231 else 231 ps.WriteLine(" </ConfigurationOverrideFile>");
232 ps.WriteLine(" <OutputPath>{0}</OutputPath>", 232 ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]);
233 Helper.EndPath(Helper.NormalizePath("bin\\"))); 233 ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
234 234 ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
235 ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]); 235 ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
236 ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]); 236 ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
237 ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]); 237 if (project.Type != ProjectType.Web)
238 ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]); 238 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
239 ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]); 239 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
240 ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]); 240 else
241 ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform); 241 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
242 ps.WriteLine(" </PropertyGroup>"); 242 Helper.EndPath(Helper.NormalizePath("bin\\")));
243 } 243
244 244 ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
245 //ps.WriteLine(" </Settings>"); 245 ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
246 246 ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
247 Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>(); 247 ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
248 List<ReferenceNode> otherReferences = new List<ReferenceNode>(); 248 ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
249 249 ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
250 foreach (ReferenceNode refr in project.References) 250 ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform);
251 { 251 ps.WriteLine(" </PropertyGroup>");
252 ProjectNode projectNode = FindProjectInSolution(refr.Name, solution); 252 }
253 253
254 if (projectNode == null) 254 //ps.WriteLine(" </Settings>");
255 otherReferences.Add(refr); 255
256 else 256 Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>();
257 projectReferences.Add(refr, projectNode); 257 List<ReferenceNode> otherReferences = new List<ReferenceNode>();
258 } 258
259 // Assembly References 259 foreach (ReferenceNode refr in project.References)
260 ps.WriteLine(" <ItemGroup>"); 260 {
261 261 ProjectNode projectNode = FindProjectInSolution(refr.Name, solution);
262 foreach (ReferenceNode refr in otherReferences) 262
263 { 263 if (projectNode == null)
264 ps.Write(" <Reference"); 264 otherReferences.Add(refr);
265 ps.Write(" Include=\""); 265 else
266 ps.Write(refr.Name); 266 projectReferences.Add(refr, projectNode);
267 ps.WriteLine("\" >"); 267 }
268 ps.Write(" <Name>"); 268 // Assembly References
269 ps.Write(refr.Name); 269 ps.WriteLine(" <ItemGroup>");
270 ps.WriteLine("</Name>"); 270
271 271 foreach (ReferenceNode refr in otherReferences)
272 if(!String.IsNullOrEmpty(refr.Path)) 272 {
273 { 273 ps.Write(" <Reference");
274 // Use absolute path to assembly (for determining assembly type) 274 ps.Write(" Include=\"");
275 string absolutePath = Path.Combine(project.FullPath, refr.Path); 275 ps.Write(refr.Name);
276 if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) { 276 ps.WriteLine("\" >");
277 // Assembly is an executable (exe) 277 ps.Write(" <Name>");
278 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe")); 278 ps.Write(refr.Name);
279 } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) { 279 ps.WriteLine("</Name>");
280 // Assembly is an library (dll) 280
281 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); 281 if(!String.IsNullOrEmpty(refr.Path))
282 } else { 282 {
283 string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll"); 283 // Use absolute path to assembly (for determining assembly type)
284 kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath); 284 string absolutePath = Path.Combine(project.FullPath, refr.Path);
285 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); 285 if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) {
286 } 286 // Assembly is an executable (exe)
287 } 287 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
288 288 } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) {
289 ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy); 289 // Assembly is an library (dll)
290 ps.WriteLine(" </Reference>"); 290 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
291 } 291 } else {
292 ps.WriteLine(" </ItemGroup>"); 292 string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll");
293 293 kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath);
294 //Project References 294 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
295 ps.WriteLine(" <ItemGroup>"); 295 }
296 foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences) 296 }
297 { 297
298 ToolInfo tool = tools[pair.Value.Language]; 298 ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
299 if (tools == null) 299 ps.WriteLine(" </Reference>");
300 throw new UnknownLanguageException(); 300 }
301 301 ps.WriteLine(" </ItemGroup>");
302 string path = 302
303 Helper.MakePathRelativeTo(project.FullPath, 303 //Project References
304 Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension)); 304 ps.WriteLine(" <ItemGroup>");
305 ps.WriteLine(" <ProjectReference Include=\"{0}\">", path); 305 foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences)
306 306 {
307 // TODO: Allow reference to visual basic projects 307 ToolInfo tool = tools[pair.Value.Language];
308 ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name); 308 if (tools == null)
309 ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper()); 309 throw new UnknownLanguageException();
310 ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper()); 310
311 311 string path =
312 //This is the Copy Local flag in VS 312 Helper.MakePathRelativeTo(project.FullPath,
313 ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy); 313 Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension));
314 314 ps.WriteLine(" <ProjectReference Include=\"{0}\">", path);
315 ps.WriteLine(" </ProjectReference>"); 315
316 } 316 // TODO: Allow reference to visual basic projects
317 ps.WriteLine(" </ItemGroup>"); 317 ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name);
318 318 ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper());
319 // ps.WriteLine(" </Build>"); 319 ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper());
320 ps.WriteLine(" <ItemGroup>"); 320
321 321 //This is the Copy Local flag in VS
322 // ps.WriteLine(" <Include>"); 322 ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy);
323 List<string> list = new List<string>(); 323
324 324 ps.WriteLine(" </ProjectReference>");
325 foreach (string path in project.Files) 325 }
326 { 326 ps.WriteLine(" </ItemGroup>");
327 string lower = path.ToLower(); 327
328 if (lower.EndsWith(".resx")) 328 // ps.WriteLine(" </Build>");
329 { 329 ps.WriteLine(" <ItemGroup>");
330 string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension); 330
331 if (!list.Contains(codebehind)) 331 // ps.WriteLine(" <Include>");
332 list.Add(codebehind); 332 List<string> list = new List<string>();
333 } 333
334 334 foreach (string path in project.Files)
335 } 335 {
336 336 string lower = path.ToLower();
337 foreach (string filePath in project.Files) 337 if (lower.EndsWith(".resx"))
338 { 338 {
339 // if (file == "Properties\\Bind.Designer.cs") 339 string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension);
340 // { 340 if (!list.Contains(codebehind))
341 // Console.WriteLine("Wait a minute!"); 341 list.Add(codebehind);
342 // Console.WriteLine(project.Files.GetSubType(file).ToString()); 342 }
343 // } 343
344 SubType subType = project.Files.GetSubType(filePath); 344 }
345 345
346 // Visual Studio chokes on file names if forward slash is used as a path separator 346
347 // instead of backslash. So we must make sure that all file paths written to the 347 foreach (string filePath in project.Files)
348 // project file use \ as a path separator. 348 {
349 string file = filePath.Replace(@"/", @"\"); 349 // Add the filePath with the destination as the key
350 350 // will use it later to form the copy parameters with Include lists
351 if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer 351 // for each destination
352 && subType != SubType.CodeBehind) 352 if (project.Files.GetBuildAction(filePath) == BuildAction.Copy)
353 { 353 continue;
354 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); 354 // if (file == "Properties\\Bind.Designer.cs")
355 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file)); 355 // {
356 ps.WriteLine(" <SubType>Designer</SubType>"); 356 // Console.WriteLine("Wait a minute!");
357 ps.WriteLine(" </EmbeddedResource>"); 357 // Console.WriteLine(project.Files.GetSubType(file).ToString());
358 // 358 // }
359 } 359 SubType subType = project.Files.GetSubType(filePath);
360 360
361 if (subType == SubType.Designer) 361 // Visual Studio chokes on file names if forward slash is used as a path separator
362 { 362 // instead of backslash. So we must make sure that all file paths written to the
363 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file); 363 // project file use \ as a path separator.
364 364 string file = filePath.Replace(@"/", @"\");
365 string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs"; 365
366 string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs"; 366 if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer
367 367 && subType != SubType.CodeBehind)
368 // Check for a parent .cs file with the same name as this designer file 368 {
369 if (File.Exists(Helper.NormalizePath(dependent_name))) 369 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
370 { 370 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
371 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); 371 ps.WriteLine(" <SubType>Designer</SubType>");
372 } 372 ps.WriteLine(" </EmbeddedResource>");
373 else 373 //
374 { 374 }
375 ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>"); 375
376 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name)); 376 if (subType == SubType.Designer)
377 ps.WriteLine(" <SubType>" + subType + "</SubType>"); 377 {
378 } 378 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
379 379
380 ps.WriteLine(" </EmbeddedResource>"); 380 string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs";
381 if (File.Exists(Helper.NormalizePath(autogen_name))) 381 string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs";
382 { 382
383 ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name); 383 // Check for a parent .cs file with the same name as this designer file
384 //ps.WriteLine(" <DesignTime>True</DesignTime>"); 384 if (File.Exists(Helper.NormalizePath(dependent_name)))
385 385 {
386 // If a parent .cs file exists, link this autogen file to it. Otherwise link 386 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
387 // to the designer file 387 }
388 if (File.Exists(dependent_name)) 388 else
389 { 389 {
390 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); 390 ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
391 } 391 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
392 else 392 ps.WriteLine(" <SubType>" + subType + "</SubType>");
393 { 393 }
394 ps.WriteLine(" <AutoGen>True</AutoGen>"); 394
395 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath)); 395 ps.WriteLine(" </EmbeddedResource>");
396 } 396 if (File.Exists(Helper.NormalizePath(autogen_name)))
397 397 {
398 ps.WriteLine(" </Compile>"); 398 ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
399 } 399 //ps.WriteLine(" <DesignTime>True</DesignTime>");
400 list.Add(autogen_name); 400
401 } 401 // If a parent .cs file exists, link this autogen file to it. Otherwise link
402 if (subType == SubType.Settings) 402 // to the designer file
403 { 403 if (File.Exists(dependent_name))
404 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); 404 {
405 ps.WriteLine("Include=\"{0}\">", file); 405 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
406 string fileName = Path.GetFileName(filePath); 406 }
407 if (project.Files.GetBuildAction(filePath) == BuildAction.None) 407 else
408 { 408 {
409 ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>"); 409 ps.WriteLine(" <AutoGen>True</AutoGen>");
410 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); 410 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
411 } 411 }
412 else 412
413 { 413 ps.WriteLine(" </Compile>");
414 ps.WriteLine(" <SubType>Code</SubType>"); 414 }
415 ps.WriteLine(" <AutoGen>True</AutoGen>"); 415 list.Add(autogen_name);
416 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); 416 }
417 string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.')); 417 if (subType == SubType.Settings)
418 string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.')); 418 {
419 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings")); 419 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
420 } 420 ps.WriteLine("Include=\"{0}\">", file);
421 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); 421 string fileName = Path.GetFileName(filePath);
422 } 422 if (project.Files.GetBuildAction(filePath) == BuildAction.None)
423 else if (subType != SubType.Designer) 423 {
424 { 424 ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
425 string path = Helper.NormalizePath(file); 425 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
426 string path_lower = path.ToLower(); 426 }
427 427 else
428 if (!list.Contains(filePath)) 428 {
429 { 429 ps.WriteLine(" <SubType>Code</SubType>");
430 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); 430 ps.WriteLine(" <AutoGen>True</AutoGen>");
431 431 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
432 int startPos = 0; 432 string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
433 if (project.Files.GetPreservePath(filePath)) 433 string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
434 { 434 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
435 while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1) 435 }
436 startPos++; 436 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
437 437 }
438 } 438 else if (subType != SubType.Designer)
439 else 439 {
440 { 440 string path = Helper.NormalizePath(file);
441 startPos = file.LastIndexOf(Path.GetFileName(path)); 441 string path_lower = path.ToLower();
442 } 442
443 443 if (!list.Contains(filePath))
444 // be sure to write out the path with backslashes so VS recognizes 444 {
445 // the file properly. 445 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
446 ps.WriteLine("Include=\"{0}\">", file); 446
447 447 int startPos = 0;
448 int last_period_index = file.LastIndexOf('.'); 448 if (project.Files.GetPreservePath(filePath))
449 string short_file_name = file.Substring(0, last_period_index); 449 {
450 string extension = Path.GetExtension(path); 450 while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1)
451 // make this upper case, so that when File.Exists tests for the 451 startPos++;
452 // existence of a designer file on a case-sensitive platform, 452
453 // it is correctly identified. 453 }
454 string designer_format = string.Format(".Designer{0}", extension); 454 else
455 455 {
456 if (path_lower.EndsWith(designer_format.ToLowerInvariant())) 456 startPos = file.LastIndexOf(Path.GetFileName(path));
457 { 457 }
458 int designer_index = path.IndexOf(designer_format); 458
459 string file_name = path.Substring(0, designer_index); 459 // be sure to write out the path with backslashes so VS recognizes
460 460 // the file properly.
461 // There are two corrections to the next lines: 461 ps.WriteLine("Include=\"{0}\">", file);
462 // 1. Fix the connection between a designer file and a form 462
463 // or usercontrol that don't have an associated resx file. 463 int last_period_index = file.LastIndexOf('.');
464 // 2. Connect settings files to associated designer files. 464 string short_file_name = (last_period_index >= 0)
465 if (File.Exists(file_name + extension)) 465 ? file.Substring(0, last_period_index)
466 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension)); 466 : file;
467 else if (File.Exists(file_name + ".resx")) 467 string extension = Path.GetExtension(path);
468 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx")); 468 // make this upper case, so that when File.Exists tests for the
469 else if (File.Exists(file_name + ".settings")) 469 // existence of a designer file on a case-sensitive platform,
470 { 470 // it is correctly identified.
471 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings")); 471 string designer_format = string.Format(".Designer{0}", extension);
472 ps.WriteLine(" <AutoGen>True</AutoGen>"); 472
473 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); 473 if (path_lower.EndsWith(designer_format.ToLowerInvariant()))
474 } 474 {
475 } 475 int designer_index = path.IndexOf(designer_format);
476 else if (subType == SubType.CodeBehind) 476 string file_name = path.Substring(0, designer_index);
477 { 477
478 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name)); 478 // There are two corrections to the next lines:
479 } 479 // 1. Fix the connection between a designer file and a form
480 if (project.Files.GetIsLink(filePath)) 480 // or usercontrol that don't have an associated resx file.
481 { 481 // 2. Connect settings files to associated designer files.
482 string alias = project.Files.GetLinkPath(filePath); 482 if (File.Exists(file_name + extension))
483 alias += file.Substring(startPos); 483 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
484 alias = Helper.NormalizePath(alias); 484 else if (File.Exists(file_name + ".resx"))
485 ps.WriteLine(" <Link>{0}</Link>", alias); 485 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
486 } 486 else if (File.Exists(file_name + ".settings"))
487 else if (project.Files.GetBuildAction(filePath) != BuildAction.None) 487 {
488 { 488 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
489 if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource) 489 ps.WriteLine(" <AutoGen>True</AutoGen>");
490 { 490 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
491 ps.WriteLine(" <SubType>{0}</SubType>", subType); 491 }
492 } 492 }
493 } 493 else if (subType == SubType.CodeBehind)
494 494 {
495 if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never) 495 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
496 { 496 }
497 ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath)); 497 if (project.Files.GetIsLink(filePath))
498 } 498 {
499 499 string alias = project.Files.GetLinkPath(filePath);
500 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); 500 alias += file.Substring(startPos);
501 } 501 alias = Helper.NormalizePath(alias);
502 } 502 ps.WriteLine(" <Link>{0}</Link>", alias);
503 } 503 }
504 504 else if (project.Files.GetBuildAction(filePath) != BuildAction.None)
505 ps.WriteLine(" </ItemGroup>"); 505 {
506 ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />"); 506 if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource)
507 ps.WriteLine(" <PropertyGroup>"); 507 {
508 ps.WriteLine(" <PreBuildEvent>"); 508 ps.WriteLine(" <SubType>{0}</SubType>", subType);
509 ps.WriteLine(" </PreBuildEvent>"); 509 }
510 ps.WriteLine(" <PostBuildEvent>"); 510 }
511 ps.WriteLine(" </PostBuildEvent>"); 511
512 ps.WriteLine(" </PropertyGroup>"); 512 if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never)
513 ps.WriteLine("</Project>"); 513 {
514 } 514 ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
515 #endregion 515 }
516 516
517 #region User File 517 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
518 518 }
519 ps = new StreamWriter(projectFile + ".user"); 519 }
520 using (ps) 520 }
521 { 521 ps.WriteLine(" </ItemGroup>");
522 // Get the first configuration from the project. 522
523 ConfigurationNode firstConfiguration = null; 523 /*
524 524 * Copy Task
525 if (project.Configurations.Count > 0) 525 *
526 { 526 */
527 firstConfiguration = project.Configurations[0]; 527 if ( project.Files.CopyFiles > 0 ) {
528 } 528
529 529 Dictionary<string, string> IncludeTags = new Dictionary<string, string>();
530 ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">"); 530 int TagCount = 0;
531 //ps.WriteLine( "<VisualStudioProject>" ); 531
532 //ps.WriteLine(" <{0}>", toolInfo.XMLTag); 532 // Handle Copy tasks
533 //ps.WriteLine(" <Build>"); 533 ps.WriteLine(" <ItemGroup>");
534 ps.WriteLine(" <PropertyGroup>"); 534 foreach (string destPath in project.Files.Destinations)
535 //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); 535 {
536 536 string tag = "FilesToCopy_" + TagCount.ToString("0000");
537 if (firstConfiguration != null) 537
538 { 538 ps.WriteLine(" <{0} Include=\"{1}\" />", tag, String.Join(";", project.Files.SourceFiles(destPath)));
539 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name); 539 IncludeTags.Add(destPath, tag);
540 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform); 540 TagCount++;
541 } 541 }
542 542
543 ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project)); 543 ps.WriteLine(" </ItemGroup>");
544 ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion); 544
545 ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>"); 545 ps.WriteLine(" <Target Name=\"CopyFiles\">");
546 ps.WriteLine(" <ProjectTrust>0</ProjectTrust>"); 546
547 ps.WriteLine(" </PropertyGroup>"); 547 foreach (string destPath in project.Files.Destinations)
548 foreach (ConfigurationNode conf in project.Configurations) 548 {
549 { 549 ps.WriteLine(" <Copy SourceFiles=\"@({0})\" DestinationFolder=\"{1}\" />",
550 ps.Write(" <PropertyGroup"); 550 IncludeTags[destPath], destPath);
551 ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform); 551 }
552 ps.WriteLine(" />"); 552
553 } 553 ps.WriteLine(" </Target>");
554 ps.WriteLine("</Project>"); 554 }
555 } 555
556 #endregion 556 ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
557 557 ps.WriteLine(" <PropertyGroup>");
558 kernel.CurrentWorkingDirectory.Pop(); 558 ps.WriteLine(" <PreBuildEvent>");
559 } 559 ps.WriteLine(" </PreBuildEvent>");
560 560 ps.WriteLine(" <PostBuildEvent>");
561 private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) 561 ps.WriteLine(" </PostBuildEvent>");
562 { 562 ps.WriteLine(" </PropertyGroup>");
563 kernel.Log.Write("Creating {0} solution and project files", VersionName); 563 ps.WriteLine("</Project>");
564 564 }
565 foreach (SolutionNode child in solution.Solutions) 565 #endregion
566 { 566
567 kernel.Log.Write("...Creating folder: {0}", child.Name); 567 #region User File
568 WriteSolution(child, false); 568
569 } 569 ps = new StreamWriter(projectFile + ".user");
570 570 using (ps)
571 foreach (ProjectNode project in solution.Projects) 571 {
572 { 572 // Get the first configuration from the project.
573 kernel.Log.Write("...Creating project: {0}", project.Name); 573 ConfigurationNode firstConfiguration = null;
574 WriteProject(solution, project); 574
575 } 575 if (project.Configurations.Count > 0)
576 576 {
577 foreach (DatabaseProjectNode project in solution.DatabaseProjects) 577 firstConfiguration = project.Configurations[0];
578 { 578 }
579 kernel.Log.Write("...Creating database project: {0}", project.Name); 579
580 WriteDatabaseProject(solution, project); 580 ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
581 } 581 //ps.WriteLine( "<VisualStudioProject>" );
582 582 //ps.WriteLine(" <{0}>", toolInfo.XMLTag);
583 if (writeSolutionToDisk) // only write main solution 583 //ps.WriteLine(" <Build>");
584 { 584 ps.WriteLine(" <PropertyGroup>");
585 kernel.Log.Write(""); 585 //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
586 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 586
587 587 if (firstConfiguration != null)
588 using (StreamWriter ss = new StreamWriter(solutionFile)) 588 {
589 { 589 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name);
590 kernel.CurrentWorkingDirectory.Push(); 590 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform);
591 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); 591 }
592 592
593 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); 593 ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project));
594 ss.WriteLine(SolutionTag); 594 ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion);
595 595 ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>");
596 WriteProjectDeclarations(ss, solution, solution); 596 ps.WriteLine(" <ProjectTrust>0</ProjectTrust>");
597 597 ps.WriteLine(" </PropertyGroup>");
598 ss.WriteLine("Global"); 598 foreach (ConfigurationNode conf in project.Configurations)
599 599 {
600 ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); 600 ps.Write(" <PropertyGroup");
601 foreach (ConfigurationNode conf in solution.Configurations) 601 ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform);
602 { 602 ps.WriteLine(" />");
603 ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform); 603 }
604 } 604 ps.WriteLine("</Project>");
605 ss.WriteLine("\tEndGlobalSection"); 605 }
606 606 #endregion
607 ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); 607
608 WriteConfigurationLines(solution.Configurations, solution, ss); 608 kernel.CurrentWorkingDirectory.Pop();
609 ss.WriteLine("\tEndGlobalSection"); 609 }
610 610
611 if (solution.Solutions.Count > 0) 611 private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk)
612 { 612 {
613 ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution"); 613 kernel.Log.Write("Creating {0} solution and project files", VersionName);
614 foreach (SolutionNode embeddedSolution in solution.Solutions) 614
615 { 615 foreach (SolutionNode child in solution.Solutions)
616 WriteNestedProjectMap(ss, embeddedSolution); 616 {
617 } 617 kernel.Log.Write("...Creating folder: {0}", child.Name);
618 ss.WriteLine("\tEndGlobalSection"); 618 WriteSolution(child, false);
619 } 619 }
620 620
621 ss.WriteLine("EndGlobal"); 621 foreach (ProjectNode project in solution.Projects)
622 } 622 {
623 623 kernel.Log.Write("...Creating project: {0}", project.Name);
624 kernel.CurrentWorkingDirectory.Pop(); 624 WriteProject(solution, project);
625 } 625 }
626 } 626
627 627 foreach (DatabaseProjectNode project in solution.DatabaseProjects)
628 private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) 628 {
629 { 629 kernel.Log.Write("...Creating database project: {0}", project.Name);
630 foreach (SolutionNode childSolution in embeddedSolution.Solutions) 630 WriteDatabaseProject(solution, project);
631 { 631 }
632 WriteEmbeddedSolution(writer, childSolution); 632
633 WriteProjectDeclarations(writer, actualSolution, childSolution); 633 if (writeSolutionToDisk) // only write main solution
634 } 634 {
635 635 kernel.Log.Write("");
636 foreach (ProjectNode project in embeddedSolution.Projects) 636 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
637 { 637
638 WriteProject(actualSolution, writer, project); 638 using (StreamWriter ss = new StreamWriter(solutionFile))
639 } 639 {
640 640 kernel.CurrentWorkingDirectory.Push();
641 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) 641 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
642 { 642
643 WriteProject(actualSolution, writer, dbProject); 643 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion);
644 } 644 ss.WriteLine(SolutionTag);
645 645
646 if (actualSolution.Guid == embeddedSolution.Guid) 646 WriteProjectDeclarations(ss, solution, solution);
647 { 647
648 WriteSolutionFiles(actualSolution, writer); 648 ss.WriteLine("Global");
649 } 649
650 } 650 ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");
651 651 foreach (ConfigurationNode conf in solution.Configurations)
652 private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution) 652 {
653 { 653 ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform);
654 foreach (ProjectNode project in embeddedSolution.Projects) 654 }
655 { 655 ss.WriteLine("\tEndGlobalSection");
656 WriteNestedProject(writer, embeddedSolution, project.Guid); 656
657 } 657 ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
658 658 WriteConfigurationLines(solution.Configurations, solution, ss);
659 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) 659 ss.WriteLine("\tEndGlobalSection");
660 { 660
661 WriteNestedProject(writer, embeddedSolution, dbProject.Guid); 661 if (solution.Solutions.Count > 0)
662 } 662 {
663 663 ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution");
664 foreach (SolutionNode child in embeddedSolution.Solutions) 664 foreach (SolutionNode embeddedSolution in solution.Solutions)
665 { 665 {
666 WriteNestedProject(writer, embeddedSolution, child.Guid); 666 WriteNestedProjectMap(ss, embeddedSolution);
667 WriteNestedProjectMap(writer, child); 667 }
668 } 668 ss.WriteLine("\tEndGlobalSection");
669 } 669 }
670 670
671 private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid) 671 ss.WriteLine("EndGlobal");
672 { 672 }
673 WriteNestedFolder(writer, solution.Guid, projectGuid); 673
674 } 674 kernel.CurrentWorkingDirectory.Pop();
675 675 }
676 private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid) 676 }
677 { 677
678 writer.WriteLine("\t\t{0} = {1}", 678 private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution)
679 childGuid.ToString("B").ToUpper(), 679 {
680 parentGuid.ToString("B").ToUpper()); 680 foreach (SolutionNode childSolution in embeddedSolution.Solutions)
681 } 681 {
682 682 WriteEmbeddedSolution(writer, childSolution);
683 private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss) 683 WriteProjectDeclarations(writer, actualSolution, childSolution);
684 { 684 }
685 foreach (ProjectNode project in solution.Projects) 685
686 { 686 foreach (ProjectNode project in embeddedSolution.Projects)
687 foreach (ConfigurationNode conf in configurations) 687 {
688 { 688 WriteProject(actualSolution, writer, project);
689 ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}", 689 }
690 project.Guid.ToString("B").ToUpper(), 690
691 conf.NameAndPlatform); 691 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
692 692 {
693 ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}", 693 WriteProject(actualSolution, writer, dbProject);
694 project.Guid.ToString("B").ToUpper(), 694 }
695 conf.NameAndPlatform); 695
696 } 696 if (actualSolution.Guid == embeddedSolution.Guid)
697 } 697 {
698 698 WriteSolutionFiles(actualSolution, writer);
699 foreach (SolutionNode child in solution.Solutions) 699 }
700 { 700 }
701 WriteConfigurationLines(configurations, child, ss); 701
702 } 702 private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution)
703 } 703 {
704 704 foreach (ProjectNode project in embeddedSolution.Projects)
705 private void WriteSolutionFiles(SolutionNode solution, TextWriter ss) 705 {
706 { 706 WriteNestedProject(writer, embeddedSolution, project.Guid);
707 if(solution.Files != null && solution.Files.Count > 0) 707 }
708 WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); 708
709 } 709 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
710 710 {
711 private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution) 711 WriteNestedProject(writer, embeddedSolution, dbProject.Guid);
712 { 712 }
713 WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files); 713
714 } 714 foreach (SolutionNode child in embeddedSolution.Solutions)
715 715 {
716 private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project) 716 WriteNestedProject(writer, embeddedSolution, child.Guid);
717 { 717 WriteNestedProjectMap(writer, child);
718 WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath); 718 }
719 } 719 }
720 720
721 private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject) 721 private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid)
722 { 722 {
723 if (solution.Files != null && solution.Files.Count > 0) 723 WriteNestedFolder(writer, solution.Guid, projectGuid);
724 WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath); 724 }
725 } 725
726 726 private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid)
727 const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\""; 727 {
728 const string ProjectDeclarationEndFormat = "EndProject"; 728 writer.WriteLine("\t\t{0} = {1}",
729 729 childGuid.ToString("B").ToUpper(),
730 private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) 730 parentGuid.ToString("B").ToUpper());
731 { 731 }
732 if (!tools.ContainsKey(language)) 732
733 throw new UnknownLanguageException("Unknown .NET language: " + language); 733 private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss)
734 734 {
735 ToolInfo toolInfo = tools[language]; 735 foreach (ProjectNode project in solution.Projects)
736 736 {
737 string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath); 737 foreach (ConfigurationNode conf in configurations)
738 738 {
739 path = Helper.MakeFilePath(path, name, toolInfo.FileExtension); 739 ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}",
740 740 project.Guid.ToString("B").ToUpper(),
741 WriteProject(ss, language, guid, name, path); 741 conf.NameAndPlatform);
742 } 742
743 743 ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}",
744 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location) 744 project.Guid.ToString("B").ToUpper(),
745 { 745 conf.NameAndPlatform);
746 WriteProject(writer, language, projectGuid, name, location, null); 746 }
747 } 747 }
748 748
749 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) 749 foreach (SolutionNode child in solution.Solutions)
750 { 750 {
751 if (!tools.ContainsKey(language)) 751 WriteConfigurationLines(configurations, child, ss);
752 throw new UnknownLanguageException("Unknown .NET language: " + language); 752 }
753 753 }
754 ToolInfo toolInfo = tools[language]; 754
755 755 private void WriteSolutionFiles(SolutionNode solution, TextWriter ss)
756 writer.WriteLine(ProjectDeclarationBeginFormat, 756 {
757 toolInfo.Guid, 757 if(solution.Files != null && solution.Files.Count > 0)
758 name, 758 WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files);
759 location, 759 }
760 projectGuid.ToString("B").ToUpper()); 760
761 761 private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution)
762 if (files != null) 762 {
763 { 763 WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files);
764 writer.WriteLine("\tProjectSection(SolutionItems) = preProject"); 764 }
765 765
766 foreach (string file in files) 766 private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project)
767 writer.WriteLine("\t\t{0} = {0}", file); 767 {
768 768 WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath);
769 writer.WriteLine("\tEndProjectSection"); 769 }
770 } 770
771 771 private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject)
772 writer.WriteLine(ProjectDeclarationEndFormat); 772 {
773 } 773 if (solution.Files != null && solution.Files.Count > 0)
774 774 WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath);
775 private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project) 775 }
776 { 776
777 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp"); 777 const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\"";
778 IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); 778 const string ProjectDeclarationEndFormat = "EndProject";
779 779
780 kernel.CurrentWorkingDirectory.Push(); 780 private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath)
781 781 {
782 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); 782 if (!tools.ContainsKey(language))
783 783 throw new UnknownLanguageException("Unknown .NET language: " + language);
784 using (ps) 784
785 { 785 ToolInfo toolInfo = tools[language];
786 ps.WriteLine("# Microsoft Developer Studio Project File - Database Project"); 786
787 ps.WriteLine("Begin DataProject = \"{0}\"", project.Name); 787 string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath);
788 ps.Indent++; 788
789 ps.WriteLine("MSDTVersion = \"80\""); 789 path = Helper.MakeFilePath(path, name, toolInfo.FileExtension);
790 // TODO: Use the project.Files property 790
791 if (ContainsSqlFiles(Path.GetDirectoryName(projectFile))) 791 WriteProject(ss, language, guid, name, path);
792 WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile)); 792 }
793 793
794 ps.WriteLine("Begin DBRefFolder = \"Database References\""); 794 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location)
795 ps.Indent++; 795 {
796 foreach (DatabaseReferenceNode reference in project.References) 796 WriteProject(writer, language, projectGuid, name, location, null);
797 { 797 }
798 ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name); 798
799 ps.Indent++; 799 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files)
800 ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString); 800 {
801 ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper()); 801 if (!tools.ContainsKey(language))
802 //ps.WriteLine("Colorizer = 5"); 802 throw new UnknownLanguageException("Unknown .NET language: " + language);
803 ps.Indent--; 803
804 ps.WriteLine("End"); 804 ToolInfo toolInfo = tools[language];
805 } 805
806 ps.Indent--; 806 writer.WriteLine(ProjectDeclarationBeginFormat,
807 ps.WriteLine("End"); 807 toolInfo.Guid,
808 ps.Indent--; 808 name,
809 ps.WriteLine("End"); 809 location,
810 810 projectGuid.ToString("B").ToUpper());
811 ps.Flush(); 811
812 } 812 if (files != null)
813 813 {
814 kernel.CurrentWorkingDirectory.Pop(); 814 writer.WriteLine("\tProjectSection(SolutionItems) = preProject");
815 } 815
816 816 foreach (string file in files)
817 private static bool ContainsSqlFiles(string folder) 817 writer.WriteLine("\t\t{0} = {0}", file);
818 { 818
819 if(Directory.GetFiles(folder, "*.sql").Length > 0) 819 writer.WriteLine("\tEndProjectSection");
820 return true; // if the folder contains 1 .sql file, that's good enough 820 }
821 821
822 foreach (string child in Directory.GetDirectories(folder)) 822 writer.WriteLine(ProjectDeclarationEndFormat);
823 { 823 }
824 if (ContainsSqlFiles(child)) 824
825 return true; // if 1 child folder contains a .sql file, still good enough 825 private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project)
826 } 826 {
827 827 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp");
828 return false; 828 IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " ");
829 } 829
830 830 kernel.CurrentWorkingDirectory.Push();
831 private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) 831
832 { 832 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
833 foreach (string child in Directory.GetDirectories(folder)) 833
834 { 834 using (ps)
835 if (ContainsSqlFiles(child)) 835 {
836 { 836 ps.WriteLine("# Microsoft Developer Studio Project File - Database Project");
837 writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child)); 837 ps.WriteLine("Begin DataProject = \"{0}\"", project.Name);
838 writer.Indent++; 838 ps.Indent++;
839 WriteDatabaseFoldersAndFiles(writer, child); 839 ps.WriteLine("MSDTVersion = \"80\"");
840 writer.Indent--; 840 // TODO: Use the project.Files property
841 writer.WriteLine("End"); 841 if (ContainsSqlFiles(Path.GetDirectoryName(projectFile)))
842 } 842 WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile));
843 } 843
844 foreach (string file in Directory.GetFiles(folder, "*.sql")) 844 ps.WriteLine("Begin DBRefFolder = \"Database References\"");
845 { 845 ps.Indent++;
846 writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file)); 846 foreach (DatabaseReferenceNode reference in project.References)
847 } 847 {
848 } 848 ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name);
849 849 ps.Indent++;
850 private void CleanProject(ProjectNode project) 850 ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString);
851 { 851 ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper());
852 kernel.Log.Write("...Cleaning project: {0}", project.Name); 852 //ps.WriteLine("Colorizer = 5");
853 853 ps.Indent--;
854 ToolInfo toolInfo = tools[project.Language]; 854 ps.WriteLine("End");
855 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 855 }
856 string userFile = projectFile + ".user"; 856 ps.Indent--;
857 857 ps.WriteLine("End");
858 Helper.DeleteIfExists(projectFile); 858 ps.Indent--;
859 Helper.DeleteIfExists(userFile); 859 ps.WriteLine("End");
860 } 860
861 861 ps.Flush();
862 private void CleanSolution(SolutionNode solution) 862 }
863 { 863
864 kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name); 864 kernel.CurrentWorkingDirectory.Pop();
865 865 }
866 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 866
867 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); 867 private static bool ContainsSqlFiles(string folder)
868 868 {
869 Helper.DeleteIfExists(slnFile); 869 if(Directory.GetFiles(folder, "*.sql").Length > 0)
870 Helper.DeleteIfExists(suoFile); 870 return true; // if the folder contains 1 .sql file, that's good enough
871 871
872 foreach (ProjectNode project in solution.Projects) 872 foreach (string child in Directory.GetDirectories(folder))
873 { 873 {
874 CleanProject(project); 874 if (ContainsSqlFiles(child))
875 } 875 return true; // if 1 child folder contains a .sql file, still good enough
876 876 }
877 kernel.Log.Write(""); 877
878 } 878 return false;
879 879 }
880 #endregion 880
881 881 private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder)
882 #region ITarget Members 882 {
883 883 foreach (string child in Directory.GetDirectories(folder))
884 /// <summary> 884 {
885 /// Writes the specified kern. 885 if (ContainsSqlFiles(child))
886 /// </summary> 886 {
887 /// <param name="kern">The kern.</param> 887 writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child));
888 public virtual void Write(Kernel kern) 888 writer.Indent++;
889 { 889 WriteDatabaseFoldersAndFiles(writer, child);
890 if (kern == null) 890 writer.Indent--;
891 { 891 writer.WriteLine("End");
892 throw new ArgumentNullException("kern"); 892 }
893 } 893 }
894 kernel = kern; 894 foreach (string file in Directory.GetFiles(folder, "*.sql"))
895 foreach (SolutionNode sol in kernel.Solutions) 895 {
896 { 896 writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file));
897 WriteSolution(sol, true); 897 }
898 } 898 }
899 kernel = null; 899
900 } 900 private void CleanProject(ProjectNode project)
901 901 {
902 /// <summary> 902 kernel.Log.Write("...Cleaning project: {0}", project.Name);
903 /// Cleans the specified kern. 903
904 /// </summary> 904 ToolInfo toolInfo = tools[project.Language];
905 /// <param name="kern">The kern.</param> 905 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
906 public virtual void Clean(Kernel kern) 906 string userFile = projectFile + ".user";
907 { 907
908 if (kern == null) 908 Helper.DeleteIfExists(projectFile);
909 { 909 Helper.DeleteIfExists(userFile);
910 throw new ArgumentNullException("kern"); 910 }
911 } 911
912 kernel = kern; 912 private void CleanSolution(SolutionNode solution)
913 foreach (SolutionNode sol in kernel.Solutions) 913 {
914 { 914 kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name);
915 CleanSolution(sol); 915
916 } 916 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
917 kernel = null; 917 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
918 } 918
919 919 Helper.DeleteIfExists(slnFile);
920 #endregion 920 Helper.DeleteIfExists(suoFile);
921 } 921
922} 922 foreach (ProjectNode project in solution.Projects)
923 {
924 CleanProject(project);
925 }
926
927 kernel.Log.Write("");
928 }
929
930 #endregion
931
932 #region ITarget Members
933
934 /// <summary>
935 /// Writes the specified kern.
936 /// </summary>
937 /// <param name="kern">The kern.</param>
938 public virtual void Write(Kernel kern)
939 {
940 if (kern == null)
941 {
942 throw new ArgumentNullException("kern");
943 }
944 kernel = kern;
945 foreach (SolutionNode sol in kernel.Solutions)
946 {
947 WriteSolution(sol, true);
948 }
949 kernel = null;
950 }
951
952 /// <summary>
953 /// Cleans the specified kern.
954 /// </summary>
955 /// <param name="kern">The kern.</param>
956 public virtual void Clean(Kernel kern)
957 {
958 if (kern == null)
959 {
960 throw new ArgumentNullException("kern");
961 }
962 kernel = kern;
963 foreach (SolutionNode sol in kernel.Solutions)
964 {
965 CleanSolution(sol);
966 }
967 kernel = null;
968 }
969
970 #endregion
971 }
972}
diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs
index 081c89c..35a5dfa 100644
--- a/Prebuild/src/Prebuild.cs
+++ b/Prebuild/src/Prebuild.cs
@@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: kunnis $ 29 * $Author: kunnis $
30 * $Date: 2009-04-15 02:33:14 +0100 (Wed, 15 Apr 2009) $ 30 * $Date: 2009-04-14 21:33:14 -0400 (Tue, 14 Apr 2009) $
31 * $Revision: 308 $ 31 * $Revision: 308 $
32 */ 32 */
33#endregion 33#endregion
diff --git a/Prebuild/src/data/prebuild-1.7.xsd b/Prebuild/src/data/prebuild-1.7.xsd
index 3675503..a7f5c88 100644
--- a/Prebuild/src/data/prebuild-1.7.xsd
+++ b/Prebuild/src/data/prebuild-1.7.xsd
@@ -1,350 +1,350 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"> 2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
3 <xs:annotation> 3 <xs:annotation>
4 <xs:documentation> 4 <xs:documentation>
5 Copyright (c) 2004-2007 5 Copyright (c) 2004-2007
6 Matthew Holmes (calefaction at houston . rr . com), 6 Matthew Holmes (calefaction at houston . rr . com),
7 Dan Moorehead (dan05a at gmail . com), 7 Dan Moorehead (dan05a at gmail . com),
8 David Hudson (jendave at yahoo dot com), 8 David Hudson (jendave at yahoo dot com),
9 C.J. Adams-Collier (cjac at colliertech dot com) 9 C.J. Adams-Collier (cjac at colliertech dot com)
10 10
11 .NET Prebuild is a cross-platform XML-driven pre-build tool which 11 .NET Prebuild is a cross-platform XML-driven pre-build tool which
12 allows developers to easily generate project or make files for major 12 allows developers to easily generate project or make files for major
13 IDE's and .NET development tools including: Visual Studio .NET 2002, 13 IDE's and .NET development tools including: Visual Studio .NET 2002,
14 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools. 14 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools.
15 15
16 BSD License: 16 BSD License:
17 17
18 Redistribution and use in source and binary forms, with or without modification, are permitted 18 Redistribution and use in source and binary forms, with or without modification, are permitted
19 provided that the following conditions are met: 19 provided that the following conditions are met:
20 20
21 * Redistributions of source code must retain the above copyright notice, this list of conditions 21 * Redistributions of source code must retain the above copyright notice, this list of conditions
22 and the following disclaimer. 22 and the following disclaimer.
23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
24 and the following disclaimer in the documentation and/or other materials provided with the 24 and the following disclaimer in the documentation and/or other materials provided with the
25 distribution. 25 distribution.
26 * The name of the author may not be used to endorse or promote products derived from this software 26 * The name of the author may not be used to endorse or promote products derived from this software
27 without specific prior written permission. 27 without specific prior written permission.
28 28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 </xs:documentation> 36 </xs:documentation>
37 </xs:annotation> 37 </xs:annotation>
38 38
39 <xs:element name="Prebuild"> 39 <xs:element name="Prebuild">
40 <xs:complexType> 40 <xs:complexType>
41 <xs:sequence> 41 <xs:sequence>
42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
43 <xs:element ref="Solution" minOccurs="1" maxOccurs="unbounded" /> 43 <xs:element ref="Solution" minOccurs="1" maxOccurs="unbounded" />
44 </xs:sequence> 44 </xs:sequence>
45 <xs:attribute name="version" /> 45 <xs:attribute name="version" />
46 <xs:attribute name="checkOsVars" /> 46 <xs:attribute name="checkOsVars" />
47 </xs:complexType> 47 </xs:complexType>
48 </xs:element> 48 </xs:element>
49 49
50 <xs:element name="Process" type="xs:string" /> 50 <xs:element name="Process" type="xs:string" />
51 51
52 <xs:element name="Solution"> 52 <xs:element name="Solution">
53 <xs:complexType> 53 <xs:complexType>
54 <xs:sequence> 54 <xs:sequence>
55 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" /> 55 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
56 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 56 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
57 <xs:element ref="Options" minOccurs="0" /> 57 <xs:element ref="Options" minOccurs="0" />
58 <xs:element ref="Files" minOccurs="0" /> 58 <xs:element ref="Files" minOccurs="0" />
59 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" /> 59 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
60 <xs:element ref="Cleanup" minOccurs="0" maxOccurs="1" /> 60 <xs:element ref="Cleanup" minOccurs="0" maxOccurs="1" />
61 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" /> 61 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
62 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" /> 62 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
63 </xs:sequence> 63 </xs:sequence>
64 <xs:attribute name="name" type="xs:string" use="required" /> 64 <xs:attribute name="name" type="xs:string" use="required" />
65 <xs:attribute name="activeConfig" type="xs:string" default="Debug" /> 65 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
66 <xs:attribute name="path" type="xs:string" default="" /> 66 <xs:attribute name="path" type="xs:string" default="" />
67 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 67 <xs:attribute name="version" type="xs:string" default="1.0.0" />
68 </xs:complexType> 68 </xs:complexType>
69 </xs:element> 69 </xs:element>
70 70
71 <xs:element name="EmbeddedSolution"> 71 <xs:element name="EmbeddedSolution">
72 <xs:complexType> 72 <xs:complexType>
73 <xs:sequence> 73 <xs:sequence>
74 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 74 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
75 <xs:element ref="Files" minOccurs="0" /> 75 <xs:element ref="Files" minOccurs="0" />
76 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" /> 76 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
77 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" /> 77 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
78 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" /> 78 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
79 </xs:sequence> 79 </xs:sequence>
80 <xs:attribute name="name" type="xs:string" use="required" /> 80 <xs:attribute name="name" type="xs:string" use="required" />
81 <xs:attribute name="activeConfig" type="xs:string" default="Debug" /> 81 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
82 <xs:attribute name="path" type="xs:string" default="" /> 82 <xs:attribute name="path" type="xs:string" default="" />
83 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 83 <xs:attribute name="version" type="xs:string" default="1.0.0" />
84 </xs:complexType> 84 </xs:complexType>
85 </xs:element> 85 </xs:element>
86 86
87 <xs:element name="DatabaseProject"> 87 <xs:element name="DatabaseProject">
88 <xs:complexType> 88 <xs:complexType>
89 <xs:sequence> 89 <xs:sequence>
90 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 90 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
91 <xs:element ref="DatabaseReference" minOccurs="0" maxOccurs="unbounded" /> 91 <xs:element ref="DatabaseReference" minOccurs="0" maxOccurs="unbounded" />
92 </xs:sequence> 92 </xs:sequence>
93 <xs:attribute name="name" type="xs:string" use="required" /> 93 <xs:attribute name="name" type="xs:string" use="required" />
94 <xs:attribute name="path" type="xs:string" /> 94 <xs:attribute name="path" type="xs:string" />
95 </xs:complexType> 95 </xs:complexType>
96 </xs:element> 96 </xs:element>
97 97
98 <xs:element name="DatabaseReference"> 98 <xs:element name="DatabaseReference">
99 <xs:complexType> 99 <xs:complexType>
100 <xs:attribute name="name" type="xs:string" use="required" /> 100 <xs:attribute name="name" type="xs:string" use="required" />
101 <xs:attribute name="providerId" type="xs:string" /> 101 <xs:attribute name="providerId" type="xs:string" />
102 <xs:attribute name="providerName" type="xs:string" /> 102 <xs:attribute name="providerName" type="xs:string" />
103 <xs:attribute name="connectionString" type="xs:string" use="required" /> 103 <xs:attribute name="connectionString" type="xs:string" use="required" />
104 </xs:complexType> 104 </xs:complexType>
105 </xs:element> 105 </xs:element>
106 106
107 <xs:element name="Project"> 107 <xs:element name="Project">
108 <xs:complexType> 108 <xs:complexType>
109 <xs:sequence> 109 <xs:sequence>
110 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 110 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
111 <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" /> 111 <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" />
112 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" /> 112 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
113 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 113 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
114 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded"> 114 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
115 <xs:complexType> 115 <xs:complexType>
116 <xs:attribute name="name" type="xs:string" use="required" /> 116 <xs:attribute name="name" type="xs:string" use="required" />
117 <xs:attribute name="path" type="xs:string" /> 117 <xs:attribute name="path" type="xs:string" />
118 <xs:attribute name="localCopy" type="xs:boolean" /> 118 <xs:attribute name="localCopy" type="xs:boolean" />
119 <xs:attribute name="version" type="xs:string" /> 119 <xs:attribute name="version" type="xs:string" />
120 </xs:complexType> 120 </xs:complexType>
121 </xs:element> 121 </xs:element>
122 <xs:element ref="Files" /> 122 <xs:element ref="Files" />
123 </xs:sequence> 123 </xs:sequence>
124 <xs:attribute name="name" type="xs:string" use="required" /> 124 <xs:attribute name="name" type="xs:string" use="required" />
125 <xs:attribute name="designerFolder" type="xs:string" default="" /> 125 <xs:attribute name="designerFolder" type="xs:string" default="" />
126 <xs:attribute name="filterGroups" type="xs:string" default="" /> 126 <xs:attribute name="filterGroups" type="xs:string" default="" />
127 <xs:attribute name="path" type="xs:string" default="" /> 127 <xs:attribute name="path" type="xs:string" default="" />
128 <xs:attribute name="icon" type="xs:string" default="" /> 128 <xs:attribute name="icon" type="xs:string" default="" />
129 <xs:attribute name="configFile" type="xs:string" default="" /> 129 <xs:attribute name="configFile" type="xs:string" default="" />
130 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 130 <xs:attribute name="version" type="xs:string" default="1.0.0" />
131 <xs:attribute name="guid" type="xs:string"/> 131 <xs:attribute name="guid" type="xs:string"/>
132 <xs:attribute name="language" default="C#"> 132 <xs:attribute name="language" default="C#">
133 <xs:simpleType> 133 <xs:simpleType>
134 <xs:restriction base="xs:string"> 134 <xs:restriction base="xs:string">
135 <xs:enumeration value="C#" /> 135 <xs:enumeration value="C#" />
136 <xs:enumeration value="VB.NET" /> 136 <xs:enumeration value="VB.NET" />
137 </xs:restriction> 137 </xs:restriction>
138 </xs:simpleType> 138 </xs:simpleType>
139 </xs:attribute> 139 </xs:attribute>
140 <xs:attribute name="type" default="Exe"> 140 <xs:attribute name="type" default="Exe">
141 <xs:simpleType> 141 <xs:simpleType>
142 <xs:restriction base="xs:string"> 142 <xs:restriction base="xs:string">
143 <xs:enumeration value="Exe" /> 143 <xs:enumeration value="Exe" />
144 <xs:enumeration value="WinExe" /> 144 <xs:enumeration value="WinExe" />
145 <xs:enumeration value="Library" /> 145 <xs:enumeration value="Library" />
146 <xs:enumeration value="Web" /> 146 <xs:enumeration value="Web" />
147 </xs:restriction> 147 </xs:restriction>
148 </xs:simpleType> 148 </xs:simpleType>
149 </xs:attribute> 149 </xs:attribute>
150 <xs:attribute name="runtime" default="Microsoft"> 150 <xs:attribute name="runtime" default="Microsoft">
151 <xs:simpleType> 151 <xs:simpleType>
152 <xs:restriction base="xs:string"> 152 <xs:restriction base="xs:string">
153 <xs:enumeration value="Microsoft" /> 153 <xs:enumeration value="Microsoft" />
154 <xs:enumeration value="Mono" /> 154 <xs:enumeration value="Mono" />
155 </xs:restriction> 155 </xs:restriction>
156 </xs:simpleType> 156 </xs:simpleType>
157 </xs:attribute> 157 </xs:attribute>
158 <xs:attribute name="frameworkVersion" default="v2_0"> 158 <xs:attribute name="frameworkVersion" default="v2_0">
159 <xs:simpleType> 159 <xs:simpleType>
160 <xs:restriction base="xs:string"> 160 <xs:restriction base="xs:string">
161 <xs:enumeration value="v2_0" /> 161 <xs:enumeration value="v2_0" />
162 <xs:enumeration value="v3_0" /> 162 <xs:enumeration value="v3_0" />
163 <xs:enumeration value="v3_5" /> 163 <xs:enumeration value="v3_5" />
164 </xs:restriction> 164 </xs:restriction>
165 </xs:simpleType> 165 </xs:simpleType>
166 </xs:attribute> 166 </xs:attribute>
167 <xs:attribute name="startupObject" type="xs:string" default="" /> 167 <xs:attribute name="startupObject" type="xs:string" default="" />
168 <xs:attribute name="rootNamespace" type="xs:string" /> 168 <xs:attribute name="rootNamespace" type="xs:string" />
169 <xs:attribute name="debugStartParameters" type="xs:string" /> 169 <xs:attribute name="debugStartParameters" type="xs:string" />
170 <xs:attribute name="assemblyName" type="xs:string" /> 170 <xs:attribute name="assemblyName" type="xs:string" />
171 <xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false" /> 171 <xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false" />
172 </xs:complexType> 172 </xs:complexType>
173 </xs:element> 173 </xs:element>
174 174
175 <xs:element name="Configuration"> 175 <xs:element name="Configuration">
176 <xs:complexType> 176 <xs:complexType>
177 <xs:sequence> 177 <xs:sequence>
178 <xs:element ref="Options" minOccurs="0" /> 178 <xs:element ref="Options" minOccurs="0" />
179 </xs:sequence> 179 </xs:sequence>
180 <xs:attribute name="name" type="xs:string" use="required" /> 180 <xs:attribute name="name" type="xs:string" use="required" />
181 </xs:complexType> 181 </xs:complexType>
182 </xs:element> 182 </xs:element>
183 <xs:element name="Options"> 183 <xs:element name="Options">
184 <xs:complexType> 184 <xs:complexType>
185 <xs:all> 185 <xs:all>
186 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" /> 186 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
187 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" /> 187 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
188 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" /> 188 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
189 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" /> 189 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
190 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" /> 190 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
191 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" /> 191 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
192 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess"> 192 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
193 <xs:simpleType> 193 <xs:simpleType>
194 <xs:restriction base="xs:string"> 194 <xs:restriction base="xs:string">
195 <xs:enumeration value="OnBuildSuccess" /> 195 <xs:enumeration value="OnBuildSuccess" />
196 <xs:enumeration value="Always" /> 196 <xs:enumeration value="Always" />
197 <xs:enumeration value="OnOutputUpdated" /> 197 <xs:enumeration value="OnOutputUpdated" />
198 </xs:restriction> 198 </xs:restriction>
199 </xs:simpleType> 199 </xs:simpleType>
200 </xs:element> 200 </xs:element>
201 <xs:element name="RunScript" type="xs:string" minOccurs="0" /> 201 <xs:element name="RunScript" type="xs:string" minOccurs="0" />
202 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" /> 202 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
203 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" /> 203 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
204 <xs:element name="WarningLevel" minOccurs="0"> 204 <xs:element name="WarningLevel" minOccurs="0">
205 <xs:simpleType> 205 <xs:simpleType>
206 <xs:restriction base="xs:integer"> 206 <xs:restriction base="xs:integer">
207 <xs:minInclusive value="0" /> 207 <xs:minInclusive value="0" />
208 <xs:maxInclusive value="4" /> 208 <xs:maxInclusive value="4" />
209 </xs:restriction> 209 </xs:restriction>
210 </xs:simpleType> 210 </xs:simpleType>
211 </xs:element> 211 </xs:element>
212 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" /> 212 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
213 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" /> 213 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
214 <xs:element name="OutputPath" type="xs:string" minOccurs="0" /> 214 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
215 <xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" /> 215 <xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" />
216 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" /> 216 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
217 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" /> 217 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
218 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" /> 218 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
219 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" /> 219 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
220 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" /> 220 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
221 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" /> 221 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
222 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" /> 222 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
223 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" /> 223 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
224 <xs:element name="KeyFile" type="xs:string" minOccurs="0" /> 224 <xs:element name="KeyFile" type="xs:string" minOccurs="0" />
225 </xs:all> 225 </xs:all>
226 </xs:complexType> 226 </xs:complexType>
227 </xs:element> 227 </xs:element>
228 228
229 <xs:element name="Files"> 229 <xs:element name="Files">
230 <xs:complexType> 230 <xs:complexType>
231 <xs:sequence> 231 <xs:sequence>
232 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" /> 232 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
233 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" /> 233 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
234 </xs:sequence> 234 </xs:sequence>
235 </xs:complexType> 235 </xs:complexType>
236 </xs:element> 236 </xs:element>
237 237
238 <xs:element name="File"> 238 <xs:element name="File">
239 <xs:complexType> 239 <xs:complexType>
240 <xs:simpleContent> 240 <xs:simpleContent>
241 <xs:extension base="xs:string"> 241 <xs:extension base="xs:string">
242 <xs:attribute name="resourceName" type="xs:string" default="" /> 242 <xs:attribute name="resourceName" type="xs:string" default="" />
243 <xs:attribute name="buildAction" default="Compile"> 243 <xs:attribute name="buildAction" default="Compile">
244 <xs:simpleType> 244 <xs:simpleType>
245 <xs:restriction base="xs:string"> 245 <xs:restriction base="xs:string">
246 <xs:enumeration value="None" /> 246 <xs:enumeration value="None" />
247 <xs:enumeration value="Compile" /> 247 <xs:enumeration value="Compile" />
248 <xs:enumeration value="Content" /> 248 <xs:enumeration value="Content" />
249 <xs:enumeration value="EmbeddedResource" /> 249 <xs:enumeration value="EmbeddedResource" />
250 </xs:restriction> 250 </xs:restriction>
251 </xs:simpleType> 251 </xs:simpleType>
252 </xs:attribute> 252 </xs:attribute>
253 <xs:attribute name="subType" default="Code"> 253 <xs:attribute name="subType" default="Code">
254 <xs:simpleType> 254 <xs:simpleType>
255 <xs:restriction base="xs:string"> 255 <xs:restriction base="xs:string">
256 <xs:enumeration value="Code" /> 256 <xs:enumeration value="Code" />
257 <xs:enumeration value="CodeBehind" /> 257 <xs:enumeration value="CodeBehind" />
258 <xs:enumeration value="Component" /> 258 <xs:enumeration value="Component" />
259 <xs:enumeration value="Form" /> 259 <xs:enumeration value="Form" />
260 <xs:enumeration value="Settings" /> 260 <xs:enumeration value="Settings" />
261 <xs:enumeration value="UserControl" /> 261 <xs:enumeration value="UserControl" />
262 </xs:restriction> 262 </xs:restriction>
263 </xs:simpleType> 263 </xs:simpleType>
264 </xs:attribute> 264 </xs:attribute>
265 <xs:attribute name="link" type="xs:boolean" /> 265 <xs:attribute name="link" type="xs:boolean" />
266 <xs:attribute name="copyToOutput" default="Never"> 266 <xs:attribute name="copyToOutput" default="Never">
267 <xs:simpleType> 267 <xs:simpleType>
268 <xs:restriction base="xs:string"> 268 <xs:restriction base="xs:string">
269 <xs:enumeration value="Never" /> 269 <xs:enumeration value="Never" />
270 <xs:enumeration value="Always" /> 270 <xs:enumeration value="Always" />
271 <xs:enumeration value="PreserveNewest" /> 271 <xs:enumeration value="PreserveNewest" />
272 </xs:restriction> 272 </xs:restriction>
273 </xs:simpleType> 273 </xs:simpleType>
274 </xs:attribute> 274 </xs:attribute>
275 <xs:attribute name="preservePath" type="xs:boolean" /> 275 <xs:attribute name="preservePath" type="xs:boolean" />
276 <xs:attribute name="linkPath" type="xs:string" /> 276 <xs:attribute name="linkPath" type="xs:string" />
277 </xs:extension> 277 </xs:extension>
278 </xs:simpleContent> 278 </xs:simpleContent>
279 </xs:complexType> 279 </xs:complexType>
280 </xs:element> 280 </xs:element>
281 281
282 <xs:element name="Match"> 282 <xs:element name="Match">
283 <xs:complexType> 283 <xs:complexType>
284 <xs:sequence> 284 <xs:sequence>
285 <xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" /> 285 <xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" />
286 </xs:sequence> 286 </xs:sequence>
287 <xs:attribute name="path" type="xs:string" /> 287 <xs:attribute name="path" type="xs:string" />
288 <xs:attribute name="pattern" type="xs:string" use="required" /> 288 <xs:attribute name="pattern" type="xs:string" use="required" />
289 <xs:attribute name="recurse" type="xs:boolean" default="false" /> 289 <xs:attribute name="recurse" type="xs:boolean" default="false" />
290 <xs:attribute name="useRegex" type="xs:boolean" default="false" /> 290 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
291 <xs:attribute name="buildAction" default="Compile"> 291 <xs:attribute name="buildAction" default="Compile">
292 <xs:simpleType> 292 <xs:simpleType>
293 <xs:restriction base="xs:string"> 293 <xs:restriction base="xs:string">
294 <xs:enumeration value="None" /> 294 <xs:enumeration value="None" />
295 <xs:enumeration value="Compile" /> 295 <xs:enumeration value="Compile" />
296 <xs:enumeration value="Content" /> 296 <xs:enumeration value="Content" />
297 <xs:enumeration value="EmbeddedResource" /> 297 <xs:enumeration value="EmbeddedResource" />
298 </xs:restriction> 298 </xs:restriction>
299 </xs:simpleType> 299 </xs:simpleType>
300 </xs:attribute> 300 </xs:attribute>
301 <xs:attribute name="resourceName" type="xs:string" default="" /> 301 <xs:attribute name="resourceName" type="xs:string" default="" />
302 <xs:attribute name="subType" default="Code"> 302 <xs:attribute name="subType" default="Code">
303 <xs:simpleType> 303 <xs:simpleType>
304 <xs:restriction base="xs:string"> 304 <xs:restriction base="xs:string">
305 <xs:enumeration value="Code" /> 305 <xs:enumeration value="Code" />
306 <xs:enumeration value="CodeBehind" /> 306 <xs:enumeration value="CodeBehind" />
307 <xs:enumeration value="Component" /> 307 <xs:enumeration value="Component" />
308 <xs:enumeration value="Designer" /> 308 <xs:enumeration value="Designer" />
309 <xs:enumeration value="Form" /> 309 <xs:enumeration value="Form" />
310 <xs:enumeration value="Settings" /> 310 <xs:enumeration value="Settings" />
311 <xs:enumeration value="UserControl" /> 311 <xs:enumeration value="UserControl" />
312 </xs:restriction> 312 </xs:restriction>
313 </xs:simpleType> 313 </xs:simpleType>
314 </xs:attribute> 314 </xs:attribute>
315 <xs:attribute name="link" type="xs:boolean" /> 315 <xs:attribute name="link" type="xs:boolean" />
316 <xs:attribute name="copyToOutput" default="Never"> 316 <xs:attribute name="copyToOutput" default="Never">
317 <xs:simpleType> 317 <xs:simpleType>
318 <xs:restriction base="xs:string"> 318 <xs:restriction base="xs:string">
319 <xs:enumeration value="Never" /> 319 <xs:enumeration value="Never" />
320 <xs:enumeration value="Always" /> 320 <xs:enumeration value="Always" />
321 <xs:enumeration value="PreserveNewest" /> 321 <xs:enumeration value="PreserveNewest" />
322 </xs:restriction> 322 </xs:restriction>
323 </xs:simpleType> 323 </xs:simpleType>
324 </xs:attribute> 324 </xs:attribute>
325 <xs:attribute name="preservePath" type="xs:boolean" /> 325 <xs:attribute name="preservePath" type="xs:boolean" />
326 <xs:attribute name="linkPath" type="xs:string" /> 326 <xs:attribute name="linkPath" type="xs:string" />
327 </xs:complexType> 327 </xs:complexType>
328 </xs:element> 328 </xs:element>
329 329
330 <xs:element name="Exclude"> 330 <xs:element name="Exclude">
331 <xs:complexType> 331 <xs:complexType>
332 <xs:attribute name="name" type="xs:string" /> 332 <xs:attribute name="name" type="xs:string" />
333 <xs:attribute name="pattern" type="xs:string" /> 333 <xs:attribute name="pattern" type="xs:string" />
334 </xs:complexType> 334 </xs:complexType>
335 </xs:element> 335 </xs:element>
336 336
337 <xs:element name="Cleanup"> 337 <xs:element name="Cleanup">
338 <xs:complexType> 338 <xs:complexType>
339 <xs:sequence> 339 <xs:sequence>
340 <xs:element ref="CleanFiles" minOccurs="1" maxOccurs="unbounded" /> 340 <xs:element ref="CleanFiles" minOccurs="1" maxOccurs="unbounded" />
341 </xs:sequence> 341 </xs:sequence>
342 </xs:complexType> 342 </xs:complexType>
343 </xs:element> 343 </xs:element>
344 344
345 <xs:element name="CleanFiles"> 345 <xs:element name="CleanFiles">
346 <xs:complexType> 346 <xs:complexType>
347 <xs:attribute name="pattern" type="xs:string" /> 347 <xs:attribute name="pattern" type="xs:string" />
348 </xs:complexType> 348 </xs:complexType>
349 </xs:element> 349 </xs:element>
350</xs:schema> 350</xs:schema>
diff --git a/Prebuild/src/data/prebuild-1.9.xsd b/Prebuild/src/data/prebuild-1.9.xsd
index fbca556..d647e08 100644
--- a/Prebuild/src/data/prebuild-1.9.xsd
+++ b/Prebuild/src/data/prebuild-1.9.xsd
@@ -1,336 +1,336 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd"> 2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd">
3 <xs:annotation> 3 <xs:annotation>
4 <xs:documentation> 4 <xs:documentation>
5 Copyright (c) 2004-2007 5 Copyright (c) 2004-2007
6 Matthew Holmes (calefaction at houston . rr . com), 6 Matthew Holmes (calefaction at houston . rr . com),
7 Dan Moorehead (dan05a at gmail . com), 7 Dan Moorehead (dan05a at gmail . com),
8 David Hudson (jendave at yahoo dot com), 8 David Hudson (jendave at yahoo dot com),
9 C.J. Adams-Collier (cjac at colliertech dot com) 9 C.J. Adams-Collier (cjac at colliertech dot com)
10 10
11 .NET Prebuild is a cross-platform XML-driven pre-build tool which 11 .NET Prebuild is a cross-platform XML-driven pre-build tool which
12 allows developers to easily generate project or make files for major 12 allows developers to easily generate project or make files for major
13 IDE's and .NET development tools including: Visual Studio .NET 2002, 13 IDE's and .NET development tools including: Visual Studio .NET 2002,
14 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools. 14 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools.
15 15
16 BSD License: 16 BSD License:
17 17
18 Redistribution and use in source and binary forms, with or without modification, are permitted 18 Redistribution and use in source and binary forms, with or without modification, are permitted
19 provided that the following conditions are met: 19 provided that the following conditions are met:
20 20
21 * Redistributions of source code must retain the above copyright notice, this list of conditions 21 * Redistributions of source code must retain the above copyright notice, this list of conditions
22 and the following disclaimer. 22 and the following disclaimer.
23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
24 and the following disclaimer in the documentation and/or other materials provided with the 24 and the following disclaimer in the documentation and/or other materials provided with the
25 distribution. 25 distribution.
26 * The name of the author may not be used to endorse or promote products derived from this software 26 * The name of the author may not be used to endorse or promote products derived from this software
27 without specific prior written permission. 27 without specific prior written permission.
28 28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 </xs:documentation> 36 </xs:documentation>
37 </xs:annotation> 37 </xs:annotation>
38 38
39 <xs:element name="Prebuild"> 39 <xs:element name="Prebuild">
40 <xs:complexType> 40 <xs:complexType>
41 <xs:sequence> 41 <xs:sequence>
42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
43 <xs:element ref="Solution" minOccurs="1" maxOccurs="1" /> 43 <xs:element ref="Solution" minOccurs="1" maxOccurs="1" />
44 </xs:sequence> 44 </xs:sequence>
45 <xs:attribute name="version" /> 45 <xs:attribute name="version" />
46 <xs:attribute name="checkOsVars" /> 46 <xs:attribute name="checkOsVars" />
47 </xs:complexType> 47 </xs:complexType>
48 </xs:element> 48 </xs:element>
49 49
50 <xs:element name="Process" type="xs:string" /> 50 <xs:element name="Process" type="xs:string" />
51 51
52 <xs:element name="Solution"> 52 <xs:element name="Solution">
53 <xs:complexType> 53 <xs:complexType>
54 <xs:sequence> 54 <xs:sequence>
55 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" /> 55 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
56 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 56 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
57 <xs:element ref="Options" minOccurs="0" /> 57 <xs:element ref="Options" minOccurs="0" />
58 <xs:element ref="Files" minOccurs="0" /> 58 <xs:element ref="Files" minOccurs="0" />
59 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" /> 59 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
60 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" /> 60 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
61 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" /> 61 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
62 </xs:sequence> 62 </xs:sequence>
63 <xs:attribute name="name" type="xs:string" use="required" /> 63 <xs:attribute name="name" type="xs:string" use="required" />
64 <xs:attribute name="activeConfig" type="xs:string" default="Debug" /> 64 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
65 <xs:attribute name="path" type="xs:string" default="" /> 65 <xs:attribute name="path" type="xs:string" default="" />
66 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 66 <xs:attribute name="version" type="xs:string" default="1.0.0" />
67 </xs:complexType> 67 </xs:complexType>
68 </xs:element> 68 </xs:element>
69 69
70 <xs:element name="EmbeddedSolution"> 70 <xs:element name="EmbeddedSolution">
71 <xs:complexType> 71 <xs:complexType>
72 <xs:sequence> 72 <xs:sequence>
73 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" /> 73 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
74 <xs:element ref="Files" minOccurs="0" /> 74 <xs:element ref="Files" minOccurs="0" />
75 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" /> 75 <xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
76 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" /> 76 <xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
77 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" /> 77 <xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
78 </xs:sequence> 78 </xs:sequence>
79 <xs:attribute name="name" type="xs:string" use="required" /> 79 <xs:attribute name="name" type="xs:string" use="required" />
80 <xs:attribute name="activeConfig" type="xs:string" default="Debug" /> 80 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
81 <xs:attribute name="path" type="xs:string" default="" /> 81 <xs:attribute name="path" type="xs:string" default="" />
82 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 82 <xs:attribute name="version" type="xs:string" default="1.0.0" />
83 </xs:complexType> 83 </xs:complexType>
84 </xs:element> 84 </xs:element>
85 85
86 <xs:element name="DatabaseProject"> 86 <xs:element name="DatabaseProject">
87 <xs:complexType> 87 <xs:complexType>
88 <xs:sequence> 88 <xs:sequence>
89 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 89 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
90 <xs:element ref="DatabaseReference" minOccurs="0" maxOccurs="unbounded" /> 90 <xs:element ref="DatabaseReference" minOccurs="0" maxOccurs="unbounded" />
91 </xs:sequence> 91 </xs:sequence>
92 <xs:attribute name="name" type="xs:string" use="required" /> 92 <xs:attribute name="name" type="xs:string" use="required" />
93 <xs:attribute name="path" type="xs:string" /> 93 <xs:attribute name="path" type="xs:string" />
94 </xs:complexType> 94 </xs:complexType>
95 </xs:element> 95 </xs:element>
96 96
97 <xs:element name="DatabaseReference"> 97 <xs:element name="DatabaseReference">
98 <xs:complexType> 98 <xs:complexType>
99 <xs:attribute name="name" type="xs:string" use="required" /> 99 <xs:attribute name="name" type="xs:string" use="required" />
100 <xs:attribute name="providerId" type="xs:string" /> 100 <xs:attribute name="providerId" type="xs:string" />
101 <xs:attribute name="providerName" type="xs:string" /> 101 <xs:attribute name="providerName" type="xs:string" />
102 <xs:attribute name="connectionString" type="xs:string" use="required" /> 102 <xs:attribute name="connectionString" type="xs:string" use="required" />
103 </xs:complexType> 103 </xs:complexType>
104 </xs:element> 104 </xs:element>
105 105
106 <xs:element name="Project"> 106 <xs:element name="Project">
107 <xs:complexType> 107 <xs:complexType>
108 <xs:sequence> 108 <xs:sequence>
109 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 109 <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
110 <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" /> 110 <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" />
111 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" /> 111 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
112 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 112 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
113 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded"> 113 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
114 <xs:complexType> 114 <xs:complexType>
115 <xs:attribute name="name" type="xs:string" use="required" /> 115 <xs:attribute name="name" type="xs:string" use="required" />
116 <xs:attribute name="path" type="xs:string" /> 116 <xs:attribute name="path" type="xs:string" />
117 <xs:attribute name="localCopy" type="xs:boolean" /> 117 <xs:attribute name="localCopy" type="xs:boolean" />
118 <xs:attribute name="version" type="xs:string" /> 118 <xs:attribute name="version" type="xs:string" />
119 </xs:complexType> 119 </xs:complexType>
120 </xs:element> 120 </xs:element>
121 <xs:element ref="Files" /> 121 <xs:element ref="Files" />
122 </xs:sequence> 122 </xs:sequence>
123 <xs:attribute name="name" type="xs:string" use="required" /> 123 <xs:attribute name="name" type="xs:string" use="required" />
124 <xs:attribute name="designerFolder" type="xs:string" default="" /> 124 <xs:attribute name="designerFolder" type="xs:string" default="" />
125 <xs:attribute name="filterGroups" type="xs:string" default="" /> 125 <xs:attribute name="filterGroups" type="xs:string" default="" />
126 <xs:attribute name="path" type="xs:string" default="" /> 126 <xs:attribute name="path" type="xs:string" default="" />
127 <xs:attribute name="icon" type="xs:string" default="" /> 127 <xs:attribute name="icon" type="xs:string" default="" />
128 <xs:attribute name="configFile" type="xs:string" default="" /> 128 <xs:attribute name="configFile" type="xs:string" default="" />
129 <xs:attribute name="version" type="xs:string" default="1.0.0" /> 129 <xs:attribute name="version" type="xs:string" default="1.0.0" />
130 <xs:attribute name="guid" type="xs:string"/> 130 <xs:attribute name="guid" type="xs:string"/>
131 <xs:attribute name="language" default="C#"> 131 <xs:attribute name="language" default="C#">
132 <xs:simpleType> 132 <xs:simpleType>
133 <xs:restriction base="xs:string"> 133 <xs:restriction base="xs:string">
134 <xs:enumeration value="C#" /> 134 <xs:enumeration value="C#" />
135 <xs:enumeration value="VB.NET" /> 135 <xs:enumeration value="VB.NET" />
136 </xs:restriction> 136 </xs:restriction>
137 </xs:simpleType> 137 </xs:simpleType>
138 </xs:attribute> 138 </xs:attribute>
139 <xs:attribute name="type" default="Exe"> 139 <xs:attribute name="type" default="Exe">
140 <xs:simpleType> 140 <xs:simpleType>
141 <xs:restriction base="xs:string"> 141 <xs:restriction base="xs:string">
142 <xs:enumeration value="Exe" /> 142 <xs:enumeration value="Exe" />
143 <xs:enumeration value="WinExe" /> 143 <xs:enumeration value="WinExe" />
144 <xs:enumeration value="Library" /> 144 <xs:enumeration value="Library" />
145 <xs:enumeration value="Web" /> 145 <xs:enumeration value="Web" />
146 </xs:restriction> 146 </xs:restriction>
147 </xs:simpleType> 147 </xs:simpleType>
148 </xs:attribute> 148 </xs:attribute>
149 <xs:attribute name="runtime" default="Microsoft"> 149 <xs:attribute name="runtime" default="Microsoft">
150 <xs:simpleType> 150 <xs:simpleType>
151 <xs:restriction base="xs:string"> 151 <xs:restriction base="xs:string">
152 <xs:enumeration value="Microsoft" /> 152 <xs:enumeration value="Microsoft" />
153 <xs:enumeration value="Mono" /> 153 <xs:enumeration value="Mono" />
154 </xs:restriction> 154 </xs:restriction>
155 </xs:simpleType> 155 </xs:simpleType>
156 </xs:attribute> 156 </xs:attribute>
157 <xs:attribute name="frameworkVersion" default="v2_0"> 157 <xs:attribute name="frameworkVersion" default="v2_0">
158 <xs:simpleType> 158 <xs:simpleType>
159 <xs:restriction base="xs:string"> 159 <xs:restriction base="xs:string">
160 <xs:enumeration value="v2_0" /> 160 <xs:enumeration value="v2_0" />
161 <xs:enumeration value="v3_0" /> 161 <xs:enumeration value="v3_0" />
162 <xs:enumeration value="v3_5" /> 162 <xs:enumeration value="v3_5" />
163 <xs:enumeration value="v4_0" /> 163 <xs:enumeration value="v4_0" />
164 </xs:restriction> 164 </xs:restriction>
165 </xs:simpleType> 165 </xs:simpleType>
166 </xs:attribute> 166 </xs:attribute>
167 <xs:attribute name="startupObject" type="xs:string" default="" /> 167 <xs:attribute name="startupObject" type="xs:string" default="" />
168 <xs:attribute name="rootNamespace" type="xs:string" /> 168 <xs:attribute name="rootNamespace" type="xs:string" />
169 <xs:attribute name="assemblyName" type="xs:string" /> 169 <xs:attribute name="assemblyName" type="xs:string" />
170 <xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false" /> 170 <xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false" />
171 </xs:complexType> 171 </xs:complexType>
172 </xs:element> 172 </xs:element>
173 173
174 <xs:element name="Configuration"> 174 <xs:element name="Configuration">
175 <xs:complexType> 175 <xs:complexType>
176 <xs:sequence> 176 <xs:sequence>
177 <xs:element ref="Options" minOccurs="0" /> 177 <xs:element ref="Options" minOccurs="0" />
178 </xs:sequence> 178 </xs:sequence>
179 <xs:attribute name="name" type="xs:string" use="required" /> 179 <xs:attribute name="name" type="xs:string" use="required" />
180 <xs:attribute name="platform" type="xs:string" use="required" /> 180 <xs:attribute name="platform" type="xs:string" use="required" />
181 </xs:complexType> 181 </xs:complexType>
182 </xs:element> 182 </xs:element>
183 <xs:element name="Options"> 183 <xs:element name="Options">
184 <xs:complexType> 184 <xs:complexType>
185 <xs:all> 185 <xs:all>
186 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" /> 186 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
187 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" /> 187 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
188 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" /> 188 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
189 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" /> 189 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
190 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" /> 190 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
191 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" /> 191 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
192 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess"> 192 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
193 <xs:simpleType> 193 <xs:simpleType>
194 <xs:restriction base="xs:string"> 194 <xs:restriction base="xs:string">
195 <xs:enumeration value="OnBuildSuccess" /> 195 <xs:enumeration value="OnBuildSuccess" />
196 <xs:enumeration value="Always" /> 196 <xs:enumeration value="Always" />
197 <xs:enumeration value="OnOutputUpdated" /> 197 <xs:enumeration value="OnOutputUpdated" />
198 </xs:restriction> 198 </xs:restriction>
199 </xs:simpleType> 199 </xs:simpleType>
200 </xs:element> 200 </xs:element>
201 <xs:element name="RunScript" type="xs:string" minOccurs="0" /> 201 <xs:element name="RunScript" type="xs:string" minOccurs="0" />
202 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" /> 202 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
203 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" /> 203 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
204 <xs:element name="WarningLevel" minOccurs="0"> 204 <xs:element name="WarningLevel" minOccurs="0">
205 <xs:simpleType> 205 <xs:simpleType>
206 <xs:restriction base="xs:integer"> 206 <xs:restriction base="xs:integer">
207 <xs:minInclusive value="0" /> 207 <xs:minInclusive value="0" />
208 <xs:maxInclusive value="4" /> 208 <xs:maxInclusive value="4" />
209 </xs:restriction> 209 </xs:restriction>
210 </xs:simpleType> 210 </xs:simpleType>
211 </xs:element> 211 </xs:element>
212 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" /> 212 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
213 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" /> 213 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
214 <xs:element name="OutputPath" type="xs:string" minOccurs="0" /> 214 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
215 <xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" /> 215 <xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" />
216 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" /> 216 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
217 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" /> 217 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
218 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" /> 218 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
219 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" /> 219 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
220 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" /> 220 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
221 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" /> 221 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
222 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" /> 222 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
223 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" /> 223 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
224 <xs:element name="KeyFile" type="xs:string" minOccurs="0" /> 224 <xs:element name="KeyFile" type="xs:string" minOccurs="0" />
225 </xs:all> 225 </xs:all>
226 </xs:complexType> 226 </xs:complexType>
227 </xs:element> 227 </xs:element>
228 <xs:element name="Files"> 228 <xs:element name="Files">
229 <xs:complexType> 229 <xs:complexType>
230 <xs:sequence> 230 <xs:sequence>
231 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" /> 231 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
232 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" /> 232 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
233 </xs:sequence> 233 </xs:sequence>
234 </xs:complexType> 234 </xs:complexType>
235 </xs:element> 235 </xs:element>
236 <xs:element name="File"> 236 <xs:element name="File">
237 <xs:complexType> 237 <xs:complexType>
238 <xs:simpleContent> 238 <xs:simpleContent>
239 <xs:extension base="xs:string"> 239 <xs:extension base="xs:string">
240 <xs:attribute name="resourceName" type="xs:string" default="" /> 240 <xs:attribute name="resourceName" type="xs:string" default="" />
241 <xs:attribute name="buildAction" default="Compile"> 241 <xs:attribute name="buildAction" default="Compile">
242 <xs:simpleType> 242 <xs:simpleType>
243 <xs:restriction base="xs:string"> 243 <xs:restriction base="xs:string">
244 <xs:enumeration value="None" /> 244 <xs:enumeration value="None" />
245 <xs:enumeration value="Compile" /> 245 <xs:enumeration value="Compile" />
246 <xs:enumeration value="Content" /> 246 <xs:enumeration value="Content" />
247 <xs:enumeration value="EmbeddedResource" /> 247 <xs:enumeration value="EmbeddedResource" />
248 <xs:enumeration value="ApplicationDefinition" /> 248 <xs:enumeration value="ApplicationDefinition" />
249 <xs:enumeration value="Page" /> 249 <xs:enumeration value="Page" />
250 </xs:restriction> 250 </xs:restriction>
251 </xs:simpleType> 251 </xs:simpleType>
252 </xs:attribute> 252 </xs:attribute>
253 <xs:attribute name="subType" default="Code"> 253 <xs:attribute name="subType" default="Code">
254 <xs:simpleType> 254 <xs:simpleType>
255 <xs:restriction base="xs:string"> 255 <xs:restriction base="xs:string">
256 <xs:enumeration value="Code" /> 256 <xs:enumeration value="Code" />
257 <xs:enumeration value="CodeBehind" /> 257 <xs:enumeration value="CodeBehind" />
258 <xs:enumeration value="Component" /> 258 <xs:enumeration value="Component" />
259 <xs:enumeration value="Form" /> 259 <xs:enumeration value="Form" />
260 <xs:enumeration value="Settings" /> 260 <xs:enumeration value="Settings" />
261 <xs:enumeration value="UserControl" /> 261 <xs:enumeration value="UserControl" />
262 </xs:restriction> 262 </xs:restriction>
263 </xs:simpleType> 263 </xs:simpleType>
264 </xs:attribute> 264 </xs:attribute>
265 <xs:attribute name="link" type="xs:boolean" /> 265 <xs:attribute name="link" type="xs:boolean" />
266 <xs:attribute name="copyToOutput" default="Never"> 266 <xs:attribute name="copyToOutput" default="Never">
267 <xs:simpleType> 267 <xs:simpleType>
268 <xs:restriction base="xs:string"> 268 <xs:restriction base="xs:string">
269 <xs:enumeration value="Never" /> 269 <xs:enumeration value="Never" />
270 <xs:enumeration value="Always" /> 270 <xs:enumeration value="Always" />
271 <xs:enumeration value="PreserveNewest" /> 271 <xs:enumeration value="PreserveNewest" />
272 </xs:restriction> 272 </xs:restriction>
273 </xs:simpleType> 273 </xs:simpleType>
274 </xs:attribute> 274 </xs:attribute>
275 <xs:attribute name="preservePath" type="xs:boolean" /> 275 <xs:attribute name="preservePath" type="xs:boolean" />
276 <xs:attribute name="linkPath" type="xs:string" /> 276 <xs:attribute name="linkPath" type="xs:string" />
277 </xs:extension> 277 </xs:extension>
278 </xs:simpleContent> 278 </xs:simpleContent>
279 </xs:complexType> 279 </xs:complexType>
280 </xs:element> 280 </xs:element>
281 <xs:element name="Match"> 281 <xs:element name="Match">
282 <xs:complexType> 282 <xs:complexType>
283 <xs:sequence> 283 <xs:sequence>
284 <xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" /> 284 <xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" />
285 </xs:sequence> 285 </xs:sequence>
286 <xs:attribute name="path" type="xs:string" /> 286 <xs:attribute name="path" type="xs:string" />
287 <xs:attribute name="pattern" type="xs:string" use="required" /> 287 <xs:attribute name="pattern" type="xs:string" use="required" />
288 <xs:attribute name="recurse" type="xs:boolean" default="false" /> 288 <xs:attribute name="recurse" type="xs:boolean" default="false" />
289 <xs:attribute name="useRegex" type="xs:boolean" default="false" /> 289 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
290 <xs:attribute name="buildAction" default="Compile"> 290 <xs:attribute name="buildAction" default="Compile">
291 <xs:simpleType> 291 <xs:simpleType>
292 <xs:restriction base="xs:string"> 292 <xs:restriction base="xs:string">
293 <xs:enumeration value="None" /> 293 <xs:enumeration value="None" />
294 <xs:enumeration value="Compile" /> 294 <xs:enumeration value="Compile" />
295 <xs:enumeration value="Content" /> 295 <xs:enumeration value="Content" />
296 <xs:enumeration value="EmbeddedResource" /> 296 <xs:enumeration value="EmbeddedResource" />
297 <xs:enumeration value="ApplicationDefinition" /> 297 <xs:enumeration value="ApplicationDefinition" />
298 <xs:enumeration value="Page" /> 298 <xs:enumeration value="Page" />
299 </xs:restriction> 299 </xs:restriction>
300 </xs:simpleType> 300 </xs:simpleType>
301 </xs:attribute> 301 </xs:attribute>
302 <xs:attribute name="resourceName" type="xs:string" default="" /> 302 <xs:attribute name="resourceName" type="xs:string" default="" />
303 <xs:attribute name="subType" default="Code"> 303 <xs:attribute name="subType" default="Code">
304 <xs:simpleType> 304 <xs:simpleType>
305 <xs:restriction base="xs:string"> 305 <xs:restriction base="xs:string">
306 <xs:enumeration value="Code" /> 306 <xs:enumeration value="Code" />
307 <xs:enumeration value="CodeBehind" /> 307 <xs:enumeration value="CodeBehind" />
308 <xs:enumeration value="Component" /> 308 <xs:enumeration value="Component" />
309 <xs:enumeration value="Designer" /> 309 <xs:enumeration value="Designer" />
310 <xs:enumeration value="Form" /> 310 <xs:enumeration value="Form" />
311 <xs:enumeration value="Settings" /> 311 <xs:enumeration value="Settings" />
312 <xs:enumeration value="UserControl" /> 312 <xs:enumeration value="UserControl" />
313 </xs:restriction> 313 </xs:restriction>
314 </xs:simpleType> 314 </xs:simpleType>
315 </xs:attribute> 315 </xs:attribute>
316 <xs:attribute name="link" type="xs:boolean" /> 316 <xs:attribute name="link" type="xs:boolean" />
317 <xs:attribute name="copyToOutput" default="Never"> 317 <xs:attribute name="copyToOutput" default="Never">
318 <xs:simpleType> 318 <xs:simpleType>
319 <xs:restriction base="xs:string"> 319 <xs:restriction base="xs:string">
320 <xs:enumeration value="Never" /> 320 <xs:enumeration value="Never" />
321 <xs:enumeration value="Always" /> 321 <xs:enumeration value="Always" />
322 <xs:enumeration value="PreserveNewest" /> 322 <xs:enumeration value="PreserveNewest" />
323 </xs:restriction> 323 </xs:restriction>
324 </xs:simpleType> 324 </xs:simpleType>
325 </xs:attribute> 325 </xs:attribute>
326 <xs:attribute name="preservePath" type="xs:boolean" /> 326 <xs:attribute name="preservePath" type="xs:boolean" />
327 <xs:attribute name="linkPath" type="xs:string" /> 327 <xs:attribute name="linkPath" type="xs:string" />
328 </xs:complexType> 328 </xs:complexType>
329 </xs:element> 329 </xs:element>
330 <xs:element name="Exclude"> 330 <xs:element name="Exclude">
331 <xs:complexType> 331 <xs:complexType>
332 <xs:attribute name="name" type="xs:string" /> 332 <xs:attribute name="name" type="xs:string" />
333 <xs:attribute name="pattern" type="xs:string" /> 333 <xs:attribute name="pattern" type="xs:string" />
334 </xs:complexType> 334 </xs:complexType>
335 </xs:element> 335 </xs:element>
336</xs:schema> 336</xs:schema>
diff --git a/bin/C5.dll b/bin/C5.dll
index 1234ce9..42093e5 100755
--- a/bin/C5.dll
+++ b/bin/C5.dll
Binary files differ
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 972efe4..3e7f8a6 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -181,6 +181,11 @@
181 ; ## PHYSICS 181 ; ## PHYSICS
182 ; ## 182 ; ##
183 183
184 ; If true then prims can be collided with by avatars, other prims, etc.
185 ; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked.
186 ; Also, no prims are subject to physics.
187 collidable_prim = true
188
184 ; If true then prims can be made subject to physics (gravity, pushing, etc.). 189 ; If true then prims can be made subject to physics (gravity, pushing, etc.).
185 ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction 190 ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction
186 physical_prim = true 191 physical_prim = true
diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe
index ead3c6b..bdb25b6 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 eee7dc8..49ee41a 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -82,6 +82,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
82; * 82; *
83[GridService] 83[GridService]
84 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" 84 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
85 HypergridLinker = true
86
85 ; Realm = "regions" 87 ; Realm = "regions"
86 ; AllowDuplicateNames = "True" 88 ; AllowDuplicateNames = "True"
87 89
diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini
index 4c32498..5f0ba37 100644
--- a/bin/config-include/GridHypergrid.ini
+++ b/bin/config-include/GridHypergrid.ini
@@ -26,7 +26,6 @@
26 LandServices = "RemoteLandServicesConnector" 26 LandServices = "RemoteLandServicesConnector"
27 FriendsModule = "HGFriendsModule" 27 FriendsModule = "HGFriendsModule"
28 MapImageService = "MapImageServiceModule" 28 MapImageService = "MapImageServiceModule"
29 HypergridLinker = "HypergridLinker"
30 29
31 LandServiceInConnector = true 30 LandServiceInConnector = true
32 NeighbourServiceInConnector = true 31 NeighbourServiceInConnector = true
@@ -60,6 +59,7 @@
60 ; Needed to display non-default map tile images for linked regions 59 ; Needed to display non-default map tile images for linked regions
61 AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector" 60 AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"
62 61
62 HypergridLinker = true
63 AllowHypergridMapSearch = true 63 AllowHypergridMapSearch = true
64 64
65[LibraryService] 65[LibraryService]
diff --git a/bin/config-include/HyperSimianGrid.ini b/bin/config-include/HyperSimianGrid.ini
index ec4efc0..99a589c 100644
--- a/bin/config-include/HyperSimianGrid.ini
+++ b/bin/config-include/HyperSimianGrid.ini
@@ -40,7 +40,6 @@
40 LibraryModule = false 40 LibraryModule = false
41 41
42 AssetCaching = "FlotsamAssetCache" 42 AssetCaching = "FlotsamAssetCache"
43 HypergridLinker = "HypergridLinker"
44 43
45[SimulationDataStore] 44[SimulationDataStore]
46 LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" 45 LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService"
@@ -56,6 +55,7 @@
56 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" 55 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
57 NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector" 56 NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
58 57
58 HypergridLinker = true
59 AllowHypergridMapSearch = true 59 AllowHypergridMapSearch = true
60 60
61[LibraryService] 61[LibraryService]
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index f8c258a..00beb31 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -22,7 +22,6 @@
22 EntityTransferModule = "HGEntityTransferModule" 22 EntityTransferModule = "HGEntityTransferModule"
23 InventoryAccessModule = "HGInventoryAccessModule" 23 InventoryAccessModule = "HGInventoryAccessModule"
24 FriendsModule = "HGFriendsModule" 24 FriendsModule = "HGFriendsModule"
25 HypergridLinker = "HypergridLinker"
26 25
27 InventoryServiceInConnector = true 26 InventoryServiceInConnector = true
28 AssetServiceInConnector = true 27 AssetServiceInConnector = true
@@ -84,6 +83,7 @@
84 ; Needed to display non-default map tile images for remote regions 83 ; Needed to display non-default map tile images for remote regions
85 AssetService = "OpenSim.Services.AssetService.dll:AssetService" 84 AssetService = "OpenSim.Services.AssetService.dll:AssetService"
86 85
86 HypergridLinker = true
87 AllowHypergridMapSearch = true 87 AllowHypergridMapSearch = true
88 88
89[PresenceService] 89[PresenceService]
diff --git a/prebuild.xml b/prebuild.xml
index e951187..4ea4708 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -926,6 +926,7 @@
926 <ReferencePath>../../../bin/</ReferencePath> 926 <ReferencePath>../../../bin/</ReferencePath>
927 <Reference name="System"/> 927 <Reference name="System"/>
928 <Reference name="System.Core"/> 928 <Reference name="System.Core"/>
929 <Reference name="System.Web"/>
929 <Reference name="System.Xml"/> 930 <Reference name="System.Xml"/>
930 <Reference name="System.Drawing"/> 931 <Reference name="System.Drawing"/>
931 <Reference name="OpenMetaverseTypes" path="../../../bin/"/> 932 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>