Skip to content

Commit f759cc0

Browse files
committed
C#: Enable exporting for Android
1 parent 7c456d2 commit f759cc0

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

modules/mono/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "haiku", "web", "ios"]
22
# Eventually support for each them should be added back (except Haiku if not supported by .NET Core)
3-
supported_platforms = ["windows", "macos", "linuxbsd"]
3+
supported_platforms = ["windows", "macos", "linuxbsd", "android"]
44

55

66
def can_build(env, platform):

modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private void _ExportBeginImpl(string[] features, bool isDebug, string path, long
127127
if (!DeterminePlatformFromFeatures(features, out string platform))
128128
throw new NotSupportedException("Target platform not supported.");
129129

130-
if (!new[] { OS.Platforms.Windows, OS.Platforms.LinuxBSD, OS.Platforms.MacOS }
130+
if (!new[] { OS.Platforms.Windows, OS.Platforms.LinuxBSD, OS.Platforms.MacOS, OS.Platforms.Android }
131131
.Contains(platform))
132132
{
133133
throw new NotImplementedException("Target platform not yet implemented.");
@@ -142,15 +142,19 @@ private void _ExportBeginImpl(string[] features, bool isDebug, string path, long
142142
{
143143
archs.Add("x86_64");
144144
}
145-
else if (features.Contains("x86_32"))
145+
if (features.Contains("x86_32"))
146146
{
147147
archs.Add("x86_32");
148148
}
149-
else if (features.Contains("arm64"))
149+
if (features.Contains("arm64"))
150150
{
151151
archs.Add("arm64");
152152
}
153-
else if (features.Contains("universal"))
153+
if (features.Contains("arm32"))
154+
{
155+
archs.Add("arm32");
156+
}
157+
if (features.Contains("universal"))
154158
{
155159
if (platform == OS.Platforms.MacOS)
156160
{
@@ -159,7 +163,7 @@ private void _ExportBeginImpl(string[] features, bool isDebug, string path, long
159163
}
160164
}
161165

162-
bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs");
166+
bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs") || features.Contains("android");
163167

164168
foreach (var arch in archs)
165169
{
@@ -256,7 +260,7 @@ private string DetermineRuntimeIdentifierArch(string arch)
256260
"x86_64" => "x64",
257261
"armeabi-v7a" => "arm",
258262
"arm64-v8a" => "arm64",
259-
"armv7" => "arm",
263+
"arm32" => "arm",
260264
"arm64" => "arm64",
261265
_ => throw new ArgumentOutOfRangeException(nameof(arch), arch, "Unexpected architecture")
262266
};

0 commit comments

Comments
 (0)