add parameters frameworkVersion and forceFrameworkVersion to the prebuild solution. First sets the version if not defined on projects, alternatively the second does override those. The comandline can still override all. Use command line override to compile for 4.8 so remove 4.4 xml and simplify main xml, still defaulting to 4.6
This commit is contained in:
@@ -77,6 +77,7 @@ namespace Prebuild.Core.Nodes
|
||||
/// </summary>
|
||||
public enum FrameworkVersion: byte
|
||||
{
|
||||
none = 0,
|
||||
/// <summary>
|
||||
/// .NET 2.0
|
||||
/// </summary>
|
||||
@@ -140,7 +141,7 @@ 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 FrameworkVersion m_Framework = FrameworkVersion.none;
|
||||
private bool m_useFramework = true;
|
||||
private string m_StartupObject = "";
|
||||
private string m_RootNamespace;
|
||||
@@ -529,6 +530,18 @@ namespace Prebuild.Core.Nodes
|
||||
{
|
||||
m_Configurations[conf.NameAndPlatform] = (ConfigurationNode)conf.Clone();
|
||||
}
|
||||
if(m_useFramework)
|
||||
{
|
||||
if(parent.ForceFramework != FrameworkVersion.none)
|
||||
{
|
||||
m_Framework = parent.ForceFramework;
|
||||
m_useFramework = false;
|
||||
}
|
||||
else if(m_Framework == FrameworkVersion.none)
|
||||
{
|
||||
m_Framework = parent.DefaultFramework != FrameworkVersion.none ? parent.DefaultFramework : FrameworkVersion.v2_0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace Prebuild.Core.Nodes
|
||||
private string m_FullPath = "";
|
||||
private string m_ActiveConfig;
|
||||
private string m_Version = "1.0.0";
|
||||
public FrameworkVersion DefaultFramework = FrameworkVersion.none;
|
||||
public FrameworkVersion ForceFramework = FrameworkVersion.none;
|
||||
|
||||
private OptionsNode m_Options;
|
||||
private FilesNode m_Files;
|
||||
@@ -302,6 +304,22 @@ namespace Prebuild.Core.Nodes
|
||||
m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
|
||||
m_Path = Helper.AttributeValue(node, "path", m_Path);
|
||||
m_Version = Helper.AttributeValue(node, "version", m_Version);
|
||||
string tmp = Helper.AttributeValue(node, "forceFrameworkVersion", "");
|
||||
if (tmp.Length > 0)
|
||||
{
|
||||
if (!FrameworkVersion.TryParse(tmp, true, out ForceFramework))
|
||||
ForceFramework = FrameworkVersion.none;
|
||||
}
|
||||
|
||||
if(ForceFramework == FrameworkVersion.none)
|
||||
{
|
||||
tmp = Helper.AttributeValue(node, "frameworkVersion", "");
|
||||
if (tmp.Length > 0)
|
||||
{
|
||||
if (!FrameworkVersion.TryParse(tmp, true, out DefaultFramework))
|
||||
DefaultFramework = FrameworkVersion.none;
|
||||
}
|
||||
}
|
||||
|
||||
m_FullPath = m_Path;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user