Adds app icon support to dotnet

This commit is contained in:
Zontreck 2023-08-22 07:23:11 -07:00
parent 99ee951d98
commit e40e0908ba
3 changed files with 45 additions and 5 deletions

View file

@ -0,0 +1,20 @@
using Prebuild.Core.Attributes;
using Prebuild.Core.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Prebuild.Core.Nodes
{
[DataNode("Nullable")]
public class NullableNode : DataNode
{
public override void Parse(XmlNode node)
{
base.Parse(node);
}
}
}

View file

@ -247,8 +247,9 @@ public class ProjectNode : DataNode, IComparable
else if (dataNode is AuthorNode)
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;
else if (dataNode is TextGenNode) TextGenNodes.Add((TextGenNode)dataNode);
else if (dataNode is MauiNode obj) MauiSettings = obj;
else if (dataNode is NullableNode) Nullable = true;
}
}
finally
@ -342,6 +343,18 @@ public class ProjectNode : DataNode, IComparable
/// <value>The filter groups.</value>
public string FilterGroups { get; private set; } = "";
/// <summary>
/// Indicates project nullable attribute
/// </summary>
public bool Nullable { get; private set; } = false;
public string NullableStr
{
get
{
return Nullable ? "enable" : "disable";
}
}
/// <summary>
/// Gets the project's version
/// </summary>

View file

@ -714,8 +714,7 @@ public abstract class VSGenericTarget : ITarget
ps.WriteLine();
ps.WriteLine(" <PropertyGroup>");
ps.WriteLine(" <TargetFramework>{0}</TargetFramework>",
project.FrameworkVersion.ToString().Replace("_", "."));
ps.WriteLine($" <TargetFramework>{project.FrameworkVersion.ToString().Replace("_", ".")}</TargetFramework>");
ps.WriteLine(" <PreserveCompilationContext>false</PreserveCompilationContext>");
ps.WriteLine(" <OutputType>{0}</OutputType>",
project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
@ -744,7 +743,15 @@ public abstract class VSGenericTarget : ITarget
}
}
ps.WriteLine($"<SelfContained>{solution.Options.SelfContained}</SelfContained>");
if(project.Nullable)
ps.WriteLine($" <Nullable>{project.NullableStr}</Nullable>");
if(project.AppIcon != "")
{
ps.WriteLine($" <ApplicationIcon>{project.AppIcon}</ApplicationIcon>");
}
ps.WriteLine($" <SelfContained>{solution.Options.SelfContained}</SelfContained>");
if (solution.Options.UseRuntimeIdentifier)
{
var RID = "unknown";