Add ability to use other text gen tools
This commit is contained in:
parent
19d2cba440
commit
7e3f7f7998
3 changed files with 24 additions and 3 deletions
Binary file not shown.
|
@ -16,6 +16,7 @@ namespace Prebuild.Core.Nodes
|
|||
private string m_Name;
|
||||
private string m_OutputName;
|
||||
private List<string> m_Libs = new();
|
||||
private string m_Tool;
|
||||
|
||||
|
||||
#endregion
|
||||
|
@ -25,6 +26,7 @@ namespace Prebuild.Core.Nodes
|
|||
{
|
||||
m_Name = Helper.AttributeValue(node, "name", "");
|
||||
m_OutputName = Helper.AttributeValue(node, "output", "");
|
||||
m_Tool = Helper.AttributeValue(node, "tool", "SnapWrap");
|
||||
|
||||
foreach (XmlNode childNode in node.ChildNodes)
|
||||
{
|
||||
|
@ -75,6 +77,14 @@ namespace Prebuild.Core.Nodes
|
|||
}
|
||||
}
|
||||
|
||||
public string Tool
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Tool;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -687,17 +687,28 @@ public abstract class VSGenericTarget : ITarget
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void WriteTextGeneratorNodes(ProjectNode project, StreamWriter ps)
|
||||
{
|
||||
int count = 0;
|
||||
foreach(TextGenNode node in project.TextGenNodes)
|
||||
{
|
||||
string pathText = Path.Combine("Prebuild", "bootstrap", "SnapWrap.dll");
|
||||
string pathText = Path.Combine("Prebuild", "bootstrap", node.Tool);
|
||||
pathText = Path.ChangeExtension(pathText, "dll");
|
||||
|
||||
string filePath = Path.Combine(project.Path, node.Name);
|
||||
string outputFile = Path.Combine(project.Path, node.OutputName);
|
||||
|
||||
ps.WriteLine(" <Target Name=\"Prebuild\" BeforeTargets=\"PreBuildEvent\">");
|
||||
ps.WriteLine(" <Target Name=\"Prebuild-"+count+"\" BeforeTargets=\"PreBuildEvent\">");
|
||||
|
||||
if (node.Tool == "SnapWrap")
|
||||
ps.WriteLine($" <Exec Command='dotnet \"$(SolutionDir){pathText}\" \"$({node.SourceDirectory}){node.Name}\" \"$(ProjectDir){node.OutputName}\" \"{node.Libraries}\"' />");
|
||||
else
|
||||
ps.WriteLine($" <Exec Command='dotnet \"$(SolutionDir){pathText}\" \"$({node.SourceDirectory}){node.Name}\" \"$(ProjectDir){node.OutputName}\" />");
|
||||
|
||||
ps.WriteLine($" </Target>");
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue