-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
93 lines (87 loc) · 5.74 KB
/
Directory.Build.props
File metadata and controls
93 lines (87 loc) · 5.74 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
<!--Directory.Build.props: MSBuild properties that are included in every project-->
<!--Info: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#directorybuildprops-and-directorybuildtargets-->
<Project InitialTargets="SetDefaultPackageVersion">
<PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), `Tests(.FSharp)?$`))">
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType> <!--Required by xunit.v3-->
</PropertyGroup>
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), `Tests(.FSharp)?$`))">
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.1" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.1" />
</ItemGroup>
<PropertyGroup>
<!--CSharpMath-specific properties for centralized control of values-->
<AvaloniaVersion>11.3.9</AvaloniaVersion>
<IsPublishedPackage>true</IsPublishedPackage>
<IsPublishedPackage Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), `(Tests(.FSharp)?|Benchmarks|Example)$`))">false</IsPublishedPackage>
<!--C# code properties-->
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<NoWarn>
CA1062,<!--Obsolete with C# 8 nullability annotations-->
CA1303,<!--Who localizes exception messages, anyway?-->
</NoWarn>
<WarningsAsErrors>nullable</WarningsAsErrors>
<!--NuGet properties: Ordered according to https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target-->
<PackageId>$(MSBuildProjectName)</PackageId>
<!--PackageVersion is set in the SetDefaultPackageVersion target below-->
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<Title>$(PackageId)</Title>
<!--Description property is defined in individual projects-->
<Copyright>© CSharpMath Contributors 2026</Copyright>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageIcon>Icon.png</PackageIcon>
<PackageTags>
math mathematics mathematical formula equation equations
expression tex latex render rendering display beautiful CSharpMath
</PackageTags>
<!--PackageReleaseNotes is not set by default and is set by CI-->
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>master</RepositoryBranch>
<!--RepositoryCommit property is set in the SetDefaultPackageVersion target below-->
<!--SourceLink properties: Ordered according to https://github.com/dotnet/sourcelink#using-source-link-in-net-projects-->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!--Info on NuGet packaging properties: https://github.com/NuGet/Home/wiki/Adding-nuget-pack-as-a-msbuild-target-->
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GeneratePackageOnBuild Condition="$(IsPublishedPackage) And $(Configuration.Equals('Release'))">true</GeneratePackageOnBuild>
<PackageOutputPath>$(MSBuildThisFileDirectory).nupkgs</PackageOutputPath>
<!--https://github.com/clairernovotny/DeterministicBuilds
Deterministic builds are important as they enable verification that the resulting binary was built from the specified source and provides traceability.
It should not be enabled during local dev or the debugger won't be able to find the local source files.
Also, this requires SourceLink to be enabled or else error: https://github.com/dotnet/sourcelink/issues/91#issuecomment-400787926-->
<!--But this only works well with dotnet msbuild, not the Windows full MSBuild-->
<ContinuousIntegrationBuild Condition="'$(MSBuildRuntimeType)'=='Core'">$(GeneratePackageOnBuild)</ContinuousIntegrationBuild>
<!--Assembly properties-->
<NeutralLanguage>en</NeutralLanguage>
<!--Prefix namespace for embedded resources-->
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
</PropertyGroup>
<ItemGroup>
<None Condition="$(GeneratePackageOnBuild)" Include="$(MSBuildThisFileDirectory)Icon.png" Pack="true" PackagePath="" />
<PackageReference Condition="$(GeneratePackageOnBuild)" Include="Microsoft.SourceLink.GitHub" Version="10.0.102" PrivateAssets="All" />
<PackageReference Condition="$(IsPublishedPackage)" Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.0.0-1.25277.114" PrivateAssets="All" />
</ItemGroup>
<!--Also run for non-CSharpMath projects: Normalize PackageVersion or else error-->
<Target Name="SetDefaultPackageVersion">
<!--Setting StandardOutputImportance to Low ensures that EchoOff works: https://github.com/Microsoft/msbuild/issues/2826-->
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true" EchoOff="true" StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="RepositoryCommit" />
</Exec>
<!--For local builds-->
<CreateProperty Condition="$(PackageVersion) == '1.0.0'" Value="2147483647.2147483647.2147483647-localbuild+$(RepositoryCommit)">
<Output TaskParameter="Value" PropertyName="PackageVersion" />
</CreateProperty>
<!--For CI builds that supply -p:PackageVersion-->
<CreateProperty Value="$(PackageVersion.TrimStart('v'))">
<Output TaskParameter="Value" PropertyName="PackageVersion" />
</CreateProperty>
</Target>
</Project>