Merge branch 'master' into careminster

avinationmerge
Melanie 2011-12-28 09:24:35 +00:00
commit bde004c08e
30 changed files with 3931 additions and 3777 deletions

View File

@ -388,8 +388,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
string assetServerURL = string.Empty; string assetServerURL = string.Empty;
if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
{ {
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); assetServerURL = assetServerURL + "/";
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id);
AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived);
return; return;
} }
} }

View File

@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public AssetBase FetchAsset(string url, UUID assetID) public AssetBase FetchAsset(string url, UUID assetID)
{ {
AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString()); if (!url.EndsWith("/") && !url.EndsWith("="))
url = url + "/";
AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString());
if (asset != null) if (asset != null)
{ {
@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
if (asset != null) if (asset != null)
{ {
if (!url.EndsWith("/") && !url.EndsWith("="))
url = url + "/";
// See long comment in AssetCache.AddAsset // See long comment in AssetCache.AddAsset
if (!asset.Temporary || asset.Local) if (!asset.Temporary || asset.Local)
{ {
@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
Copy(asset, asset1); Copy(asset, asset1);
try try
{ {
asset1.ID = url + "/" + asset.ID; asset1.ID = url + asset.ID;
} }
catch catch
{ {

View File

@ -29,7 +29,9 @@ using log4net;
using Nini.Config; using Nini.Config;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.Reflection; using System.Reflection;
using System.Web;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Hypergrid; using OpenSim.Services.Connectors.Hypergrid;
@ -72,12 +74,27 @@ namespace OpenSim.Services.Connectors
if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) &&
assetUri.Scheme == Uri.UriSchemeHttp) assetUri.Scheme == Uri.UriSchemeHttp)
{
// Simian
if (assetUri.Query != string.Empty)
{
NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query);
assetID = qscoll["id"];
if (assetID != null)
url = id.Replace(assetID, ""); // Malformed again, as simian expects
else
url = id; // !!! best effort
}
else // robust
{ {
url = "http://" + assetUri.Authority; url = "http://" + assetUri.Authority;
assetID = assetUri.LocalPath.Trim(new char[] { '/' }); assetID = assetUri.LocalPath.Trim(new char[] { '/' });
}
return true; return true;
} }
m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id);
return false; return false;
} }

View File

@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors
public HeloServicesConnector(string serverURI) public HeloServicesConnector(string serverURI)
{ {
m_ServerURI = serverURI.TrimEnd('/'); if (!serverURI.EndsWith("="))
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else
{
// Simian sends malformed urls like this:
// http://valley.virtualportland.org/simtest/Grid/?id=
//
try
{
Uri uri = new Uri(serverURI + "xxx");
if (uri.Query == string.Empty)
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else
{
serverURI = serverURI + "xxx";
m_ServerURI = serverURI.Replace("?" + uri.Query, "");
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
}
}
catch (UriFormatException e)
{
m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
}
}
} }
public virtual string Helo() public virtual string Helo()
{ {
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
// Eventually we need to switch to HEAD // Eventually we need to switch to HEAD
/* req.Method = "HEAD"; */ /* req.Method = "HEAD"; */

BIN
Prebuild/Prebuild.exe Executable file

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd" version="1.9"> <Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.9.xsd" version="1.9">
<Solution name="Prebuild" version="2.0.4"> <Solution name="Prebuild" version="2.0.5">
<Configuration name="Debug"> <Configuration name="Debug">
<Options> <Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines> <CompilerDefines>DEBUG;TRACE</CompilerDefines>
@ -31,13 +31,15 @@
type="Exe" type="Exe"
rootNamespace="Prebuild" rootNamespace="Prebuild"
startupObject="Prebuild.Prebuild" startupObject="Prebuild.Prebuild"
version="2.0.3" version="2.0.5"
frameworkVersion="v3_5"
> >
<Author>Matthew Holmes (matthew@wildfiregames.com)</Author> <Author>Matthew Holmes (matthew@wildfiregames.com)</Author>
<Author>Dan Moorehead (dan05a@gmail.com)</Author> <Author>Dan Moorehead (dan05a@gmail.com)</Author>
<Author>Dave Hudson (jendave@yahoo.com)</Author> <Author>Dave Hudson (jendave@yahoo.com)</Author>
<Author>Rob Loach (http://robloach.net)</Author> <Author>Rob Loach (http://robloach.net)</Author>
<Author>C.J. Adams-Collier (cjac@colliertech.org)</Author> <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author>
<Author>John Hurliman (john.hurliman@intel.com)</Author>
<Description>The Prebuild project generator</Description> <Description>The Prebuild project generator</Description>
<Configuration name="Debug"> <Configuration name="Debug">
<Options> <Options>

View File

@ -62,7 +62,11 @@ namespace Prebuild.Core.Nodes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
Page Page,
/// <summary>
///
/// </summary>
Copy
} }
/// <summary> /// <summary>
@ -245,6 +249,9 @@ namespace Prebuild.Core.Nodes
if (subType != String.Empty) if (subType != String.Empty)
m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction);
m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
if ( this.m_Link == true ) if ( this.m_Link == true )

View File

@ -25,6 +25,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.Xml; using System.Xml;
using Prebuild.Core.Attributes; using Prebuild.Core.Attributes;
@ -49,6 +50,8 @@ namespace Prebuild.Core.Nodes
private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>();
private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>();
private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>();
private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>();
private readonly NameValueCollection m_CopyFiles = new NameValueCollection();
#endregion #endregion
@ -62,6 +65,16 @@ namespace Prebuild.Core.Nodes
} }
} }
public string[] Destinations
{
get { return m_CopyFiles.AllKeys; }
}
public int CopyFiles
{
get { return m_CopyFiles.Count; }
}
#endregion #endregion
#region Public Methods #region Public Methods
@ -76,6 +89,20 @@ namespace Prebuild.Core.Nodes
return m_BuildActions[file]; return m_BuildActions[file];
} }
public string GetDestinationPath(string file)
{
if( !m_DestinationPath.ContainsKey(file))
{
return null;
}
return m_DestinationPath[file];
}
public string[] SourceFiles(string dest)
{
return m_CopyFiles.GetValues(dest);
}
public CopyToOutput GetCopyToOutput(string file) public CopyToOutput GetCopyToOutput(string file)
{ {
if (!m_CopyToOutputs.ContainsKey(file)) if (!m_CopyToOutputs.ContainsKey(file))
@ -178,6 +205,13 @@ namespace Prebuild.Core.Nodes
m_BuildActions[file] = GetBuildActionByFileName(file); m_BuildActions[file] = GetBuildActionByFileName(file);
else else
m_BuildActions[file] = matchNode.BuildAction.Value; m_BuildActions[file] = matchNode.BuildAction.Value;
if (matchNode.BuildAction == BuildAction.Copy)
{
m_CopyFiles.Add(matchNode.DestinationPath, file);
m_DestinationPath[file] = matchNode.DestinationPath;
}
m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value;
m_ResourceNames[ file ] = matchNode.ResourceName; m_ResourceNames[ file ] = matchNode.ResourceName;
m_PreservePaths[ file ] = matchNode.PreservePath; m_PreservePaths[ file ] = matchNode.PreservePath;

View File

@ -52,6 +52,7 @@ namespace Prebuild.Core.Nodes
private bool m_Link; private bool m_Link;
private string m_LinkPath; private string m_LinkPath;
private bool m_PreservePath; private bool m_PreservePath;
private string m_Destination = "";
private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>();
#endregion #endregion
@ -80,6 +81,13 @@ namespace Prebuild.Core.Nodes
} }
} }
public string DestinationPath
{
get
{
return m_Destination;
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -285,12 +293,14 @@ namespace Prebuild.Core.Nodes
} }
string path = Helper.AttributeValue(node, "path", "."); string path = Helper.AttributeValue(node, "path", ".");
string pattern = Helper.AttributeValue(node, "pattern", "*"); string pattern = Helper.AttributeValue(node, "pattern", "*");
string destination = Helper.AttributeValue(node, "destination", string.Empty);
bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
if (buildAction != string.Empty) if (buildAction != string.Empty)
m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
//TODO: Figure out where the subtype node is being assigned //TODO: Figure out where the subtype node is being assigned
//string subType = Helper.AttributeValue(node, "subType", string.Empty); //string subType = Helper.AttributeValue(node, "subType", string.Empty);
//if (subType != String.Empty) //if (subType != String.Empty)
@ -304,11 +314,12 @@ namespace Prebuild.Core.Nodes
} }
m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) );
if ( buildAction == "Copy")
m_Destination = destination;
if(path != null && path.Length == 0) if(path != null && path.Length == 0)
{
path = ".";//use current directory path = ".";//use current directory
}
//throw new WarningException("Match must have a 'path' attribute"); //throw new WarningException("Match must have a 'path' attribute");
if(pattern == null) if(pattern == null)

