Add Project/Configuration/Option/OutDir since VS and Mono seem to have

different destination directory rules.
Pass all set Option parameters through to the csproj.
This commit is contained in:
Robert Adams
2022-02-25 15:02:39 -08:00
parent f069d47370
commit ad220821c5
3 changed files with 29 additions and 7 deletions

View File

@@ -297,6 +297,24 @@ namespace Prebuild.Core.Nodes
}
}
[OptionNode("OutDir")]
private string m_OutDir = "bin/";
/// <summary>
///
/// </summary>
public string OutDir
{
get
{
return m_OutDir;
}
set
{
m_OutDir = value;
}
}
[OptionNode("OutputPath")]
private string m_OutputPath = "bin/";
@@ -673,6 +691,14 @@ namespace Prebuild.Core.Nodes
return m_FieldsDefined.Contains("m_" + name);
}
// Return the names of all the fields that have had a value set
public IEnumerable<string> AllDefined()
{
foreach (string name in m_FieldsDefined) {
yield return name.Substring(2);
}
}
/// <summary>
/// Copies to.
/// </summary>

View File

@@ -592,14 +592,10 @@ namespace Prebuild.Core.Targets
if (conf.Name == "unknown")
{
ps.WriteLine(" <PropertyGroup>");
string[] optionNames = new string[] { "OutputPath", "OutputType", "RootNamespace" };
foreach (var opt in optionNames)
foreach (string opt in conf.Options.AllDefined())
{
if (conf.Options.IsDefined(opt))
{
ps.WriteLine(" <{0}>{1}</{0}>", opt,
Helper.EndPath(Helper.NormalizePath(conf.Options[opt].ToString())));
}
ps.WriteLine(" <{0}>{1}</{0}>", opt,
Helper.EndPath(Helper.NormalizePath(conf.Options[opt].ToString())));
}
ps.WriteLine(" </PropertyGroup>");
ps.WriteLine();

Binary file not shown.