Skip to content

Commit

Permalink
Add RuntimeIdentifer(s) properties to project constants
Browse files Browse the repository at this point in the history
These are typically useful in addition to TFM.
  • Loading branch information
kzu committed Feb 22, 2025
1 parent a4785b0 commit cff35f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ThisAssembly.Project/ThisAssembly.Project.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<ProjectProperty Include="TargetFrameworkIdentifier" />
<ProjectProperty Include="TargetFrameworkMoniker" />
<ProjectProperty Include="TargetFrameworkVersion" />

<ProjectProperty Include="RuntimeIdentifier" />
<ProjectProperty Include="RuntimeIdentifiers" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/ThisAssembly.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ public void CanUseHierarchicalMetadata()
public void CanUseProjectProperty()
=> Assert.Equal("Bar", ThisAssembly.Project.Foo);

/// <summary />
[Fact]
public void CanUseProjectProperty2()
=> Assert.NotEmpty(ThisAssembly.Project.RuntimeIdentifiers);

/// <summary />
[Fact]
public void CanUseStringsNamedArguments()
Expand Down
1 change: 1 addition & 0 deletions src/ThisAssembly.Tests/ThisAssembly.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ProjectFileComment>$(ProjectFile)</ProjectFileComment>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>true</WarningsAsErrors>
<RuntimeIdentifiers>win-x64;linux-x86</RuntimeIdentifiers>
</PropertyGroup>

<Import Project="..\*\ThisAssembly*.props" />
Expand Down

0 comments on commit cff35f8

Please sign in to comment.