FIX: Api generation file name collision, bump version 1.8.1

This commit is contained in:
Amer Koleci
2022-10-07 15:14:27 +02:00
parent f6720c616e
commit d04ee1d77c
24 changed files with 1614 additions and 49 deletions

View File

@@ -7,7 +7,7 @@
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<VersionPrefix>1.8.0</VersionPrefix>
<VersionPrefix>1.8.1</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

View File

@@ -1,6 +1,7 @@
// Copyright © Amer Koleci and Contributors.
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
using System.Dynamic;
using System.Globalization;
using System.Text;
using Newtonsoft.Json;
@@ -1092,7 +1093,7 @@ public static class Program
outputPath = wicPath;
useSubFolders = false;
}
else if (jsonFile.EndsWith("Direct2D.json"))
else if (jsonFile == "Graphics.Direct2D.json")
{
outputPath = d2dPath;
useSubFolders = false;
@@ -1221,8 +1222,35 @@ public static class Program
private static void GenerateConstants(string folder, string apiName, string docFileName, ApiData api)
{
bool generateFile = false;
foreach (var constant in api.Constants)
{
if (ShouldSkipConstant(constant))
continue;
bool skipValue = false;
foreach (var enumToGenerate in s_generatedEnums)
{
if (constant.Name.StartsWith(enumToGenerate.Key))
{
skipValue = true;
break;
}
}
if (skipValue)
continue;
generateFile = true;
break;
}
if (!generateFile)
return;
using CodeWriter writer = new(
Path.Combine(folder, $"Apis.cs"),
Path.Combine(folder, $"{apiName}.Apis.cs"),
apiName,
docFileName,
$"Win32.{apiName}");
@@ -1511,7 +1539,7 @@ public static class Program
return;
using CodeWriter writer = new(
Path.Combine(folder, "Apis.Functions.cs"),
Path.Combine(folder, $"{apiName}.Apis.Functions.cs"),
apiName,
docFileName,
$"Win32.{apiName}");

View File

@@ -1,15 +0,0 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Win32.Graphics.Imaging.D2D;
public static partial class Apis
{
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Win32.Graphics.Direct3D11on12;
public static partial class Apis
{
}

View File

@@ -1,15 +0,0 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Win32.Graphics.Direct2D.Common;
public static partial class Apis
{
}