Adds app icon support to dotnet
This commit is contained in:
parent
99ee951d98
commit
e40e0908ba
3 changed files with 45 additions and 5 deletions
20
source/Prebuild/Core/Nodes/NullableNode.cs
Normal file
20
source/Prebuild/Core/Nodes/NullableNode.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -247,8 +247,9 @@ public class ProjectNode : DataNode, IComparable
|
||||||
else if (dataNode is AuthorNode)
|
else if (dataNode is AuthorNode)
|
||||||
Authors.Add((AuthorNode)dataNode);
|
Authors.Add((AuthorNode)dataNode);
|
||||||
else if (dataNode is FilesNode) Files = (FilesNode)dataNode;
|
else if (dataNode is FilesNode) Files = (FilesNode)dataNode;
|
||||||
else if(dataNode is TextGenNode) TextGenNodes.Add((TextGenNode)dataNode);
|
else if (dataNode is TextGenNode) TextGenNodes.Add((TextGenNode)dataNode);
|
||||||
else if(dataNode is MauiNode obj) MauiSettings = obj;
|
else if (dataNode is MauiNode obj) MauiSettings = obj;
|
||||||
|
else if (dataNode is NullableNode) Nullable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -342,6 +343,18 @@ public class ProjectNode : DataNode, IComparable
|
||||||
/// <value>The filter groups.</value>
|
/// <value>The filter groups.</value>
|
||||||
public string FilterGroups { get; private set; } = "";
|
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>
|
/// <summary>
|
||||||
/// Gets the project's version
|
/// Gets the project's version
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -714,8 +714,7 @@ public abstract class VSGenericTarget : ITarget
|
||||||
ps.WriteLine();
|
ps.WriteLine();
|
||||||
|
|
||||||
ps.WriteLine(" <PropertyGroup>");
|
ps.WriteLine(" <PropertyGroup>");
|
||||||
ps.WriteLine(" <TargetFramework>{0}</TargetFramework>",
|
ps.WriteLine($" <TargetFramework>{project.FrameworkVersion.ToString().Replace("_", ".")}</TargetFramework>");
|
||||||
project.FrameworkVersion.ToString().Replace("_", "."));
|
|
||||||
ps.WriteLine(" <PreserveCompilationContext>false</PreserveCompilationContext>");
|
ps.WriteLine(" <PreserveCompilationContext>false</PreserveCompilationContext>");
|
||||||
ps.WriteLine(" <OutputType>{0}</OutputType>",
|
ps.WriteLine(" <OutputType>{0}</OutputType>",
|
||||||
project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
|
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)
|
if (solution.Options.UseRuntimeIdentifier)
|
||||||
{
|
{
|
||||||
var RID = "unknown";
|
var RID = "unknown";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue