You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #98066 from TCROC/fix-android-mono-export
Fix Android mono export with 2 or more cpu architectures fails
This commit is contained in:
@@ -216,6 +216,8 @@ namespace GodotTools.Export
|
|||||||
|
|
||||||
bool embedBuildResults = ((bool)GetOption("dotnet/embed_build_outputs") || platform == OS.Platforms.Android) && platform != OS.Platforms.MacOS;
|
bool embedBuildResults = ((bool)GetOption("dotnet/embed_build_outputs") || platform == OS.Platforms.Android) && platform != OS.Platforms.MacOS;
|
||||||
|
|
||||||
|
var exportedJars = new HashSet<string>();
|
||||||
|
|
||||||
foreach (PublishConfig config in targets)
|
foreach (PublishConfig config in targets)
|
||||||
{
|
{
|
||||||
string ridOS = config.RidOS;
|
string ridOS = config.RidOS;
|
||||||
@@ -325,14 +327,6 @@ namespace GodotTools.Export
|
|||||||
{
|
{
|
||||||
string fileName = Path.GetFileName(path);
|
string fileName = Path.GetFileName(path);
|
||||||
|
|
||||||
if (fileName.EndsWith(".jar"))
|
|
||||||
{
|
|
||||||
// We exclude jar files from the export since they should
|
|
||||||
// already be included in the Godot templates, adding them
|
|
||||||
// again would cause conflicts.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsSharedObject(fileName))
|
if (IsSharedObject(fileName))
|
||||||
{
|
{
|
||||||
AddSharedObject(path, tags: new string[] { arch },
|
AddSharedObject(path, tags: new string[] { arch },
|
||||||
@@ -343,10 +337,19 @@ namespace GodotTools.Export
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsSharedObject(string fileName)
|
bool IsSharedObject(string fileName)
|
||||||
{
|
{
|
||||||
if (fileName.EndsWith(".so") || fileName.EndsWith(".a")
|
if (fileName.EndsWith(".jar"))
|
||||||
|| fileName.EndsWith(".dex"))
|
{
|
||||||
|
// Don't export the same jar twice. Otherwise we will have conflicts.
|
||||||
|
// This can happen when exporting for multiple architectures. Dotnet
|
||||||
|
// stores the jars in .godot/mono/temp/bin/Export[Debug|Release] per
|
||||||
|
// target architecture. Jars are cpu agnostic so only 1 is needed.
|
||||||
|
var jarName = Path.GetFileName(fileName);
|
||||||
|
return exportedJars.Add(jarName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileName.EndsWith(".so") || fileName.EndsWith(".a") || fileName.EndsWith(".dex"))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,10 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// .NET dependencies
|
// .NET dependencies
|
||||||
monoImplementation fileTree(dir: 'monoLibs', include: ['*.jar'])
|
String jar = '../../../../modules/mono/thirdparty/libSystem.Security.Cryptography.Native.Android.jar'
|
||||||
|
if (file(jar).exists()) {
|
||||||
|
monoImplementation files(jar)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|||||||
Reference in New Issue
Block a user