refactor: move global classes def into package
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(NuGetPackages)" DestinationFolder="/NuGetFeed"/>
|
||||
</Target>
|
||||
<Target Name="RestoreNoCache" BeforeTargets="Restore">
|
||||
<Target Name="RestoreNoCache" BeforeTargets="Build">
|
||||
<Message Text="Restoring packages with no chache" Importance="high"/>
|
||||
<Exec Command="dotnet restore --no-cache"/>
|
||||
</Target>
|
||||
|
||||
@@ -15,9 +15,6 @@ public class GenerateProxyNodesTask : Task
|
||||
{
|
||||
[Required]
|
||||
public string SourceDirectory { get; set; }
|
||||
|
||||
[Required]
|
||||
public string OutputDirectory { get; set; }
|
||||
|
||||
[Required]
|
||||
public string TemplateDirectory { get; set; }
|
||||
@@ -29,9 +26,6 @@ public class GenerateProxyNodesTask : Task
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Directory.Exists(OutputDirectory))
|
||||
Directory.Delete(OutputDirectory, true);
|
||||
Directory.CreateDirectory(OutputDirectory);
|
||||
|
||||
string[] csFiles = Directory.GetFiles(SourceDirectory, "*.cs", SearchOption.AllDirectories);
|
||||
foreach (string csFile in csFiles)
|
||||
@@ -47,20 +41,6 @@ public class GenerateProxyNodesTask : Task
|
||||
foreach (ClassDeclarationSyntax cls in classes)
|
||||
{
|
||||
string className = cls.Identifier.Text;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb
|
||||
.AppendLine("using Godot;")
|
||||
.AppendLine("namespace GlobalClasses;")
|
||||
.AppendLine("[GlobalClass]")
|
||||
.AppendLine("[Tool]")
|
||||
.AppendLine($"public partial class {className} : {GetDisplayName(cls)}")
|
||||
.AppendLine("{")
|
||||
.AppendLine("}");
|
||||
|
||||
string outputFile = Path.Combine(OutputDirectory, $"{className}.cs");
|
||||
File.WriteAllText(outputFile, sb.ToString());
|
||||
Log.LogMessage(MessageImportance.High, $"Generated proxy file: {outputFile}");
|
||||
|
||||
StringBuilder sbx = new StringBuilder();
|
||||
sbx
|
||||
|
||||
Reference in New Issue
Block a user