diff --git a/Prebuild.sln b/Prebuild.sln deleted file mode 100644 index 55f02ff..0000000 --- a/Prebuild.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 22 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prebuild", "..\Prebuild\src\Prebuild.csproj", "{BCE0B56D-0000-0000-0000-000000000000}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{198FE683-AA28-459F-9818-EF8F29428DFC}" - ProjectSection(SolutionItems) = preProject - prebuild.xml = prebuild.xml - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BCE0B56D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BCE0B56D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BCE0B56D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCE0B56D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/bootstrap/prebuild.dll b/bootstrap/prebuild.dll index 6939f20..c8f18f6 100644 Binary files a/bootstrap/prebuild.dll and b/bootstrap/prebuild.dll differ diff --git a/prebuild.xml b/prebuild.xml index 7ec22b0..f4a5f0b 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1,6 +1,6 @@ - + true @@ -33,7 +33,7 @@ type="Exe" rootNamespace="Prebuild" startupObject="Prebuild.Prebuild" - version="2.0.8" + version="2.0.9" > Matthew Holmes (matthew@wildfiregames.com) Dan Moorehead (dan05a@gmail.com) diff --git a/src/Core/Nodes/ProjectNode.cs b/src/Core/Nodes/ProjectNode.cs index b070327..bc99504 100644 --- a/src/Core/Nodes/ProjectNode.cs +++ b/src/Core/Nodes/ProjectNode.cs @@ -247,6 +247,7 @@ public class ProjectNode : DataNode, IComparable else if (dataNode is AuthorNode) Authors.Add((AuthorNode)dataNode); else if (dataNode is FilesNode) Files = (FilesNode)dataNode; + else if(dataNode is TextGenNode) TextGenNodes.Add((TextGenNode)dataNode); } } finally @@ -428,6 +429,12 @@ public class ProjectNode : DataNode, IComparable } } + /// + /// Gets the text generator nodes + /// + public List TextGenNodes { get; private set; } = new(); + + /// /// Gets the configurations table. /// diff --git a/src/Core/Nodes/TextGenNode.cs b/src/Core/Nodes/TextGenNode.cs new file mode 100644 index 0000000..d32090b --- /dev/null +++ b/src/Core/Nodes/TextGenNode.cs @@ -0,0 +1,76 @@ +using Prebuild.Core.Attributes; +using Prebuild.Core.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; + +namespace Prebuild.Core.Nodes +{ + [DataNode("TextGen")] + public class TextGenNode : DataNode + { + #region Values + private string m_Name; + private string m_Generator; + private bool m_AutoGen = true; + private string m_OutputName; + + #endregion + + #region Methods + public override void Parse(XmlNode node) + { + m_Name = Helper.AttributeValue(node, "name", ""); + m_Generator = Helper.AttributeValue(node, "generator", "TextTemplatingFileGenerator"); + m_AutoGen = Helper.ParseBoolean(node, "autogen", true); + m_OutputName = Helper.AttributeValue(node, "output", ""); + } + #endregion + + #region Fields + public string Name + { + get + { + return m_Name; + } + } + + public string Generator + { + get + { + return m_Generator; + } + } + + public bool AutoGen + { + get + { + return m_AutoGen; + } + } + + public string AutoGenerate + { + get + { + return AutoGen ? "True" : "False"; + } + } + + public string OutputName + { + get + { + return m_OutputName; + } + } + + #endregion + } +} diff --git a/src/Core/Targets/VSGenericTarget.cs b/src/Core/Targets/VSGenericTarget.cs index 10067e2..7b4b798 100644 --- a/src/Core/Targets/VSGenericTarget.cs +++ b/src/Core/Targets/VSGenericTarget.cs @@ -687,6 +687,23 @@ public abstract class VSGenericTarget : ITarget } } + private void WriteTextGeneratorNodes(ProjectNode project, StreamWriter ps) + { + foreach(TextGenNode node in project.TextGenNodes) + { + ps.WriteLine(" "); + ps.WriteLine($" "); + ps.WriteLine($" {node.Generator}"); + ps.WriteLine($" "); + ps.WriteLine($" "); + ps.WriteLine($" True"); + ps.WriteLine($" {node.AutoGenerate}"); + ps.WriteLine($" {node.Name}"); + ps.WriteLine($" "); + ps.WriteLine($" "); + } + } + private void WriteProjectDotNet(SolutionNode solution, ProjectNode project, StreamWriter ps) { #region Project File @@ -838,6 +855,8 @@ public abstract class VSGenericTarget : ITarget // Output the ItemGroup for project.References WriteProjectReferencesDotNet(solution, project, ps); + WriteTextGeneratorNodes(project, ps); + if (project.Files.Count > 0) { var list = new List(); @@ -1044,8 +1063,9 @@ public abstract class VSGenericTarget : ITarget ps.WriteLine(""); - #endregion } + + #endregion } private void WriteProjectReferencesDotNet(SolutionNode solution, ProjectNode project, StreamWriter ps) diff --git a/src/Prebuild.csproj b/src/Prebuild.csproj deleted file mode 100644 index efcec55..0000000 --- a/src/Prebuild.csproj +++ /dev/null @@ -1,259 +0,0 @@ - - - - net7.0 - false - Exe - false - disable - prebuild - true - false - false - false - True -False - - - - False - 285212672 - - - DEBUG;TRACE - - True - 4096 - False - false - False - True - True - bin\Debug\ - False - False - False - 4 - False - 1595 - AnyCPU - - - False - 285212672 - - - TRACE - - False - 4096 - True - false - False - True - True - bin\Release\ - False - False - False - 4 - False - 1595 - AnyCPU - - - - System.EnterpriseServices - False - - - - - - - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index 7c4c576..2e73f83 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -60,7 +60,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration(".NET CLR")] [assembly: AssemblyCompany("The Prebuild Project")] [assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Copyright 2004-2015 " + +[assembly: AssemblyCopyright("Copyright 2004-2023 " + "Tara Piccari (Aria's Creations)" + "Matthew Holmes, " + "Dan Moorehead, " + @@ -73,7 +73,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguageAttribute("en-US")] -[assembly: AssemblyVersion("2.0.8.0")] +[assembly: AssemblyVersion("2.0.9.0")] // // Version information for an assembly consists of the following four values: