summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/GodotTools
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-10-04 04:31:44 +0200
committerRaul Santos <raulsntos@gmail.com>2023-10-10 00:35:08 +0200
commitcea77d0b48523425b92c1d0fb1fcd53ced693456 (patch)
tree41eea3c72ef516cc311942eb002039421f66230c /modules/mono/editor/GodotTools
parent6b727ebdd298bdfad8b5c5ea78100bfb6a537d79 (diff)
downloadredot-engine-cea77d0b48523425b92c1d0fb1fcd53ced693456.tar.gz
C#: Add checks to Android export
- Add .NET 7.0 TFM when the platform is Anroid to the created csproj. - Prevent exporting to Android when the architecture is not supported.
Diffstat (limited to 'modules/mono/editor/GodotTools')
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs2
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
index 1e5d7c901e..04ea46e9ef 100644
--- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
@@ -23,11 +23,15 @@ namespace GodotTools.ProjectEditor
var mainGroup = root.AddPropertyGroup();
mainGroup.AddProperty("TargetFramework", "net6.0");
- mainGroup.AddProperty("EnableDynamicLoading", "true");
+
+ var net7 = mainGroup.AddProperty("TargetFramework", "net7.0");
+ net7.Condition = " '$(GodotTargetPlatform)' == 'android' ";
var net8 = mainGroup.AddProperty("TargetFramework", "net8.0");
net8.Condition = " '$(GodotTargetPlatform)' == 'ios' ";
+ mainGroup.AddProperty("EnableDynamicLoading", "true");
+
string sanitizedName = IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true);
// If the name is not a valid namespace, manually set RootNamespace to a sanitized one.
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index 595c9a1268..018298cb33 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -187,7 +187,7 @@ namespace GodotTools.Export
List<string> outputPaths = new();
- bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs") || features.Contains("android");
+ bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs") || platform == OS.Platforms.Android;
foreach (PublishConfig config in targets)
{