Fix mixed newline characters in generated bindings
This commit is contained in:
@@ -1487,7 +1487,7 @@ namespace Flax.Build.Bindings
|
|||||||
}
|
}
|
||||||
|
|
||||||
contents.AppendLine();
|
contents.AppendLine();
|
||||||
contents.AppendLine(string.Join("\n" + indent, (indent + $$"""
|
contents.AppendLine(string.Join(Environment.NewLine + indent, (indent + $$"""
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marshaller for type <see cref="{{classInfo.Name}}"/>.
|
/// Marshaller for type <see cref="{{classInfo.Name}}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1546,7 +1546,7 @@ namespace Flax.Build.Bindings
|
|||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
#pragma warning restore 1591
|
#pragma warning restore 1591
|
||||||
}
|
}
|
||||||
""").Split(new char[] { '\n' })));
|
""").Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Namespace end
|
// Namespace end
|
||||||
@@ -1824,7 +1824,7 @@ namespace Flax.Build.Bindings
|
|||||||
toManagedContent.Append("return managed;");
|
toManagedContent.Append("return managed;");
|
||||||
}
|
}
|
||||||
|
|
||||||
contents.AppendLine(string.Join("\n" + indent, (indent + $$"""
|
contents.AppendLine(string.Join(Environment.NewLine + indent, (indent + $$"""
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marshaller for type <see cref="{{structureInfo.Name}}"/>.
|
/// Marshaller for type <see cref="{{structureInfo.Name}}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1842,7 +1842,7 @@ namespace Flax.Build.Bindings
|
|||||||
{
|
{
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
#pragma warning disable 618
|
#pragma warning disable 618
|
||||||
{{structContents.Replace("\n", "\n" + " ").ToString().TrimEnd()}}
|
{{structContents.Replace("\n", Environment.NewLine + " ").ToString().TrimEnd()}}
|
||||||
|
|
||||||
{{InsertHideInEditorSection()}}
|
{{InsertHideInEditorSection()}}
|
||||||
public static class NativeToManaged
|
public static class NativeToManaged
|
||||||
@@ -1851,7 +1851,7 @@ namespace Flax.Build.Bindings
|
|||||||
public static {{structureInfo.Name}}Internal ConvertToUnmanaged({{structureInfo.Name}} managed) => {{marshallerFullName}}.ToNative(managed);
|
public static {{structureInfo.Name}}Internal ConvertToUnmanaged({{structureInfo.Name}} managed) => {{marshallerFullName}}.ToNative(managed);
|
||||||
public static void Free({{structureInfo.Name}}Internal unmanaged)
|
public static void Free({{structureInfo.Name}}Internal unmanaged)
|
||||||
{
|
{
|
||||||
{{freeContents2.Replace("\n", "\n" + " ").ToString().TrimEnd()}}
|
{{freeContents2.Replace("\n", Environment.NewLine + " ").ToString().TrimEnd()}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{InsertHideInEditorSection()}}
|
{{InsertHideInEditorSection()}}
|
||||||
@@ -1876,21 +1876,21 @@ namespace Flax.Build.Bindings
|
|||||||
internal static {{structureInfo.Name}}Internal ConvertToUnmanaged({{structureInfo.Name}} managed) => ToNative(managed);
|
internal static {{structureInfo.Name}}Internal ConvertToUnmanaged({{structureInfo.Name}} managed) => ToNative(managed);
|
||||||
internal static void Free({{structureInfo.Name}}Internal unmanaged)
|
internal static void Free({{structureInfo.Name}}Internal unmanaged)
|
||||||
{
|
{
|
||||||
{{freeContents.Replace("\n", "\n" + " ").ToString().TrimEnd()}}
|
{{freeContents.Replace("\n", Environment.NewLine + " ").ToString().TrimEnd()}}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static {{structureInfo.Name}} ToManaged({{structureInfo.Name}}Internal unmanaged)
|
internal static {{structureInfo.Name}} ToManaged({{structureInfo.Name}}Internal unmanaged)
|
||||||
{
|
{
|
||||||
{{toManagedContent.Replace("\n", "\n" + " ").ToString().TrimEnd()}}
|
{{toManagedContent.Replace("\n", Environment.NewLine + " ").ToString().TrimEnd()}}
|
||||||
}
|
}
|
||||||
internal static {{structureInfo.Name}}Internal ToNative({{structureInfo.Name}} managed)
|
internal static {{structureInfo.Name}}Internal ToNative({{structureInfo.Name}} managed)
|
||||||
{
|
{
|
||||||
{{toNativeContent.Replace("\n", "\n" + " ").ToString().TrimEnd()}}
|
{{toNativeContent.Replace("\n", Environment.NewLine + " ").ToString().TrimEnd()}}
|
||||||
}
|
}
|
||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
#pragma warning restore 1591
|
#pragma warning restore 1591
|
||||||
}
|
}
|
||||||
""").Split(new char[] { '\n' })));
|
""").Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)));
|
||||||
|
|
||||||
string InsertHideInEditorSection()
|
string InsertHideInEditorSection()
|
||||||
{
|
{
|
||||||
@@ -2158,7 +2158,7 @@ namespace Flax.Build.Bindings
|
|||||||
{
|
{
|
||||||
value = entryInfo.Value;
|
value = entryInfo.Value;
|
||||||
}
|
}
|
||||||
contents.Append(" = ").Append(value);
|
contents.Append(" = ").Append(value.Trim());
|
||||||
}
|
}
|
||||||
// Handle case of next value after Max value being zero if a value is not defined.
|
// Handle case of next value after Max value being zero if a value is not defined.
|
||||||
else if (string.IsNullOrEmpty(entryInfo.Value) && usedMax)
|
else if (string.IsNullOrEmpty(entryInfo.Value) && usedMax)
|
||||||
|
|||||||
Reference in New Issue
Block a user