add: Script Templates for global classes
This commit is contained in:
@@ -18,6 +18,9 @@ public class GenerateProxyNodesTask : Task
|
||||
|
||||
[Required]
|
||||
public string OutputDirectory { get; set; }
|
||||
|
||||
[Required]
|
||||
public string TemplateDirectory { get; set; }
|
||||
|
||||
[Required]
|
||||
public string AttributeName { get; set; }
|
||||
@@ -58,6 +61,19 @@ public class GenerateProxyNodesTask : Task
|
||||
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
|
||||
.AppendLine("// meta-default: true")
|
||||
.AppendLine("using _BINDINGS_NAMESPACE_;")
|
||||
.AppendLine("using System;")
|
||||
.AppendLine("public partial class _CLASS_ : GlobalClasses._BASE_")
|
||||
.AppendLine("{")
|
||||
.AppendLine("}");
|
||||
if(!Directory.Exists($"{TemplateDirectory}/{className}"))
|
||||
Directory.CreateDirectory($"{TemplateDirectory}/{className}");
|
||||
string templateFile = $"{TemplateDirectory}/{className}/Polonium_{className}.cs";
|
||||
File.WriteAllText(templateFile, sbx.ToString());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user