=== PREBUILD UPSTREAMS UPDATE : POTENTIAL BREAKAGE ===

* Applied upstreams changes to allow for auditing and debugging in our various environments.
* This should, in theory, bring back 'multiple ref dirs'.
* Temporarily Removed xmlns because prebuild-1.7 schema does not allow for multiple solutions per prebuild node (This will be a moot issue once the Prebuild node is moved out of prebuild.xml)
* Autotools target: Various minor fixes
* MonoDevelop Target : No changes.
* Nant Target: Various minor fixes, support for net-3.5 and mono-2.0/3.5 targets
* Sharpdevelop targets: No changes.
* VS Targets: Refactored into using VSGenericTarget, and supports 2.0-3.5
* XCode Target: No changes.

--- Regressions and outstanding issues ---
* The Solution is assigned a random Guid - will lead to unnecessary reloads and loss of user settings.

--- New features of Prebuild 2.0.4 ---
* (Better) support for Web, WinForms and Database Projects and build actions
* Conditional Framework Version compilation support (1.1, 2.0-3.5)
* ArrayList -> List<>, ICollection -> IList
  (this means Prebuild can generate 1.1 solutions, but can't itself be built under 1.1 - how very meta)
* Added <?include file="sub_prebuild.xml" ?> preprocessor directive.
GenericGridServerConcept
lbsa71 2009-02-19 12:48:38 +00:00
parent 74e3a85492
commit dd9640cda8
61 changed files with 2801 additions and 1991 deletions

View File

@ -4,4 +4,7 @@ Dan Moorehead (dan05a@gmail.com)
Rob Loach (http://www.robloach.net)
C.J. Adams-Collier (cjac@colliertech.org)
Patch Contributers
lbsa71
chi11ken
sdague

View File

@ -1,3 +1,90 @@
2008-12-09T02:15 D. Moonfire <d.moonfire@mfgames.com>
* src/Core/Kernel.cs
- Added a /ppi target to get the results of processing but before
processing the actual results.
* src/Core/Preprocessor.cs
- Applied the patch from kanato with formatting changes.
- Uses the <?include file="" ?> format.
* tests/
- Added some lightweight tests to test the functionality of the
include patch.
2008-06-19T09:37 John Anderson <sontek@gmail.com>
* src/Core/Kernel.cs
- Only Loop through targets that are not abstract.
* src/Core/Targets/VSGenericTarget.cs
- Marked abstract and removed the Target attribute.
2008-06-16T17:37 John Anderson <sontek@gmail.com>
* src/Core/Nodes/ProjectNode.cs,data/prebuild-1.7.xsd
- Added the ability to hardcode guid's in the projects
2008-05-21T0737 C.J. Adams-Collier <cjac@colliertech.org>
* src/Core/Targets/AutotoolsTarget.cs
- catch exception when unable to compile AssemblyInfo.cs
2008-05-07T17:29 John Anderson <sontek@gmail.com>
* src/Core/Targets/VSGenericTarget.cs
- Generate asp.net output in bin\ folder (asp.net requires it there)
2008-04-30T17:29 John Anderson <sontek@gmail.com>
* src/Core/Nodes/DatabaseReferenceNode.cs,
src/Core/Nodes/Datanode.cs,
src/Core/Nodes/FileNode.cs,
src/Core/Nodes/FileNodes.cs,
src/Core/Nodes/MatchNode.cs,
src/Core/Targets/VS2008Target.cs,
src/data/prebuild-1.7.xsd
- Refactored the project generation code to handle web projects and more
logically handle embedded resources and designer files.
2008-04-30T17:29 Joseph Lombrozo <digitaljeebus@gmail.com>
* src/Core/Nodes/SolutionNode.cs
- Had solutions inherit Configurations in the same way that Projects do.
2008-04-29T06:35 Joseph Lombrozo <digitaljeebus@gmail.com>
* src/Core/Targets/VS2008Target.cs,
src/Core/Nodes/DatabaseProjectNode.cs,
src/Core/Nodes/DatabaseReferenceNode.cs,
src/data/prebuild-1.7.xsd
- Added database references to database projects.
- Prevented nested solutions from being written to disk.
2008-04-29T05:43 Joseph Lombrozo <digitaljeebus@gmail.com>
* src/Core/Targets/VS2008Target.cs
- Enabled embedded solutions to contain Files.
2008-04-29T04:13 Joseph Lombrozo <digitaljeebus@gmail.com>
* src/Core/VSVersion.cs
- Fixed spelling mistake in enum comment.
* src/Core/Attributes/DataNodeAttribute.cs
- Allowed the DataNodeAttribute to be attached to a single class
more than once, allowing one class to be used to parse more than
one node at a time.
* src/Core/Kernel.cs
- Changed CacheNodeTypes() to allow for multiple DataNodeAttribute
instances in one class. Refactored ProcessFile(...) to return Solutions,
rather than adding them to the Kernel.
* src/Core/Nodes/SolutionNode.cs
- Added Guid (for embedded folders)
- Added DatabaseProjects, Solutions and Processes to the SolutionNode
when parsing.
* src/Core/Nodes/ProjectNode.cs
- Added FrameworkVersion property to allow for 2.0/3.0/3.5 differentiation.
* src/Core/Targets/VS2008Target.cs, src/data/prebuild-1.7.xsd
- Added ability to have embedded solutions, and externally referenced
prebuild scripts.
2008-04-24T04:33 John M. Anderson <sontek@gmail.com>
* src/Core/Targets/VS2003Target.cs, src/Core/Targets/VSVersion.cs
- Moved the VSVersion enum into its own file.
* src/Core/Targets/VS2008Target.cs
- added support for VS2008
* src/Core/Nodes/ProjectNode.cs
- Added initial support for ASP.NET projects
* src/Core/Nodes/DatabaseProjectNode.cs
- Added support for Visual Studio database projects
2008-02-19T07:08 C.J. Adams-Collier <cjac@colliertech.org>
* TODO
- added some tasks from Sam Hocevar

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Solution name="Prebuild" version="2.0.3">
<Solution name="Prebuild" version="2.0.4">
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>

View File

@ -0,0 +1,4 @@
@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
@rem for Microsoft Visual Studio .NET 2008
cd ..
Prebuild.exe /target vs2008 /file prebuild.xml /pause

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Collections.Specialized;
@ -40,7 +31,7 @@ namespace Prebuild.Core.Attributes
/// <summary>
///
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple=true)]
public sealed class DataNodeAttribute : Attribute
{
#region Fields

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
namespace Prebuild.Core.Attributes

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
namespace Prebuild.Core.Attributes

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Runtime.Serialization;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Xml;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
namespace Prebuild.Core.Interfaces

View File

@ -36,16 +36,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: cjcollier $
* $Date: 2008-02-08 01:31:29 +0900 (Fri, 08 Feb 2008) $
* $Revision: 256 $
*/
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Collections;
using System.Collections.Specialized;
@ -80,17 +72,17 @@ namespace Prebuild.Core
#region Fields
private static Kernel m_Instance = new Kernel();
private static readonly Kernel m_Instance = new Kernel();
/// <summary>
/// This must match the version of the schema that is embeeded
/// </summary>
private static string m_SchemaVersion = "1.7";
private static string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd";
private static string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema;
private const string m_SchemaVersion = "1.7";
private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd";
private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema;
bool disposed;
private Version m_Version;
private string m_Revision = "";
private const string m_Revision = "";
private CommandLineCollection m_CommandLine;
private Log m_Log;
private CurrentDirectory m_CurrentWorkingDirectory;
@ -98,19 +90,16 @@ namespace Prebuild.Core
private Hashtable m_Targets;
private Hashtable m_Nodes;
ArrayList m_Solutions;
readonly List<SolutionNode> m_Solutions = new List<SolutionNode>();
string m_Target;
string m_Clean;
string[] m_RemoveDirectories;
string m_CurrentFile;
XmlDocument m_CurrentDoc;
XmlDocument m_CurrentDoc;
bool m_PauseAfterFinish;
string[] m_ProjectGroups;
StringCollection m_Refs;
#endregion
#endregion
#region Constructors
@ -210,7 +199,7 @@ namespace Prebuild.Core
/// Gets the solutions.
/// </summary>
/// <value>The solutions.</value>
public ArrayList Solutions
public List<SolutionNode> Solutions
{
get
{
@ -235,7 +224,7 @@ namespace Prebuild.Core
#region Private Methods
private void RemoveDirectories(string rootDir, string[] dirNames)
private static void RemoveDirectories(string rootDir, string[] dirNames)
{
foreach(string dir in Directory.GetDirectories(rootDir))
{
@ -297,13 +286,15 @@ namespace Prebuild.Core
foreach(Type t in assm.GetTypes())
{
TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget));
if(ta == null)
{
continue;
}
if(ta == null)
continue;
if (t.IsAbstract)
continue;
ITarget target = (ITarget)assm.CreateInstance(t.FullName);
if(target == null)
if (target == null)
{
throw new MissingMethodException("Could not create ITarget instance");
}
@ -316,16 +307,13 @@ namespace Prebuild.Core
{
foreach(Type t in assm.GetTypes())
{
DataNodeAttribute dna = (DataNodeAttribute)Helper.CheckType(t, typeof(DataNodeAttribute), typeof(IDataNode));
if(dna == null)
{
continue;
}
NodeEntry ne = new NodeEntry();
ne.Type = t;
ne.Attribute = dna;
m_Nodes[dna.Name] = ne;
foreach (DataNodeAttribute dna in t.GetCustomAttributes(typeof(DataNodeAttribute), true))
{
NodeEntry ne = new NodeEntry();
ne.Type = t;
ne.Attribute = dna;
m_Nodes[dna.Name] = ne;
}
}
}
@ -343,7 +331,32 @@ namespace Prebuild.Core
m_Log.Write();
}
private void ProcessFile(string file)
private void ProcessFile(string file)
{
ProcessFile(file, this.m_Solutions);
}
public void ProcessFile(ProcessNode node, SolutionNode parent)
{
if (node.IsValid)
{
List<SolutionNode> list = new List<SolutionNode>();
ProcessFile(node.Path, list);
foreach (SolutionNode solution in list)
parent.SolutionsTable[solution.Name] = solution;
}
}
/// <summary>
///
/// </summary>
/// <param name="file"></param>
/// <param name="solutions"></param>
/// <returns></returns>
public void ProcessFile(string file, IList<SolutionNode> solutions)
{
m_CurrentWorkingDirectory.Push();
@ -361,8 +374,7 @@ namespace Prebuild.Core
return;
}
m_CurrentFile = path;
Helper.SetCurrentDir(Path.GetDirectoryName(path));
Helper.SetCurrentDir(Path.GetDirectoryName(path));
XmlTextReader reader = new XmlTextReader(path);
@ -379,6 +391,33 @@ namespace Prebuild.Core
string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML
// See if the user put into a pseudo target of "prebuild:preprocessed-input" to indicate they want to see the
// output before the system processes it.
if (m_CommandLine.WasPassed("ppi"))
{
// Get the filename if there is one, otherwise use a default.
string ppiFile = m_CommandLine["ppi"];
if (ppiFile == null || ppiFile.Trim().Length == 0)
{
ppiFile = "preprocessed-input.xml";
}
// Write out the string to the given stream.
try
{
using (StreamWriter ppiWriter = new StreamWriter(ppiFile))
{
ppiWriter.WriteLine(xml);
}
}
catch(IOException ex)
{
Console.WriteLine("Could not write PPI file '{0}': {1}", ppiFile, ex.Message);
}
// Finish processing this special tag.
return;
}
m_CurrentDoc = new XmlDocument();
try
@ -443,7 +482,7 @@ namespace Prebuild.Core
}
else if(dataNode is SolutionNode)
{
m_Solutions.Add(dataNode);
solutions.Add((SolutionNode)dataNode);
}
}
}
@ -527,7 +566,7 @@ namespace Prebuild.Core
/// <returns></returns>
public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode)
{
IDataNode dataNode = null;
IDataNode dataNode;
try
{
@ -629,9 +668,6 @@ namespace Prebuild.Core
m_PauseAfterFinish = m_CommandLine.WasPassed("pause");
LoadSchema();
m_Solutions = new ArrayList();
m_Refs = new StringCollection();
}
/// <summary>
@ -664,17 +700,18 @@ namespace Prebuild.Core
m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together");
return;
}
else if(m_Target == null && m_Clean == null)
{
if(perfomedOtherTask) //finished
{
return;
}
m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file");
return;
}
if(m_Target == null && m_Clean == null)
{
if(perfomedOtherTask) //finished
{
return;
}
m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file");
return;
}
string file = "./prebuild.xml";
string file = "./prebuild.xml";
if(m_CommandLine.WasPassed("file"))
{
file = m_CommandLine["file"];

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source $
* $Author: $
* $Date: $
* $Revision: $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Xml;

View File

@ -23,31 +23,24 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Xml;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using System.IO;
namespace Prebuild.Core.Nodes
{
/// <summary>
///
/// </summary>
public class DataNode : IDataNode
public abstract class DataNode : IDataNode
{
#region Fields
private IDataNode parent;
string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" };
#endregion
@ -68,7 +61,10 @@ namespace Prebuild.Core.Nodes
parent = value;
}
}
public string[] WebTypes
{
get { return m_WebTypes; }
}
/// <summary>
/// Parses the specified node.
/// </summary>
@ -76,7 +72,46 @@ namespace Prebuild.Core.Nodes
public virtual void Parse(XmlNode node)
{
}
public BuildAction GetBuildActionByFileName(string fileName)
{
string extension = Path.GetExtension(fileName).ToLower();
foreach (string type in WebTypes)
{
if (extension == type)
return BuildAction.Content;
}
return BuildAction.Compile;
}
/// <summary>
/// Parses the file type to figure out what type it is
/// </summary>
/// <returns></returns>
public SubType GetSubTypeByFileName(string fileName)
{
string extension = System.IO.Path.GetExtension(fileName).ToLower();
string designer = String.Format(".designer{0}", extension);
string path = fileName.ToLower();
if (extension == ".resx")
{
return SubType.Designer;
}
else if (path.EndsWith(".settings"))
{
return SubType.Settings;
}
else
{
foreach (string type in WebTypes)
{
if (path.EndsWith(string.Format("{0}{1}", type, extension)))
{
return SubType.CodeBehind;
}
}
}
return SubType.Code;
}
#endregion
}
}

View File

@ -0,0 +1,94 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using Prebuild.Core.Utilities;
namespace Prebuild.Core.Nodes
{
[DataNode("DatabaseProject")]
public class DatabaseProjectNode : DataNode
{
string name;
string path;
string fullpath;
Guid guid = Guid.NewGuid();
readonly List<AuthorNode> authors = new List<AuthorNode>();
readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>();
public Guid Guid
{
get { return guid; }
}
public string Name
{
get { return name; }
}
public string Path
{
get { return path; }
}
public string FullPath
{
get { return fullpath; }
}
public IEnumerable<DatabaseReferenceNode> References
{
get { return references; }
}
public override void Parse(XmlNode node)
{
name = Helper.AttributeValue(node, "name", name);
path = Helper.AttributeValue(node, "path", name);
try
{
fullpath = Helper.ResolvePath(path);
}
catch
{
throw new WarningException("Could not resolve Solution path: {0}", path);
}
Kernel.Instance.CurrentWorkingDirectory.Push();
try
{
Helper.SetCurrentDir(fullpath);
if (node == null)
{
throw new ArgumentNullException("node");
}
foreach (XmlNode child in node.ChildNodes)
{
IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
if (dataNode == null)
continue;
if (dataNode is AuthorNode)
authors.Add((AuthorNode)dataNode);
else if (dataNode is DatabaseReferenceNode)
references.Add((DatabaseReferenceNode)dataNode);
}
}
finally
{
Kernel.Instance.CurrentWorkingDirectory.Pop();
}
base.Parse(node);
}
}
}

