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.
This commit is contained in:
Raul Santos 2023-10-04 04:31:44 +02:00
parent 6b727ebdd2
commit cea77d0b48
No known key found for this signature in database
GPG key ID: B532473AE3A803E4
3 changed files with 19 additions and 2 deletions

View file

@ -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.

View file

@ -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)
{