Skip to content

Commit

Permalink
Merge pull request #27 from jss2a98aj/mono-glue-with-NET6
Browse files Browse the repository at this point in the history
Fix mono glue generation with .NET 6 (targeting blazium-dev)
  • Loading branch information
Bioblaze authored Oct 16, 2024
2 parents 2f86fac + c583d50 commit 47ecd14
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<LangVersion>11</LangVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ public static Test MakeVerifier(ICollection<string> sources, params DiagnosticRe
{
var verifier = new Test();

verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"is_global = true\nbuild_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}"));

verifier.TestState.Sources.AddRange(sources.Select(source =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ public static Test MakeVerifier(string source, string results)
verifier.TestCode = File.ReadAllText(Path.Combine(Constants.SourceFolderPath, source));
verifier.FixedCode = File.ReadAllText(Path.Combine(Constants.GeneratedSourceFolderPath, results));

verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"is_global = true\nbuild_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}"));

return verifier;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ public static Test MakeVerifier(ICollection<string> sources, ICollection<string>
{
var verifier = new Test();

verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"is_global = true\nbuild_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}"));

verifier.TestState.Sources.AddRange(sources.Select(source => (
source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<EnablePreviewFeatures>true</EnablePreviewFeatures>
<LangVersion>11</LangVersion>

<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ private static (string, SourceText) MakeAssemblyScriptTypesGeneratedSource(IColl
{
return (
Path.Combine("Godot.SourceGenerators", "Godot.SourceGenerators.ScriptPathAttributeGenerator", "AssemblyScriptTypes.generated.cs"),
SourceText.From($$"""
[assembly:Godot.AssemblyHasScriptsAttribute(new System.Type[] {{{string.Join(", ", types.Select(type => $"typeof({type})"))}}})]
""", Encoding.UTF8)
SourceText.From($"[assembly:Godot.AssemblyHasScriptsAttribute(new System.Type[] {{{string.Join(", ", types.Select(type => $"typeof({type})"))}}})]\n", Encoding.UTF8)
);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/mono/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "6.0.0",
"rollForward": "latestMajor"
}
}

0 comments on commit 47ecd14

Please sign in to comment.