View File

@ -0,0 +1,63 @@
using System;
using Prebuild.Core.Attributes;
using Prebuild.Core.Utilities;
namespace Prebuild.Core.Nodes
{
[DataNode("DatabaseReference")]
public class DatabaseReferenceNode : DataNode
{
string name;
Guid providerId;
string connectionString;
public string Name
{
get { return name; }
}
public Guid ProviderId
{
get { return providerId; }
}
public string ConnectionString
{
get { return connectionString; }
}
public override void Parse(System.Xml.XmlNode node)
{
name = Helper.AttributeValue(node, "name", name);
string providerName = Helper.AttributeValue(node, "providerName", string.Empty);
if (providerName != null)
{
switch (providerName)
{
// digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\*
// Not sure if these will help other operating systems, or if there's a better way.
case "Microsoft.SqlServerCe.Client.3.5":
providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break;
case "System.Data.OleDb":
providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break;
case "System.Data.OracleClient":
providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break;
case "System.Data.SqlClient":
providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break;
case "System.Data.Odbc":
providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break;
default:
throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id.");
}
}
else
providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B")));
connectionString = Helper.AttributeValue(node, "connectionString", connectionString);
base.Parse(node);
}
}
}

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source $
* $Author: $
* $Date: $
* $Revision: $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: borrillis $
* $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
* $Revision: 243 $
*/
#endregion
using System;
using System.Xml;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: borrillis $
* $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
* $Revision: 243 $
*/
#endregion
using System;
using System.IO;
using System.Xml;
@ -39,6 +30,7 @@ using System.Xml;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using Prebuild.Core.Utilities;
using Prebuild.Core.Targets;
namespace Prebuild.Core.Nodes
{
@ -93,7 +85,11 @@ namespace Prebuild.Core.Nodes
/// <summary>
///
/// </summary>
UserControl
UserControl,
/// <summary>
///
/// </summary>
CodeBehind,
}
public enum CopyToOutput
@ -113,9 +109,9 @@ namespace Prebuild.Core.Nodes
private string m_Path;
private string m_ResourceName = "";
private BuildAction m_BuildAction = BuildAction.Compile;
private BuildAction? m_BuildAction;
private bool m_Valid;
private SubType m_SubType = SubType.Code;
private SubType? m_SubType;
private CopyToOutput m_CopyToOutput = CopyToOutput.Never;
private bool m_Link = false;
private string m_LinkPath = string.Empty;
@ -155,7 +151,11 @@ namespace Prebuild.Core.Nodes
{
get
{
return m_BuildAction;
if (m_BuildAction != null)
return m_BuildAction.Value;
else
return GetBuildActionByFileName(this.Path);
}
}
@ -189,7 +189,10 @@ namespace Prebuild.Core.Nodes
{
get
{
return m_SubType;
if (m_SubType != null)
return m_SubType.Value;
else
return GetSubTypeByFileName(this.Path);
}
}
@ -227,10 +230,13 @@ namespace Prebuild.Core.Nodes
/// <param name="node"></param>
public override void Parse(XmlNode node)
{
m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
m_SubType = (SubType)Enum.Parse(typeof(SubType),
Helper.AttributeValue(node, "subType", m_SubType.ToString()));
string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
if (buildAction != string.Empty)
m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
string subType = Helper.AttributeValue(node, "subType", string.Empty);
if (subType != String.Empty)
m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
if ( this.m_Link == true )

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: borrillis $
* $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
* $Revision: 243 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
@ -39,6 +30,7 @@ using System.Xml;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using System.IO;
namespace Prebuild.Core.Nodes
{
@ -224,8 +216,8 @@ namespace Prebuild.Core.Nodes
if (!m_Files.Contains(file))
{
m_Files.Add(file);
m_BuildActions[ file ] = matchNode.BuildAction;
m_SubTypes[ file ] = matchNode.SubType;
m_BuildActions[ file ] = matchNode.BuildAction == null ? GetBuildActionByFileName(file) : matchNode.BuildAction;
m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value;
m_ResourceNames[ file ] = matchNode.ResourceName;
this.m_PreservePaths[ file ] = matchNode.PreservePath;
this.m_Links[ file ] = matchNode.IsLink;

View File

@ -23,16 +23,8 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: borrillis $
* $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
* $Revision: 243 $
*/
#endregion
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Text.RegularExpressions;
@ -53,29 +45,16 @@ namespace Prebuild.Core.Nodes
{
#region Fields
private StringCollection m_Files;
private readonly StringCollection m_Files = new StringCollection();
private Regex m_Regex;
private BuildAction m_BuildAction = BuildAction.Compile;
private SubType m_SubType = SubType.Code;
private BuildAction? m_BuildAction;
private SubType? m_SubType;
string m_ResourceName = "";
private CopyToOutput m_CopyToOutput;
private bool m_Link;
private string m_LinkPath;
private bool m_PreservePath;
private ArrayList m_Exclusions;
#endregion
#region Constructors
/// <summary>
///
/// </summary>
public MatchNode()
{
m_Files = new StringCollection();
m_Exclusions = new ArrayList();
}
private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>();
#endregion
@ -95,7 +74,7 @@ namespace Prebuild.Core.Nodes
/// <summary>
///
/// </summary>
public BuildAction BuildAction
public BuildAction? BuildAction
{
get
{
@ -106,7 +85,7 @@ namespace Prebuild.Core.Nodes
/// <summary>
///
/// </summary>
public SubType SubType
public SubType? SubType
{
get
{
@ -167,7 +146,7 @@ namespace Prebuild.Core.Nodes
/// <param name="pattern">The pattern.</param>
/// <param name="recurse">if set to <c>true</c> [recurse].</param>
/// <param name="useRegex">if set to <c>true</c> [use regex].</param>
private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, ArrayList exclusions)
private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions)
{
Match match;
Boolean excludeFile;
@ -279,10 +258,14 @@ namespace Prebuild.Core.Nodes
string pattern = Helper.AttributeValue(node, "pattern", "*");
bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
m_SubType = (SubType)Enum.Parse(typeof(SubType),
Helper.AttributeValue(node, "subType", m_SubType.ToString()));
string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
if (buildAction != string.Empty)
m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
//TODO: Figure out where the subtype node is being assigned
//string subType = Helper.AttributeValue(node, "subType", string.Empty);
//if (subType != String.Empty)
// m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
@ -329,7 +312,7 @@ namespace Prebuild.Core.Nodes
if(dataNode is ExcludeNode)
{
ExcludeNode excludeNode = (ExcludeNode)dataNode;
m_Exclusions.Add( dataNode );
m_Exclusions.Add( excludeNode );
}
}

View File

@ -23,17 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-01-09 01:55:40 +0900 (Tue, 09 Jan 2007) $
* $Revision: 197 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,17 +23,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-05-26 06:58:26 +0900 (Sat, 26 May 2007) $
* $Revision: 244 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml;
@ -59,7 +51,11 @@ namespace Prebuild.Core.Nodes
/// <summary>
/// The project is a library
/// </summary>
Library
Library,
/// <summary>
/// The project is a website
/// </summary>
Web,
}
/// <summary>
@ -76,7 +72,25 @@ namespace Prebuild.Core.Nodes
/// </summary>
Mono
}
/// <summary>
/// The version of the .NET framework to use (Required for VS2008)
/// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks>
/// </summary>
public enum FrameworkVersion
{
/// <summary>
/// .NET 2.0
/// </summary>
v2_0,
/// <summary>
/// .NET 3.0
/// </summary>
v3_0,
/// <summary>
/// .NET 3.5
/// </summary>
v3_5,
}
/// <summary>
/// The Node object representing /Prebuild/Solution/Project elements
/// </summary>
@ -95,35 +109,22 @@ namespace Prebuild.Core.Nodes
private string m_Language = "C#";
private ProjectType m_Type = ProjectType.Exe;
private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
private FrameworkVersion m_Framework = FrameworkVersion.v2_0;
private string m_StartupObject = "";
private string m_RootNamespace;
private string m_FilterGroups = "";
private string m_Version = "";
private Guid m_Guid;
private string m_DebugStartParameters;
private Hashtable m_Configurations;
private ArrayList m_ReferencePaths;
private ArrayList m_References;
private ArrayList m_Authors;
private Hashtable m_Configurations = new Hashtable();
private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>();
private readonly List<ReferenceNode> m_References = new List<ReferenceNode>();
private readonly List<AuthorNode> m_Authors = new List<AuthorNode>();
private FilesNode m_Files;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ProjectNode"/> class.
/// </summary>
public ProjectNode()
{
m_Configurations = new Hashtable();
m_ReferencePaths = new ArrayList();
m_References = new ArrayList();
m_Authors = new ArrayList();
}
#endregion
#region Properties
/// <summary>
@ -134,10 +135,19 @@ namespace Prebuild.Core.Nodes
{
get
{
return m_Name;
return m_Name;
}
}
/// <summary>
/// The version of the .NET Framework to compile under
/// </summary>
public FrameworkVersion FrameworkVersion
{
get
{
return this.m_Framework;
}
}
/// <summary>
/// Gets the path.
/// </summary>
@ -210,17 +220,17 @@ namespace Prebuild.Core.Nodes
}
}
/// <summary>
/// Gets the app icon.
/// </summary>
/// <value>The app icon.</value>
public string ConfigFile
{
get
{
return m_ConfigFile;
}
}
/// <summary>
/// Gets the app icon.
/// </summary>
/// <value>The app icon.</value>
public string ConfigFile
{
get
{
return m_ConfigFile;
}
}
/// <summary>
///
@ -269,22 +279,22 @@ namespace Prebuild.Core.Nodes
}
}
private bool m_GenerateAssemblyInfoFile = false;
/// <summary>
///
/// </summary>
public bool GenerateAssemblyInfoFile
{
get
{
return m_GenerateAssemblyInfoFile;
}
set
{
m_GenerateAssemblyInfoFile = value;
}
}
private bool m_GenerateAssemblyInfoFile = false;
/// <summary>
///
/// </summary>
public bool GenerateAssemblyInfoFile
{
get
{
return m_GenerateAssemblyInfoFile;
}
set
{
m_GenerateAssemblyInfoFile = value;
}
}
/// <summary>
/// Gets the startup object.
@ -314,7 +324,7 @@ namespace Prebuild.Core.Nodes
/// Gets the configurations.
/// </summary>
/// <value>The configurations.</value>
public ICollection Configurations
public IList Configurations
{
get
{
@ -340,11 +350,11 @@ namespace Prebuild.Core.Nodes
/// Gets the reference paths.
/// </summary>
/// <value>The reference paths.</value>
public ArrayList ReferencePaths
public List<ReferencePathNode> ReferencePaths
{
get
{
ArrayList tmp = new ArrayList(m_ReferencePaths);
List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths);
tmp.Sort();
return tmp;
}
@ -354,11 +364,11 @@ namespace Prebuild.Core.Nodes
/// Gets the references.
/// </summary>
/// <value>The references.</value>
public ArrayList References
public List<ReferenceNode> References
{
get
{
ArrayList tmp = new ArrayList(m_References);
List<ReferenceNode> tmp = new List<ReferenceNode>(m_References);
tmp.Sort();
return tmp;
}
@ -368,7 +378,7 @@ namespace Prebuild.Core.Nodes
/// Gets the Authors list.
/// </summary>
/// <value>The list of the project's authors.</value>
public ArrayList Authors
public List<AuthorNode> Authors
{
get
{
@ -424,7 +434,15 @@ namespace Prebuild.Core.Nodes
}
}
#endregion
public string DebugStartParameters
{
get
{
return m_DebugStartParameters;
}
}
#endregion
#region Private Methods
@ -470,13 +488,18 @@ namespace Prebuild.Core.Nodes
m_Language = Helper.AttributeValue(node, "language", m_Language);
m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework);
m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
int hash = m_Name.GetHashCode();
m_Guid = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString());
m_Guid = new Guid(guid);
m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty);
if(m_AssemblyName == null || m_AssemblyName.Length < 1)
{
m_AssemblyName = m_Name;
@ -516,15 +539,15 @@ namespace Prebuild.Core.Nodes
}
else if(dataNode is ReferencePathNode)
{
m_ReferencePaths.Add(dataNode);
m_ReferencePaths.Add((ReferencePathNode)dataNode);
}
else if(dataNode is ReferenceNode)
{
m_References.Add(dataNode);
m_References.Add((ReferenceNode)dataNode);
}
else if(dataNode is AuthorNode)
{
m_Authors.Add(dataNode);
m_Authors.Add((AuthorNode)dataNode);
}
else if(dataNode is FilesNode)
{
@ -548,6 +571,6 @@ namespace Prebuild.Core.Nodes
return this.m_Name.CompareTo(that.m_Name);
}
#endregion
#endregion
}
}

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-07-26 01:56:49 +0900 (Wed, 26 Jul 2006) $
* $Revision: 132 $
*/
#endregion
using System;
using System.Xml;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,17 +23,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-03-01 01:15:42 +0900 (Wed, 01 Mar 2006) $
* $Revision: 92 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Xml;
@ -48,40 +40,62 @@ namespace Prebuild.Core.Nodes
///
/// </summary>
[DataNode("Solution")]
[DataNode("EmbeddedSolution")]
[DebuggerDisplay("{Name}")]
public class SolutionNode : DataNode
{
#region Fields
private Guid m_Guid = Guid.NewGuid();
private string m_Name = "unknown";
private string m_Path = "";
private string m_FullPath = "";
private string m_ActiveConfig = "Debug";
private string m_Version = "1.0.0";
private OptionsNode m_Options;
private FilesNode m_Files;
private Hashtable m_Configurations;
private Hashtable m_Projects;
private ArrayList m_ProjectsOrder;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="SolutionNode"/> class.
/// </summary>
public SolutionNode()
{
m_Configurations = new Hashtable();
m_Projects = new Hashtable();
m_ProjectsOrder = new ArrayList();
}
private readonly Hashtable m_Configurations = new Hashtable();
private readonly Hashtable m_Projects = new Hashtable();
private readonly Hashtable m_DatabaseProjects = new Hashtable();
private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>();
private readonly Hashtable m_Solutions = new Hashtable();
#endregion
#region Properties
public override IDataNode Parent
{
get
{
return base.Parent;
}
set
{
if (value is SolutionNode)
{
SolutionNode solution = (SolutionNode)value;
foreach (ConfigurationNode conf in solution.Configurations)
{
m_Configurations[conf.Name] = conf.Clone();
}
}
base.Parent = value;
}
}
public Guid Guid
{
get
{
return m_Guid;
}
set
{
m_Guid = value;
}
}
/// <summary>
/// Gets or sets the active config.
/// </summary>
@ -195,7 +209,36 @@ namespace Prebuild.Core.Nodes
return m_Configurations;
}
}
/// <summary>
/// Gets the database projects.
/// </summary>
public ICollection DatabaseProjects
{
get
{
return m_DatabaseProjects.Values;
}
}
/// <summary>
/// Gets the nested solutions.
/// </summary>
public ICollection Solutions
{
get
{
return m_Solutions.Values;
}
}
/// <summary>
/// Gets the nested solutions hash table.
/// </summary>
public Hashtable SolutionsTable
{
get
{
return this.m_Solutions;
}
}
/// <summary>
/// Gets the projects.
/// </summary>
@ -226,7 +269,7 @@ namespace Prebuild.Core.Nodes
/// Gets the projects table.
/// </summary>
/// <value>The projects table.</value>
public ArrayList ProjectsTableOrder
public List<ProjectNode> ProjectsTableOrder
{
get
{
@ -287,8 +330,21 @@ namespace Prebuild.Core.Nodes
else if(dataNode is ProjectNode)
{
m_Projects[((ProjectNode)dataNode).Name] = dataNode;
m_ProjectsOrder.Add(dataNode);
m_ProjectsOrder.Add((ProjectNode)dataNode);
}
else if(dataNode is SolutionNode)
{
m_Solutions[((SolutionNode)dataNode).Name] = dataNode;
}
else if (dataNode is ProcessNode)
{
ProcessNode p = (ProcessNode)dataNode;
Kernel.Instance.ProcessFile(p, this);
}
else if (dataNode is DatabaseProjectNode)
{
m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = dataNode;
}
}
}
finally

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
namespace Prebuild.Core.Parse

