Skip to content

Commit

Permalink
Filter on types should only include Code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Sep 5, 2024
1 parent a677b48 commit a07f9fd
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 31 deletions.
1 change: 1 addition & 0 deletions props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<NuGetAudit>true</NuGetAudit>
<Nullable>enable</Nullable>
<OutputType>library</OutputType>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<PropertyGroup Label="Diagnostics">
Expand Down
7 changes: 3 additions & 4 deletions props/package.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<Import Project="common.props" />
Expand Down Expand Up @@ -28,13 +27,13 @@
</PropertyGroup>

<ItemGroup Label="Package files">
<None Include="$(MSBuildThisFileDirectory)..\design\package-icon.png" Pack="true" PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)../design/package-icon.png" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="Qowaiv.Analyzers.CSharp" Version="*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="StyleCop.Analyzers" Version="*-*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="Qowaiv.Analyzers.CSharp" Version="*" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="*-*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Additional files">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\props\nopackage.props" />
<Import Project="../../props/nopackage.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Specs</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\shared\Guard.cs" Link="Guard.cs" />
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
Expand All @@ -29,19 +29,15 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Qowaiv.CodeGeneration.OpenApi\Qowaiv.CodeGeneration.OpenApi.csproj" />
<ProjectReference Include="..\..\src\Qowaiv.CodeGeneration\Qowaiv.CodeGeneration.csproj" />
<ProjectReference Include="..\..\src\Qowaiv.CodeGeneration.SingleValueObjects\Qowaiv.CodeGeneration.SingleValueObjects.csproj" />
<ProjectReference Include="../../src/Qowaiv.CodeGeneration/Qowaiv.CodeGeneration.csproj" />
<ProjectReference Include="../../src/Qowaiv.CodeGeneration.OpenApi/Qowaiv.CodeGeneration.OpenApi.csproj" />
<ProjectReference Include="../../src/Qowaiv.CodeGeneration.SingleValueObjects/Qowaiv.CodeGeneration.SingleValueObjects.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="OpenApi\Definitions\*.*">
<None Update="OpenApi/Definitions/*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Generated\" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Qowaiv.CodeGeneration.OpenApi/OpenApiCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public OpenApiCode Filter(Predicate<TypeBase> predicate)
.OfType<TypeBase>()
.Where(t => predicate(t))
.IncludeUsings()
.Cast<Code>()
.OfType<Code>()
.ToArray());

/// <summary>Saves the code.</summary>
Expand Down Expand Up @@ -182,7 +182,6 @@ public static OpenApiCode Resolve(OpenApiDocument document, OpenApiTypeResolver
{
Guard.NotNull(document);
Guard.NotNull(resolver);

return new OpenApiCode(resolver.Walk(document)).Filter(_ => true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../../props/package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.0.1-alpha-018</Version>
<PackageId>Qowaiv.CodeGeneration.OpenApi</PackageId>
<PackageReleaseNotes>
ToBeReleased
- Initial alpha release
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi" Version="1.6.20" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.20" />
<PackageReference Include="Qowaiv.Diagnostics.Contracts" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Qowaiv.Validation.Abstractions" Version="0.3.0" />
<PackageReference Include="System.Memory.Data" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Qowaiv.CodeGeneration/Qowaiv.CodeGeneration.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\props\package.props" />
<Import Project="../../props/package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.0.1-alpha-017</Version>
<Version>0.0.1-alpha-018</Version>
<PackageId>Qowaiv.CodeGeneration.OpenApi</PackageId>
<PackageReleaseNotes>
<![CDATA[
ToBeReleased
- Initial alpha release
]]>
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\shared\Guard.cs" Link="Guard.cs" />
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi" Version="1.6.15" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.15" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.20" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.20" />
<PackageReference Include="Qowaiv.Diagnostics.Contracts" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Qowaiv.Validation.Abstractions" Version="0.3.0" />
<PackageReference Include="System.Memory.Data" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Qowaiv.CodeGeneration\Qowaiv.CodeGeneration.csproj" />
<ProjectReference Include="../Qowaiv.CodeGeneration/Qowaiv.CodeGeneration.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\props\nopackage.props" />
<Import Project="../../props/nopackage.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\shared\Guard.cs" Link="Guard.cs" />
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Snippets\*.cs" />
<EmbeddedResource Include="Snippets\*.cs" />
<Compile Remove="Snippets/*.cs" />
<EmbeddedResource Include="Snippets/*.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Qowaiv.Diagnostics.Contracts" Version="1.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Qowaiv.CodeGeneration\Qowaiv.CodeGeneration.csproj" />
<ProjectReference Include="../Qowaiv.CodeGeneration/Qowaiv.CodeGeneration.csproj" />
</ItemGroup>


Expand Down
31 changes: 31 additions & 0 deletions src/Qowaiv.CodeGeneration/Qowaiv - Backup.CodeGeneration.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../../props/package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.0.1-alpha-018</Version>
<PackageId>Qowaiv.CodeGeneration</PackageId>
<PackageReleaseNotes>
ToBeReleased
- Extend Open API documentation with explicit example. #188
- Initial alpha release
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.*" />
<PackageReference Include="Qowaiv" Version="7.0.4" />
<PackageReference Include="Qowaiv.Diagnostics.Contracts" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Qowaiv.Validation.DataAnnotations" Version="2.0.0" />
</ItemGroup>

</Project>
10 changes: 6 additions & 4 deletions src/Qowaiv.CodeGeneration/Qowaiv.CodeGeneration.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\props\package.props" />
<Import Project="../../props/package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.0.1-alpha-017</Version>
<Version>0.0.1-alpha-018</Version>
<PackageId>Qowaiv.CodeGeneration</PackageId>
<PackageReleaseNotes>
<![CDATA[
ToBeReleased
- Extend Open API documentation with explicit example. #188
- Initial alpha release
]]>
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\shared\Guard.cs" Link="Guard.cs" />
<Compile Include="../../shared/Guard.cs" Link="Guard.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.*" />
<PackageReference Include="Qowaiv" Version="7.0.0" />
<PackageReference Include="Qowaiv" Version="7.0.4" />
<PackageReference Include="Qowaiv.Diagnostics.Contracts" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Qowaiv.Validation.DataAnnotations" Version="2.0.0" />
</ItemGroup>
Expand Down

0 comments on commit a07f9fd

Please sign in to comment.