View File

@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
/* /*
* $Source$ * $Source$
* $Author: jendave $ * $Author: jendave $
* $Date: 2006-09-20 08:42:51 +0100 (Wed, 20 Sep 2006) $ * $Date: 2006-09-20 03:42:51 -0400 (Wed, 20 Sep 2006) $
* $Revision: 164 $ * $Revision: 164 $
*/ */
#endregion #endregion

View File

@ -1,4 +1,4 @@
#region BSD License #region BSD License
/* /*
Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (sontek@gmail.com) Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (sontek@gmail.com)
@ -25,6 +25,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO; using System.IO;
using Prebuild.Core.Interfaces; using Prebuild.Core.Interfaces;
using Prebuild.Core.Nodes; using Prebuild.Core.Nodes;
@ -42,6 +43,7 @@ namespace Prebuild.Core.Targets
#region Fields #region Fields
readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>(); readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>();
// NameValueCollection CopyFiles = new NameValueCollection();
Kernel kernel; Kernel kernel;
#endregion #endregion
@ -168,7 +170,14 @@ namespace Prebuild.Core.Targets
#region Project File #region Project File
using (ps) using (ps)
{ {
ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {0}>", GetToolsVersionXml(project.FrameworkVersion)); string targets = "";
if(project.Files.CopyFiles > 0)
targets = "Build;CopyFiles";
else
targets = "Build";
ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion));
ps.WriteLine(" <PropertyGroup>"); ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <ProjectType>Local</ProjectType>"); ps.WriteLine(" <ProjectType>Local</ProjectType>");
ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion); ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion);
@ -334,8 +343,14 @@ namespace Prebuild.Core.Targets
} }
foreach (string filePath in project.Files) foreach (string filePath in project.Files)
{ {
// Add the filePath with the destination as the key
// will use it later to form the copy parameters with Include lists
// for each destination
if (project.Files.GetBuildAction(filePath) == BuildAction.Copy)
continue;
// if (file == "Properties\\Bind.Designer.cs") // if (file == "Properties\\Bind.Designer.cs")
// { // {
// Console.WriteLine("Wait a minute!"); // Console.WriteLine("Wait a minute!");
@ -446,7 +461,9 @@ namespace Prebuild.Core.Targets
ps.WriteLine("Include=\"{0}\">", file); ps.WriteLine("Include=\"{0}\">", file);
int last_period_index = file.LastIndexOf('.'); int last_period_index = file.LastIndexOf('.');
string short_file_name = file.Substring(0, last_period_index); string short_file_name = (last_period_index >= 0)
? file.Substring(0, last_period_index)
: file;
string extension = Path.GetExtension(path); string extension = Path.GetExtension(path);
// make this upper case, so that when File.Exists tests for the // make this upper case, so that when File.Exists tests for the
// existence of a designer file on a case-sensitive platform, // existence of a designer file on a case-sensitive platform,
@ -501,8 +518,41 @@ namespace Prebuild.Core.Targets
} }
} }
} }
ps.WriteLine(" </ItemGroup>");
/*
* Copy Task
*
*/
if ( project.Files.CopyFiles > 0 ) {
Dictionary<string, string> IncludeTags = new Dictionary<string, string>();
int TagCount = 0;
// Handle Copy tasks
ps.WriteLine(" <ItemGroup>");
foreach (string destPath in project.Files.Destinations)
{
string tag = "FilesToCopy_" + TagCount.ToString("0000");
ps.WriteLine(" <{0} Include=\"{1}\" />", tag, String.Join(";", project.Files.SourceFiles(destPath)));
IncludeTags.Add(destPath, tag);
TagCount++;
}
ps.WriteLine(" </ItemGroup>"); ps.WriteLine(" </ItemGroup>");
ps.WriteLine(" <Target Name=\"CopyFiles\">");
foreach (string destPath in project.Files.Destinations)
{
ps.WriteLine(" <Copy SourceFiles=\"@({0})\" DestinationFolder=\"{1}\" />",
IncludeTags[destPath], destPath);
}
ps.WriteLine(" </Target>");
}
ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />"); ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
ps.WriteLine(" <PropertyGroup>"); ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <PreBuildEvent>"); ps.WriteLine(" <PreBuildEvent>");

View File

@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
/* /*
* $Source$ * $Source$
* $Author: kunnis $ * $Author: kunnis $
* $Date: 2009-04-15 02:33:14 +0100 (Wed, 15 Apr 2009) $ * $Date: 2009-04-14 21:33:14 -0400 (Tue, 14 Apr 2009) $
* $Revision: 308 $ * $Revision: 308 $
*/ */
#endregion #endregion

Binary file not shown.

View File

@ -956,6 +956,7 @@
<ReferencePath>../../../bin/</ReferencePath> <ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/> <Reference name="System"/>
<Reference name="System.Core"/> <Reference name="System.Core"/>
<Reference name="System.Web"/>
<Reference name="System.Xml"/> <Reference name="System.Xml"/>
<Reference name="System.Drawing"/> <Reference name="System.Drawing"/>
<Reference name="OpenMetaverseTypes" path="../../../bin/"/> <Reference name="OpenMetaverseTypes" path="../../../bin/"/>