Browse Source

added build props to source generator

Vicente Penades 3 years ago
parent
commit
a8075338b1
2 changed files with 51 additions and 0 deletions
  1. 3 0
      SharpGLTF.sln
  2. 48 0
      build/Directory.Build.props

+ 3 - 0
SharpGLTF.sln

@@ -22,6 +22,9 @@ EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.Core", "src\SharpGLTF.Core\SharpGLTF.Core.csproj", "{B1DA4F42-AB6A-4021-9989-674B1394E8A2}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{D7D51F42-D08C-4DDA-88DA-AF008F10B644}"
+	ProjectSection(SolutionItems) = preProject
+		build\Directory.Build.props = build\Directory.Build.props
+	EndProjectSection
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.Toolkit", "src\SharpGLTF.Toolkit\SharpGLTF.Toolkit.csproj", "{41690879-1F91-4555-A40A-F67B01868D7E}"
 EndProject

+ 48 - 0
build/Directory.Build.props

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  
+  <!-- https://blog.johnnyreilly.com/2021/07/14/directory-build-props-c-sharp-9-for-all -->
+
+  <!-- Legal =================================================================================== -->
+
+  <PropertyGroup>
+    <Authors>Vicente Penades</Authors>    
+    <Copyright>Copyright (c) 2022 Vicente Penades</Copyright>
+    <Description>SharpGLTF is a C# library for reading and writing glTF2 3D models</Description>    
+  </PropertyGroup>  
+
+  <!-- Configuration =================================================================================== -->
+
+  <PropertyGroup>
+    <LangVersion>8.0</LangVersion>
+    <IsPackable>false</IsPackable>
+  </PropertyGroup>
+  
+  <!-- Testing & Analysers =================================================================================== -->  
+
+  <PropertyGroup>
+    <NoWarn>1701;1702;1591;CA1062;CA1304;CA1310;CA1000</NoWarn>
+  </PropertyGroup>  
+
+  <PropertyGroup>
+    <!-- Enable all FxCop rules with NetAnalyzers
+    https://docs.microsoft.com/es-es/visualstudio/code-quality/migrate-from-fxcop-analyzers-to-net-analyzers?view=vs-2022#migration-steps
+    -->
+    
+    <AnalysisMode>AllEnabledByDefault</AnalysisMode>
+    <!-- <CodeAnalysisRuleSet>$(MsBuildThisFileDirectory)..\solution.ruleset</CodeAnalysisRuleSet>  -->  
+    
+  </PropertyGroup>
+
+  <ItemGroup>
+    
+    <AdditionalFiles Include="$(MsBuildThisFileDirectory)..\stylecop.json" />
+    
+    <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    
+  </ItemGroup>  
+  
+</Project>