-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
136 lines (121 loc) · 7.43 KB
/
Copy pathDirectory.Build.props
File metadata and controls
136 lines (121 loc) · 7.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<Project>
<PropertyGroup>
<QtaVersionFile>$(MSBuildThisFileDirectory)lib/VERSION</QtaVersionFile>
<QtaVersion Condition="Exists('$(QtaVersionFile)')">$([System.IO.File]::ReadAllText('$(QtaVersionFile)').Trim())</QtaVersion>
<Version Condition="'$(QtaVersion)' != ''">$(QtaVersion)</Version>
<PackageVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion)</PackageVersion>
<AssemblyVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion).0</AssemblyVersion>
<FileVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion).0</FileVersion>
<InformationalVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion)</InformationalVersion>
<LangVersion>preview</LangVersion>
<NoWarn>$(NoWarn);NU1903;NU5104</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
<NeutralLanguage>en-US</NeutralLanguage>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<OutputPath>bin\$(Configuration)\</OutputPath>
<BaseIntermediateOutputPath>obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<DebugType>full</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>false</IncludeSymbols>
<IsLocalBuild Condition="'$(GITHUB_ACTIONS)' == ''">true</IsLocalBuild>
<!-- AOT and Trim compatibility analyzers (build-time validation) -->
<IsAotCompatible>true</IsAotCompatible>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- SARIF 2.1 output for Roslyn analyzers - all projects -->
<PropertyGroup>
<!-- Use forward slashes for cross-platform compatibility (works on Windows, Linux, macOS) -->
<SarifOutputDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'QuanTAlib.slnx'))/.sarif</SarifOutputDir>
<ErrorLog>$(SarifOutputDir)/$(MSBuildProjectName).sarif,version=2.1</ErrorLog>
</PropertyGroup>
<!-- Stamp lib/VERSION into README.md heading — single project only to prevent parallel race -->
<Target Name="StampReadmeVersion" BeforeTargets="CoreCompile"
Condition="'$(MSBuildProjectName)' == 'quantalib' AND Exists('$(QtaVersionFile)') AND Exists('$(MSBuildThisFileDirectory)README.md')">
<PropertyGroup>
<ReadmeFile>$(MSBuildThisFileDirectory)README.md</ReadmeFile>
</PropertyGroup>
<Exec Command="pwsh -NoProfile -Command "(Get-Content '$(ReadmeFile)' -Raw) -replace '# QuanTAlib .*','# QuanTAlib $(QtaVersion)' | Set-Content '$(ReadmeFile)' -NoNewline""
Condition="$([MSBuild]::IsOSPlatform('Windows'))"
IgnoreExitCode="true" />
<Exec Command="sed -i 's/# QuanTAlib .*/# QuanTAlib $(QtaVersion)/' '$(ReadmeFile)'"
Condition="!$([MSBuild]::IsOSPlatform('Windows'))"
IgnoreExitCode="true" />
</Target>
<Target Name="CreateSarifDir" BeforeTargets="CoreCompile">
<MakeDir Directories="$(SarifOutputDir)" />
<Message Importance="High" Text="SARIF output directory: $(SarifOutputDir)" />
<Message Importance="High" Text="SARIF file: $(ErrorLog)" />
</Target>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Deterministic>true</Deterministic>
<!-- Trim mode for library compatibility validation -->
<TrimMode>link</TrimMode>
<!-- Runtime feature switches (reduce size when library is trimmed by consumer) -->
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- Suppress reflection-based serialization (faster startup, smaller footprint) -->
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>
<PropertyGroup>
<!-- S3604: "Remove member initializer" - null! is intentional for nullable reference types in Quantower adapters -->
<!-- S107: "Methods should not have too many parameters" - high-performance SIMD methods require multiple parameters for zero-allocation patterns -->
<!-- S1244: "Do not check floating point equality with exact values" - exact-zero div guards and exact-equality tie detection are fundamental patterns in quantitative indicators -->
<!-- MA0007: "Add comma after the last value" - trailing commas not enforced in this codebase -->
<NoWarn>$(NoWarn);S107;S1144;S1192;S1244;S1944;S2053;S2245;S2259;S2583;S2589;S3329;S3604;S3655;S3776;S3949;S3966;S4158;S4347;S5773;S6781;MA0007;MA0048;MA0051;MA0076;RCS1123;RCS1159;IDE0007</NoWarn>
</PropertyGroup>
<!-- Code Coverage Configuration (for NDepend integration) -->
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<CollectCoverage>true</CollectCoverage>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<CoverletOutput>$(MSBuildProjectDirectory)/TestResults/</CoverletOutput>
<ExcludeByFile>**/*.Designer.cs,**/*.g.cs,**/*.g.i.cs</ExcludeByFile>
<Exclude>[xunit.*]*,[*.Tests]*</Exclude>
</PropertyGroup>
<!-- SonarLint local rule configuration (IDE-only, not committed to git)
The SonarLint VS/VSCode plugin manages .sonarlint/ locally.
SonarAnalyzer.CSharp NuGet provides build-time analysis; suppressions are in <NoWarn> above. -->
<PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory).sonarlint\csharp.ruleset')">
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory).sonarlint\csharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition="Exists('$(MSBuildThisFileDirectory).sonarlint\CSharp\SonarLint.xml')">
<AdditionalFiles Include="$(MSBuildThisFileDirectory).sonarlint\CSharp\SonarLint.xml">
<Link>Properties\SonarLint.xml</Link>
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.267">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Quantower SDK: local deployment path (override with QuantowerRoot env var).
QuantowerPath removed - was dead code running GetDirectories on every MSBuild evaluation. -->
<PropertyGroup Condition="'$(IsLocalBuild)' == 'true' AND $([MSBuild]::IsOSPlatform('Windows'))">
<QuantowerRoot Condition="'$(QuantowerRoot)' == ''">Z:\Quantower</QuantowerRoot>
</PropertyGroup>
</Project>