Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

unsafe
{
Native.Beatmap_CreateFromFile(@"C:\Users\mini\Desktop\test.osu", out NativeBeatmap nativeBeatmap);
int error = Native.Beatmap_CreateFromFile(@"C:\Users\mini\Desktop\test.osu", out NativeBeatmap nativeBeatmap);
Console.WriteLine($"Error code: {error}");
Console.WriteLine($"Error message: {Native.ErrorHandler_GetLastMessage()}");
Console.WriteLine($"ID: {nativeBeatmap.Handle}");
Console.WriteLine($"Ruleset ID: {nativeBeatmap.RulesetId}");
Console.WriteLine($"AR: {nativeBeatmap.ApproachRate}");
Expand All @@ -21,7 +23,7 @@
nativeBeatmap.Handle = 2;

int size;
int error = Native.Beatmap_GetTitle(nativeBeatmap.Handle, null, &size);
error = Native.Beatmap_GetTitle(nativeBeatmap.Handle, null, &size);
Console.WriteLine($"Error code: {error}");
Console.WriteLine($"Error message: {Native.ErrorHandler_GetLastMessage()}");

Expand Down
21 changes: 10 additions & 11 deletions Test/Test.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.5" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.5" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace osu.Native.Analyzers;

[Generator]
public class DynamicDependencyGenerator : IIncrementalGenerator
public class DynamicDependenciesGenerator : IIncrementalGenerator
{
public void Initialize(IncrementalGeneratorInitializationContext context)
{
Expand Down
20 changes: 10 additions & 10 deletions osu.Native.Analyzers/osu.Native.Analyzers.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<OutputItemType>Analyzer</OutputItemType>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<OutputItemType>Analyzer</OutputItemType>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
</ItemGroup>
</Project>
57 changes: 28 additions & 29 deletions osu.Native.Tests/osu.Native.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>
<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>

<Target Name="ValidateOsuNativeArtifact" BeforeTargets="Build">
<Error Text="osu.Native is not built. To build it, run: &#xD;&#xA;dotnet publish --ucr" Condition="'@(OsuNativeArtifact)' == ''" />
</Target>
<Target Name="ValidateOsuNativeArtifact" BeforeTargets="Build">
<Error Text="osu.Native is not built. To build it, run: &#xD;&#xA;dotnet publish --ucr" Condition="'@(OsuNativeArtifact)' == ''" />
</Target>

<ItemGroup>
<Content Include="@(OsuNativeArtifact)">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<TargetPath>osu.Native-aot.dll</TargetPath>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\osu.Native\osu.Native.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="@(OsuNativeArtifact)">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<TargetPath>osu.Native-aot.dll</TargetPath>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\osu.Native\osu.Native.csproj" />
</ItemGroup>
</Project>
Loading