Debian Codegraph @

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Constants.cs

raw symbols SCIP
1 using System.IO;
2 using System.Reflection;
3 using Microsoft.CodeAnalysis.Testing;
4
5 namespace Godot.SourceGenerators.Tests;
6
7 public static class Constants
8 {
9 public static Assembly GodotSharpAssembly => typeof(GodotObject).Assembly;
10
11 // Can't find what needs updating to be able to access ReferenceAssemblies.Net.Net80, so we're making our own one.
12 public static ReferenceAssemblies Net80 => new ReferenceAssemblies(
13 "net8.0",
14 new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.0"),
15 Path.Combine("ref", "net8.0")
16 );
17
18 public static string ExecutingAssemblyPath { get; }
19 public static string SourceFolderPath { get; }
20 public static string GeneratedSourceFolderPath { get; }
21
22 static Constants()
23 {
24 ExecutingAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location!)!);
25
26 var testDataPath = Path.Combine(ExecutingAssemblyPath, "TestData");
27
28 SourceFolderPath = Path.Combine(testDataPath, "Sources");
29 GeneratedSourceFolderPath = Path.Combine(testDataPath, "GeneratedSources");
30 }
31 }