Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add Directory.Build.props to the template repository #255

Open
3 tasks
guibranco opened this issue Nov 13, 2024 · 2 comments
Open
3 tasks

[FEATURE] Add Directory.Build.props to the template repository #255

guibranco opened this issue Nov 13, 2024 · 2 comments
Labels
⚙️ CI/CD Continuous Integration/Continuous Deployment processes ♻️ code quality Code quality-related tasks or issues 📝 documentation Tasks related to writing or updating documentation enhancement New feature or request gitauto GitAuto label to trigger the app in a issue. good first issue Good for newcomers hacktoberfest Participation in the Hacktoberfest event help wanted Extra attention is needed .NET Pull requests that update .net code

Comments

@guibranco
Copy link
Member

guibranco commented Nov 13, 2024

To enhance the template repository apiclient-boilerplate-dotnet, I propose adding a Directory.Build.props file with the following contents:

<Project>
  <PropertyGroup Label="SDK Versions">
    <DotNetVersions>netstandard2.0;netstandard2.1;net6.0;net8.0</DotNetVersions>
    <DotNetVersionTests>net8.0</DotNetVersionTests>
  </PropertyGroup>
  
  <PropertyGroup Label="NuGet package">
    <Authors>{{owner name}}</Authors>
    <Company>{{owner name}}</Company>
    <Copyright>© $([System.DateTime]::Now.Year) {{owner name}}. All rights reserved.</Copyright>
    <PackageProjectUrl>https://{{username}}.github.io/{{repository}}</PackageProjectUrl>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <RepositoryUrl>https://github.com/{{username}}/{{reposiitory}}</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <Version>1.0.0</Version>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <PackageIcon>logo.png</PackageIcon>
    <PackageLicenseFile>LICENSE</PackageLicenseFile>
    <PackageReadmeFile>README.md</PackageReadmeFile>
  </PropertyGroup>

  <PropertyGroup Label="NuGet">
    <NuGetAudit>true</NuGetAudit>
    <NuGetAuditLevel>low</NuGetAuditLevel>
    <NuGetAuditMode>all</NuGetAuditMode>
  </PropertyGroup>

  <PropertyGroup Label="Build">
    <UpdateVersionProperties>true</UpdateVersionProperties>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
    <LangVersion>latest</LangVersion>
    <ImplicitUsings>disabled</ImplicitUsings>
    <Nullable>disable</Nullable>
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
    <RestorePackagesWithLockFile>false</RestorePackagesWithLockFile>
    <NoWarn>$(NoWarn);1591;NU5105;SA1633;CA1711</NoWarn>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <GenerateDependencyFile>true</GenerateDependencyFile>
    <AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
  </PropertyGroup>

  <PropertyGroup Label="Analysis settings">
    <AnalysisLevel>latest-Recommended</AnalysisLevel>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" Condition="$(MSBuildProjectExtension) == '.csproj' And $(IsTestProject) != 'true'" />
    <PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="all" Condition="$(MSBuildProjectExtension) == '.csproj' And $(IsTestProject) != 'true'" />
  </ItemGroup>

  <ItemGroup>
    <None Include="..\..\LICENSE">
      <Pack>True</Pack>
      <PackagePath></PackagePath>
    </None>
    <None Include="..\..\logo.png">
      <Pack>True</Pack>
      <PackagePath></PackagePath>
    </None>
    <None Include="..\..\README.md">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
  </ItemGroup>
</Project>

Benefits

  1. Centralized Configuration: Ensures all projects in the repository follow consistent settings.
  2. Standardized NuGet Packaging: Automates common properties for NuGet packages.
  3. Improved Build Settings: Applies best practices for .NET builds and analysis.
  4. Simplified Multi-Targeting: Facilitates support for multiple .NET versions.

Tasks

  • Add the Directory.Build.props file to the repository's root directory.
  • Test the configuration in AppVeyor CI to verify compatibility with existing workflows.
  • Update the repository documentation to include details about the Directory.Build.props.

By including this file, the template will provide a more robust starting point for .NET API client projects.

Copy link

gitauto-ai bot commented Nov 13, 2024

Click the checkbox below to generate a PR!

  • Generate PR

@guibranco, You have 3 requests left in this cycle which refreshes on 2024-11-21 09:19:24+00:00.
If you have any questions or concerns, please contact us at [email protected].

@guibranco guibranco added 📝 documentation Tasks related to writing or updating documentation enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers .NET Pull requests that update .net code ⚙️ CI/CD Continuous Integration/Continuous Deployment processes hacktoberfest Participation in the Hacktoberfest event ♻️ code quality Code quality-related tasks or issues labels Nov 13, 2024
@guibranco guibranco changed the title [FEATURE] [FEATURE] Add Directory.Build.props to the Template Repository Nov 13, 2024
@guibranco guibranco changed the title [FEATURE] Add Directory.Build.props to the Template Repository [FEATURE] Add Directory.Build.props to the template repository Nov 13, 2024
@gitauto-ai gitauto-ai bot added the gitauto GitAuto label to trigger the app in a issue. label Nov 14, 2024
Copy link

gitauto-ai bot commented Nov 14, 2024

Hey, I'm a bit lost here! Not sure which file I should be fixing. Could you give me a bit more to go on? Maybe add some details to the issue or drop a comment with some extra hints? Thanks!

Have feedback or need help?
Feel free to email [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ CI/CD Continuous Integration/Continuous Deployment processes ♻️ code quality Code quality-related tasks or issues 📝 documentation Tasks related to writing or updating documentation enhancement New feature or request gitauto GitAuto label to trigger the app in a issue. good first issue Good for newcomers hacktoberfest Participation in the Hacktoberfest event help wanted Extra attention is needed .NET Pull requests that update .net code
1 participant