godot/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Constants.cs
Paul Joannon fb8553e4d7
Move to .NET8
- Change TFM and LangVersion
- Better exception throwing (CA1510, CA1512, CA1513)
- Better exception utility method definition (CA1859)
- Prefer comparing `.Count` over calling `.Any()` (CA1860)
- Prefer `.AsSpan()` over `.Substring()` (CA1846)
- Add a few more `scoped`
- Use `RuntimeHelpers.GetUninitializedObject()` instead of `FormatterServices.GetUninitializedObject()`
- Use delegate instead of delegate pointer in variant generic conversions
- Enable EnforceExtendedAnalyzerRules in source generator projects
- Disable CS8981 on structs named movable in Godot.NativeInterop
2024-12-13 14:00:13 +01:00

31 lines
1.1 KiB
C#

using System.IO;
using System.Reflection;
using Microsoft.CodeAnalysis.Testing;
namespace Godot.SourceGenerators.Tests;
public static class Constants
{
public static Assembly GodotSharpAssembly => typeof(GodotObject).Assembly;
// Can't find what needs updating to be able to access ReferenceAssemblies.Net.Net80, so we're making our own one.
public static ReferenceAssemblies Net80 => new ReferenceAssemblies(
"net8.0",
new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.0"),
Path.Combine("ref", "net8.0")
);
public static string ExecutingAssemblyPath { get; }
public static string SourceFolderPath { get; }
public static string GeneratedSourceFolderPath { get; }
static Constants()
{
ExecutingAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location!)!);
var testDataPath = Path.Combine(ExecutingAssemblyPath, "TestData");
SourceFolderPath = Path.Combine(testDataPath, "Sources");
GeneratedSourceFolderPath = Path.Combine(testDataPath, "GeneratedSources");
}
}