mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
C#: Enable exporting for Android
This commit is contained in:
parent
7c456d2d0d
commit
f759cc00a3
2 changed files with 11 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "haiku", "web", "ios"]
|
# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "haiku", "web", "ios"]
|
||||||
# Eventually support for each them should be added back (except Haiku if not supported by .NET Core)
|
# Eventually support for each them should be added back (except Haiku if not supported by .NET Core)
|
||||||
supported_platforms = ["windows", "macos", "linuxbsd"]
|
supported_platforms = ["windows", "macos", "linuxbsd", "android"]
|
||||||
|
|
||||||
|
|
||||||
def can_build(env, platform):
|
def can_build(env, platform):
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace GodotTools.Export
|
||||||
if (!DeterminePlatformFromFeatures(features, out string platform))
|
if (!DeterminePlatformFromFeatures(features, out string platform))
|
||||||
throw new NotSupportedException("Target platform not supported.");
|
throw new NotSupportedException("Target platform not supported.");
|
||||||
|
|
||||||
if (!new[] { OS.Platforms.Windows, OS.Platforms.LinuxBSD, OS.Platforms.MacOS }
|
if (!new[] { OS.Platforms.Windows, OS.Platforms.LinuxBSD, OS.Platforms.MacOS, OS.Platforms.Android }
|
||||||
.Contains(platform))
|
.Contains(platform))
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Target platform not yet implemented.");
|
throw new NotImplementedException("Target platform not yet implemented.");
|
||||||
|
@ -142,15 +142,19 @@ namespace GodotTools.Export
|
||||||
{
|
{
|
||||||
archs.Add("x86_64");
|
archs.Add("x86_64");
|
||||||
}
|
}
|
||||||
else if (features.Contains("x86_32"))
|
if (features.Contains("x86_32"))
|
||||||
{
|
{
|
||||||
archs.Add("x86_32");
|
archs.Add("x86_32");
|
||||||
}
|
}
|
||||||
else if (features.Contains("arm64"))
|
if (features.Contains("arm64"))
|
||||||
{
|
{
|
||||||
archs.Add("arm64");
|
archs.Add("arm64");
|
||||||
}
|
}
|
||||||
else if (features.Contains("universal"))
|
if (features.Contains("arm32"))
|
||||||
|
{
|
||||||
|
archs.Add("arm32");
|
||||||
|
}
|
||||||
|
if (features.Contains("universal"))
|
||||||
{
|
{
|
||||||
if (platform == OS.Platforms.MacOS)
|
if (platform == OS.Platforms.MacOS)
|
||||||
{
|
{
|
||||||
|
@ -159,7 +163,7 @@ namespace GodotTools.Export
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs");
|
bool embedBuildResults = (bool)GetOption("dotnet/embed_build_outputs") || features.Contains("android");
|
||||||
|
|
||||||
foreach (var arch in archs)
|
foreach (var arch in archs)
|
||||||
{
|
{
|
||||||
|
@ -256,7 +260,7 @@ namespace GodotTools.Export
|
||||||
"x86_64" => "x64",
|
"x86_64" => "x64",
|
||||||
"armeabi-v7a" => "arm",
|
"armeabi-v7a" => "arm",
|
||||||
"arm64-v8a" => "arm64",
|
"arm64-v8a" => "arm64",
|
||||||
"armv7" => "arm",
|
"arm32" => "arm",
|
||||||
"arm64" => "arm64",
|
"arm64" => "arm64",
|
||||||
_ => throw new ArgumentOutOfRangeException(nameof(arch), arch, "Unexpected architecture")
|
_ => throw new ArgumentOutOfRangeException(nameof(arch), arch, "Unexpected architecture")
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue