-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ASPNETCORE] Add support for central package version management (#20401)
* Added useCentralPackageVersionManagement option for aspnetcore * Removed debug code from template * Added option to opt out of centralized version management * Added sample for centralized version management * Removed changes for .net9 * Updated template file for model project * Code formatting * Corrected sample config for aspnetcore * Regenerated Samples * update samples, docs * Fixed models project mustache file * Regenerated samples and docs * Regenerated smaples and doc * Changed options to enum WIP * fix option * [ASPNETCORE] Add support for central package version management #20192 (#20403) * Fixed default value for usePackageVersions * Regenerated docs * update workflow * add props file --------- Co-authored-by: Urganot <[email protected]>
- Loading branch information
Showing
62 changed files
with
5,349 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ jobs: | |
- samples/server/petstore/aspnetcore-8.0-pocoModels | ||
- samples/server/petstore/aspnetcore-8.0-project4Models | ||
- samples/server/petstore/aspnetcore-8.0-useSwashBuckle | ||
- samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
|
9 changes: 9 additions & 0 deletions
9
bin/configs/aspnetcore-8.0-use-centralized-package-version-management.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
generatorName: aspnetcore | ||
outputDir: samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 | ||
additionalProperties: | ||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' | ||
aspnetCoreVersion: "8.0" | ||
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' | ||
centralizedPackageVersionManagement: "enable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 59 additions & 56 deletions
115
modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,61 @@ | ||
<Project Sdk="{{projectSdk}}"> | ||
<PropertyGroup> | ||
<Description>{{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}}</Description> | ||
<Copyright>{{packageCopyright}}</Copyright> | ||
<Authors>{{packageAuthors}}</Authors> | ||
<TargetFramework>{{targetFramework}}</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<Version>{{packageVersion}}</Version> | ||
{{#nullableReferenceTypes}} | ||
<Nullable>annotations</Nullable> | ||
{{/nullableReferenceTypes}} | ||
{{#isLibrary}} | ||
<OutputType>Library</OutputType> | ||
{{/isLibrary}} | ||
<AssemblyName>{{packageName}}</AssemblyName> | ||
<PackageId>{{packageName}}</PackageId> | ||
<UserSecretsId>{{userSecretsGuid}}</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..</DockerfileContext> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
{{#useSeparateModelProject}} | ||
<ProjectReference Include="../{{modelPackage}}/{{modelPackage}}.csproj"/> | ||
{{/useSeparateModelProject}} | ||
{{#useFrameworkReference}} | ||
{{#isLibrary}} | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
{{/isLibrary}} | ||
{{/useFrameworkReference}} | ||
{{^useFrameworkReference}} | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
{{/useFrameworkReference}} | ||
{{^useSeparateModelProject}} | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="{{aspnetCoreVersion}}.0"/> | ||
{{/useSeparateModelProject}} | ||
{{#useSwashbuckle}} | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" /> | ||
{{#useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="{{swashbuckleVersion}}"/> | ||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="{{swashbuckleVersion}}"/> | ||
{{/useNewtonsoft}} | ||
{{^useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="{{swashbuckleVersion}}"/> | ||
{{/useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="{{swashbuckleVersion}}" /> | ||
{{/useSwashbuckle}} | ||
{{^useSwashbuckle}} | ||
{{#useNewtonsoft}} | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="{{newtonsoftVersion}}" /> | ||
{{/useNewtonsoft}} | ||
{{/useSwashbuckle}} | ||
<PackageReference Include="JsonSubTypes" Version="1.8.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!--<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="{{aspnetCoreVersion}}.0" />--> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Description>{{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}}</Description> | ||
<Copyright>{{packageCopyright}}</Copyright> | ||
<Authors>{{packageAuthors}}</Authors> | ||
<TargetFramework>{{targetFramework}}</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<Version>{{packageVersion}}</Version> | ||
{{#nullableReferenceTypes}} | ||
<Nullable>annotations</Nullable> | ||
{{/nullableReferenceTypes}} | ||
{{#isLibrary}} | ||
<OutputType>Library</OutputType> | ||
{{/isLibrary}} | ||
<AssemblyName>{{packageName}}</AssemblyName> | ||
<PackageId>{{packageName}}</PackageId> | ||
<UserSecretsId>{{userSecretsGuid}}</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..</DockerfileContext> | ||
{{#centralizedPackageVersionManagement}} | ||
<ManagePackageVersionsCentrally>{{.}}</ManagePackageVersionsCentrally> | ||
{{/centralizedPackageVersionManagement}} | ||
</PropertyGroup> | ||
<ItemGroup> | ||
{{#useSeparateModelProject}} | ||
<ProjectReference Include="../{{modelPackage}}/{{modelPackage}}.csproj"/> | ||
{{/useSeparateModelProject}} | ||
{{#useFrameworkReference}} | ||
{{#isLibrary}} | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
{{/isLibrary}} | ||
{{/useFrameworkReference}} | ||
{{^useFrameworkReference}} | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
{{/useFrameworkReference}} | ||
{{^useSeparateModelProject}} | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" {{#usePackageVersions}}Version="{{aspnetCoreVersion}}.0" {{/usePackageVersions}}/> | ||
{{/useSeparateModelProject}} | ||
{{#useSwashbuckle}} | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" {{#usePackageVersions}}Version="1.10.8" {{/usePackageVersions}}/> | ||
{{#useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" {{#usePackageVersions}}Version="{{swashbuckleVersion}}" {{/usePackageVersions}}/> | ||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" {{#usePackageVersions}}Version="{{swashbuckleVersion}}" {{/usePackageVersions}}/> | ||
{{/useNewtonsoft}} | ||
{{^useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore" {{#usePackageVersions}}Version="{{swashbuckleVersion}}" {{/usePackageVersions}}/> | ||
{{/useNewtonsoft}} | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" {{#usePackageVersions}}Version="{{swashbuckleVersion}}" {{/usePackageVersions}}/> | ||
{{/useSwashbuckle}} | ||
{{^useSwashbuckle}} | ||
{{#useNewtonsoft}} | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" {{#usePackageVersions}}Version="{{newtonsoftVersion}}" {{/usePackageVersions}}/> | ||
{{/useNewtonsoft}} | ||
{{/useSwashbuckle}} | ||
<PackageReference Include="JsonSubTypes" {{#usePackageVersions}}Version="1.8.0" {{/usePackageVersions}}/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!--<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="{{aspnetCoreVersion}}.0" />--> | ||
</ItemGroup> | ||
</Project> |
48 changes: 24 additions & 24 deletions
48
...rver/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<Description>A library generated from a OpenAPI doc</Description> | ||
<Copyright>No Copyright</Copyright> | ||
<Authors>OpenAPI</Authors> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<Version>1.0.0</Version> | ||
<AssemblyName>Org.OpenAPITools</AssemblyName> | ||
<PackageId>Org.OpenAPITools</PackageId> | ||
<UserSecretsId>cb87e868-8646-48ef-9bb6-344b537d0d37</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..</DockerfileContext> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0"/> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/> | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" /> | ||
<PackageReference Include="JsonSubTypes" Version="1.8.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!--<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />--> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Description>A library generated from a OpenAPI doc</Description> | ||
<Copyright>No Copyright</Copyright> | ||
<Authors>OpenAPI</Authors> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<Version>1.0.0</Version> | ||
<AssemblyName>Org.OpenAPITools</AssemblyName> | ||
<PackageId>Org.OpenAPITools</PackageId> | ||
<UserSecretsId>cb87e868-8646-48ef-9bb6-344b537d0d37</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..</DockerfileContext> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" /> | ||
<PackageReference Include="JsonSubTypes" Version="1.8.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!--<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />--> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.