Update prebuild bootstrap, and add MAUI initial support

This commit is contained in:
Zontreck 2023-08-13 23:13:53 -07:00
parent f7f2344276
commit 99ee951d98
6 changed files with 81 additions and 0 deletions

View file

@ -1,6 +1,7 @@
2023, Tara Piccari
* Prebuild updated fully to net7
* Added VS Solution flag to include dep files
* Added support for Multi-platform App UI
2017, August Ubit Umarov
* add Freak Tech patch for prefer32bit default to false

Binary file not shown.

View file

@ -0,0 +1,40 @@
using Prebuild.Core.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Prebuild.Core.Nodes
{
[DataNode("Maui")]
public class MauiNode : DataNode
{
public MauiTitle applicationTitle { get; private set; } = null;
public override void Parse(XmlNode node)
{
foreach (XmlNode child in node.ChildNodes)
{
var dataNode = Kernel.Instance.ParseNode(child, this);
if (dataNode != null)
{
if (dataNode is MauiTitle title) applicationTitle = title;
}
}
}
public override string ToString()
{
string ret = "<UseMaui>true</UseMaui>\n";
if(applicationTitle != null)
{
ret += applicationTitle.ToString() + "\n";
}
return ret;
}
}
}

View file

@ -0,0 +1,25 @@
using Prebuild.Core.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Prebuild.Core.Nodes
{
[DataNode("Title")]
public class MauiTitle : DataNode
{
public string value { get; private set; } = string.Empty;
public override void Parse(XmlNode node)
{
value = node.InnerText;
}
public override string ToString()
{
return $"<ApplicationTitle>{value}</ApplicationTitle>";
}
}
}

View file

@ -248,6 +248,7 @@ public class ProjectNode : DataNode, IComparable
Authors.Add((AuthorNode)dataNode);
else if (dataNode is FilesNode) Files = (FilesNode)dataNode;
else if(dataNode is TextGenNode) TextGenNodes.Add((TextGenNode)dataNode);
else if(dataNode is MauiNode obj) MauiSettings = obj;
}
}
finally
@ -300,6 +301,12 @@ public class ProjectNode : DataNode, IComparable
/// <value>The name.</value>
public string Name { get; private set; } = "unknown";
/// <summary>
/// Contains settings for DotNet Maui (7.0+)
/// Default is null, which indicates not to include any Maui content in the project file.
/// </summary>
public MauiNode MauiSettings { get; private set; } = null;
/// <summary>
/// The version of the .NET Framework to compile under
/// </summary>

View file

@ -736,6 +736,14 @@ public abstract class VSGenericTarget : ITarget
ps.WriteLine(
$" <CopyLocalLockFileAssemblies>{project.CopyLocalLockFileAssemblies}</CopyLocalLockFileAssemblies>");
if(project.FrameworkVersion >= FrameworkVersion.net7_0)
{
if(project.MauiSettings != null)
{
ps.WriteLine(project.MauiSettings);
}
}
ps.WriteLine($"<SelfContained>{solution.Options.SelfContained}</SelfContained>");
if (solution.Options.UseRuntimeIdentifier)
{