-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
67 lines (58 loc) · 3.03 KB
/
Directory.Build.props
File metadata and controls
67 lines (58 loc) · 3.03 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
<Project>
<PropertyGroup Label="DefaultWarnings">
<NoWarn>$(NoWarn);4014</NoWarn>
</PropertyGroup>
<PropertyGroup Label="LibWeb">
<TargetFramework>net8.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<Target Name="AddGitMetadaAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<!--Executes
the Git Commands to get the Hash and Branch-->
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true"
StandardOutputImportance="low" IgnoreExitCode="true" Condition=" '$(CommitHash)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
</Exec>
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true"
StandardOutputImportance="low" IgnoreExitCode="true" Condition=" '$(CommitShortHash)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitShortHash" />
</Exec>
<Exec Command="git rev-parse --abbrev-ref HEAD" ConsoleToMSBuild="true"
StandardOutputImportance="low" IgnoreExitCode="true" Condition=" '$(CommitBranch)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitBranch" />
</Exec>
<!--Generates
the ItemGroup and all AssemblyMetadata Tags-->
<ItemGroup>
<AssemblyMetadata Include="BuildTimestamp" Value="$([System.DateTime]::UtcNow.ToString(yyyy-MM-ddTHH:mm:ssK))" />
<AssemblyMetadata Condition=" $(CommitHash) != '' " Include="GitHash" Value="$(CommitHash)" />
<AssemblyMetadata Condition=" $(CommitBranch) != '' " Include="GitBranch" Value="$(CommitBranch)" />
</ItemGroup>
</Target>
<PropertyGroup Label="PackageMetadata">
<Company>Roblox</Company>
<Copyright>Copyright © $(Company) $([System.DateTime]::Now.ToString(`yyyy`)). All rights reserved.</Copyright>
<Authors>$(Company)</Authors>
</PropertyGroup>
<PropertyGroup Label="TestsProperties" Condition="$(MSBuildProjectName.Contains('.Tests'))">
<IsTestProject>true</IsTestProject>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Label="ComponentTestProperties" Condition="$(MSBuildProjectName.Contains('.Component.Test'))">
<IsComponentTestProject>true</IsComponentTestProject>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup Label="TestReferences" Condition="'$(IsTestProject)' == 'true' And '$(IsComponentTestProject)' != 'true'">
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<Using Include="NUnit.Framework" />
</ItemGroup>
<PropertyGroup Label="PackageProperties" Condition="'$(IsTestProject)' != 'true' And '$(IsComponentTestProject)' != 'true'">
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>
</PropertyGroup>
</Project>