Skip to content

Commit

Permalink
Improve trimmability
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Dec 15, 2024
1 parent ce1b0e2 commit d5c6496
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Ultra.Core/Ultra.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Ultra.Sampler\UltraSamplerConstants.cs" Link="UltraSamplerConstants.cs" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../../img/ultra.png" Pack="true" PackagePath="/" />
<None Include="readme.md" Pack="true" PackagePath="/" />
Expand All @@ -55,4 +51,8 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Ultra.Sampler\Ultra.Sampler.csproj" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Ultra.Sampler/UltraSamplerSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Ultra.Sampler;
[EventSource(Name = UltraSamplerConstants.ProviderName)] // Cannot set the ProviderGuid that is not used https://github.com/dotnet/diagnostics/issues/389
internal sealed class UltraSamplerSource : EventSource
{
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(UltraSamplerSource))]
public static readonly UltraSamplerSource Log = new();

private UltraSamplerSource()
Expand Down
Binary file modified src/Ultra.Sampler/libUltraSampler.dylib
Binary file not shown.
9 changes: 9 additions & 0 deletions src/Ultra.Tests/UltraSamplerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.

using Ultra.Core;
using Ultra.Sampler;
using Ultra.Sampler.MacOS;

Expand All @@ -23,4 +24,12 @@ public void TestNativeModules()
Console.WriteLine($"{nativeModule}");
}
}

[TestMethod]
public void TestEventSource()
{
var sampler = UltraSamplerSource.Log;
Assert.AreEqual(UltraSamplerConstants.ProviderName, sampler.Name);
Assert.AreEqual(UltraSamplerConstants.ProviderGuid, sampler.Guid);
}
}

0 comments on commit d5c6496

Please sign in to comment.