View File

@ -23,18 +23,10 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-04-26 17:10:27 +0900 (Thu, 26 Apr 2007) $
* $Revision: 236 $
*/
#endregion
using System;
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
namespace Prebuild.Core.Parse
@ -79,6 +71,16 @@ namespace Prebuild.Core.Parse
/// </summary>
public class Preprocessor
{
#region Constants
/// <summary>
/// Includes the regex to look for file tags in the <?include
/// ?> processing instruction.
/// </summary>
private static readonly Regex includeFileRegex = new Regex("file=\"(.+?)\"");
#endregion
#region Fields
XmlDocument m_OutDoc;
@ -138,10 +140,10 @@ namespace Prebuild.Core.Parse
return "Win32";
}
if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa"))
{
return "MACOSX";
}
if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa"))
{
return "MACOSX";
}
/*
* .NET 1.x, under Mono, the UNIX code is 128. Under
@ -236,7 +238,7 @@ namespace Prebuild.Core.Parse
OperatorSymbol oper = OperatorSymbol.None;
bool inStr = false;
char c;
for(int i = 0; i < exp.Length; i++)
{
c = exp[i];
@ -283,7 +285,7 @@ namespace Prebuild.Core.Parse
{
oper = OperatorSymbol.NotEqual;
}
break;
case '<':
@ -295,7 +297,7 @@ namespace Prebuild.Core.Parse
{
oper = OperatorSymbol.LessThan;
}
break;
case '>':
@ -314,7 +316,7 @@ namespace Prebuild.Core.Parse
}
}
if(inStr)
{
throw new WarningException("Expected end of string in expression");
@ -392,9 +394,9 @@ namespace Prebuild.Core.Parse
/// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception>
/// <param name="reader"></param>
/// <returns>the output xml </returns>
public string Process(XmlReader reader)
public string Process(XmlReader initialReader)
{
if(reader == null)
if(initialReader == null)
{
throw new ArgumentException("Invalid XML reader to pre-process");
}
@ -403,119 +405,175 @@ namespace Prebuild.Core.Parse
StringWriter xmlText = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(xmlText);
writer.Formatting = Formatting.Indented;
while(reader.Read())
// Create a queue of XML readers and add the initial
// reader to it. Then we process until we run out of
// readers which lets the <?include?> operation add more
// readers to generate a multi-file parser and not require
// XML fragments that a recursive version would use.
Stack readerStack = new Stack();
readerStack.Push(initialReader);
while(readerStack.Count > 0)
{
if(reader.NodeType == XmlNodeType.ProcessingInstruction)
// Pop off the next reader.
XmlReader reader = (XmlReader) readerStack.Pop();
// Process through this XML reader until it is
// completed (or it is replaced by the include
// operation).
while(reader.Read())
{
bool ignore = false;
switch(reader.LocalName)
// The prebuild file has a series of processing
// instructions which allow for specific
// inclusions based on operating system or to
// include additional files.
if(reader.NodeType == XmlNodeType.ProcessingInstruction)
{
case "if":
m_IfStack.Push(context);
context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If);
ignore = true;
break;
bool ignore = false;
case "elseif":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'elseif' outside of 'if'");
}
else if(context.State != IfState.If && context.State != IfState.ElseIf)
{
throw new WarningException("Unexpected 'elseif' outside of 'if'");
}
switch(reader.LocalName)
{
case "include":
// use regular expressions to parse out the attributes.
MatchCollection matches = includeFileRegex.Matches(reader.Value);
// make sure there is only one file attribute.
if(matches.Count > 1)
{
throw new WarningException("An <?include ?> node was found, but it specified more than one file.");
}
context.State = IfState.ElseIf;
if(!context.EverKept)
{
context.Keep = ParseExpression(reader.Value);
}
else
{
context.Keep = false;
}
if(matches.Count == 0)
{
throw new WarningException("An <?include ?> node was found, but it did not specify the file attribute.");
}
// Pull the file out from the regex and make sure it is a valid file before using it.
string filename = matches[0].Groups[1].Value;
FileInfo includeFile = new FileInfo(filename);
ignore = true;
break;
if(!includeFile.Exists)
{
throw new WarningException("Cannot include file: " + includeFile.FullName);
}
case "else":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'else' outside of 'if'");
}
else if(context.State != IfState.If && context.State != IfState.ElseIf)
{
throw new WarningException("Unexpected 'else' outside of 'if'");
}
// Create a new reader object for this file. Then put the old reader back on the stack and start
// processing using this new XML reader.
XmlReader newReader = new XmlTextReader(includeFile.Open(FileMode.Open, FileAccess.Read, FileShare.Read));
context.State = IfState.Else;
context.Keep = !context.EverKept;
ignore = true;
break;
readerStack.Push(reader);
reader = newReader;
ignore = true;
break;
case "endif":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'endif' outside of 'if'");
}
case "if":
m_IfStack.Push(context);
context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If);
ignore = true;
break;
context = (IfContext)m_IfStack.Pop();
ignore = true;
break;
}
case "elseif":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'elseif' outside of 'if'");
}
else if(context.State != IfState.If && context.State != IfState.ElseIf)
{
throw new WarningException("Unexpected 'elseif' outside of 'if'");
}
if(ignore)
context.State = IfState.ElseIf;
if(!context.EverKept)
{
context.Keep = ParseExpression(reader.Value);
}
else
{
context.Keep = false;
}
ignore = true;
break;
case "else":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'else' outside of 'if'");
}
else if(context.State != IfState.If && context.State != IfState.ElseIf)
{
throw new WarningException("Unexpected 'else' outside of 'if'");
}
context.State = IfState.Else;
context.Keep = !context.EverKept;
ignore = true;
break;
case "endif":
if(m_IfStack.Count == 0)
{
throw new WarningException("Unexpected 'endif' outside of 'if'");
}
context = (IfContext)m_IfStack.Pop();
ignore = true;
break;
}
if(ignore)
{
continue;
}
}//end pre-proc instruction
if(!context.Active || !context.Keep)
{
continue;
}
}//end pre-proc instruction
if(!context.Active || !context.Keep)
{
continue;
}
switch(reader.NodeType)
{
case XmlNodeType.Element:
bool empty = reader.IsEmptyElement;
writer.WriteStartElement(reader.Name);
switch(reader.NodeType)
{
case XmlNodeType.Element:
bool empty = reader.IsEmptyElement;
writer.WriteStartElement(reader.Name);
while (reader.MoveToNextAttribute())
{
writer.WriteAttributeString(reader.Name, reader.Value);
}
while (reader.MoveToNextAttribute())
{
writer.WriteAttributeString(reader.Name, reader.Value);
}
if(empty)
{
writer.WriteEndElement();
}
break;
if(empty)
{
case XmlNodeType.EndElement:
writer.WriteEndElement();
}
break;
break;
case XmlNodeType.EndElement:
writer.WriteEndElement();
break;
case XmlNodeType.Text:
writer.WriteString(reader.Value);
break;
case XmlNodeType.Text:
writer.WriteString(reader.Value);
break;
case XmlNodeType.CDATA:
writer.WriteCData(reader.Value);
break;
case XmlNodeType.CDATA:
writer.WriteCData(reader.Value);
break;
default:
break;
}
}
default:
break;
if(m_IfStack.Count != 0)
{
throw new WarningException("Mismatched 'if', 'endif' pair");
}
}
if(m_IfStack.Count != 0)
{
throw new WarningException("Mismatched 'if', 'endif' pair");
}
return xmlText.ToString();
}

View File

@ -65,18 +65,9 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-07-28 22:43:24 -0700 (Fri, 28 Jul 2006) $
* $Revision: 136 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Reflection;
@ -182,8 +173,7 @@ namespace Prebuild.Core.Targets
Hashtable assemblyPathToPackage = new Hashtable();
Hashtable assemblyFullNameToPath = new Hashtable();
Hashtable packagesHash = new Hashtable();
ArrayList packages = new ArrayList();
ClrVersion currentVersion;
readonly List<SystemPackage> packages = new List<SystemPackage>();
#endregion
@ -203,22 +193,6 @@ namespace Prebuild.Core.Targets
di.Create();
}
private void mkStubFiles(string dirName, ArrayList fileNames)
{
for (int i = 0; i < fileNames.Count; i++)
{
string tmpFile = dirName + "/" + (string)fileNames[i];
FileStream tmpFileStream =
new FileStream(tmpFile, FileMode.Create);
StreamWriter sw = new StreamWriter(tmpFileStream);
sw.WriteLine("These are not the files you are looking for.");
sw.Flush();
tmpFileStream.Close();
}
}
private void chkMkDir(string dirName)
{
System.IO.DirectoryInfo di =
@ -273,11 +247,11 @@ namespace Prebuild.Core.Targets
}
}
private ArrayList GetAssembliesWithLibInfo(string line, string file)
private List<string> GetAssembliesWithLibInfo(string line, string file)
{
ArrayList references = new ArrayList();
ArrayList libdirs = new ArrayList();
ArrayList retval = new ArrayList();
List<string> references = new List<string>();
List<string> libdirs = new List<string>();
List<string> retval = new List<string>();
foreach (string piece in line.Split(' '))
{
if (piece.ToLower().Trim().StartsWith("/r:") || piece.ToLower().Trim().StartsWith("-r:"))
@ -304,9 +278,9 @@ namespace Prebuild.Core.Targets
return retval;
}
private ArrayList GetAssembliesWithoutLibInfo(string line, string file)
private List<string> GetAssembliesWithoutLibInfo(string line, string file)
{
ArrayList references = new ArrayList();
List<string> references = new List<string>();
foreach (string reference in line.Split(' '))
{
if (reference.ToLower().Trim().StartsWith("/r:") || reference.ToLower().Trim().StartsWith("-r:"))
@ -356,7 +330,7 @@ namespace Prebuild.Core.Targets
if (packagesHash.Contains(pname))
return;
ArrayList fullassemblies = null;
List<string> fullassemblies = null;
string version = "";
string desc = "";
@ -404,7 +378,7 @@ namespace Prebuild.Core.Targets
package.Initialize(pname,
version,
desc,
(string[])fullassemblies.ToArray(typeof(string)),
fullassemblies.ToArray(),
ClrVersion.Default,
false);
packages.Add(package);
@ -414,7 +388,7 @@ namespace Prebuild.Core.Targets
void RegisterSystemAssemblies(string prefix, string version, ClrVersion ver)
{
SystemPackage package = new SystemPackage();
ArrayList list = new ArrayList();
List<string> list = new List<string>();
string dir = Path.Combine(prefix, version);
if (!Directory.Exists(dir))
@ -431,7 +405,7 @@ namespace Prebuild.Core.Targets
package.Initialize("mono",
version,
"The Mono runtime",
(string[])list.ToArray(typeof(string)),
list.ToArray(),
ver,
false);
packages.Add(package);
@ -444,12 +418,10 @@ namespace Prebuild.Core.Targets
if (Environment.Version.Major == 1)
{
versionDir = "1.0";
currentVersion = ClrVersion.Net_1_1;
}
else
{
versionDir = "2.0";
currentVersion = ClrVersion.Net_2_0;
}
//Pull up assemblies from the installed mono system.
@ -483,9 +455,9 @@ namespace Prebuild.Core.Targets
}
}
search_dirs += Path.PathSeparator + libpath;
if (search_dirs != null && search_dirs.Length > 0)
if (!string.IsNullOrEmpty(search_dirs))
{
ArrayList scanDirs = new ArrayList();
List<string> scanDirs = new List<string>();
foreach (string potentialDir in search_dirs.Split(Path.PathSeparator))
{
if (!scanDirs.Contains(potentialDir))
@ -763,20 +735,22 @@ namespace Prebuild.Core.Targets
bool hasAssemblyConfig = false;
chkMkDir(projectDir);
ArrayList
compiledFiles = new ArrayList(),
contentFiles = new ArrayList(),
embeddedFiles = new ArrayList(),
List<string>
compiledFiles = new List<string>(),
contentFiles = new List<string>(),
embeddedFiles = new List<string>(),
binaryLibs = new ArrayList(),
pkgLibs = new ArrayList(),
systemLibs = new ArrayList(),
runtimeLibs = new ArrayList(),
binaryLibs = new List<string>(),
pkgLibs = new List<string>(),
systemLibs = new List<string>(),
runtimeLibs = new List<string>(),
extraDistFiles = new ArrayList(),
localCopyTargets = new ArrayList();
extraDistFiles = new List<string>(),
localCopyTargets = new List<string>();
// If there exists a .config file for this assembly, copy
// it to the project folder
// If there exists a .config file for this assembly, copy it to the project folder
// TODO: Support copying .config.osx files
// TODO: support processing the .config file for native library deps
string projectAssemblyName = project.Name;
@ -839,11 +813,15 @@ namespace Prebuild.Core.Targets
foreach (System.CodeDom.Compiler.CompilerError error in cr.Errors)
Console.WriteLine("Error! '{0}'", error.ErrorText);
string projectFullName = cr.CompiledAssembly.FullName;
Regex verRegex = new Regex("Version=([\\d\\.]+)");
Match verMatch = verRegex.Match(projectFullName);
if (verMatch.Success)
try {
string projectFullName = cr.CompiledAssembly.FullName;
Regex verRegex = new Regex("Version=([\\d\\.]+)");
Match verMatch = verRegex.Match(projectFullName);
if (verMatch.Success)
projectVersion = verMatch.Groups[1].Value;
}catch{
Console.WriteLine("Couldn't compile AssemblyInfo.cs");
}
// Clean up the temp file
try
@ -853,7 +831,7 @@ namespace Prebuild.Core.Targets
}
catch
{
//Console.WriteLine("Error! '{0}'", e.ToString());
Console.WriteLine("Error! '{0}'", e.ToString());
}
}
@ -1013,46 +991,46 @@ namespace Prebuild.Core.Targets
}
}
string lineSep = " \\\n\t";
const string lineSep = " \\\n\t";
string compiledFilesString = string.Empty;
if (compiledFiles.Count > 0)
compiledFilesString =
lineSep + string.Join(lineSep, (string[])compiledFiles.ToArray(typeof(string)));
lineSep + string.Join(lineSep, compiledFiles.ToArray());
string embeddedFilesString = "";
if (embeddedFiles.Count > 0)
embeddedFilesString =
lineSep + string.Join(lineSep, (string[])embeddedFiles.ToArray(typeof(string)));
lineSep + string.Join(lineSep, embeddedFiles.ToArray());
string contentFilesString = "";
if (contentFiles.Count > 0)
contentFilesString =
lineSep + string.Join(lineSep, (string[])contentFiles.ToArray(typeof(string)));
lineSep + string.Join(lineSep, contentFiles.ToArray());
string extraDistFilesString = "";
if (extraDistFiles.Count > 0)
extraDistFilesString =
lineSep + string.Join(lineSep, (string[])extraDistFiles.ToArray(typeof(string)));
lineSep + string.Join(lineSep, extraDistFiles.ToArray());
string pkgLibsString = "";
if (pkgLibs.Count > 0)
pkgLibsString =
lineSep + string.Join(lineSep, (string[])pkgLibs.ToArray(typeof(string)));
lineSep + string.Join(lineSep, pkgLibs.ToArray());
string binaryLibsString = "";
if (binaryLibs.Count > 0)
binaryLibsString =
lineSep + string.Join(lineSep, (string[])binaryLibs.ToArray(typeof(string)));
lineSep + string.Join(lineSep, binaryLibs.ToArray());
string systemLibsString = "";
if (systemLibs.Count > 0)
systemLibsString =
lineSep + string.Join(lineSep, (string[])systemLibs.ToArray(typeof(string)));
lineSep + string.Join(lineSep, systemLibs.ToArray());
string localCopyTargetsString = "";
if (localCopyTargets.Count > 0)
localCopyTargetsString =
string.Join("\n", (string[])localCopyTargets.ToArray(typeof(string)));
string.Join("\n", localCopyTargets.ToArray());
string monoPath = "";
foreach (string runtimeLib in runtimeLibs)

View File

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

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: cjcollier $
* $Date: 2007-04-11 07:10:35 +0900 (Wed, 11 Apr 2007) $
* $Revision: 231 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -1,9 +1,9 @@
#region BSD License
/*
Copyright (c) 2004 - 2008
Matthew Holmes (matthew@wildfiregames.com),
Dan Moorehead (dan05a@gmail.com),
C.J. Adams-Collier (cjac@colliertech.org),
Matthew Holmes (matthew@wildfiregames.com),
Dan Moorehead (dan05a@gmail.com),
C.J. Adams-Collier (cjac@colliertech.org),
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -35,15 +35,6 @@ POSSIBILITY OF SUCH DAMAGE.
#endregion
#region CVS Information
/*
* $Source$
* $Author: cjcollier $
* $Date: 2008-02-07 10:22:36 +0900 (Thu, 07 Feb 2008) $
* $Revision: 255 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
@ -58,85 +49,73 @@ using Prebuild.Core.Utilities;
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
[Target("nant")]
public class NAntTarget : ITarget
{
#region Fields
/// <summary>
///
/// </summary>
[Target("nant")]
public class NAntTarget : ITarget
{
#region Fields
private Kernel m_Kernel;
private Kernel m_Kernel;
#endregion
#endregion
#region Private Methods
#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);
// }
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;
}
return tmpPath;
}
private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr)
{
string ret = "";
string referencePath = ((ReferencePathNode)currentProject.ReferencePaths[0]).Path;
if (String.IsNullOrEmpty(refr.Path))
{
if (solution.ProjectsTable.ContainsKey(refr.Name))
{
ProjectNode project = (ProjectNode) solution.ProjectsTable[refr.Name];
string finalPath =
Helper.NormalizePath(referencePath + refr.Name + GetProjectExtension(project), '/');
return finalPath;
}
else
{
ProjectNode project = (ProjectNode) refr.Parent;
// Do we have an explicit file reference?
string fileRef = FindFileReference(refr.Name, project);
if (fileRef != null)
{
return fileRef;
}
// Is there an explicit path in the project ref?
if (refr.Path != null)
{
return Helper.NormalizePath(refr.Path + "/" + refr.Name + GetProjectExtension(project), '/');
}
// Is it a specified extension (dll or exe?)
if (ExtensionSpecified(refr.Name))
{
return Helper.NormalizePath(referencePath + GetRefFileName(refr.Name), '/');
}
// No, it's an extensionless GAC ref, but nant needs the .dll extension anyway
return refr.Name + ".dll";
}
}
else
if (!String.IsNullOrEmpty(refr.Path))
{
return refr.Path;
}
if (solution.ProjectsTable.ContainsKey(refr.Name))
{
ProjectNode projectRef = (ProjectNode) solution.ProjectsTable[refr.Name];
string finalPath =
Helper.NormalizePath(refr.Name + GetProjectExtension(projectRef), '/');
return finalPath;
}
ProjectNode project = (ProjectNode) refr.Parent;
// Do we have an explicit file reference?
string fileRef = FindFileReference(refr.Name, project);
if (fileRef != null)
{
return fileRef;
}
// Is there an explicit path in the project ref?
if (refr.Path != null)
{
return Helper.NormalizePath(refr.Path + "/" + refr.Name + GetProjectExtension(project), '/');
}
// No, it's an extensionless GAC ref, but nant needs the .dll extension anyway
return refr.Name + ".dll";
}
public static string GetRefFileName(string refName)
public static string GetRefFileName(string refName)
{
if (ExtensionSpecified(refName))
{
@ -144,7 +123,7 @@ namespace Prebuild.Core.Targets
}
else
{
return refName + ".dll";
return refName + ".dll";
}
}
@ -156,268 +135,235 @@ namespace Prebuild.Core.Targets
private static string GetProjectExtension(ProjectNode project)
{
string extension = ".dll";
if (project.Type == ProjectType.Exe)
if (project.Type == ProjectType.Exe || project.Type == ProjectType.WinExe)
{
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
// {
// if (refr.Path == null)
// {
// 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 += "";
// }
// }
// else
// {
// ret = refr.Path;
// }
// }
// return ret;
//}
private static string FindFileReference(string refName, ProjectNode project)
{
foreach (ReferencePathNode refPath in project.ReferencePaths)
{
string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
private static string FindFileReference(string refName, ProjectNode project)
{
foreach (ReferencePathNode refPath in project.ReferencePaths)
{
string fullPath = Helper.MakeFilePath(refPath.Path, refName);
if (File.Exists(fullPath))
{
return fullPath;
}
fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
if (File.Exists(fullPath))
{
return fullPath;
}
fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe");
if (File.Exists(fullPath))
{
return fullPath;
}
}
}
return null;
}
return null;
}
/// <summary>
/// Gets the XML doc file.
/// </summary>
/// <param name="project">The project.</param>
/// <param name="conf">The conf.</param>
/// <returns></returns>
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;
}
/// <summary>
/// Gets the XML doc file.
/// </summary>
/// <param name="project">The project.</param>
/// <param name="conf">The conf.</param>
/// <returns></returns>
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)
{
private void WriteProject(SolutionNode solution, ProjectNode project)
{
string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build");
StreamWriter ss = new StreamWriter(projFile);
StreamWriter ss = new StreamWriter(projFile);
m_Kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
bool hasDoc = false;
m_Kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
bool hasDoc = false;
using (ss)
{
ss.WriteLine("<?xml version=\"1.0\" ?>");
ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name);
ss.WriteLine(" <target name=\"{0}\">", "build");
ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\" flatten=\"true\">");
ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
foreach (ReferenceNode refr in project.References)
{
if (refr.LocalCopy)
{
ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)) + "\" />", '/'));
}
}
ss.WriteLine(" </fileset>");
ss.WriteLine(" </copy>");
if (project.ConfigFile != null && project.ConfigFile.Length!=0)
{
ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${project::get-base-directory()}/${build.dir}/${project::get-name()}");
using (ss)
{
ss.WriteLine("<?xml version=\"1.0\" ?>");
ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name);
ss.WriteLine(" <target name=\"{0}\">", "build");
ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\" flatten=\"true\">");
ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
foreach (ReferenceNode refr in project.References)
{
if (refr.LocalCopy)
{
ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)) + "\" />", '/'));
}
}
ss.WriteLine(" </fileset>");
ss.WriteLine(" </copy>");
if (project.ConfigFile != null && project.ConfigFile.Length!=0)
{
ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${project::get-base-directory()}/${build.dir}/${project::get-name()}");
if (project.Type == ProjectType.Library)
{
ss.Write(".dll.config\"");
}
else
{
ss.Write(".exe.config\"");
}
ss.WriteLine(" />");
}
if (project.Type == ProjectType.Library)
{
ss.Write(".dll.config\"");
}
else
{
ss.Write(".exe.config\"");
}
ss.WriteLine(" />");
}
// Add the content files to just be copied
ss.WriteLine(" {0}", "<copy todir=\"${project::get-base-directory()}/${build.dir}\">");
ss.WriteLine(" {0}", "<fileset basedir=\".\">");
foreach (string file in project.Files)
{
// Ignore if we aren't content
if (project.Files.GetBuildAction(file) != BuildAction.Content)
continue;
// Add the content files to just be copied
ss.WriteLine(" {0}", "<copy todir=\"${project::get-base-directory()}/${build.dir}\">");
ss.WriteLine(" {0}", "<fileset basedir=\".\">");
foreach (string file in project.Files)
{
// Ignore if we aren't content
if (project.Files.GetBuildAction(file) != BuildAction.Content)
continue;
// Create a include tag
ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
}
// Create a include tag
ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
}
ss.WriteLine(" {0}", "</fileset>");
ss.WriteLine(" {0}", "</copy>");
ss.WriteLine(" {0}", "</fileset>");
ss.WriteLine(" {0}", "</copy>");
ss.Write(" <csc");
ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower());
ss.Write(" debug=\"{0}\"", "${build.debug}");
foreach (ConfigurationNode conf in project.Configurations)
{
if (conf.Options.KeyFile != "")
{
ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile);
break;
}
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines);
break;
}
ss.Write(" main=\"{0}\"", project.StartupObject);
ss.Write(" <csc");
ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower());
ss.Write(" debug=\"{0}\"", "${build.debug}");
foreach (ConfigurationNode conf in project.Configurations)
{
if (conf.Options.KeyFile != "")
{
ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile);
break;
}
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]);
break;
}
foreach (ConfigurationNode conf in project.Configurations)
{
if (GetXmlDocFile(project, conf) != "")
{
ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf));
hasDoc = true;
}
break;
}
ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}");
if (project.Type == ProjectType.Library)
{
ss.Write(".dll\"");
}
else
{
ss.Write(".exe\"");
}
if (project.AppIcon != null && project.AppIcon.Length != 0)
{
ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/'));
}
ss.WriteLine(">");
ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace);
foreach (string file in project.Files)
{
switch (project.Files.GetBuildAction(file))
{
case BuildAction.EmbeddedResource:
ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
break;
default:
if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
{
ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx");
}
break;
}
}
//if (project.Files.GetSubType(file).ToString() != "Code")
//{
// ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
ss.Write(" main=\"{0}\"", project.StartupObject);
ss.WriteLine(" </resources>");
ss.WriteLine(" <sources failonempty=\"true\">");
foreach (string file in project.Files)
foreach (ConfigurationNode conf in project.Configurations)
{
if (GetXmlDocFile(project, conf) != "")
{
ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf));
hasDoc = true;
}
break;
}
ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}");
if (project.Type == ProjectType.Library)
{
ss.Write(".dll\"");
}
else
{
ss.Write(".exe\"");
}
if (project.AppIcon != null && project.AppIcon.Length != 0)
{
ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/'));
}
ss.WriteLine(">");
ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace);
foreach (string file in project.Files)
{
switch (project.Files.GetBuildAction(file))
{
case BuildAction.EmbeddedResource:
ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
break;
default:
if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
{
ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx");
}
break;
}
}
//if (project.Files.GetSubType(file).ToString() != "Code")
//{
// ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
ss.WriteLine(" </resources>");
ss.WriteLine(" <sources failonempty=\"true\">");
foreach (string file in project.Files)
{
switch (project.Files.GetBuildAction(file))
{
case BuildAction.Compile:
ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
break;
default:
break;
}
}
ss.WriteLine(" </sources>");
ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <lib>");
ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />");
foreach(ReferencePathNode refPath in project.ReferencePaths)
{
switch (project.Files.GetBuildAction(file))
{
case BuildAction.Compile:
ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
break;
default:
break;
}
ss.WriteLine(" <include name=\"${project::get-base-directory()}/" + refPath.Path.TrimEnd('/', '\\') + "\" />");
}
ss.WriteLine(" </sources>");
ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <lib>");
ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />");
ss.WriteLine(" <include name=\"${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" </lib>");
foreach (ReferenceNode refr in project.References)
{
string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/');
ss.WriteLine(" </lib>");
foreach (ReferenceNode refr in project.References)
{
string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/');
ss.WriteLine(" <include name=\"" + path + "\" />");
}
ss.WriteLine(" </references>");
}
ss.WriteLine(" </references>");
ss.WriteLine(" </csc>");
ss.WriteLine(" </csc>");
foreach (ConfigurationNode conf in project.Configurations)
foreach (ConfigurationNode conf in project.Configurations)
{
if (!String.IsNullOrEmpty(conf.Options.OutputPath))
{
@ -432,149 +378,160 @@ namespace Prebuild.Core.Targets
ss.WriteLine(" <include name=\"*.dll\"/>");
ss.WriteLine(" <include name=\"*.exe\"/>");
ss.WriteLine(" <include name=\"*.mdb\" if='${build.debug}'/>");
ss.WriteLine(" <include name=\"*.pdb\" if='${build.debug}'/>");
ss.WriteLine(" </fileset>");
ss.WriteLine(" </copy>");
break;
}
}
ss.WriteLine(" </target>");
ss.WriteLine(" </target>");
ss.WriteLine(" <target name=\"clean\">");
ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
ss.WriteLine(" </target>");
ss.WriteLine(" <target name=\"clean\">");
ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
ss.WriteLine(" </target>");
ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">");
if (hasDoc)
{
ss.WriteLine(" <property name=\"doc.target\" value=\"\" />");
ss.WriteLine(" <if test=\"${platform::is-unix()}\">");
ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />");
ss.WriteLine(" </if>");
ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">");
ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">");
ss.Write(" <include name=\"${build.dir}/${project::get-name()}");
if (project.Type == ProjectType.Library)
{
ss.WriteLine(".dll\" />");
}
else
{
ss.WriteLine(".exe\" />");
}
ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">");
if (hasDoc)
{
ss.WriteLine(" <property name=\"doc.target\" value=\"\" />");
ss.WriteLine(" <if test=\"${platform::is-unix()}\">");
ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />");
ss.WriteLine(" </if>");
ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">");
ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">");
ss.Write(" <include name=\"${build.dir}/${project::get-name()}");
if (project.Type == ProjectType.Library)
{
ss.WriteLine(".dll\" />");
}
else
{
ss.WriteLine(".exe\" />");
}
ss.WriteLine(" </assemblies>");
ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>");
ss.WriteLine(" </summaries>");
ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <include name=\"${build.dir}\" />");
// foreach(ReferenceNode refr in project.References)
// {
// string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
// if (path != "")
// {
// ss.WriteLine(" <include name=\"{0}\" />", path);
// }
// }
ss.WriteLine(" </referencepaths>");
ss.WriteLine(" <documenters>");
ss.WriteLine(" <documenter name=\"MSDN\">");
ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />");
ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />");
ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />");
ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />");
ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />");
ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />");
ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />");
ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />");
ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />");
ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />");
ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />");
ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />");
ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />");
ss.WriteLine(" </documenter>");
ss.WriteLine(" </documenters>");
ss.WriteLine(" </ndoc>");
}
ss.WriteLine(" </target>");
ss.WriteLine("</project>");
}
m_Kernel.CurrentWorkingDirectory.Pop();
}
ss.WriteLine(" </assemblies>");
ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>");
ss.WriteLine(" </summaries>");
ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <include name=\"${build.dir}\" />");
// foreach(ReferenceNode refr in project.References)
// {
// string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
// if (path != "")
// {
// ss.WriteLine(" <include name=\"{0}\" />", path);
// }
// }
ss.WriteLine(" </referencepaths>");
ss.WriteLine(" <documenters>");
ss.WriteLine(" <documenter name=\"MSDN\">");
ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />");
ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />");
ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />");
ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />");
ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />");
ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />");
ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />");
ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />");
ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />");
ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />");
ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />");
ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />");
ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />");
ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />");
ss.WriteLine(" </documenter>");
ss.WriteLine(" </documenters>");
ss.WriteLine(" </ndoc>");
}
ss.WriteLine(" </target>");
ss.WriteLine("</project>");
}
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);
}
}
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.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));
m_Kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
using (ss)
{
ss.WriteLine("<?xml version=\"1.0\" ?>");
ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
ss.WriteLine();
using (ss)
{
ss.WriteLine("<?xml version=\"1.0\" ?>");
ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
ss.WriteLine();
//ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />");
//ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />");
ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />");
ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />");
ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />");
ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");
//ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />");
//ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />");
ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />");
ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />");
ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />");
ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");
// actually use active config out of prebuild.xml
ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig);
foreach (ConfigurationNode conf in solution.Configurations)
{
ss.WriteLine();
ss.WriteLine(" <target name=\"{0}\" description=\"\">", conf.Name);
ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name);
ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
ss.WriteLine(" </target>");
ss.WriteLine();
}
foreach (ConfigurationNode conf in solution.Configurations)
{
ss.WriteLine();
ss.WriteLine(" <target name=\"{0}\" description=\"\">", conf.Name);
ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name);
ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
ss.WriteLine(" </target>");
ss.WriteLine();
}
ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">");
ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"init\" description=\"\">");
ss.WriteLine(" <call target=\"${project.config}\" />");

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-27 16:49:58 -0800 (Fri, 27 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using Prebuild.Core.Attributes;
@ -43,17 +34,37 @@ namespace Prebuild.Core.Targets
/// </summary>
[Target("sharpdev2")]
public class SharpDevelop2Target : VS2005Target
{
protected override string VersionName
{
#region Properties
public override string VersionName
{
get
{
return "SharpDevelop2";
}
}
#endregion
#region Public Methods
/// <summary>
/// Writes the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public override void Write(Kernel kern)
{
base.Write(kern);
}
/// <summary>
/// Cleans the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public override void Clean(Kernel kern)
{
base.Clean(kern);
}
/// <summary>
/// Gets the name.
/// </summary>

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-02-14 05:58:03 +0900 (Wed, 14 Feb 2007) $
* $Revision: 205 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -0,0 +1,197 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
public struct ToolInfo
{
string name;
string guid;
string fileExtension;
string xmlTag;
string importProject;
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
/// <summary>
/// Gets or sets the GUID.
/// </summary>
/// <value>The GUID.</value>
public string Guid
{
get
{
return guid;
}
set
{
guid = value;
}
}
/// <summary>
/// Gets or sets the file extension.
/// </summary>
/// <value>The file extension.</value>
public string FileExtension
{
get
{
return fileExtension;
}
set
{
fileExtension = value;
}
}
public string LanguageExtension
{
get
{
switch (this.Name)
{
case "C#":
return ".cs";
case "VisualBasic":
return ".vb";
case "Boo":
return ".boo";
default:
return ".cs";
}
}
}
/// <summary>
/// Gets or sets the XML tag.
/// </summary>
/// <value>The XML tag.</value>
public string XmlTag
{
get
{
return xmlTag;
}
set
{
xmlTag = value;
}
}
/// <summary>
/// Gets or sets the import project property.
/// </summary>
/// <value>The ImportProject tag.</value>
public string ImportProject
{
get
{
return importProject;
}
set
{
importProject = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="ToolInfo"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="guid">The GUID.</param>
/// <param name="fileExtension">The file extension.</param>
/// <param name="xml">The XML.</param>
/// <param name="importProject">The import project.</param>
public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject)
{
this.name = name;
this.guid = guid;
this.fileExtension = fileExtension;
this.xmlTag = xml;
this.importProject = importProject;
}
/// <summary>
/// Initializes a new instance of the <see cref="ToolInfo"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="guid">The GUID.</param>
/// <param name="fileExtension">The file extension.</param>
/// <param name="xml">The XML.</param>
public ToolInfo(string name, string guid, string fileExtension, string xml)
{
this.name = name;
this.guid = guid;
this.fileExtension = fileExtension;
this.xmlTag = xml;
this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets";
}
/// <summary>
/// Equals operator
/// </summary>
/// <param name="obj">ToolInfo to compare</param>
/// <returns>true if toolInfos are equal</returns>
public override bool Equals(object obj)
{
if (obj == null)
{
throw new ArgumentNullException("obj");
}
if (obj.GetType() != typeof(ToolInfo))
return false;
ToolInfo c = (ToolInfo)obj;
return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject));
}
/// <summary>
/// Equals operator
/// </summary>
/// <param name="c1">ToolInfo to compare</param>
/// <param name="c2">ToolInfo to compare</param>
/// <returns>True if toolInfos are equal</returns>
public static bool operator ==(ToolInfo c1, ToolInfo c2)
{
return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag));
}
/// <summary>
/// Not equals operator
/// </summary>
/// <param name="c1">ToolInfo to compare</param>
/// <param name="c2">ToolInfo to compare</param>
/// <returns>True if toolInfos are not equal</returns>
public static bool operator !=(ToolInfo c1, ToolInfo c2)
{
return !(c1 == c2);
}
/// <summary>
/// Hash Code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode();
}
}
}

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using Prebuild.Core.Attributes;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-09-30 04:11:40 +0900 (Sat, 30 Sep 2006) $
* $Revision: 177 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
@ -44,28 +35,6 @@ using Prebuild.Core.Utilities;
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
public enum VSVersion
{
/// <summary>
///
/// </summary>
VS70,
/// <summary>
///
/// </summary>
VS71,
/// <summary>
///
/// </summary>
VS80
}
/// <summary>
///
/// </summary>
[Target("vs2003")]
public class VS2003Target : ITarget
{

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: borrillis $
* $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
* $Revision: 243 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
@ -45,185 +36,11 @@ using Prebuild.Core.Utilities;
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
public struct ToolInfo
{
string name;
string guid;
string fileExtension;
string xmlTag;
string importProject;
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
/// <summary>
/// Gets or sets the GUID.
/// </summary>
/// <value>The GUID.</value>
public string Guid
{
get
{
return guid;
}
set
{
guid = value;
}
}
/// <summary>
/// Gets or sets the file extension.
/// </summary>
/// <value>The file extension.</value>
public string FileExtension
{
get
{
return fileExtension;
}
set
{
fileExtension = value;
}
}
/// <summary>
/// Gets or sets the XML tag.
/// </summary>
/// <value>The XML tag.</value>
public string XmlTag
{
get
{
return xmlTag;
}
set
{
xmlTag = value;
}
}
/// <summary>
/// Gets or sets the import project property.
/// </summary>
/// <value>The ImportProject tag.</value>
public string ImportProject
{
get
{
return importProject;
}
set
{
importProject = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="ToolInfo"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="guid">The GUID.</param>
/// <param name="fileExtension">The file extension.</param>
/// <param name="xml">The XML.</param>
/// <param name="importProject">The import project.</param>
public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject)
{
this.name = name;
this.guid = guid;
this.fileExtension = fileExtension;
this.xmlTag = xml;
this.importProject = importProject;
}
/// <summary>
/// Initializes a new instance of the <see cref="ToolInfo"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="guid">The GUID.</param>
/// <param name="fileExtension">The file extension.</param>
/// <param name="xml">The XML.</param>
public ToolInfo(string name, string guid, string fileExtension, string xml)
{
this.name = name;
this.guid = guid;
this.fileExtension = fileExtension;
this.xmlTag = xml;
this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets";
}
/// <summary>
/// Equals operator
/// </summary>
/// <param name="obj">ToolInfo to compare</param>
/// <returns>true if toolInfos are equal</returns>
public override bool Equals(object obj)
{
if (obj == null)
{
throw new ArgumentNullException("obj");
}
if (obj.GetType() != typeof(ToolInfo))
return false;
ToolInfo c = (ToolInfo)obj;
return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject));
}
/// <summary>
/// Equals operator
/// </summary>
/// <param name="c1">ToolInfo to compare</param>
/// <param name="c2">ToolInfo to compare</param>
/// <returns>True if toolInfos are equal</returns>
public static bool operator ==(ToolInfo c1, ToolInfo c2)
{
return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag));
}
/// <summary>
/// Not equals operator
/// </summary>
/// <param name="c1">ToolInfo to compare</param>
/// <param name="c2">ToolInfo to compare</param>
/// <returns>True if toolInfos are not equal</returns>
public static bool operator !=(ToolInfo c1, ToolInfo c2)
{
return !(c1 == c2);
}
/// <summary>
/// Hash Code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode();
}
}
/// <summary>
///
/// </summary>
[Target("vs2005")]
public class VS2005Target : ITarget
public class VS2005Target : VSGenericTarget
{
#region Inner Classes
@ -231,90 +48,87 @@ namespace Prebuild.Core.Targets
#region Fields
string solutionVersion = "9.00";
string productVersion = "8.0.50727";
string schemaVersion = "2.0";
string versionName = "Visual C# 2005";
string name = "vs2005";
VSVersion version = VSVersion.VS80;
Hashtable tools;
Kernel kernel;
protected virtual string ToolsVersionXml
{
get
{
return String.Empty;
}
}
protected virtual string SolutionTag
public override string SolutionTag
{
get { return "# Visual Studio 2005"; }
}
protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
{
return string.Empty;
}
/// <summary>
/// Gets or sets the solution version.
/// </summary>
/// <value>The solution version.</value>
protected virtual string SolutionVersion
public override string SolutionVersion
{
get
{
return "9.00";
return solutionVersion;
}
}
/// <summary>
/// Gets or sets the product version.
/// </summary>
/// <value>The product version.</value>
protected virtual string ProductVersion
public override string ProductVersion
{
get
{
return "8.0.50727";
return productVersion;
}
}
/// <summary>
/// Gets or sets the schema version.
/// </summary>
/// <value>The schema version.</value>
protected string SchemaVersion
public override string SchemaVersion
{
get
{
return this.schemaVersion;
}
set
{
this.schemaVersion = value;
return schemaVersion;
}
}
/// <summary>
/// Gets or sets the name of the version.
/// </summary>
/// <value>The name of the version.</value>
protected virtual string VersionName
public override string VersionName
{
get
{
return "Visual C# 2005";
return versionName;
}
}
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
protected VSVersion Version
public override VSVersion Version
{
get
{
return this.version;
return version;
}
set
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public override string Name
{
get
{
this.version = value;
return name;
}
}
@ -325,600 +139,9 @@ namespace Prebuild.Core.Targets
/// <summary>
/// Initializes a new instance of the <see cref="VS2005Target"/> class.
/// </summary>
public VS2005Target()
{
this.tools = new Hashtable();
this.tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets");
this.tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets");
this.tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets");
}
#endregion
#region Private Methods
private string MakeRefPath(ProjectNode project)
{
string ret = "";
foreach (ReferencePathNode node in project.ReferencePaths)
{
try
{
string fullPath = Helper.ResolvePath(node.Path);
if (ret.Length < 1)
{
ret = fullPath;
}
else
{
ret += ";" + fullPath;
}
}
catch (ArgumentException)
{
this.kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
}
}
return ret;
}
private static bool ExtensionSpecified(string refName)
{
return refName.EndsWith(".dll") || refName.EndsWith(".exe");
}
private static string GetProjectExtension(ProjectNode project)
{
string extension = ".dll";
if (project.Type == ProjectType.Exe)
{
extension = ".exe";
}
return extension;
}
private void WriteProject(SolutionNode solution, ProjectNode project)
{
if (!tools.ContainsKey(project.Language))
{
throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
}
ToolInfo toolInfo = (ToolInfo)tools[project.Language];
string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
StreamWriter ps = new StreamWriter(projectFile);
kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
#region Project File
using (ps)
{
ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"{0}>", ToolsVersionXml);
//ps.WriteLine(" <{0}", toolInfo.XMLTag);
ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <ProjectType>Local</ProjectType>");
ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", this.ProductVersion);
ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", this.SchemaVersion);
ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper());
ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
//ps.WriteLine(" <Build>");
//ps.WriteLine(" <Settings");
ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon);
ps.WriteLine(" <AssemblyKeyContainerName>");
ps.WriteLine(" </AssemblyKeyContainerName>");
ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName);
foreach (ConfigurationNode conf in project.Configurations)
{
if (conf.Options.KeyFile != "")
{
ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
ps.WriteLine(" <SignAssembly>true</SignAssembly>");
break;
}
}
ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
ps.WriteLine(" <DelaySign>false</DelaySign>");
//if(m_Version == VSVersion.VS70)
// ps.WriteLine(" NoStandardLibraries = \"false\"");
ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type.ToString());
ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
//ps.WriteLine(" >");
ps.WriteLine(" <FileUpgradeFlags>");
ps.WriteLine(" </FileUpgradeFlags>");
ps.WriteLine(" </PropertyGroup>");
foreach (ConfigurationNode conf in project.Configurations)
{
ps.Write(" <PropertyGroup ");
ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \">", conf.Name);
ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
ps.WriteLine(" <ConfigurationOverrideFile>");
ps.WriteLine(" </ConfigurationOverrideFile>");
ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]);
ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
// ps.WriteLine(" <IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"]);
// if(m_Version == VSVersion.VS71)
// {
// ps.WriteLine(" NoStdLib = \"{0}\"", conf.Options["NoStdLib"]);
// ps.WriteLine(" NoWarn = \"{0}\"", conf.Options["SuppressWarnings"]);
// }
ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
ps.WriteLine(" </PropertyGroup>");
}
//ps.WriteLine(" </Settings>");
// Assembly References
ps.WriteLine(" <ItemGroup>");
string refPath = ((ReferencePathNode) project.ReferencePaths[0]).Path;
foreach (ReferenceNode refr in project.References)
{
if (!solution.ProjectsTable.ContainsKey(refr.Name))
{
ps.Write(" <Reference");
ps.Write(" Include=\"");
ps.Write(refr.Name);
ps.WriteLine("\" >");
string path;
if (String.IsNullOrEmpty(refr.Path))
{
if ( ExtensionSpecified( refr.Name ) )
{
path = Helper.NormalizePath(Path.Combine(refPath, refr.Name), '\\');
}
else
{
path = refr.Name + ".dll";
}
}
else
{
path = refr.Path;
}
// TODO: Allow reference to *.exe files
ps.WriteLine(" <HintPath>{0}</HintPath>", path );
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
ps.WriteLine(" </Reference>");
}
}
ps.WriteLine(" </ItemGroup>");
//Project References
ps.WriteLine(" <ItemGroup>");
foreach (ReferenceNode refr in project.References)
{
if (solution.ProjectsTable.ContainsKey(refr.Name))
{
ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
// TODO: Allow reference to visual basic projects
string path =
Helper.MakePathRelativeTo(project.FullPath,
Helper.MakeFilePath(refProject.FullPath, refProject.Name, "csproj"));
ps.WriteLine(" <ProjectReference Include=\"{0}\">", path );
//<ProjectReference Include="..\..\RealmForge\Utility\RealmForge.Utility.csproj">
ps.WriteLine(" <Name>{0}</Name>", refProject.Name);
// <Name>RealmForge.Utility</Name>
ps.WriteLine(" <Project>{{{0}}}</Project>", refProject.Guid.ToString().ToUpper());
// <Project>{6880D1D3-69EE-461B-B841-5319845B20D3}</Project>
ps.WriteLine(" <Package>{0}</Package>", toolInfo.Guid.ToString().ToUpper());
// <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
ps.WriteLine("\t\t\t<Private>{0}</Private>", refr.LocalCopy);
ps.WriteLine(" </ProjectReference>");
//</ProjectReference>
}
else
{
}
}
ps.WriteLine(" </ItemGroup>");
// ps.WriteLine(" </Build>");
ps.WriteLine(" <ItemGroup>");
// ps.WriteLine(" <Include>");
ArrayList list = new ArrayList();
foreach (string file in project.Files)
{
// if (file == "Properties\\Bind.Designer.cs")
// {
// Console.WriteLine("Wait a minute!");
// Console.WriteLine(project.Files.GetSubType(file).ToString());
// }
if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings && project.Files.GetSubType(file) != SubType.Designer)
{
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
int slash = file.LastIndexOf('\\');
if (slash == -1)
{
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file);
}
else
{
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file.Substring(slash + 1, file.Length - slash - 1));
}
ps.WriteLine(" <SubType>Designer</SubType>");
ps.WriteLine(" </EmbeddedResource>");
//
}
if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) == SubType.Designer)
{
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
ps.WriteLine(" <SubType>" + project.Files.GetSubType(file) + "</SubType>");
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
ps.WriteLine(" <LastGenOutput>Resources.Designer.cs</LastGenOutput>");
ps.WriteLine(" </EmbeddedResource>");
ps.WriteLine(" <Compile Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs");
ps.WriteLine(" <AutoGen>True</AutoGen>");
ps.WriteLine(" <DesignTime>True</DesignTime>");
ps.WriteLine(" <DependentUpon>Resources.resx</DependentUpon>");
ps.WriteLine(" </Compile>");
list.Add(file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs");
}
if (project.Files.GetSubType(file).ToString() == "Settings")
{
//Console.WriteLine("File: " + file);
//Console.WriteLine("Last index: " + file.LastIndexOf('.'));
//Console.WriteLine("Length: " + file.Length);
ps.Write(" <{0} ", project.Files.GetBuildAction(file));
ps.WriteLine("Include=\"{0}\">", file);
int slash = file.LastIndexOf('\\');
string fileName = file.Substring(slash + 1, file.Length - slash - 1);
if (project.Files.GetBuildAction(file) == BuildAction.None)
{
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
//Console.WriteLine("FileName: " + fileName);
//Console.WriteLine("FileNameMain: " + fileName.Substring(0, fileName.LastIndexOf('.')));
//Console.WriteLine("FileNameExt: " + fileName.Substring(fileName.LastIndexOf('.'), fileName.Length - fileName.LastIndexOf('.')));
if (slash == -1)
{
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
}
else
{
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
}
}
else
{
ps.WriteLine(" <SubType>Code</SubType>");
ps.WriteLine(" <AutoGen>True</AutoGen>");
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", fileNameShorter + ".settings");
}
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
}
else if (project.Files.GetSubType(file) != SubType.Designer)
{
if (!list.Contains(file))
{
ps.Write(" <{0} ", project.Files.GetBuildAction(file));
int startPos = 0;
if ( project.Files.GetPreservePath( file ) )
{
while ( ( @"./\" ).IndexOf( file.Substring( startPos, 1 ) ) != -1 )
startPos++;
}
else
{
startPos = file.LastIndexOf( Path.GetFileName( file ) );
}
ps.WriteLine("Include=\"{0}\">", Helper.NormalizePath(file));
if (file.Contains("Designer.cs"))
{
string d = ".Designer.cs";
int index = file.Contains("\\") ? file.IndexOf("\\") + 1 : 0;
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file.Substring(index, file.Length - index - d.Length) + ".cs");
}
if (project.Files.GetIsLink(file))
{
string alias = project.Files.GetLinkPath( file );
alias += file.Substring( startPos );
alias = Helper.NormalizePath( alias );
ps.WriteLine( " <Link>{0}</Link>", alias );
}
else if (project.Files.GetBuildAction(file) != BuildAction.None)
{
if (project.Files.GetBuildAction(file) != BuildAction.EmbeddedResource)
{
ps.WriteLine(" <SubType>{0}</SubType>", project.Files.GetSubType(file));
}
}
if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never)
{
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(file));
}
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
}
}
}
// ps.WriteLine(" </Include>");
ps.WriteLine(" </ItemGroup>");
ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <PreBuildEvent>");
ps.WriteLine(" </PreBuildEvent>");
ps.WriteLine(" <PostBuildEvent>");
ps.WriteLine(" </PostBuildEvent>");
ps.WriteLine(" </PropertyGroup>");
// ps.WriteLine(" </{0}>", toolInfo.XMLTag);
ps.WriteLine("</Project>");
}
#endregion
#region User File
ps = new StreamWriter(projectFile + ".user");
using (ps)
{
ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
//ps.WriteLine( "<VisualStudioProject>" );
//ps.WriteLine(" <{0}>", toolInfo.XMLTag);
//ps.WriteLine(" <Build>");
ps.WriteLine(" <PropertyGroup>");
//ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
if (projectFile.Contains( "OpenSim.csproj" ))
{
ps.WriteLine(" <StartArguments>-loginserver -sandbox -accounts</StartArguments>");
}
ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project));
ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", this.ProductVersion);
ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>");
ps.WriteLine(" <ProjectTrust>0</ProjectTrust>");
ps.WriteLine(" </PropertyGroup>");
foreach (ConfigurationNode conf in project.Configurations)
{
ps.Write(" <PropertyGroup");
ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \"", conf.Name);
ps.WriteLine(" />");
}
ps.WriteLine("</Project>");
}
#endregion
kernel.CurrentWorkingDirectory.Pop();
}
private void WriteSolution(SolutionNode solution)
{
kernel.Log.Write("Creating {0} solution and project files", this.VersionName);
foreach (ProjectNode project in solution.Projects)
{
kernel.Log.Write("...Creating project: {0}", project.Name);
WriteProject(solution, project);
}
kernel.Log.Write("");
string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
using (StreamWriter ss = new StreamWriter(solutionFile))
{
kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
using (ss)
{
ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
ss.WriteLine(SolutionTag);
foreach (ProjectNode project in solution.Projects)
{
if (!tools.ContainsKey(project.Language))
{
throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
}
ToolInfo toolInfo = (ToolInfo)tools[project.Language];
string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"",
toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name,
toolInfo.FileExtension), project.Guid.ToString().ToUpper());
//ss.WriteLine(" ProjectSection(ProjectDependencies) = postProject");
//ss.WriteLine(" EndProjectSection");
ss.WriteLine("EndProject");
}
if (solution.Files != null)
{
ss.WriteLine("Project(\"{0}\") = \"Solution Items\", \"Solution Items\", \"{1}\"", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", "{468F1D07-AD17-4CC3-ABD0-2CA268E4E1A6}");
ss.WriteLine("\tProjectSection(SolutionItems) = preProject");
foreach (string file in solution.Files)
ss.WriteLine("\t\t{0} = {0}", file);
ss.WriteLine("\tEndProjectSection");
ss.WriteLine("EndProject");
}
ss.WriteLine("Global");
ss.WriteLine(" GlobalSection(SolutionConfigurationPlatforms) = preSolution");
foreach (ConfigurationNode conf in solution.Configurations)
{
ss.WriteLine(" {0}|Any CPU = {0}|Any CPU", conf.Name);
}
ss.WriteLine(" EndGlobalSection");
if (solution.Projects.Count > 1)
{
ss.WriteLine(" GlobalSection(ProjectDependencies) = postSolution");
}
foreach (ProjectNode project in solution.Projects)
{
for (int i = 0; i < project.References.Count; i++)
{
ReferenceNode refr = (ReferenceNode)project.References[i];
if (solution.ProjectsTable.ContainsKey(refr.Name))
{
ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
ss.WriteLine(" ({{{0}}}).{1} = ({{{2}}})",
project.Guid.ToString().ToUpper()
, i,
refProject.Guid.ToString().ToUpper()
);
}
}
}
if (solution.Projects.Count > 1)
{
ss.WriteLine(" EndGlobalSection");
}
ss.WriteLine(" GlobalSection(ProjectConfigurationPlatforms) = postSolution");
foreach (ProjectNode project in solution.Projects)
{
foreach (ConfigurationNode conf in solution.Configurations)
{
ss.WriteLine(" {{{0}}}.{1}|Any CPU.ActiveCfg = {1}|Any CPU",
project.Guid.ToString().ToUpper(),
conf.Name);
ss.WriteLine(" {{{0}}}.{1}|Any CPU.Build.0 = {1}|Any CPU",
project.Guid.ToString().ToUpper(),
conf.Name);
}
}
ss.WriteLine(" EndGlobalSection");
ss.WriteLine(" GlobalSection(SolutionProperties) = preSolution");
ss.WriteLine(" HideSolutionNode = FALSE");
ss.WriteLine(" EndGlobalSection");
ss.WriteLine("EndGlobal");
}
}
kernel.CurrentWorkingDirectory.Pop();
}
private void CleanProject(ProjectNode project)
{
kernel.Log.Write("...Cleaning project: {0}", project.Name);
ToolInfo toolInfo = (ToolInfo)tools[project.Language];
string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
string userFile = projectFile + ".user";
Helper.DeleteIfExists(projectFile);
Helper.DeleteIfExists(userFile);
}
private void CleanSolution(SolutionNode solution)
{
kernel.Log.Write("Cleaning {0} solution and project files", this.VersionName, solution.Name);
string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
Helper.DeleteIfExists(slnFile);
Helper.DeleteIfExists(suoFile);
foreach (ProjectNode project in solution.Projects)
{
CleanProject(project);
}
kernel.Log.Write("");
}
#endregion
#region ITarget Members
/// <summary>
/// Writes the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public virtual void Write(Kernel kern)
{
if (kern == null)
{
throw new ArgumentNullException("kern");
}
kernel = kern;
foreach (SolutionNode sol in kernel.Solutions)
{
WriteSolution(sol);
}
kernel = null;
}
/// <summary>
/// Cleans the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public virtual void Clean(Kernel kern)
{
if (kern == null)
{
throw new ArgumentNullException("kern");
}
kernel = kern;
foreach (SolutionNode sol in kernel.Solutions)
{
CleanSolution(sol);
}
kernel = null;
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public virtual string Name
{
get
{
return "vs2005";
}
public VS2005Target()
: base()
{
}
#endregion

View File

@ -1,56 +1,132 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using Prebuild.Core.Nodes;
using Prebuild.Core.Utilities;
using System.CodeDom.Compiler;
namespace Prebuild.Core.Targets
{
[Target("vs2008")]
public class VS2008Target : VS2005Target
{
protected override string SolutionTag
/// <summary>
///
/// </summary>
[Target("vs2008")]
public class VS2008Target : VSGenericTarget
{
#region Fields
string solutionVersion = "10.00";
string productVersion = "9.0.21022";
string schemaVersion = "2.0";
string versionName = "Visual Studio 2008";
string name = "vs2008";
VSVersion version = VSVersion.VS90;
Hashtable tools;
Kernel kernel;
/// <summary>
/// Gets or sets the solution version.
/// </summary>
/// <value>The solution version.</value>
public override string SolutionVersion
{
get
{
return solutionVersion;
}
}
/// <summary>
/// Gets or sets the product version.
/// </summary>
/// <value>The product version.</value>
public override string ProductVersion
{
get
{
return productVersion;
}
}
/// <summary>
/// Gets or sets the schema version.
/// </summary>
/// <value>The schema version.</value>
public override string SchemaVersion
{
get
{
return schemaVersion;
}
}
/// <summary>
/// Gets or sets the name of the version.
/// </summary>
/// <value>The name of the version.</value>
public override string VersionName
{
get
{
return versionName;
}
}
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
public override VSVersion Version
{
get
{
return version;
}
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public override string Name
{
get
{
return name;
}
}
protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
{
switch (frameworkVersion)
{
case FrameworkVersion.v3_5:
return "ToolsVersion=\"3.5\"";
case FrameworkVersion.v3_0:
return "ToolsVersion=\"3.0\"";
default:
return "ToolsVersion=\"2.0\"";
}
}
public override string SolutionTag
{
get { return "# Visual Studio 2008"; }
}
protected override string SolutionVersion
{
get
{
return "10.00";
}
}
#endregion
protected override string VersionName
{
get
{
return "Visual C# 2008";
}
}
#region Constructors
protected override string ToolsVersionXml
{
get
{
return " ToolsVersion=\"3.5\"";
}
}
/// <summary>
/// Initializes a new instance of the <see cref="VS2005Target"/> class.
/// </summary>
public VS2008Target()
: base()
{
}
protected override string ProductVersion
{
get
{
return "9.0.21022";
}
}
public override string Name
{
get
{
return "vs2008";
}
}
}
#endregion
}
}

View File

@ -0,0 +1,881 @@
#region BSD License
/*
Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (sontek@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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using Prebuild.Core.Attributes;
using Prebuild.Core.Interfaces;
using Prebuild.Core.Nodes;
using Prebuild.Core.Utilities;
using System.CodeDom.Compiler;
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
public abstract class VSGenericTarget : ITarget
{
#region Fields
readonly Hashtable tools = new Hashtable();
Kernel kernel;
#endregion
#region Properties
/// <summary>
/// Gets or sets the solution version.
/// </summary>
/// <value>The solution version.</value>
public abstract string SolutionVersion { get; }
/// <summary>
/// Gets or sets the product version.
/// </summary>
/// <value>The product version.</value>
public abstract string ProductVersion { get; }
/// <summary>
/// Gets or sets the schema version.
/// </summary>
/// <value>The schema version.</value>
public abstract string SchemaVersion { get; }
/// <summary>
/// Gets or sets the name of the version.
/// </summary>
/// <value>The name of the version.</value>
public abstract string VersionName { get; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
public abstract VSVersion Version { get; }
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public abstract string Name { get; }
protected abstract string GetToolsVersionXml(FrameworkVersion version);
public abstract string SolutionTag { get; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="VSGenericTarget"/> class.
/// </summary>
protected VSGenericTarget()
{
this.tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets");
this.tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN");
this.tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets");
this.tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets");
this.tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null);
}
#endregion
#region Private Methods
private string MakeRefPath(ProjectNode project)
{
string ret = "";
foreach (ReferencePathNode node in project.ReferencePaths)
{
try
{
string fullPath = Helper.ResolvePath(node.Path);
if (ret.Length < 1)
{
ret = fullPath;
}
else
{
ret += ";" + fullPath;
}
}
catch (ArgumentException)
{
this.kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
}
}
return ret;
}
private static ProjectNode FindProjectInSolution(string name, SolutionNode solution)
{
SolutionNode node = solution;
while (node.Parent is SolutionNode)
node = node.Parent as SolutionNode;
return FindProjectInSolutionRecursively(name, node);
}
private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution)
{
if (solution.ProjectsTable.ContainsKey(name))
return (ProjectNode)solution.ProjectsTable[name];
foreach (SolutionNode child in solution.Solutions)
{
ProjectNode node = FindProjectInSolutionRecursively(name, child);
if (node != null)
return node;
}
return null;
}
private void WriteProject(SolutionNode solution, ProjectNode project)
{
if (!tools.ContainsKey(project.Language))
{
throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
}
ToolInfo toolInfo = (ToolInfo)tools[project.Language];
string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
StreamWriter ps = new StreamWriter(projectFile);
kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
#region Project File
using (ps)
{
ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {0}>", GetToolsVersionXml(project.FrameworkVersion));
ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <ProjectType>Local</ProjectType>");
ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", this.ProductVersion);
ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", this.SchemaVersion);
ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper());
// Visual Studio has a hard coded guid for the project type
if (project.Type == ProjectType.Web)
ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>");
ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon);
ps.WriteLine(" <AssemblyKeyContainerName>");
ps.WriteLine(" </AssemblyKeyContainerName>");
ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName);
foreach (ConfigurationNode conf in project.Configurations)
{
if (conf.Options.KeyFile != "")
{
ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
ps.WriteLine(" <SignAssembly>true</SignAssembly>");
break;
}
}
ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
ps.WriteLine(" <DelaySign>false</DelaySign>");
ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", "."));
ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
if (string.IsNullOrEmpty(project.DebugStartParameters))
{
ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters);
}
ps.WriteLine(" <FileUpgradeFlags>");
ps.WriteLine(" </FileUpgradeFlags>");
ps.WriteLine(" </PropertyGroup>");
foreach (ConfigurationNode conf in project.Configurations)
{
ps.Write(" <PropertyGroup ");
ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \">", conf.Name);
ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
ps.WriteLine(" <ConfigurationOverrideFile>");
ps.WriteLine(" </ConfigurationOverrideFile>");
ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]);
ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
if (project.Type != ProjectType.Web)
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
else
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
Helper.EndPath(Helper.NormalizePath("bin\\")));
ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
ps.WriteLine(" </PropertyGroup>");
}
//ps.WriteLine(" </Settings>");
List<ProjectNode> projectReferences = new List<ProjectNode>();
List<ReferenceNode> otherReferences = new List<ReferenceNode>();
foreach (ReferenceNode refr in project.References)
{
ProjectNode projectNode = FindProjectInSolution(refr.Name, solution);
if (projectNode == null)
otherReferences.Add(refr);
else
projectReferences.Add(projectNode);
}
// Assembly References
ps.WriteLine(" <ItemGroup>");
foreach (ReferenceNode refr in otherReferences)
{
ps.Write(" <Reference");
ps.Write(" Include=\"");
ps.Write(refr.Name);
ps.WriteLine("\" >");
ps.Write(" <Name>");
ps.Write(refr.Name);
ps.WriteLine("</Name>");
// TODO: Allow reference to *.exe files
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
ps.WriteLine(" </Reference>");
}
ps.WriteLine(" </ItemGroup>");
//Project References
ps.WriteLine(" <ItemGroup>");
foreach (ProjectNode projectReference in projectReferences)
{
ToolInfo tool = (ToolInfo)tools[projectReference.Language];
if (tools == null)
throw new UnknownLanguageException();
string path =
Helper.MakePathRelativeTo(project.FullPath,
Helper.MakeFilePath(projectReference.FullPath, projectReference.Name, tool.FileExtension));
ps.WriteLine(" <ProjectReference Include=\"{0}\">", path);
// TODO: Allow reference to visual basic projects
ps.WriteLine(" <Name>{0}</Name>", projectReference.Name);
ps.WriteLine(" <Project>{0}</Project>", projectReference.Guid.ToString("B").ToUpper());
ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper());
ps.WriteLine(" </ProjectReference>");
}
ps.WriteLine(" </ItemGroup>");
// ps.WriteLine(" </Build>");
ps.WriteLine(" <ItemGroup>");
// ps.WriteLine(" <Include>");
List<string> list = new List<string>();
foreach (string path in project.Files)
{
string lower = path.ToLower();
if (lower.EndsWith(".resx"))
{
string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension);
if (!list.Contains(codebehind))
list.Add(codebehind);
}
}
foreach (string file in project.Files)
{
// if (file == "Properties\\Bind.Designer.cs")
// {
// Console.WriteLine("Wait a minute!");
// Console.WriteLine(project.Files.GetSubType(file).ToString());
// }
SubType subType = project.Files.GetSubType(file);
if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer
&& subType != SubType.CodeBehind)
{
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
ps.WriteLine(" <SubType>Designer</SubType>");
ps.WriteLine(" </EmbeddedResource>");
//
}
if (subType == SubType.Designer)
{
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
ps.WriteLine(" <SubType>" + subType + "</SubType>");
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs";
string dependent_name = file.Substring(0, file.LastIndexOf('.')) + ".cs";
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", autogen_name);
// Check for a parent .cs file with the same name as this designer file
if (File.Exists(dependent_name))
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
ps.WriteLine(" </EmbeddedResource>");
if (File.Exists(autogen_name))
{
ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
ps.WriteLine(" <AutoGen>True</AutoGen>");
ps.WriteLine(" <DesignTime>True</DesignTime>");
// If a parent .cs file exists, link this autogen file to it. Otherwise link
// to the designer file
if (File.Exists(dependent_name))
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
else
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
ps.WriteLine(" </Compile>");
}
list.Add(autogen_name);
}
if (subType == SubType.Settings)
{
ps.Write(" <{0} ", project.Files.GetBuildAction(file));
ps.WriteLine("Include=\"{0}\">", file);
string fileName = Path.GetFileName(file);
if (project.Files.GetBuildAction(file) == BuildAction.None)
{
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
}
else
{
ps.WriteLine(" <SubType>Code</SubType>");
ps.WriteLine(" <AutoGen>True</AutoGen>");
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
}
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
}
else if (subType != SubType.Designer)
{
string path = Helper.NormalizePath(file);
string path_lower = path.ToLower();
if (!list.Contains(file))
{
ps.Write(" <{0} ", project.Files.GetBuildAction(path));
int startPos = 0;
if (project.Files.GetPreservePath(file))
{
while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1)
startPos++;
}
else
{
startPos = file.LastIndexOf(Path.GetFileName(path));
}
ps.WriteLine("Include=\"{0}\">", path);
int last_period_index = file.LastIndexOf('.');
string short_file_name = file.Substring(0, last_period_index);
string extension = Path.GetExtension(path);
string designer_format = string.Format(".designer{0}", extension);
if (path_lower.EndsWith(designer_format))
{
int designer_index = path_lower.IndexOf(designer_format);
string file_name = path.Substring(0, designer_index);
if (File.Exists(file_name))
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name));
else if (File.Exists(file_name + ".resx"))
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
}
else if (subType == SubType.CodeBehind)
{
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
}
if (project.Files.GetIsLink(file))
{
string alias = project.Files.GetLinkPath(file);
alias += file.Substring(startPos);
alias = Helper.NormalizePath(alias);
ps.WriteLine(" <Link>{0}</Link>", alias);
}
else if (project.Files.GetBuildAction(file) != BuildAction.None)
{
if (project.Files.GetBuildAction(file) != BuildAction.EmbeddedResource)
{
ps.WriteLine(" <SubType>{0}</SubType>", subType);
}
}
if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never)
{
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(file));
}
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
}
}
}
ps.WriteLine(" </ItemGroup>");
ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <PreBuildEvent>");
ps.WriteLine(" </PreBuildEvent>");
ps.WriteLine(" <PostBuildEvent>");
ps.WriteLine(" </PostBuildEvent>");
ps.WriteLine(" </PropertyGroup>");
ps.WriteLine("</Project>");
}
#endregion
#region User File
ps = new StreamWriter(projectFile + ".user");
using (ps)
{
ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
//ps.WriteLine( "<VisualStudioProject>" );
//ps.WriteLine(" <{0}>", toolInfo.XMLTag);
//ps.WriteLine(" <Build>");
ps.WriteLine(" <PropertyGroup>");
//ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project));
ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", this.ProductVersion);
ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>");
ps.WriteLine(" <ProjectTrust>0</ProjectTrust>");
ps.WriteLine(" </PropertyGroup>");
foreach (ConfigurationNode conf in project.Configurations)
{
ps.Write(" <PropertyGroup");
ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \"", conf.Name);
ps.WriteLine(" />");
}
ps.WriteLine("</Project>");
}
#endregion
kernel.CurrentWorkingDirectory.Pop();
}
private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk)
{
kernel.Log.Write("Creating {0} solution and project files", this.VersionName);
foreach (SolutionNode child in solution.Solutions)
{
kernel.Log.Write("...Creating folder: {0}", child.Name);
WriteSolution(child, false);
}
foreach (ProjectNode project in solution.Projects)
{
kernel.Log.Write("...Creating project: {0}", project.Name);
WriteProject(solution, project);
}
foreach (DatabaseProjectNode project in solution.DatabaseProjects)
{
kernel.Log.Write("...Creating database project: {0}", project.Name);
WriteDatabaseProject(solution, project);
}
if (writeSolutionToDisk) // only write main solution
{
kernel.Log.Write("");
string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
using (StreamWriter ss = new StreamWriter(solutionFile))
{
kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
ss.WriteLine(SolutionTag);
WriteProjectDeclarations(ss, solution, solution);
ss.WriteLine("Global");
ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");
foreach (ConfigurationNode conf in solution.Configurations)
{
ss.WriteLine("\t\t{0}|Any CPU = {0}|Any CPU", conf.Name);
}
ss.WriteLine("\tEndGlobalSection");
ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
WriteConfigurationLines(solution.Configurations, solution, ss);
ss.WriteLine("\tEndGlobalSection");
if (solution.Solutions.Count > 0)
{
ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution");
foreach (SolutionNode embeddedSolution in solution.Solutions)
{
WriteNestedProjectMap(ss, embeddedSolution);
}
ss.WriteLine("\tEndGlobalSection");
}
ss.WriteLine("EndGlobal");
}
kernel.CurrentWorkingDirectory.Pop();
}
}
private void WriteProjectDeclarations(StreamWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution)
{
foreach (SolutionNode childSolution in embeddedSolution.Solutions)
{
WriteEmbeddedSolution(writer, childSolution);
WriteProjectDeclarations(writer, actualSolution, childSolution);
}
foreach (ProjectNode project in embeddedSolution.Projects)
{
WriteProject(actualSolution, writer, project);
}
foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
{
WriteProject(actualSolution, writer, dbProject);
}
if (actualSolution.Guid == embeddedSolution.Guid)
{
WriteSolutionFiles(actualSolution, writer);
}
}
private static void WriteNestedProjectMap(StreamWriter writer, SolutionNode embeddedSolution)
{
foreach (ProjectNode project in embeddedSolution.Projects)
{
WriteNestedProject(writer, embeddedSolution, project.Guid);
}
foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
{
WriteNestedProject(writer, embeddedSolution, dbProject.Guid);
}
foreach (SolutionNode child in embeddedSolution.Solutions)
{
WriteNestedProject(writer, embeddedSolution, child.Guid);
WriteNestedProjectMap(writer, child);
}
}
private static void WriteNestedProject(StreamWriter writer, SolutionNode solution, Guid projectGuid)
{
WriteNestedFolder(writer, solution.Guid, projectGuid);
}
private static void WriteNestedFolder(StreamWriter writer, Guid parentGuid, Guid childGuid)
{
writer.WriteLine("\t\t{0} = {1}",
childGuid.ToString("B").ToUpper(),
parentGuid.ToString("B").ToUpper());
}
private static void WriteConfigurationLines(ICollection configurations, SolutionNode solution, StreamWriter ss)
{
foreach (ProjectNode project in solution.Projects)
{
foreach (ConfigurationNode conf in configurations)
{
ss.WriteLine("\t\t{0}.{1}|Any CPU.ActiveCfg = {1}|Any CPU",
project.Guid.ToString("B").ToUpper(),
conf.Name);
ss.WriteLine("\t\t{0}.{1}|Any CPU.Build.0 = {1}|Any CPU",
project.Guid.ToString("B").ToUpper(),
conf.Name);
}
}
foreach (SolutionNode child in solution.Solutions)
{
WriteConfigurationLines(configurations, child, ss);
}
}
private void WriteSolutionFiles(SolutionNode solution, StreamWriter ss)
{
WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files);
}
private void WriteEmbeddedSolution(StreamWriter writer, SolutionNode embeddedSolution)
{
WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files);
}
private void WriteProject(SolutionNode solution, StreamWriter ss, ProjectNode project)
{
WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath);
}
private void WriteProject(SolutionNode solution, StreamWriter ss, DatabaseProjectNode dbProject)
{
if (solution.Files != null && solution.Files.Count > 0)
WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath);
}
private static bool ExtensionSpecified(string refName)
{
return refName.EndsWith(".dll") || refName.EndsWith(".exe");
}
private static string GetProjectExtension(ProjectNode project)
{
string extension = ".dll";
if (project.Type == ProjectType.Exe)
{
extension = ".exe";
}
return extension;
}
const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\"";
const string ProjectDeclarationEndFormat = "EndProject";
private void WriteProject(StreamWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath)
{
if (!tools.ContainsKey(language))
throw new UnknownLanguageException("Unknown .NET language: " + language);
ToolInfo toolInfo = (ToolInfo)tools[language];
string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath);
path = Helper.MakeFilePath(path, name, toolInfo.FileExtension);
WriteProject(ss, language, guid, name, path);
}
private void WriteProject(StreamWriter writer, string language, Guid projectGuid, string name, string location)
{
WriteProject(writer, language, projectGuid, name, location, null);
}
private void WriteProject(StreamWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files)
{
if (!tools.ContainsKey(language))
throw new UnknownLanguageException("Unknown .NET language: " + language);
ToolInfo toolInfo = (ToolInfo)tools[language];
writer.WriteLine(ProjectDeclarationBeginFormat,
toolInfo.Guid,
name,
location,
projectGuid.ToString("B").ToUpper());
if (files != null)
{
writer.WriteLine("\tProjectSection(SolutionItems) = preProject");
foreach (string file in files)
writer.WriteLine("\t\t{0} = {0}", file);
writer.WriteLine("\tEndProjectSection");
}
writer.WriteLine(ProjectDeclarationEndFormat);
}
private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project)
{
string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp");
IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " ");
kernel.CurrentWorkingDirectory.Push();
Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
using (ps)
{
ps.WriteLine("# Microsoft Developer Studio Project File - Database Project");
ps.WriteLine("Begin DataProject = \"{0}\"", project.Name);
ps.Indent++;
ps.WriteLine("MSDTVersion = \"80\"");
// TODO: Use the project.Files property
if (ContainsSqlFiles(Path.GetDirectoryName(projectFile)))
WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile));
ps.WriteLine("Begin DBRefFolder = \"Database References\"");
ps.Indent++;
foreach (DatabaseReferenceNode reference in project.References)
{
ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name);
ps.Indent++;
ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString);
ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper());
//ps.WriteLine("Colorizer = 5");
ps.Indent--;
ps.WriteLine("End");
}
ps.Indent--;
ps.WriteLine("End");
ps.Indent--;
ps.WriteLine("End");
ps.Flush();
}
kernel.CurrentWorkingDirectory.Pop();
}
private bool ContainsSqlFiles(string folder)
{
foreach (string file in Directory.GetFiles(folder, "*.sql"))
{
return true; // if the folder contains 1 .sql file, that's good enough
}
foreach (string child in Directory.GetDirectories(folder))
{
if (ContainsSqlFiles(child))
return true; // if 1 child folder contains a .sql file, still good enough
}
return false;
}
private void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder)
{
foreach (string child in Directory.GetDirectories(folder))
{
if (ContainsSqlFiles(child))
{
writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child));
writer.Indent++;
WriteDatabaseFoldersAndFiles(writer, child);
writer.Indent--;
writer.WriteLine("End");
}
}
foreach (string file in Directory.GetFiles(folder, "*.sql"))
{
writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file));
}
}
private void CleanProject(ProjectNode project)
{
kernel.Log.Write("...Cleaning project: {0}", project.Name);
ToolInfo toolInfo = (ToolInfo)tools[project.Language];
string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
string userFile = projectFile + ".user";
Helper.DeleteIfExists(projectFile);
Helper.DeleteIfExists(userFile);
}
private void CleanSolution(SolutionNode solution)
{
kernel.Log.Write("Cleaning {0} solution and project files", this.VersionName, solution.Name);
string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
Helper.DeleteIfExists(slnFile);
Helper.DeleteIfExists(suoFile);
foreach (ProjectNode project in solution.Projects)
{
CleanProject(project);
}
kernel.Log.Write("");
}
#endregion
#region ITarget Members
/// <summary>
/// Writes the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public virtual void Write(Kernel kern)
{
if (kern == null)
{
throw new ArgumentNullException("kern");
}
kernel = kern;
foreach (SolutionNode sol in kernel.Solutions)
{
WriteSolution(sol, true);
}
kernel = null;
}
/// <summary>
/// Cleans the specified kern.
/// </summary>
/// <param name="kern">The kern.</param>
public virtual void Clean(Kernel kern)
{
if (kern == null)
{
throw new ArgumentNullException("kern");
}
kernel = kern;
foreach (SolutionNode sol in kernel.Solutions)
{
CleanSolution(sol);
}
kernel = null;
}
#endregion
}
}

View File

@ -0,0 +1,50 @@
#region BSD License
/*
Copyright (c) 2008-2009 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com), John Anderson (sontek@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
namespace Prebuild.Core.Targets
{
/// <summary>
///
/// </summary>
public enum VSVersion
{
/// <summary>
/// Visual Studio 2002
/// </summary>
VS70,
/// <summary>
/// Visual Studio 2003
/// </summary>
VS71,
/// <summary>
/// Visual Studio 2005
/// </summary>
VS80,
/// <summary>
/// Visual Studio 2008
/// </summary>
VS90
}
}

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-02-13 12:58:03 -0800 (Tue, 13 Feb 2007) $
* $Revision: 205 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: robloach $
* $Date: 2006-09-26 07:30:53 +0900 (Tue, 26 Sep 2006) $
* $Revision: 165 $
*/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.Collections;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2007-02-14 05:58:03 +0900 (Wed, 14 Feb 2007) $
* $Revision: 205 $
*/
#endregion
using System;
using System.Collections;
using System.Diagnostics;
@ -289,6 +280,8 @@ namespace Prebuild.Core.Utilities
return true;
}
static readonly char seperator = Path.DirectorySeparatorChar;
// This little gem was taken from the NeL source, thanks guys!
/// <summary>
/// Makes a relative path
@ -298,8 +291,8 @@ namespace Prebuild.Core.Utilities
/// <returns>Path that will get from startPath to endPath</returns>
public static string MakePathRelativeTo(string startPath, string endPath)
{
string tmp = NormalizePath(startPath, '/');
string src = NormalizePath(endPath, '/');
string tmp = NormalizePath(startPath, seperator);
string src = NormalizePath(endPath, seperator);
string prefix = "";
while(true)
@ -312,14 +305,14 @@ namespace Prebuild.Core.Utilities
{
return "./";
}
if ((src.Length > tmp.Length) && src[tmp.Length-1] != '/' && src[tmp.Length-1] != '\\')
if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator)
{
}
else
{
ret = prefix + endPath.Substring(size, endPath.Length - size);
ret = ret.Trim();
if(ret[0] == '/' || ret[0] == '\\')
if(ret[0] == seperator)
{
ret = "." + ret;
}
@ -334,8 +327,8 @@ namespace Prebuild.Core.Utilities
break;
}
int lastPos = tmp.LastIndexOf('/', tmp.Length - 2);
int prevPos = tmp.IndexOf('/');
int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2);
int prevPos = tmp.IndexOf(seperator);
if((lastPos == prevPos) || (lastPos == -1))
{
@ -343,7 +336,7 @@ namespace Prebuild.Core.Utilities
}
tmp = tmp.Substring(0, lastPos + 1);
prefix += "../";
prefix += ".." + seperator.ToString();
}
return endPath;

