Adds a new flag to allow the transformer source file to be in the solution directory

This commit is contained in:
Zontreck 2023-08-10 23:24:10 -07:00
parent fdbdf0ce62
commit ea7bb0d8c9
4 changed files with 15 additions and 28 deletions

2
.gitignore vendored
View file

@ -404,5 +404,5 @@ bootstrap/*.exe
bootstrap/**
bootstrap
source/**/*.csproj
*.sln

Binary file not shown.

View file

@ -14,10 +14,9 @@ namespace Prebuild.Core.Nodes
{
#region Values
private string m_Name;
private string m_Generator;
private bool m_AutoGen = true;
private string m_OutputName;
private List<string> m_Libs = new();
#endregion
@ -35,6 +34,8 @@ namespace Prebuild.Core.Nodes
m_Libs.Add(((ReferenceNode)data).Name);
}
}
SourceInSolution = Helper.ParseBoolean(node, "sourceInSolution", false);
}
#endregion
@ -48,30 +49,6 @@ namespace Prebuild.Core.Nodes
}
}
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
@ -88,6 +65,16 @@ namespace Prebuild.Core.Nodes
}
}
public bool SourceInSolution { get; private set; } = false;
public string SourceDirectory
{
get
{
return SourceInSolution ? "SolutionDir" : "ProjectDir";
}
}
#endregion
}
}

View file

@ -696,7 +696,7 @@ public abstract class VSGenericTarget : ITarget
string outputFile = Path.Combine(project.Path, node.OutputName);
ps.WriteLine(" <Target Name=\"Prebuild\" BeforeTargets=\"PreBuildEvent\">");
ps.WriteLine($" <Exec Command='dotnet \"$(SolutionDir){pathText}\" \"$(ProjectDir){node.Name}\" \"$(ProjectDir){node.OutputName}\" \"{node.Libraries}\"' />");
ps.WriteLine($" <Exec Command='dotnet \"$(SolutionDir){pathText}\" \"$({node.SourceDirectory}){node.Name}\" \"$(ProjectDir){node.OutputName}\" \"{node.Libraries}\"' />");
ps.WriteLine($" </Target>");
}
}