From b8b18356e6d07aa72f7ec4cbaa6cb2c906725f07 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 23 Feb 2008 03:11:50 +0000 Subject: [PATCH] * Rex merge, random bits and pieces * Prebuild merged really badly - I think this may need some manual fixing yet. --- CONTRIBUTORS.txt | 138 +- LICENSE.txt | 25 + Prebuild/scripts/Clean.bat | 0 Prebuild/scripts/Help.bat | 0 Prebuild/scripts/MonoDevelop.sh | 0 Prebuild/scripts/SharpDevelop.bat | 0 Prebuild/scripts/SharpDevelop2.bat | 0 Prebuild/scripts/VS2002.bat | 0 Prebuild/scripts/VS2003.bat | 0 Prebuild/scripts/VS2005.bat | 0 Prebuild/scripts/autotools.bat | 0 Prebuild/scripts/autotools.sh | 0 Prebuild/scripts/nant.bat | 0 Prebuild/scripts/nant.sh | 0 Prebuild/src/Core/Targets/NAntTarget.cs | 1354 +++---- Prebuild/src/data/prebuild-1.7.xsd | 520 +-- README.txt | 69 + TESTING.txt | 24 + .../BaseDataReader.cs | 127 + .../BaseDatabaseConnector.cs | 142 + .../BaseFieldMapper.cs | 163 + .../BaseRowMapper.cs | 60 + .../TribalMedia.Framework.Data/BaseSchema.cs | 68 + .../BaseTableMapper.cs | 280 ++ .../Properties/AssemblyInfo.cs | 66 + .../TribalMedia.Framework.Data.snk | Bin 0 -> 596 bytes prebuild.xml | 3109 +++++++++-------- runprebuild.bat | 0 runprebuild2008.bat | 2 +- share/php/generateUserFunction.php | 0 share/ruby/aserv.rb | 0 share/ruby/config.rb | 0 share/ruby/gridserv.rb | 0 share/ruby/userserv.rb | 0 update-svn-properties.py | 160 + 35 files changed, 3855 insertions(+), 2452 deletions(-) create mode 100644 LICENSE.txt mode change 100644 => 100755 Prebuild/scripts/Clean.bat mode change 100644 => 100755 Prebuild/scripts/Help.bat mode change 100644 => 100755 Prebuild/scripts/MonoDevelop.sh mode change 100644 => 100755 Prebuild/scripts/SharpDevelop.bat mode change 100644 => 100755 Prebuild/scripts/SharpDevelop2.bat mode change 100644 => 100755 Prebuild/scripts/VS2002.bat mode change 100644 => 100755 Prebuild/scripts/VS2003.bat mode change 100644 => 100755 Prebuild/scripts/VS2005.bat mode change 100644 => 100755 Prebuild/scripts/autotools.bat mode change 100644 => 100755 Prebuild/scripts/autotools.sh mode change 100644 => 100755 Prebuild/scripts/nant.bat mode change 100644 => 100755 Prebuild/scripts/nant.sh create mode 100644 README.txt create mode 100644 TESTING.txt create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDataReader.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDatabaseConnector.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseFieldMapper.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseSchema.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseTableMapper.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs create mode 100644 ThirdParty/TribalMedia/TribalMedia.Framework.Data/TribalMedia.Framework.Data.snk mode change 100644 => 100755 runprebuild.bat mode change 100644 => 100755 runprebuild2008.bat mode change 100644 => 100755 share/php/generateUserFunction.php mode change 100644 => 100755 share/ruby/aserv.rb mode change 100644 => 100755 share/ruby/config.rb mode change 100644 => 100755 share/ruby/gridserv.rb mode change 100644 => 100755 share/ruby/userserv.rb create mode 100755 update-svn-properties.py diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 5f51797b3b..665892892e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,59 +1,79 @@ -The following people have contributed to OpenSim (Thank you -for your effort!) - -Add your name in here if you have committed to OpenSim - -OpenSim Developers - -* MW -* Adam Frisby (DeepThink Pty Ltd) -* MingChen (DeepThink Pty Ltd) -* lbsa71 (Tribal Media AB) -* sdague (International Business Machines Corp.) -* Andy- -* Gareth -* MorphW -* CW -* Babblefrog -* Tedd -* justincc (International Business Machines Corp.) -* Teravus (w3z) -* Johan Berntsson (3Di) - -Patches - -* Alondria -* BigFootAg -* CharlieO -* Danx0r -* Dalien -* Darok -* jhurliman (LLSD Login) - -LSL Devs - -* Alondria -* CharlieO -* Tedd - -Testers - -* Ckrinke -* CharlieO (LSL) - - -This software uses components from the following developers: -* Sleepycat Software (Berkeley DB) -* DB4objects, Inc. (DB4o) -* SQLite (Public Domain) -* XmlRpcCS (http://xmlrpccs.sf.net/) -* MySQL, Inc. (MySQL Connector/NET) -* AGEIA Inc. (PhysX) -* Russel L. Smith (ODE) -* Prebuild ( http://sourceforge.net/projects/dnpb/ ) -* LibSecondLife ( http://www.libsecondlife.org/wiki/Main_Page ) - -In addition, we would like to thank: -* The Mono Project -* The NANT Developers -* Microsoft (.NET, MSSQL-Adapters) +The following people have contributed to OpenSim (Thank you +for your effort!) + +Add your name in here if you have committed to OpenSim + + +OpenSim Developers + +* MW (Tribal Media AB) +* Adam Frisby (DeepThink Pty Ltd) +* MingChen (DeepThink Pty Ltd) +* lbsa71 (Tribal Media AB) +* sdague (International Business Machines Corp.) +* Andy- +* Gareth +* MorphW +* CW +* Babblefrog +* Tedd +* justincc (International Business Machines Corp.) +* Teravus (w3z) +* Johan Berntsson (3Di) +* Ckrinke (Charles Krinke) +* Danx0r +* Dalien +* Darok +* chi11ken (3Di) +* adjohn (3Di) +* Alondria + + +Patches + +* BigFootAg +* CharlieO +* jhurliman (LLSD Login) +* kinoc +* daTwitch +* mikkopa/_someone - RealXtend +* openlifegrid.com +* Dr Scofield (International Business Machines Corp.) +* Daedius +* alex_carnell +* webmage (International Business Machines Corp.) +* jimbo2120 (International Business Machines Corp.) +* brianw/Sir_Ahzz +* ChrisDown + + +LSL Devs + +* Alondria +* CharlieO +* Tedd + + +Testers + +* Ckrinke +* CharlieO (LSL) +* openlifegrid.com + + +This software uses components from the following developers: +* Sleepycat Software (Berkeley DB) +* DB4objects, Inc. (DB4o) +* SQLite (Public Domain) +* XmlRpcCS (http://xmlrpccs.sf.net/) +* MySQL, Inc. (MySQL Connector/NET) +* AGEIA Inc. (PhysX) +* Russel L. Smith (ODE) +* Prebuild ( http://sourceforge.net/projects/dnpb/ ) +* LibSecondLife ( http://www.libsecondlife.org/wiki/Main_Page ) + + +In addition, we would like to thank: +* The Mono Project +* The NANT Developers +* Microsoft (.NET, MSSQL-Adapters) diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000..6d54d342f3 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,25 @@ +Copyright (c) Contributors, http://opensimulator.org/ +See CONTRIBUTORS.TXT for a full list of copyright holders. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the OpenSim Project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Prebuild/scripts/Clean.bat b/Prebuild/scripts/Clean.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/Help.bat b/Prebuild/scripts/Help.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/MonoDevelop.sh b/Prebuild/scripts/MonoDevelop.sh old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/SharpDevelop.bat b/Prebuild/scripts/SharpDevelop.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/SharpDevelop2.bat b/Prebuild/scripts/SharpDevelop2.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/VS2002.bat b/Prebuild/scripts/VS2002.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/VS2003.bat b/Prebuild/scripts/VS2003.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/VS2005.bat b/Prebuild/scripts/VS2005.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/autotools.bat b/Prebuild/scripts/autotools.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/autotools.sh b/Prebuild/scripts/autotools.sh old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/nant.bat b/Prebuild/scripts/nant.bat old mode 100644 new mode 100755 diff --git a/Prebuild/scripts/nant.sh b/Prebuild/scripts/nant.sh old mode 100644 new mode 100755 diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs index d72868cbe5..8a6dbdfc70 100644 --- a/Prebuild/src/Core/Targets/NAntTarget.cs +++ b/Prebuild/src/Core/Targets/NAntTarget.cs @@ -1,676 +1,678 @@ -#region BSD License -/* - Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) - - Redistribution and use in source and binary forms, with or without modification, are permitted - provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. - * The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -#region CVS Information -/* - * $Source$ - * $Author: jendave $ - * $Date: 2007-02-13 21:58:03 +0100 (ti, 13 feb 2007) $ - * $Revision: 205 $ - */ -#endregion - -using System; -using System.Collections; -using System.Collections.Specialized; -using System.IO; -using System.Reflection; -using System.Text.RegularExpressions; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Nodes; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Targets -{ - /// - /// - /// - [Target("nant")] - public class NAntTarget : ITarget - { - #region Fields - - private Kernel m_Kernel; - - #endregion - - #region Private Methods - - private static string PrependPath(string path) - { - string tmpPath = Helper.NormalizePath(path, '/'); - Regex regex = new Regex(@"(\w):/(\w+)"); - Match match = regex.Match(tmpPath); - //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') - //{ - tmpPath = Helper.NormalizePath(tmpPath); - //} - // else - // { - // tmpPath = Helper.NormalizePath("./" + tmpPath); - // } - - return tmpPath; - } - - private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr) - { - string ret = ""; - if (solution.ProjectsTable.ContainsKey(refr.Name)) - { - ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; - - string finalPath = Helper.NormalizePath(((ReferencePathNode)currentProject.ReferencePaths[0]).Path + refr.Name + GetProjectExtension(project), '/'); - - return finalPath; - } - else - { - ProjectNode project = (ProjectNode)refr.Parent; - string fileRef = FindFileReference(refr.Name, project); - - if (refr.Path != null || fileRef != null) - { - string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + GetProjectExtension(project), '/') : fileRef; - ret += finalPath; - return ret; - } - - ret += (refr.Name + ".dll"); - } - return ret; - } - - private static string GetProjectExtension(ProjectNode project) - { - string extension = ".dll"; - if (project.Type == ProjectType.Exe) - { - extension = ".exe"; - } - return extension; - } - - private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr) - { - string ret = ""; - if (solution.ProjectsTable.ContainsKey(refr.Name)) - { - ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; - string finalPath = Helper.NormalizePath(((ReferencePathNode)project.ReferencePaths[0]).Path, '/'); - - return finalPath; - } - else - { - ProjectNode project = (ProjectNode)refr.Parent; - string fileRef = FindFileReference(refr.Name, project); - - if (refr.Path != null || fileRef != null) - { - string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef; - ret += finalPath; - return ret; - } - - try - { - Assembly assem = Assembly.Load(refr.Name); - if (assem != null) - { - ret += ""; - } - else - { - ret += ""; - } - } - catch (System.NullReferenceException e) - { - e.ToString(); - ret += ""; - } - } - return ret; - } - - private static string FindFileReference(string refName, ProjectNode project) - { - foreach (ReferencePathNode refPath in project.ReferencePaths) - { - string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); - - if (File.Exists(fullPath)) - { - return fullPath; - } - } - - return null; - } - - /// - /// Gets the XML doc file. - /// - /// The project. - /// The conf. - /// - public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) - { - if (conf == null) - { - throw new ArgumentNullException("conf"); - } - if (project == null) - { - throw new ArgumentNullException("project"); - } - string docFile = (string)conf.Options["XmlDocFile"]; - // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified - // { - // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; - // } - return docFile; - } - - private void WriteProject(SolutionNode solution, ProjectNode project) - { - string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); - StreamWriter ss = new StreamWriter(projFile); - - m_Kernel.CurrentWorkingDirectory.Push(); - Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); - bool hasDoc = false; - - using (ss) - { - ss.WriteLine(""); - ss.WriteLine("", project.Name); - ss.WriteLine(" ", "build"); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - foreach (ReferenceNode refr in project.References) - { - if (refr.LocalCopy) - { - ss.WriteLine(" ", '/')); - } - } - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.Write(" "); - ss.WriteLine(" ", project.RootNamespace); - foreach (string file in project.Files) - { - switch (project.Files.GetBuildAction(file)) - { - case BuildAction.EmbeddedResource: - ss.WriteLine(" {0}", ""); - break; - default: - if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) - { - ss.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); - } - break; - } - } - //if (project.Files.GetSubType(file).ToString() != "Code") - //{ - // ps.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); - - ss.WriteLine(" "); - ss.WriteLine(" "); - foreach (string file in project.Files) - { - switch (project.Files.GetBuildAction(file)) - { - case BuildAction.Compile: - ss.WriteLine(" "); - break; - default: - break; - } - } - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - foreach (ReferenceNode refr in project.References) - { - string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); - ss.WriteLine(" "); - } - ss.WriteLine(" "); - - ss.WriteLine(" "); - - foreach (ConfigurationNode conf in project.Configurations) - { - if (!String.IsNullOrEmpty(conf.Options.OutputPath)) - { - string targetDir = Helper.NormalizePath(conf.Options.OutputPath, '/'); - - ss.WriteLine(" "); - - ss.WriteLine(" "); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - break; - } - } - - ss.WriteLine(" "); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - - ss.WriteLine(" "); - if (hasDoc) - { - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.Write(" "); - } - else - { - ss.WriteLine(".exe\" />"); - } - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - // foreach(ReferenceNode refr in project.References) - // { - // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/'); - // if (path != "") - // { - // ss.WriteLine(" ", path); - // } - // } - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - } - ss.WriteLine(" "); - ss.WriteLine(""); - } - m_Kernel.CurrentWorkingDirectory.Pop(); - } - - private void WriteCombine(SolutionNode solution) - { - m_Kernel.Log.Write("Creating NAnt build files"); - foreach (ProjectNode project in solution.Projects) - { - if (m_Kernel.AllowProject(project.FilterGroups)) - { - m_Kernel.Log.Write("...Creating project: {0}", project.Name); - WriteProject(solution, project); - } - } - - m_Kernel.Log.Write(""); - string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); - StreamWriter ss = new StreamWriter(combFile); - - m_Kernel.CurrentWorkingDirectory.Push(); - Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); - - using (ss) - { - ss.WriteLine(""); - ss.WriteLine("", solution.Name); - ss.WriteLine(" "); - ss.WriteLine(); - - //ss.WriteLine(" "); - //ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - - // actually use active config out of prebuild.xml - ss.WriteLine(" ", solution.ActiveConfig); - - foreach (ConfigurationNode conf in solution.Configurations) - { - ss.WriteLine(); - ss.WriteLine(" ", conf.Name); - ss.WriteLine(" ", conf.Name); - ss.WriteLine(" ", conf.Options["DebugInformation"].ToString().ToLower()); - ss.WriteLine(" "); - ss.WriteLine(); - } - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - - - // sdague - ok, this is an ugly hack, but what it lets - // us do is native include of files into the nant - // created files from all .nant/*include files. This - // lets us keep using prebuild, but allows for - // extended nant targets to do build and the like. - - try - { - Regex re = new Regex(".include$"); - DirectoryInfo nantdir = new DirectoryInfo(".nant"); - foreach (FileSystemInfo item in nantdir.GetFileSystemInfos()) - { - if (item is DirectoryInfo) { } - else if (item is FileInfo) - { - if (re.Match(((FileInfo)item).FullName) != - System.Text.RegularExpressions.Match.Empty) - { - Console.WriteLine("Including file: " + ((FileInfo)item).FullName); - - using (FileStream fs = new FileStream(((FileInfo)item).FullName, - FileMode.Open, - FileAccess.Read, - FileShare.None)) - { - using (StreamReader sr = new StreamReader(fs)) - { - ss.WriteLine("", ((FileInfo)item).FullName); - while (sr.Peek() != -1) - { - ss.WriteLine(sr.ReadLine()); - } - ss.WriteLine(); - } - } - } - } - } - } - catch { } - // ss.WriteLine(" "); - // ss.WriteLine(" "); - // ss.WriteLine(" ", solution.Name, solution.Version); - // ss.WriteLine(" "); - - // ss.WriteLine(" "); - // // ss.WriteLine(" "); - // ss.WriteLine(" "); - // ss.WriteLine(" "); - // ss.WriteLine(" "); - // ss.WriteLine(" "); - ss.WriteLine(); - - - ss.WriteLine(" "); - ss.WriteLine(" "); - //ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(" "); - foreach (ProjectNode project in solution.Projects) - { - string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - ss.Write(" "); - } - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - ss.Write(" "); - } - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(); - ss.WriteLine(" "); - ss.WriteLine(); - //ss.WriteLine(" "); - ss.WriteLine(" "); - ss.WriteLine(); - - ss.WriteLine(" "); - ss.WriteLine(" "); - foreach (ProjectNode project in solution.Projects) - { - string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - ss.Write(" "); - } - ss.WriteLine(" "); - ss.WriteLine(); - ss.WriteLine(""); - } - - m_Kernel.CurrentWorkingDirectory.Pop(); - } - - private void CleanProject(ProjectNode project) - { - m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); - string projectFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); - Helper.DeleteIfExists(projectFile); - } - - private void CleanSolution(SolutionNode solution) - { - m_Kernel.Log.Write("Cleaning NAnt build files for", solution.Name); - - string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); - Helper.DeleteIfExists(slnFile); - - foreach (ProjectNode project in solution.Projects) - { - CleanProject(project); - } - - m_Kernel.Log.Write(""); - } - - #endregion - - #region ITarget Members - - /// - /// Writes the specified kern. - /// - /// The kern. - public void Write(Kernel kern) - { - if (kern == null) - { - throw new ArgumentNullException("kern"); - } - m_Kernel = kern; - foreach (SolutionNode solution in kern.Solutions) - { - WriteCombine(solution); - } - m_Kernel = null; - } - - /// - /// Cleans the specified kern. - /// - /// The kern. - public virtual void Clean(Kernel kern) - { - if (kern == null) - { - throw new ArgumentNullException("kern"); - } - m_Kernel = kern; - foreach (SolutionNode sol in kern.Solutions) - { - CleanSolution(sol); - } - m_Kernel = null; - } - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return "nant"; - } - } - - #endregion - } -} +#region BSD License +/* + Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) + + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +#region CVS Information +/* + * $Source$ + * $Author: jendave $ + * $Date: 2007-02-13 21:58:03 +0100 (ti, 13 feb 2007) $ + * $Revision: 205 $ + */ +#endregion + +using System; +using System.Collections; +using System.Collections.Specialized; +using System.IO; +using System.Reflection; +using System.Text.RegularExpressions; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Nodes; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Targets +{ + /// + /// + /// + [Target("nant")] + public class NAntTarget : ITarget + { + #region Fields + + private Kernel m_Kernel; + + #endregion + + #region Private Methods + + private static string PrependPath(string path) + { + string tmpPath = Helper.NormalizePath(path, '/'); + Regex regex = new Regex(@"(\w):/(\w+)"); + Match match = regex.Match(tmpPath); + //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') + //{ + tmpPath = Helper.NormalizePath(tmpPath); + //} + // else + // { + // tmpPath = Helper.NormalizePath("./" + tmpPath); + // } + + return tmpPath; + } + + private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr) + { + string ret = ""; + if (solution.ProjectsTable.ContainsKey(refr.Name)) + { + ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; + + string finalPath = Helper.NormalizePath(((ReferencePathNode)currentProject.ReferencePaths[0]).Path + refr.Name + GetProjectExtension(project), '/'); + + return finalPath; + } + else + { + ProjectNode project = (ProjectNode)refr.Parent; + string fileRef = FindFileReference(refr.Name, project); + + if (refr.Path != null || fileRef != null) + { + string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + GetProjectExtension(project), '/') : fileRef; + ret += finalPath; + return ret; + } + + ret += (refr.Name + ".dll"); + } + return ret; + } + + private static string GetProjectExtension(ProjectNode project) + { + string extension = ".dll"; + if (project.Type == ProjectType.Exe) + { + extension = ".exe"; + } + return extension; + } + + private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr) + { + string ret = ""; + if (solution.ProjectsTable.ContainsKey(refr.Name)) + { + ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; + string finalPath = Helper.NormalizePath(((ReferencePathNode)project.ReferencePaths[0]).Path, '/'); + + return finalPath; + } + else + { + ProjectNode project = (ProjectNode)refr.Parent; + string fileRef = FindFileReference(refr.Name, project); + + if (refr.Path != null || fileRef != null) + { + string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef; + ret += finalPath; + return ret; + } + + try + { + Assembly assem = Assembly.Load(refr.Name); + if (assem != null) + { + ret += ""; + } + else + { + ret += ""; + } + } + catch (System.NullReferenceException e) + { + e.ToString(); + ret += ""; + } + } + return ret; + } + + private static string FindFileReference(string refName, ProjectNode project) + { + foreach (ReferencePathNode refPath in project.ReferencePaths) + { + string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); + + if (File.Exists(fullPath)) + { + return fullPath; + } + } + + return null; + } + + /// + /// Gets the XML doc file. + /// + /// The project. + /// The conf. + /// + public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) + { + if (conf == null) + { + throw new ArgumentNullException("conf"); + } + if (project == null) + { + throw new ArgumentNullException("project"); + } + string docFile = (string)conf.Options["XmlDocFile"]; + // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified + // { + // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; + // } + return docFile; + } + + private void WriteProject(SolutionNode solution, ProjectNode project) + { + string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); + StreamWriter ss = new StreamWriter(projFile); + + m_Kernel.CurrentWorkingDirectory.Push(); + Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); + bool hasDoc = false; + + using (ss) + { + ss.WriteLine(""); + ss.WriteLine("", project.Name); + ss.WriteLine(" ", "build"); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + foreach (ReferenceNode refr in project.References) + { + if (refr.LocalCopy) + { + ss.WriteLine(" ", '/')); + } + } + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.Write(" "); + ss.WriteLine(" ", project.RootNamespace); + foreach (string file in project.Files) + { + switch (project.Files.GetBuildAction(file)) + { + case BuildAction.EmbeddedResource: + ss.WriteLine(" {0}", ""); + break; + default: + if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) + { + ss.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); + } + break; + } + } + //if (project.Files.GetSubType(file).ToString() != "Code") + //{ + // ps.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); + + ss.WriteLine(" "); + ss.WriteLine(" "); + foreach (string file in project.Files) + { + switch (project.Files.GetBuildAction(file)) + { + case BuildAction.Compile: + ss.WriteLine(" "); + break; + default: + break; + } + } + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + foreach (ReferenceNode refr in project.References) + { + string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); + ss.WriteLine(" "); + } + ss.WriteLine(" "); + + ss.WriteLine(" "); + + foreach (ConfigurationNode conf in project.Configurations) + { + if (!String.IsNullOrEmpty(conf.Options.OutputPath)) + { + string targetDir = Helper.NormalizePath(conf.Options.OutputPath, '/'); + + ss.WriteLine(" "); + + ss.WriteLine(" "); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + break; + } + } + + ss.WriteLine(" "); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + + ss.WriteLine(" "); + if (hasDoc) + { + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.Write(" "); + } + else + { + ss.WriteLine(".exe\" />"); + } + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + // foreach(ReferenceNode refr in project.References) + // { + // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/'); + // if (path != "") + // { + // ss.WriteLine(" ", path); + // } + // } + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + } + ss.WriteLine(" "); + ss.WriteLine(""); + } + m_Kernel.CurrentWorkingDirectory.Pop(); + } + + private void WriteCombine(SolutionNode solution) + { + m_Kernel.Log.Write("Creating NAnt build files"); + foreach (ProjectNode project in solution.Projects) + { + if (m_Kernel.AllowProject(project.FilterGroups)) + { + m_Kernel.Log.Write("...Creating project: {0}", project.Name); + WriteProject(solution, project); + } + } + + m_Kernel.Log.Write(""); + string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); + StreamWriter ss = new StreamWriter(combFile); + + m_Kernel.CurrentWorkingDirectory.Push(); + Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); + + using (ss) + { + ss.WriteLine(""); + ss.WriteLine("", solution.Name); + ss.WriteLine(" "); + ss.WriteLine(); + + //ss.WriteLine(" "); + //ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + + // actually use active config out of prebuild.xml + ss.WriteLine(" ", solution.ActiveConfig); + + foreach (ConfigurationNode conf in solution.Configurations) + { + ss.WriteLine(); + ss.WriteLine(" ", conf.Name); + ss.WriteLine(" ", conf.Name); + ss.WriteLine(" ", conf.Options["DebugInformation"].ToString().ToLower()); + ss.WriteLine(" "); + ss.WriteLine(); + } + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + + + // sdague - ok, this is an ugly hack, but what it lets + // us do is native include of files into the nant + // created files from all .nant/*include files. This + // lets us keep using prebuild, but allows for + // extended nant targets to do build and the like. + + try + { + Regex re = new Regex(".include$"); + DirectoryInfo nantdir = new DirectoryInfo(".nant"); + foreach (FileSystemInfo item in nantdir.GetFileSystemInfos()) + { + if (item is DirectoryInfo) { } + else if (item is FileInfo) + { + if (re.Match(((FileInfo)item).FullName) != + System.Text.RegularExpressions.Match.Empty) + { + Console.WriteLine("Including file: " + ((FileInfo)item).FullName); + + using (FileStream fs = new FileStream(((FileInfo)item).FullName, + FileMode.Open, + FileAccess.Read, + FileShare.None)) + { + using (StreamReader sr = new StreamReader(fs)) + { + ss.WriteLine("", ((FileInfo)item).FullName); + while (sr.Peek() != -1) + { + ss.WriteLine(sr.ReadLine()); + } + ss.WriteLine(); + } + } + } + } + } + } + catch { } + // ss.WriteLine(" "); + // ss.WriteLine(" "); + // ss.WriteLine(" ", solution.Name, solution.Version); + // ss.WriteLine(" "); + + // ss.WriteLine(" "); + // // ss.WriteLine(" "); + // ss.WriteLine(" "); + // ss.WriteLine(" "); + // ss.WriteLine(" "); + // ss.WriteLine(" "); + ss.WriteLine(); + + + ss.WriteLine(" "); + ss.WriteLine(" "); + //ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" "); + foreach (ProjectNode project in solution.Projects) + { + string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); + ss.Write(" "); + } + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + + foreach (ProjectNode project in solution.ProjectsTableOrder) + { + string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); + ss.Write(" "); + } + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(); + ss.WriteLine(" "); + ss.WriteLine(); + //ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(); + + ss.WriteLine(" "); + ss.WriteLine(" "); + foreach (ProjectNode project in solution.Projects) + { + string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); + ss.Write(" "); + } + ss.WriteLine(" "); + ss.WriteLine(); + ss.WriteLine(""); + } + + m_Kernel.CurrentWorkingDirectory.Pop(); + } + + private void CleanProject(ProjectNode project) + { + m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); + string projectFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); + Helper.DeleteIfExists(projectFile); + } + + private void CleanSolution(SolutionNode solution) + { + m_Kernel.Log.Write("Cleaning NAnt build files for", solution.Name); + + string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); + Helper.DeleteIfExists(slnFile); + + foreach (ProjectNode project in solution.Projects) + { + CleanProject(project); + } + + m_Kernel.Log.Write(""); + } + + #endregion + + #region ITarget Members + + /// + /// Writes the specified kern. + /// + /// The kern. + public void Write(Kernel kern) + { + if (kern == null) + { + throw new ArgumentNullException("kern"); + } + m_Kernel = kern; + foreach (SolutionNode solution in kern.Solutions) + { + WriteCombine(solution); + } + m_Kernel = null; + } + + /// + /// Cleans the specified kern. + /// + /// The kern. + public virtual void Clean(Kernel kern) + { + if (kern == null) + { + throw new ArgumentNullException("kern"); + } + m_Kernel = kern; + foreach (SolutionNode sol in kern.Solutions) + { + CleanSolution(sol); + } + m_Kernel = null; + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return "nant"; + } + } + + #endregion + } +} diff --git a/Prebuild/src/data/prebuild-1.7.xsd b/Prebuild/src/data/prebuild-1.7.xsd index 9d63ce6e73..381b9f0364 100644 --- a/Prebuild/src/data/prebuild-1.7.xsd +++ b/Prebuild/src/data/prebuild-1.7.xsd @@ -1,261 +1,261 @@ - - - - - Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com), David Hudson (jendave at yahoo dot com) - - .NET Prebuild is a cross-platform XML-driven pre-build tool which - allows developers to easily generate project or make files for major - IDE's and .NET development tools including: Visual Studio .NET 2002 and - 2003, SharpDevelop, MonoDevelop, and NAnt. - - BSD License: - - Redistribution and use in source and binary forms, with or without modification, are permitted - provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. - * The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - - - - - - - - - - - - - - - - - - - - + + + + + Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com), David Hudson (jendave at yahoo dot com) + + .NET Prebuild is a cross-platform XML-driven pre-build tool which + allows developers to easily generate project or make files for major + IDE's and .NET development tools including: Visual Studio .NET 2002 and + 2003, SharpDevelop, MonoDevelop, and NAnt. + + BSD License: + + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.txt b/README.txt new file mode 100644 index 0000000000..6a3acf2931 --- /dev/null +++ b/README.txt @@ -0,0 +1,69 @@ +Welcome to OpenSim! + +Version 0.5 + +== OVERVIEW == + +OpenSim is a BSD Licensed Open Source project to develop a functioning +virtual worlds server platform capable of supporting multiple clients +and servers in a heterogeneous grid structure. OpenSim is written in +C#, and can run under Mono or the Microsoft .NET runtimes. + +This is considered an alpha release. Some stuff works, a lot +doesn't. If it breaks, you get to keep *both* pieces. + +== Installation on Windows == + +Prereqs: + + * Load OpenSim.sln into Visual Studio .NET and build the solution. + * chdir bin + * OpenSim.exe + +See configuring OpenSim + +== Installation on Linux == + +Prereqs: + * Mono >= 1.2.3.1 + * Nant >= 0.85 + * sqlite3 + +From the distribution type: + * nant + * cd bin + * mono ./OpenSim.exe + +See configuring OpenSim + +== Configuring OpenSim == + +When OpenSim starts for the first time, you will be prompted with a +series of questions that look something like: + +[09-17 03:54:40] DEFAULT REGION CONFIG: Simulator Name [OpenSim Test]: + +At each of these you must provide you own value or just hit enter to +take the default (in this case "OpenSim Test"). + +YOUR SIM WILL NOT BE STARTED UNTIL YOU ANSWER ALL QUESTIONS + +Once you are presented with a prompt that looks like: + + Region# : + +You have successfully started OpenSim. + +== Connecting to your OpenSim == + +By default your sim will be running on http://127.0.0.1:9000. To use +your OpenSim add -loginuri http://127.0.0.1:9000 to your second life +client (running on the same machine as your OpenSim). + +== More Information on OpenSim == + +More extensive information on building, running, and configuring +OpenSim, as well as how to report bugs, and participate in the OpenSim +project can always be found at http://opensimulator.org. + +Thanks for trying OpenSim, we hope it was a pleasant experience. diff --git a/TESTING.txt b/TESTING.txt new file mode 100644 index 0000000000..1a3b1dc2f5 --- /dev/null +++ b/TESTING.txt @@ -0,0 +1,24 @@ +==TESTING== +To use nunit testing on opensim code, you have a variety of methods. The easiast methods involve using IDE capabilities to test code. Using VS2005/2008 I recommend using the testing capabilities of Resarper(commercial) or TestDriven.Net(free). Both will recognize nunit tests within your application and allow you to test them individually, or all at once, etc. You will also be able to step into debug mode into a test through these add-ins enabling a developer to jump right in and see how a specific test-case/scenerio works. + +Additionally, it is my understanding that sharpdevelop and monodevelop have their own nunit testing plugins within their IDE. Though I am not certain of their exact feature set or stability. + +== Using NUnit Directly == +The NUnit project is a very mature testing application. It can be obtained from www.nunit.org are via various package distrobutions for Linux. Please be sure to get a .Net 2.0 version of Nunit, as OpenSim makes use of .Net 2.0 functionality. + +Nunit comes with 2 tools that will enable you to run tests from assembly inputs. Nunit-gui and nunit-console. NUnit-gui is a console that will let you view the execution of various tests within your assemblies and give visual indication of teir success or failure. This is a useful tool for those who lack IDE addins ( or lack IDEs at all ). + +Nunit console allows you to execute the nunit tests of assemblies via console. Its output will show test failures and successes and a summary of what happened. This is very useful for a quick overview and/or automated testing. + +Windows +Windows version of nunit-console is by default .Net 2.0 if you downloaded the .Net 2.0 version of Nunit. Be sure to setup your PATH environment variable. + +Linux & OSX +On these operating systems you will have to use the command "nunit-console2" + +Example + +nunit-console2 OpenSim.Framework.Tests.dll (on linux) +nunit-console OpenSim.Framework.Tests.dll (on windows) + +For more information on testing contact the autor of this testing readme: Daedius Moskvitch ( daedius @@@@ daedius com) \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDataReader.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDataReader.cs new file mode 100644 index 0000000000..67fb7c191b --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDataReader.cs @@ -0,0 +1,127 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System; +using System.Data; +using System.IO; + +namespace TribalMedia.Framework.Data +{ + public class BaseDataReader + { + private readonly IDataReader m_source; + + public BaseDataReader(IDataReader source) + { + m_source = source; + } + + public object Get(string name) + { + return m_source[name]; + } + + public ushort GetUShort(string name) + { + return (ushort)m_source.GetInt32(m_source.GetOrdinal(name)); + } + + public byte GetByte(string name) + { + int ordinal = m_source.GetOrdinal(name); + byte value = (byte)m_source.GetInt16(ordinal); + return value; + } + + public sbyte GetSByte(string name) + { + return (sbyte)m_source.GetInt16(m_source.GetOrdinal(name)); + } + + public float GetFloat(string name) + { + return m_source.GetFloat(m_source.GetOrdinal(name)); + } + + public byte[] GetBytes(string name) + { + int ordinal = m_source.GetOrdinal(name); + + if (m_source.GetValue(ordinal) == DBNull.Value) + { + return null; + } + + byte[] buffer = new byte[16384]; + + MemoryStream memStream = new MemoryStream(); + + long totalRead = 0; + + int bytesRead; + do + { + bytesRead = (int)m_source.GetBytes(ordinal, totalRead, buffer, 0, buffer.Length); + totalRead += bytesRead; + + memStream.Write(buffer, 0, bytesRead); + } while (bytesRead == buffer.Length); + + return memStream.ToArray(); + } + + public string GetString(string name) + { + int ordinal = m_source.GetOrdinal(name); + object value = m_source.GetValue(ordinal); + + if (value is DBNull) + { + return null; + } + + return (string)value; + } + + public bool Read() + { + return m_source.Read(); + } + + public Guid GetGuid(string name) + { + string guidString = GetString(name); + if (String.IsNullOrEmpty(guidString)) + { + return Guid.Empty; + } + else + { + return new Guid(guidString); + } + } + } +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDatabaseConnector.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDatabaseConnector.cs new file mode 100644 index 0000000000..45ca650c53 --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseDatabaseConnector.cs @@ -0,0 +1,142 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; + +namespace TribalMedia.Framework.Data +{ + public abstract class BaseDatabaseConnector + { + protected string m_connectionString; + + public BaseDatabaseConnector(string connectionString) + { + m_connectionString = connectionString; + } + + public abstract DbConnection GetNewConnection(); + public abstract string CreateParamName(string fieldName); + + public DbCommand CreateSelectCommand(BaseTableMapper mapper, DbConnection connection, string fieldName, object key) + { + string table = mapper.TableName; + + DbCommand command = connection.CreateCommand(); + + string conditionString = CreateCondition(mapper, command, fieldName, key); + + string query = + String.Format("select * from {0} where {1}", table, conditionString); + + command.CommandText = query; + command.CommandType = CommandType.Text; + + return command; + } + + public string CreateCondition(BaseTableMapper mapper, DbCommand command, string fieldName, object key) + { + string keyFieldParamName = mapper.CreateParamName(fieldName); + + DbParameter param = command.CreateParameter(); + param.ParameterName = keyFieldParamName; + param.Value = ConvertToDbType(key); + command.Parameters.Add(param); + + return String.Format("{0}={1}", fieldName, keyFieldParamName); + } + + public DbCommand CreateUpdateCommand(BaseTableMapper mapper, DbConnection connection, object rowMapper, object primaryKey) + { + string table = mapper.TableName; + + List fieldNames = new List(); + + DbCommand command = connection.CreateCommand(); + + foreach (BaseFieldMapper fieldMapper in mapper.Schema.Fields.Values) + { + if (fieldMapper != mapper.KeyFieldMapper) + { + fieldMapper.ExpandField(rowMapper, command, fieldNames); + } + } + + List assignments = new List(); + + foreach (string field in fieldNames) + { + assignments.Add(String.Format("{0}={1}", field, mapper.CreateParamName(field))); + } + + string conditionString = mapper.CreateCondition(command, mapper.KeyFieldMapper.FieldName, primaryKey); + + command.CommandText = + String.Format("update {0} set {1} where {2}", table, String.Join(", ", assignments.ToArray()), + conditionString); + + return command; + } + + public DbCommand CreateInsertCommand(BaseTableMapper mapper, DbConnection connection, object obj) + { + string table = mapper.TableName; + + List fieldNames = new List(); + + DbCommand command = connection.CreateCommand(); + + foreach (BaseFieldMapper fieldMapper in mapper.Schema.Fields.Values) + { + fieldMapper.ExpandField(obj, command, fieldNames); + } + + List paramNames = new List(); + + foreach (string field in fieldNames) + { + paramNames.Add(mapper.CreateParamName(field)); + } + + command.CommandText = + String.Format("insert into {0} ({1}) values ({2})", table, String.Join(", ", fieldNames.ToArray()), + String.Join(", ", paramNames.ToArray())); + + return command; + } + + public virtual object ConvertToDbType(object value) + { + return value; + } + + public abstract BaseDataReader CreateReader(IDataReader reader); + } + +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseFieldMapper.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseFieldMapper.cs new file mode 100644 index 0000000000..20f919a7f5 --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseFieldMapper.cs @@ -0,0 +1,163 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System; +using System.Collections.Generic; +using System.Data.Common; + +namespace TribalMedia.Framework.Data +{ + public delegate TField ObjectGetAccessor(TObj obj); + public delegate void ObjectSetAccessor(TObj obj, TField value); + + public abstract class BaseFieldMapper + { + private readonly BaseTableMapper m_tableMapper; + private readonly string m_fieldName; + + public string FieldName + { + get { return m_fieldName; } + } + + protected Type m_valueType; + + public Type ValueType + { + get { return m_valueType; } + } + + public abstract object GetParamValue(object obj); + + public BaseFieldMapper(BaseTableMapper tableMapper, string fieldName, Type valueType) + { + m_fieldName = fieldName; + m_valueType = valueType; + m_tableMapper = tableMapper; + } + + public abstract void SetPropertyFromReader(object mapper, BaseDataReader reader); + + public void RawAddParam(DbCommand command, List fieldNames, string fieldName, object value) + { + string paramName = m_tableMapper.CreateParamName(fieldName); + fieldNames.Add(fieldName); + + DbParameter param = command.CreateParameter(); + param.ParameterName = paramName; + param.Value = value; + + command.Parameters.Add(param); + } + + public virtual void ExpandField(TObj obj, DbCommand command, List fieldNames) + { + string fieldName = FieldName; + object value = GetParamValue(obj); + + RawAddParam(command, fieldNames, fieldName, m_tableMapper.ConvertToDbType(value)); + } + + protected virtual object GetValue(BaseDataReader reader) + { + object value; + + if (ValueType == typeof(Guid)) + { + value = reader.GetGuid(m_fieldName); + } + else if (ValueType == typeof(bool)) + { + uint boolVal = reader.GetUShort(m_fieldName); + value = (boolVal == 1); + } + else + if (ValueType == typeof(byte)) + { + value = reader.GetByte(m_fieldName); + } + else if (ValueType == typeof(sbyte)) + { + value = reader.GetSByte(m_fieldName); + } + else if (ValueType == typeof(ushort)) + { + value = reader.GetUShort(m_fieldName); + } + else if (ValueType == typeof(byte[])) + { + value = reader.GetBytes(m_fieldName); + } + else + { + value = reader.Get(m_fieldName); + } + + if (value is DBNull) + { + value = default(ValueType); + } + + return value; + } + } + + public class ObjectField : BaseFieldMapper + { + private readonly ObjectGetAccessor m_fieldGetAccessor; + private readonly ObjectSetAccessor m_fieldSetAccessor; + + public override object GetParamValue(object obj) + { + return m_fieldGetAccessor((TObject)obj); + } + + public override void SetPropertyFromReader(object obj, BaseDataReader reader) + { + object value; + + value = GetValue(reader); + + if (value == null) + { + m_fieldSetAccessor((TObject)obj, default(TField)); + } + else + { + m_fieldSetAccessor((TObject)obj, (TField)value); + } + } + + + public ObjectField(BaseTableMapper tableMapper, string fieldName, ObjectGetAccessor rowMapperGetAccessor, + ObjectSetAccessor rowMapperSetAccessor) + : base(tableMapper, fieldName, typeof(TField)) + { + m_fieldGetAccessor = rowMapperGetAccessor; + m_fieldSetAccessor = rowMapperSetAccessor; + } + } +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs new file mode 100644 index 0000000000..e8292fd1a0 --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs @@ -0,0 +1,60 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using TribalMedia.Framework.Data; + +namespace TribalMedia.Framework.Data +{ + public abstract class BaseRowMapper + { + public abstract void FillObject(BaseDataReader reader); + } + + public class BaseRowMapper : BaseRowMapper + { + private readonly BaseSchema m_schema; + private readonly TObj m_obj; + + public TObj Object + { + get { return m_obj; } + } + + public BaseRowMapper(BaseSchema schema, TObj obj) + { + m_schema = schema; + m_obj = obj; + } + + public override void FillObject(BaseDataReader reader) + { + foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values) + { + fieldMapper.SetPropertyFromReader(this, reader); + } + } + } +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseSchema.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseSchema.cs new file mode 100644 index 0000000000..a6740c2bcd --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseSchema.cs @@ -0,0 +1,68 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System.Collections.Generic; +using TribalMedia.Framework.Data; + +namespace TribalMedia.Framework.Data +{ + public class BaseSchema + { + protected BaseTableMapper m_tableMapper; + protected Dictionary m_mappings; + + public Dictionary Fields + { + get { return m_mappings; } + } + + public BaseSchema(BaseTableMapper tableMapper) + { + m_mappings = new Dictionary(); + m_tableMapper = tableMapper; + } + } + + public class BaseSchema : BaseSchema + { + public BaseSchema(BaseTableMapper tableMapper) + : base(tableMapper) + { + } + + public ObjectField AddMapping(string fieldName, + ObjectGetAccessor rowMapperGetAccessor, + ObjectSetAccessor rowMapperSetAccessor) + { + ObjectField rowMapperField = + new ObjectField(m_tableMapper, fieldName, rowMapperGetAccessor, rowMapperSetAccessor); + + m_mappings.Add(fieldName, rowMapperField); + + return rowMapperField; + } + } +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseTableMapper.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseTableMapper.cs new file mode 100644 index 0000000000..d69fcbb8ea --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseTableMapper.cs @@ -0,0 +1,280 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System; +using System.Data; +using System.Data.Common; +using TribalMedia.Framework.Data; + +namespace TribalMedia.Framework.Data +{ + public abstract class BaseTableMapper + { + private readonly BaseDatabaseConnector m_database; + private readonly object m_syncRoot = new object(); + + protected void WithConnection(Action action) + { + lock (m_syncRoot) + { + DbConnection m_connection = m_database.GetNewConnection(); + + if (m_connection.State != ConnectionState.Open) + { + m_connection.Open(); + } + + action(m_connection); + + if (m_connection.State == ConnectionState.Open) + { + m_connection.Close(); + } + } + } + + private readonly string m_tableName; + public string TableName + { + get { return m_tableName; } + } + + protected BaseSchema m_schema; + public BaseSchema Schema + { + get { return m_schema; } + } + + protected BaseFieldMapper m_keyFieldMapper; + public BaseFieldMapper KeyFieldMapper + { + get { return m_keyFieldMapper; } + } + + public BaseTableMapper(BaseDatabaseConnector database, string tableName) + { + m_database = database; + m_tableName = tableName.ToLower(); // Stupid MySQL hack. + } + + public string CreateParamName(string fieldName) + { + return m_database.CreateParamName(fieldName); + } + + protected DbCommand CreateSelectCommand(DbConnection connection, string fieldName, object primaryKey) + { + return m_database.CreateSelectCommand(this, connection, fieldName, primaryKey); + } + + public string CreateCondition(DbCommand command, string fieldName, object key) + { + return m_database.CreateCondition(this, command, fieldName, key); + } + + public DbCommand CreateInsertCommand(DbConnection connection, object obj) + { + return m_database.CreateInsertCommand(this, connection, obj); + } + + public DbCommand CreateUpdateCommand(DbConnection connection, object rowMapper, object primaryKey) + { + return m_database.CreateUpdateCommand(this, connection, rowMapper, primaryKey); + } + + public object ConvertToDbType(object value) + { + return m_database.ConvertToDbType(value); + } + + protected virtual BaseDataReader CreateReader(IDataReader reader) + { + return m_database.CreateReader(reader); + } + } + + public abstract class BaseTableMapper : BaseTableMapper + { + public BaseTableMapper(BaseDatabaseConnector database, string tableName) + : base(database, tableName) + { + } + + // HACK: This is a temporary function used by TryGetValue(). + // Due to a bug in mono 1.2.6, delegate blocks cannot contain + // a using() block. This has been fixed in SVN, so the next + // mono release should work. + private void TryGetConnectionValue(DbConnection connection, TPrimaryKey primaryKey, ref TRowMapper result, ref bool success) + { + using ( + DbCommand command = + CreateSelectCommand(connection, KeyFieldMapper.FieldName, primaryKey)) + { + using (IDataReader reader = command.ExecuteReader()) + { + if (reader.Read()) + { + result = FromReader( CreateReader(reader)); + success = true; + } + else + { + success = false; + } + } + } + } + + public bool TryGetValue(TPrimaryKey primaryKey, out TRowMapper value) + { + TRowMapper result = default(TRowMapper); + bool success = false; + + WithConnection(delegate(DbConnection connection) + { + TryGetConnectionValue(connection, primaryKey, ref result, ref success); + }); + + value = result; + + return success; + } + + // HACK: This is a temporary function used by Remove(). + // Due to a bug in mono 1.2.6, delegate blocks cannot contain + // a using() block. This has been fixed in SVN, so the next + // mono release should work. + protected virtual void TryDelete(DbConnection connection, TPrimaryKey id, ref int deleted) + { + using ( + DbCommand command = + CreateDeleteCommand(connection, KeyFieldMapper.FieldName, id)) + { + deleted = command.ExecuteNonQuery(); + } + } + + public virtual bool Remove(TPrimaryKey id) + { + int deleted = 0; + + WithConnection(delegate(DbConnection connection) + { + TryDelete(connection, id, ref deleted); + }); + + if (deleted == 1) + { + return true; + } + else + { + return false; + } + } + + public DbCommand CreateDeleteCommand(DbConnection connection, string fieldName, TPrimaryKey primaryKey) + { + string table = TableName; + + DbCommand command = connection.CreateCommand(); + + string conditionString = CreateCondition(command, fieldName, primaryKey); + + string query = + String.Format("delete from {0} where {1}", table, conditionString); + + command.CommandText = query; + command.CommandType = CommandType.Text; + + return command; + } + + // HACK: This is a temporary function used by Update(). + // Due to a bug in mono 1.2.6, delegate blocks cannot contain + // a using() block. This has been fixed in SVN, so the next + // mono release should work. + protected void TryUpdate(DbConnection connection, TPrimaryKey primaryKey, TRowMapper value, ref int updated) + { + using (DbCommand command = CreateUpdateCommand(connection, value, primaryKey)) + { + updated = command.ExecuteNonQuery(); + } + } + + public virtual bool Update(TPrimaryKey primaryKey, TRowMapper value) + { + int updated = 0; + + WithConnection(delegate(DbConnection connection) + { + TryUpdate(connection, primaryKey, value, ref updated); + }); + + if (updated == 1) + { + return true; + } + else + { + return false; + } + } + + // HACK: This is a temporary function used by Add(). + // Due to a bug in mono 1.2.6, delegate blocks cannot contain + // a using() block. This has been fixed in SVN, so the next + // mono release should work. + protected void TryAdd(DbConnection connection, TRowMapper value, ref int added) + { + using (DbCommand command = CreateInsertCommand(connection, value)) + { + added = command.ExecuteNonQuery(); + } + } + + public virtual bool Add(TRowMapper value) + { + int added = 0; + + WithConnection(delegate(DbConnection connection) + { + TryAdd(connection, value, ref added); + }); + + if (added == 1) + { + return true; + } + else + { + return false; + } + } + + public abstract TRowMapper FromReader(BaseDataReader reader); + } +} \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..457624e466 --- /dev/null +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs @@ -0,0 +1,66 @@ +/* +* Copyright (c) Tribal Media AB, http://tribalmedia.se/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Tribal Media AB may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly : AssemblyTitle("TribalMedia.Framework.Data")] +[assembly : AssemblyDescription("Generic Database Abstraction Layer")] +[assembly : AssemblyConfiguration("")] +[assembly : AssemblyCompany("TribalMedia")] +[assembly : AssemblyProduct("TribalMedia.Framework.Data")] +[assembly: AssemblyCopyright("Copyright © 2007 Tribal Media")] +[assembly : AssemblyTrademark("")] +[assembly : AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. + +[assembly : ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM + +[assembly : Guid("9269f421-19d9-4eea-bfe3-c0ffe426fada")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly : AssemblyVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] +[assembly : AllowPartiallyTrustedCallers] \ No newline at end of file diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/TribalMedia.Framework.Data.snk b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/TribalMedia.Framework.Data.snk new file mode 100644 index 0000000000000000000000000000000000000000..fc71027d5e785f0858edf0f9f272b4545a99be7d GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096?msn_s3EHSc#ZJC7|3?&p!QfDl3n{nT zX44ZCsEJ`SF<)LsDs#GHjd$qVWV(KCh}r5Akvb^Vc1GPgvgFrqz>VM(5;O(8;w+e^ z1)5*V^kFGEStu!jQ4GB{VBI`<7MY#jU(^^E-B#%vF@y{6rsUo=|EUm?N~oQK>ky_n z^uJaT;`Wehb(*k>pLv`9B?I`-&r}D`26P{mK*YxDCtu11EE7c!zOeSMhkn;D!ZQ~5 z#j;=#P_P4jTfNw$&(=QbHsi16+?)hgjFJ1I7eFouN%0NMOw!0WuBa$o)^;f%*Iscy zHFk+ovQkZ;qD7PL1VL*AqO~!+x+TQ9)7VLV$UjyYJHlTNtDu^iPR)xDmgK9G!XDA9 zalZe;!SYfdaVtJ567`?hQyTb#E|&Cy-To41=dk?@;Psxlh_FC^bPB0z*M##v?o;$I4(q{ZHJc(6t(MX+;3>%~)Z zpZ33s^61Z0L=2qxyU$I+Yk*40inWxp)%;hGAdAn&1Hd}h$%S?F(ZbCyVw?J%!{LyY zGhg#MHzP$6!2N(MjbK646O{qK2pbcaMAa}s2vwrrN - - - - - TRACE;DEBUG - false - false - false - 4 - false - - bin - true - true - false - - - - - TRACE - true - false - false - 4 - false - - bin - false - true - false - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - ../../bin/ - - - - - ../../bin/ - - - - ../../bin/ - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - ../../../../bin/Physics/ - - - - - ../../../../bin/Physics/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - ../../../../bin/Physics/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - ../../../../bin/ScriptEngines/ - - - - - - - - - - - - - - - - ../../../../bin/ScriptEngines/ - - - - - ../../../../bin/ScriptEngines/ - - - - ../../../../bin/ - ../../../../bin/ScriptEngines/ - - - - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - ../../../bin/ScriptEngines/ - - - - - - - - - - - - - - - - - - - - - - - - - ../../../../bin/ScriptEngines/ - - - - - ../../../../bin/ScriptEngines/ - - - - ../../../../bin/ - ../../../../bin/ScriptEngines/ - - - - - - - - - - - - - - - - - - - - - - - ../../../../bin/ - - - - - ../../../../bin/ - - - - ../../../../bin/ - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - ../../../bin/ScriptEngines/ - - - - - ../../../bin/ScriptEngines/ - - - - ../../../bin/ - ../../../bin/ScriptEngines/ - - - - - - - - - - - - - - - - - - - - - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEBUG;TRACE - false - bin/Debug - true - 1595 - - - - - TRACE - bin/Release - true - false - 1595 - - - - - - DEBUG;TRACE - false - ..\..\bin\ - true - Prebuild.snk - 1595 - - - - - TRACE - ..\..\bin\ - true - false - Prebuild.snk - 1595 - - - ../../bin/ - - - - - - - - - - - - - - - - - - - - - - - +<<<<<<< .working + + + + + + TRACE;DEBUG + false + false + false + 4 + false + + bin + true + true + false + + + + + TRACE + true + false + false + 4 + false + + bin + false + true + false + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + ../../bin/ + + + + + ../../bin/ + + + + ../../bin/ + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + ../../../bin/ + TribalMedia.Framework.Data.snk + + + + + ../../../bin/ + TribalMedia.Framework.Data.snk + + + + ../../../bin/ + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../../bin/Physics/ + + + + + ../../../../bin/Physics/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + ../../../../bin/Physics/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + ../../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ScriptEngines/ + + + + + ../../../../bin/ScriptEngines/ + + + + ../../../../bin/ + ../../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ScriptEngines/ + + + + + ../../../../bin/ScriptEngines/ + + + + ../../../../bin/ + ../../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + ../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ScriptEngines/ + + + + + ../../../../bin/ScriptEngines/ + + + + ../../../../bin/ + ../../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + + + + + ../../../../bin/tests/stress + + + + + ../../../../bin/tests/stress + + + ../../../../bin/ + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + ../../../bin/ScriptEngines/ + + + + + ../../../bin/ScriptEngines/ + + + + ../../../bin/ + ../../../bin/ScriptEngines/ + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + DEBUG;TRACE + false + bin/Debug + true + 1595 + + + + + TRACE + bin/Release + true + false + 1595 + + + + + + + DEBUG;TRACE + false + ..\..\bin\ + true + Prebuild.snk + 1595 + + + + + TRACE + ..\..\bin\ + true + false + Prebuild.snk + 1595 + + + ../../bin/ + + + + + + + + + + + + diff --git a/runprebuild.bat b/runprebuild.bat old mode 100644 new mode 100755 diff --git a/runprebuild2008.bat b/runprebuild2008.bat old mode 100644 new mode 100755 index 1a80951d5c..f5b2d478b4 --- a/runprebuild2008.bat +++ b/runprebuild2008.bat @@ -1,2 +1,2 @@ -bin\Prebuild.exe /target nant +bin\Prebuild.exe /target nant bin\Prebuild.exe /target vs2008 \ No newline at end of file diff --git a/share/php/generateUserFunction.php b/share/php/generateUserFunction.php old mode 100644 new mode 100755 diff --git a/share/ruby/aserv.rb b/share/ruby/aserv.rb old mode 100644 new mode 100755 diff --git a/share/ruby/config.rb b/share/ruby/config.rb old mode 100644 new mode 100755 diff --git a/share/ruby/gridserv.rb b/share/ruby/gridserv.rb old mode 100644 new mode 100755 diff --git a/share/ruby/userserv.rb b/share/ruby/userserv.rb old mode 100644 new mode 100755 diff --git a/update-svn-properties.py b/update-svn-properties.py new file mode 100755 index 0000000000..c1518ce404 --- /dev/null +++ b/update-svn-properties.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python + +import os, os.path, popen2, re, string, sys + +def textfile(file): + return { + "svn:eol-style" : "native" + } + +def script(file): + return { + "svn:eol-style" : "native", + "svn:executable" : "*" + } + +def executable(file): + return { + "svn:executable" : "*", + "svn:mime-type" : "application/octet-stream" + } + +def binary(file): + return { + "svn:mime-type" : "application/octet-stream" + } + +def is_binary(file): + f = open(file) + data = f.read() + f.close() + + for c in data: + if c not in string.printable: + return True + return False + +def binary_or_text(file): + if is_binary(file): + return binary(file) + else: + return textfile(file) + +property_map = { + ".bat" : script, + ".config" : textfile, + ".cs" : textfile, + ".csproj" : textfile, + ".dat" : binary_or_text, + ".dll" : binary, + ".dylib" : binary, + ".example" : textfile, + ".exe" : executable, + ".fxcop" : textfile, + ".ico" : binary, + ".include" : textfile, + ".ini" : textfile, + ".j2c" : binary, + ".jp2" : binary, + ".lsl" : textfile, + ".mdp" : textfile, + ".mds" : textfile, + ".nsi" : textfile, + ".pdb" : binary, + ".php" : script, + ".pidb" : binary, + ".pl" : script, + ".png" : binary, + ".py" : script, + ".rb" : script, + ".resx" : textfile, + ".settings" : textfile, + ".stetic" : textfile, + ".sh" : script, + ".snk" : binary, + ".so" : binary, + ".sql" : textfile, + ".txt" : textfile, + ".userprefs" : textfile, + ".usertasks" : textfile, + ".xml" : textfile, + ".xsd" : textfile +} + +def propset(file, property, value): + os.system('svn propset %s "%s" "%s"' % (property, value, file)) + +def propdel(file, property): + os.system('svn propdel %s "%s"' % (property, file)) + +def propget(file, property): + output, input, error = popen2.popen3('svn propget %s "%s"' % (property, file)) + + err = error.read() + if err != "": + output.close() + error.close() + input.close() + return "" + + result = output.read() + output.close() + error.close() + input.close() + return result.strip() + +def proplist(file): + output, input, error = popen2.popen3('svn proplist "%s"' % file) + + err = error.read() + if err != "": + output.close() + error.close() + input.close() + return None + + result = output.readlines() + output.close() + error.close() + input.close() + if len(result) > 0 and re.match("^Properties on .*:$", result[0]) is not None: + return [r.strip() for r in result[1:]] + else: + return "" + +def update_file(file, properties): + current_props = proplist(file) + + if current_props is None: + # svn error occurred -- probably an unversioned file + return + + for p in current_props: + if not properties.has_key(p): + propdel(file, p) + + for p in properties: + if p not in current_props or propget(file, p) != properties[p]: + propset(file, p, properties[p]) + +def update(dir): + for f in os.listdir(dir): + fullpath = os.path.join(dir, f) + if os.path.isdir(fullpath): + if not os.path.islink(fullpath): + update(fullpath) + else: + extension = os.path.splitext(fullpath)[1].lower() + if property_map.has_key(extension): + update_file(fullpath, property_map[extension](fullpath)) + elif extension != "" and proplist(fullpath) is not None: + print "Warning: No properties defined for %s files (%s)" % (extension, fullpath) + +def main(argv = None): + if argv is None: + argv = sys.argv + + update(".") + +if __name__ == "__main__": + sys.exit(main())