View File

@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: jendave $
* $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
* $Revision: 71 $
*/
#endregion
using System;
using System.IO;

View File

@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
/*
* $Source$
* $Author: jendave $
* $Date: 2006-09-27 06:43:35 +0900 (Wed, 27 Sep 2006) $
* $Date: 2006-09-26 23:43:35 +0200 (ti, 26 sep 2006) $
* $Revision: 168 $
*/
#endregion

View File

@ -38,15 +38,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#endregion
#region CVS Information
/*
* $Source$
* $Author: cjcollier $
* $Date: 2008-02-08 01:31:29 +0900 (Fri, 08 Feb 2008) $
* $Revision: 256 $
*/
#endregion
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
@ -79,7 +70,7 @@ using System.Resources;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
[assembly: AssemblyVersion("2.0.3.*")]
[assembly: AssemblyVersion("2.0.4.*")]
//
// Version information for an assembly consists of the following four values:

View File

@ -2,39 +2,40 @@
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<xs:annotation>
<xs:documentation>
Copyright (c) 2004-2007
Matthew Holmes (calefaction at houston . rr . com),
Dan Moorehead (dan05a at gmail . com),
David Hudson (jendave at yahoo dot com),
C.J. Adams-Collier (cjac at colliertech dot com)
Copyright (c) 2004-2007
Matthew Holmes (calefaction at houston . rr . com),
Dan Moorehead (dan05a at gmail . com),
David Hudson (jendave at yahoo dot com),
C.J. Adams-Collier (cjac at colliertech 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,
2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools.
.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,
2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools.
BSD License:
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
BSD License:
* 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.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
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.
</xs:documentation>
* 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.
</xs:documentation>
</xs:annotation>
<xs:element name="Prebuild">
<xs:complexType>
<xs:sequence>
@ -45,14 +46,19 @@
<xs:attribute name="checkOsVars" />
</xs:complexType>
</xs:element>
<xs:element name="Process" type="xs:string" />
<xs:element name="Solution">
<xs:complexType>
<xs:sequence>
<xs:element ref="Options" minOccurs="0" />
<xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
<xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="Options" minOccurs="0" />
<xs:element ref="Files" minOccurs="0" />
<xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
<xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="activeConfig" type="xs:string" default="Debug" />
@ -60,12 +66,49 @@
<xs:attribute name="version" type="xs:string" default="1.0.0" />
</xs:complexType>
</xs:element>
<xs:element name="EmbeddedSolution">
<xs:complexType>
<xs:sequence>
<xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="Files" minOccurs="0" />
<xs:element ref="Project" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="DatabaseProject" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="EmbeddedSolution" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="activeConfig" type="xs:string" default="Debug" />
<xs:attribute name="path" type="xs:string" default="" />
<xs:attribute name="version" type="xs:string" default="1.0.0" />
</xs:complexType>
</xs:element>
<xs:element name="DatabaseProject">
<xs:complexType>
<xs:sequence>
<xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="DatabaseReference" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="path" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="DatabaseReference">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="providerId" type="xs:string" />
<xs:attribute name="providerName" type="xs:string" />
<xs:attribute name="connectionString" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="Project">
<xs:complexType>
<xs:sequence>
<xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
<xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
@ -84,6 +127,7 @@
<xs:attribute name="icon" type="xs:string" default="" />
<xs:attribute name="configFile" type="xs:string" default="" />
<xs:attribute name="version" type="xs:string" default="1.0.0" />
<xs:attribute name="guid" type="xs:string"/>
<xs:attribute name="language" default="C#">
<xs:simpleType>
<xs:restriction base="xs:string">
@ -98,6 +142,7 @@
<xs:enumeration value="Exe" />
<xs:enumeration value="WinExe" />
<xs:enumeration value="Library" />
<xs:enumeration value="Web" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@ -109,12 +154,23 @@
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="frameworkVersion" default="v2_0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="v2_0" />
<xs:enumeration value="v3_0" />
<xs:enumeration value="v3_5" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="startupObject" type="xs:string" default="" />
<xs:attribute name="rootNamespace" type="xs:string" />
<xs:attribute name="debugStartParameters" type="xs:string" />
<xs:attribute name="assemblyName" type="xs:string" />
<xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false" />
</xs:complexType>
</xs:element>
<xs:element name="Configuration">
<xs:complexType>
<xs:sequence>
@ -195,6 +251,7 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Code" />
<xs:enumeration value="CodeBehind" />
<xs:enumeration value="Component" />
<xs:enumeration value="Form" />
<xs:enumeration value="Settings" />
@ -242,6 +299,7 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Code" />
<xs:enumeration value="CodeBehind" />
<xs:enumeration value="Component" />
<xs:enumeration value="Designer" />
<xs:enumeration value="Form" />

24
Prebuild/tests/Makefile Normal file
View File

@ -0,0 +1,24 @@
#
# Executable
#
# Executables
PREBUILD = mono ../src/bin/Release/prebuild.exe /target makefile
# Files
PREBUILDS = $(wildcard *.prebuild)
RESULTS = $(PREBUILDS:prebuild=results)
TESTS = $(PREBUILDS:prebuild=test)
all: $(TESTS)
clean:
rm -f *~ *.log
rm -f $(RESULTS)
%.test: %.prebuild
$(PREBUILD) /log $*.log /file $*.prebuild /ppi $*.results >& /dev/null
if ! cmp $*.expected $*.results; then \
echo $*.prebuild failed; \
false; \
fi

View File

@ -0,0 +1,5 @@
There are some tests that are run via a Makfile in this
directory. They haven't been included in any form of unit tests, but
they are there to help test the functionality in some what. Simply
build prebuild (so there is a src/bin/Release/prebuild.exe) and type
`make` in this directory. Everything should pass without errors.

View File

@ -0,0 +1,46 @@
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Solution name="include-001" version="1.2.3">
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<CompilerDefines>TRACE</CompilerDefines>
<OutputPath>bin/Release</OutputPath>
<OptimizeCode>true</OptimizeCode>
<DebugInformation>false</DebugInformation>
</Options>
</Configuration>
<Project name="Prebuild" path="src" language="C#" assemblyName="include-001" type="Exe" version="1.2.3" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
<KeyFile>Prebuild.snk</KeyFile>
<SuppressWarnings>1595</SuppressWarnings>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<CompilerDefines>TRACE</CompilerDefines>
<OutputPath>bin/Release</OutputPath>
<OptimizeCode>true</OptimizeCode>
<DebugInformation>false</DebugInformation>
<KeyFile>Prebuild.snk</KeyFile>
<SuppressWarnings>1595</SuppressWarnings>
</Options>
</Configuration>
<Reference name="System" />
<Files>
<Match pattern="*.cs" recurse="true" />
</Files>
</Project>
</Solution>
</Prebuild>

View File

@ -0,0 +1,33 @@
<Project name="Prebuild"
path="src"
language="C#"
assemblyName="include-001"
type="Exe"
version="1.2.3"
xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
>
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
<KeyFile>Prebuild.snk</KeyFile>
<SuppressWarnings>1595</SuppressWarnings>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<CompilerDefines>TRACE</CompilerDefines>
<OutputPath>bin/Release</OutputPath>
<OptimizeCode>true</OptimizeCode>
<DebugInformation>false</DebugInformation>
<KeyFile>Prebuild.snk</KeyFile>
<SuppressWarnings>1595</SuppressWarnings>
</Options>
</Configuration>
<Reference name="System" />
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Solution name="include-001" version="1.2.3">
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<CompilerDefines>TRACE</CompilerDefines>
<OutputPath>bin/Release</OutputPath>
<OptimizeCode>true</OptimizeCode>
<DebugInformation>false</DebugInformation>
</Options>
</Configuration>
<?include file="include-001.include"?>
</Solution>
</Prebuild>

View File

@ -0,0 +1,8 @@
<Configuration name="Debug" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
</Options>
</Configuration>

View File

@ -0,0 +1,26 @@
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Solution name="include-002" version="1.2.3">
<Configuration name="Debug" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
</Options>
</Configuration>
<Project name="Prebuild" path="src" language="C#" assemblyName="include-001" type="Exe" version="1.2.3" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<Configuration name="Debug" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
<OptimizeCode>false</OptimizeCode>
<OutputPath>bin/Debug</OutputPath>
<DebugInformation>true</DebugInformation>
</Options>
</Configuration>
<Reference name="System" />
<Files>
<Match pattern="*.cs" recurse="true" />
</Files>
</Project>
</Solution>
</Prebuild>

View File

@ -0,0 +1,14 @@
<Project name="Prebuild"
path="src"
language="C#"
assemblyName="include-001"
type="Exe"
version="1.2.3"
xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
>
<?include file="include-002-2.include"?>
<Reference name="System" />
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Solution name="include-002" version="1.2.3">
<?include file="include-002-2.include"?>
<?include file="include-002.include"?>
</Solution>
</Prebuild>

Binary file not shown.

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
<Prebuild version="1.7">
<Solution name="OpenSim" activeConfig="Debug" path="./" version="0.5.0-$Rev$">
<Configuration name="Debug">
<Options>